The application should register a callback handler with the function goal_cclIeFbNew(). This callback will be called by the stack to inform the application about an event. The callback has three parameters:
Table 16: Application callback handler parameters
Parameter Description
GOAL_CCLIEFB_HANDLE_T*pCfb GOAL CCLIEFBhandle GOAL_CCLIEFB_CB_ID_TcbId callback ID GOAL_CCLIEFB_CB_DATA_T*pCbData callbackdata
The callback ID is used to indicate the event. Depending on the event pCbData must be casted to the appropriate data type. The callback must return a GOAL_STATUS_T value. This return value is used for certain events as a decision indicator. If no callback handler is registered, a default callback handler is used. It accepts all events.
1 s t a t i cGOAL_STATUS_T a p p l _ c c l f b C b (
2 GOAL_CCLIEFB_HANDLE_T ∗pCfb ,/ ∗∗<GOALCCLIEFBh a n d l e ∗/
3 GOAL_CCLIEFB_CB_ID_T cb Id ,/ ∗∗<c a l l b a c kID ∗/
4 GOAL_CCLIEFB_CB_DATA_T ∗pCbData/ ∗∗<c a l l b a c kdata ∗/
5 )
6 {
7 GOAL_STATUS_T r e s = GOAL_OK;/ ∗ r e s u l t ∗/
8 UNUSEDARG( pCfb ) ;
9
10 s w i t c h( c b I d ) {
11 /∗ . . . ∗/
12 }
13
14 r e t u r nr e s ;
GOAL_CCLIEFB_CB_ID_TIMEOUT
The connection to Master Station timed out. This callback is called if to many cyclicData request messages of the master are not received if the communication is running.
callback data type: none callback data: none return value: ignored
Tabelle fehlt
GOAL_CCLIEFB_CB_ID_CYC_STOP
Received cyclic stop instruction from Master Station. This callback is called if the master stops the cyclic communica- tion.
callback data type: none callback data: none return value: ignored
Tabelle fehlt
GOAL_CCLIEFB_CB_ID_NEW_MASTER
Found and connected to new master station. This callback if the GOAL CCLIEFB slave is not connected to any master and a new master starts sending cyclic request messages.
callback data type: ID of new master station
callback data: uint32_t *
return value: ignored
Tabelle fehlt
GOAL_CCLIEFB_CB_ID_MASTER_STOP_ERR
Master Station application stopped because of error. This callback is called if the master application stops because of an error (master protocol version 2).
callback data type: none callback data: none return value: ignored
Tabelle fehlt
GOAL_CCLIEFB_CB_ID_MASTER_STOP_USER
Master Station application stopped because of error. This callback is called if the master application stops because of the user (master protocol version 2).
callback data type: none callback data: none return value: ignored
Tabelle fehlt
GOAL_CCLIEFB_CB_ID_MASTER_STOP_UNKNOWN
Master Station application stopped because of error. This callback is called if the master application stops (master protocol version 1).
callback data type: none callback data: none return value: ignored
Tabelle fehlt
GOAL_CCLIEFB_CB_ID_MASTER_RUN
Master Station application running. This callback is called if a stopped master application is running again.
callback data type: none callback data: none return value: ignored
Tabelle fehlt
GOAL_CCLIEFB_CB_ID_CYC_DATA_VALID
The cyclic data from Master Station is valid. Detected that the master changed cyclic transmission state to 1 indicating that cyclic data started to exchange.
callback data type: none callback data: none return value: ignored
Tabelle fehlt
GOAL_CCLIEFB_CB_ID_CYC_DATA_INVALID
The cyclic data from Master Station is invalid. Detected that the master changed cyclic transmission state to 0 indicating that cyclic data stopped to exchange.
callback data type: none callback data: none return value: ignored
Tabelle fehlt
GOAL_CCLIEFB_CB_ID_DUPL_MASTER
The station detected master station duplication. Another master tried to connected during a running connection with the current master.
callback data type: none callback data: none return value: ignored
Tabelle fehelt
GOAL_CCLIEFB_CB_ID_DUPL_SLAVE
The station detected master station duplication. Received a frame with active cyclic connection and same station ID of the device, i.e. the master is exchanging data with another device with the same station ID. Therefore the device knows that its station ID s a duplicate.
callback data type: none callback data: none return value: ignored
Tabelle fehlt