Versions Compared
Key
- This line was added.
- This line was removed.
- Formatting was changed.
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: Application callback handler parameters
Parameter | Description |
---|---|
GOAL_CCLIEFB_HANDLE_T *pCfb | GOAL CCLIEFB handle |
GOAL_CCLIEFB_CB_ID_T cbId | callback ID |
GOAL_CCLIEFB_CB_DATA_T *pCbData | callback data |
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.
Code Block | ||
---|---|---|
| ||
static GOAL_STATUS_T appl_cclfbCb( GOAL_CCLIEFB_HANDLE_T *pCfb, /**< GOAL CCLIEFB handle */ GOAL_CCLIEFB_CB_ID_T cbId, /**< callback ID */ GOAL_CCLIEFB_CB_DATA_T *pCbData /**< callback data */ ) { GOAL_STATUS_T res = GOAL_OK; /* result */ UNUSEDARG(pCfb); switch (cbId) { /* ... */ } return res; |
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
Code Block | ||
---|---|---|
| ||
/* ... */ case GOAL_CCLIEFB_CB_ID_TIMEOUT: goal_logInfo("connection to Master Station timed out"); appRun = GOAL_FALSE; break; /* ... */ |
GOAL_CCLIEFB_CB_ID_CYC_STOP
Received cyclic stop instruction from Master Station. This callback is called if the master stops the cyclic communication.
callback data type: none
callback data: none
return value: ignored
Code Block | ||
---|---|---|
| ||
/* ... */ case GOAL_CCLIEFB_CB_ID_CYC_STOP: goal_logInfo("cyclic stop instruction from Master Station"); appRun = GOAL_FALSE; break; /* ... */ |
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
Code Block | ||
---|---|---|
| ||
/* ... */ case GOAL_CCLIEFB_CB_ID_NEW_MASTER: goal_logInfo("connected to a new Master Station with ID: 0x%08"FMT_x32, *pCbData->pNewMasterId); appRun = GOAL_TRUE; break; /* ... */ |
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
Code Block | ||
---|---|---|
| ||
/* ... */ case GOAL_CCLIEFB_CB_ID_MASTER_STOP_USER: goal_logInfo("Master Station application stopped because of error"); appRun = GOAL_FALSE; break; /* ... */ |
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
Code Block | ||
---|---|---|
| ||
/* ... */ case GOAL_CCLIEFB_CB_ID_MASTER_STOP_USER: goal_logInfo("Master Station application stopped by user"); appRun = GOAL_FALSE; break; /* ... */ |
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
Code Block | ||
---|---|---|
| ||
/* ... */ case GOAL_CCLIEFB_CB_ID_MASTER_STOP_UNKNOWN: goal_logInfo("Master Station application stopped"); appRun = GOAL_FALSE; break; /* ... */ |
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
Code Block | ||
---|---|---|
| ||
/* ... */ case GOAL_CCLIEFB_CB_ID_MASTER_RUN: goal_logInfo("Master Station application running"); appRun = GOAL_TRUE; break; /* ... */ |
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
Code Block | ||
---|---|---|
| ||
/* ... */ case GOAL_CCLIEFB_CB_ID_CYC_DATA_VALID: goal_logInfo("cyclic data from Master Station is valid"); break; /* ... */ |
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
Code Block | ||
---|---|---|
| ||
/* ... */ case GOAL_CCLIEFB_CB_ID_CYC_DATA_INVALID: goal_logInfo("cyclic data from Master Station is invalid"); break; /* ... */ |
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
Code Block | ||
---|---|---|
| ||
/* ... */ case GOAL_CCLIEFB_CB_ID_DUPL_MASTER: goal_logInfo("detected master station duplication"); break; /* ... */ |
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
Code Block | ||
---|---|---|
| ||
/* ... */ case GOAL_CCLIEFB_CB_ID_DUPL_SLAVE: goal_logInfo("detected slave duplication station ID error"); break; /* ... */ |
Table of Contents |
---|