Bluetooth® Sample Application Programmer's Reference: entry.c File Reference

Bluetooth

Bluetooth® Sample Application Programmer's Reference
entry.c File Reference
#include "sdk_tplus.h" #include "trace.h"
#include "ui_userinterface.h"
#include "fun_demofeatures.h"
#include "err_process.h"
#include "utilities.h"

Functions

int give_your_domain (NO_SEGMENT no, void *p1, S_INITPARAMOUT *param_out)
 
int after_reset (NO_SEGMENT no, void *p1, S_TRANSOUT *param_out)
 
int is_name (NO_SEGMENT no, void *p1, S_ETATOUT *param_out)
 
int is_state (NO_SEGMENT no, void *p1, S_ETATOUT *param_out)
 
int idle_message (NO_SEGMENT no, void *p1, void *p2)
 
int more_function (NO_SEGMENT no, void *p1, void *p2)
 
int keyboard_event (NO_SEGMENT noappli, S_KEY *key_in, S_KEY *key_out)
 
int file_received (NO_SEGMENT no, S_FILE *param_in, void *p2)
 
int give_interface (unsigned short AppliNum, void *p1, void *p2)
 
void entry (void)
 

Macros

#define __ENTER_KEY   -1
 
#define __BACK_KEY   -2
 
#define __EXIT_KEY   -3
 
#define NUMBER_OF_ITEMS(a)   (sizeof(a)/sizeof((a)[0]))
 
#define SERVICES_LOW_PRIORITY   30
 
#define SERVICES_HIGH_PRIORITY   10
 
#define SERVICES_DEFAULT_PRIORITY   20
 

Typedefs

typedef struct Params S_PARAMS
 

Variables

static Telium_service_desc_t Services []
 
static char appName [OBJECT_NAME_LEN+1]
 
static char fileName [OBJECT_FILE_NAME_LEN+1]
 
static const char coldReset [] = "Cold Reset\nFrom "
 
static const char warmReset [] = "Warm Reset\nFrom "
 
static const char timeToCall [] = "Time to call\nFrom "
 
static const char idleMsg [] = "\nSample\nApplication"
 
static const char szDate [] = "Date:%.2s/%.2s/%.2s %.2s:%.2s\n"
 

Function Documentation

int give_your_domain ( NO_SEGMENT  no,
void *  p1,
S_INITPARAMOUT *  param_out 
)

Ask application to define its working environment, Manager will select common parameters set and adapt its internal processing.

Parameters
no(-I)
p1(-I)
param_out(-O)
  • application_type: TYP_CARTE (French Bank) TYP_HEALTH(French Health) TYP_EXPORT (Export)
  • mask: Key "F" 031 -> Parameters initialization (0:absent, 1:present)
  • response_number: should be incremented
Returns
FCT_OK
See also
sdk_tplus.h
int after_reset ( NO_SEGMENT  no,
void *  p1,
S_TRANSOUT *  param_out 
)

Initialize data and create disks, eventually ends interrupted transaction by returning S_TRANS_OUT.

Parameters
no(-I)
p1(-I)
param_out(-O) Eventually ends interrupted transaction
Returns
FCT_OK
See also
sdk_tplus.h
int is_name ( NO_SEGMENT  no,
void *  p1,
S_ETATOUT *  param_out 
)

Report application name to Manager.

Parameters
no(-I)
p1(-I)
param_out(-O)
  • appname: Application name
  • no: Application number
  • response_number: should be incremented
Returns
FCT_OK
See also
sdk_tplus.h
int is_state ( NO_SEGMENT  no,
void *  p1,
S_ETATOUT *  param_out 
)

Report application state initialize or not to Manager.

Parameters
no(-I)
p1(-I)
param_out(-O)
  • response: REP_OK (Initialized) REP_KO (Not initialized)
Returns
FCT_OK
See also
sdk_tplus.h
int idle_message ( NO_SEGMENT  no,
void *  p1,
void *  p2 
)

Allows the application to display its idle message when Manager goes back to idle (the application should have the higher priority).

Parameters
no(-I)
p1(-I)
p2(-I)
Returns
FCT_OK
See also
sdk_tplus.h
int more_function ( NO_SEGMENT  no,
void *  p1,
void *  p2 
)

It's activated when pressing on "F" key to select the right application to go on menu.

Parameters
no(-I)
p1(-I)
p2(-I)
Returns
FCT_OK
See also
sdk_tplus.h
Note
Other prototype variant 'int more_function_ext(NO_SEGMENT no, S_ETATOUT *in, void *out)' can be used with INCENDO. This other prototype is used if the application manages more than one application name. The 'S_ETATOUT' structure allows to know the name selected by the user after pressing the "F" key. This new prototype can be used with SDK version >= 6.5.
int keyboard_event ( NO_SEGMENT  noappli,
S_KEY *  key_in,
S_KEY *  key_out 
)

It's activated when key is pressed and terminal is in idle mode.

Parameters
noappli
key_in(I-)
  • keycode: Key pressed.
key_out(-O)
  • keycode: Key pressed, new key, 0=disable.
Returns
FCT_OK
See also
sdk_tplus.h
int file_received ( NO_SEGMENT  no,
S_FILE *  param_in,
void *  p2 
)

Manager reports parameters file received from LLT. It's activated upon reception of a parameter file by the manager.

Parameters
no(-I)
param_in(I-)
  • volume_name: SYSTEM (File loaded in CFS) HOST (File loaded in DFS).
  • file_name: Application file name
p2(-I)
Returns
FCT_OK
See also
sdk_tplus.h
int give_interface ( unsigned short  AppliNum,
void *  p1,
void *  p2 
)

Services registration and priority. For all services except idle_message, priority => 0x00 highest and 0xFF lowest For idle_message, priority => 0x00 lowest 0xFF highest

Parameters
AppliNum(-I)
p1(-I)
p2(-I)
Returns
FCT_OK
See also
sdk_tplus.h
void entry ( void  )

entry() is called by the OS for recording services and opening DLL(s). The RegisteryPowerFailure() can also be moved to entry().

See also
sdk_tplus.h

Macro Definition Documentation

#define __ENTER_KEY   -1

Entry.c

Application entry point. This file was automatically generated by IngeDev and must be filled out by the developer.

Purpose:

Each time Manager calls an application, it generates only one service call that reaches your application main with the corresponding service number.

List of routines in file:

  • give_your_domain: Return application domain.
  • after_reset: Application reset processing.
  • is_name: Report application name to Manager.
  • is_state: Return application status (initialize or not).
  • idle_message: Dedicated to display idle message.
  • more_function: Dedicated to navigation menus.
  • keyboard_event: Return key pressed.
  • state: Print terminal content.
  • consult: Print daily totals.
  • mcall: Print call schedule.
  • is_time_function: Need pheripherals at the next call time_function()
  • time_function: Allow automatic execution of periodic functions.
  • is_change_init: Conditions for changing manager parameters?
  • modif_param: Manager reports parameters changing.
  • is_evol_pg: Conditions for application downloading?
  • is_delete: Conditions for application deletion?
  • file_received: Manager reports parameters file received from LLT.
  • message_received: Inter application messaging.
  • is_card_specific: Card needs a specific process?
  • card_inside: Transaction in progress for a specific card.
  • is_for_you_before: Is chip card as an ISO 7816-3?
  • is_for_you_after: recognise mag, smc or man card in order to be a candidate.
  • give_interface: Services registration and priority.
  • entry: Call by OS for recording services and opening DLL(s).
#define __BACK_KEY   -2
#define __EXIT_KEY   -3
#define NUMBER_OF_ITEMS (   a)    (sizeof(a)/sizeof((a)[0]))
#define SERVICES_LOW_PRIORITY   30
#define SERVICES_HIGH_PRIORITY   10
#define SERVICES_DEFAULT_PRIORITY   20

Typedef Documentation

typedef struct Params S_PARAMS

Variable Documentation

Telium_service_desc_t Services[]
static
Initial value:
= {
{ 0, GIVE_YOUR_DOMAIN, (Telium_callback)Main, (unsigned char)SERVICES_HIGH_PRIORITY },
{ 0, AFTER_RESET, (Telium_callback)Main, (unsigned char)SERVICES_HIGH_PRIORITY },
{ 0, IS_NAME, (Telium_callback)Main, (unsigned char)SERVICES_HIGH_PRIORITY },
{ 0, IS_STATE, (Telium_callback)Main, (unsigned char)SERVICES_HIGH_PRIORITY },
{ 0, IDLE_MESSAGE, (Telium_callback)Main, (unsigned char)SERVICES_DEFAULT_PRIORITY },
{ 0, MORE_FUNCTION, (Telium_callback)Main, (unsigned char)SERVICES_HIGH_PRIORITY },
{ 0, KEYBOARD_EVENT, (Telium_callback)Main, (unsigned char)SERVICES_DEFAULT_PRIORITY },
{ 0, FILE_RECEIVED, (Telium_callback)Main, (unsigned char)SERVICES_HIGH_PRIORITY }
}
int Main(unsigned int size, StructPt *data)
Definition: main.c:31
#define SERVICES_DEFAULT_PRIORITY
Definition: entry.c:59
#define SERVICES_HIGH_PRIORITY
Definition: entry.c:58
char appName[OBJECT_NAME_LEN+1]
static
char fileName[OBJECT_FILE_NAME_LEN+1]
static
const char coldReset[] = "Cold Reset\nFrom "
static
const char warmReset[] = "Warm Reset\nFrom "
static
const char timeToCall[] = "Time to call\nFrom "
static
const char idleMsg[] = "\nSample\nApplication"
static
const char szDate[] = "Date:%.2s/%.2s/%.2s %.2s:%.2s\n"
static

Ingenico