![]() |
NHS31xx SW API
|
The message handler module allows the application to enable or disable certain behavior through the use diversity flags in the form of defines. Sensible defaults are chosen; to deviate, simply define the relevant flags and message ids in your application before including the message handler module.
app_sel.h
#define MSG_APP_HANDLERS_COUNT 0 |
#define MSG_ENABLE_GETVERSION 1 |
The command/response for MSG_ID_GETVERSION is enforced and can not be disabled.
#define SW_MAJOR_VERSION 0 |
Use the major version to distinguish between applications and/or application types. This define is used when generating the response to MSG_ID_GETVERSION
#define SW_MINOR_VERSION 0 |
Use the minor version to distinguish between application updates. This define is used when generating the response to MSG_ID_GETVERSION
#define MSG_RESPONSE_BUFFER_SIZE 0 |
Responses that do not get treated immediately can be stored in an internal buffer.
MSG_RESPONSE_BUFFER_SIZE
and MSG_RESPONSE_BUFFER must be defined. Define here the size of the buffer. 255
bytes: This is a limitation fully due to the implementation how the responses are stored in the internal buffer.#define MSG_ENABLE_GETRESPONSE (MSG_RESPONSE_BUFFER_SIZE > 0) |
This command is automatically enabled when MSG_RESPONSE_BUFFER_SIZE is set.
#define MSG_ENABLE_RESET 0 |
Assign a non-zero value to enable the handling of the command MSG_ID_RESET
#define MSG_ENABLE_READREGISTER 0 |
Assign a non-zero value to enable the handling of the command MSG_ID_READREGISTER
#define MSG_ENABLE_WRITEREGISTER 0 |
Assign a non-zero value to enable the handling of the command MSG_ID_WRITEREGISTER
#define MSG_ENABLE_READMEMORY 0 |
Assign a non-zero value to enable the handling of the command MSG_ID_READMEMORY
#define MSG_ENABLE_WRITEMEMORY 0 |
Assign a non-zero value to enable the handling of the command MSG_ID_WRITEMEMORY
#define MSG_ENABLE_PREPAREDEBUG 0 |
Assign a non-zero value to enable the handling of the command MSG_ID_PREPAREDEBUG
#define MSG_ENABLE_GETNFCUID 1 |
Assign a zero value to disable the handling of the command MSG_ID_GETNFCUID
#define MSG_ENABLE_GETUID 1 |
Assign a zero value to disable the handling of the command MSG_ID_GETUID
#define MSG_ENABLE_CHECKBATTERY 0 |
Assign a non-zero value to enable the handling of the command MSG_ID_CHECKBATTERY.
#define MSG_ENABLE_GETCALIBRATIONTIMESTAMP 1 |
Assign a zero value to disable the handling of the command MSG_ID_GETCALIBRATIONTIMESTAMP
#define MSG_APP_HANDLERS application defined array with MSG_APP_HANDLERS_COUNT elements of type #MSG_CMD_HANDLER_T |
To define custom command handlers, both MSG_APP_HANDLERS_COUNT and MSG_APP_HANDLERS must be defined.
#define MSG_RESPONSE_BUFFER application defined array with MSG_RESPONSE_BUFFER_SIZE elements of type uint8_t |
Responses that do not get treated immediately can be stored in an internal buffer. To define a buffer to be used by the message handler module, both MSG_RESPONSE_BUFFER_SIZE and MSG_RESPONSE_BUFFER must be defined. Define here the location of the buffer.
#define MSG_COMMAND_ACCEPT_CB application function of type pMsg_AcceptCommandCb_t |
Adds a hook inside Msg_HandleCommand that allows to block handling each individual command.
#define MSG_CATCHALL_HANDLER application function of type pMsg_CmdHandler_t |
When the flexibility offered at compile time with MSG_APP_HANDLERS and MSG_APP_HANDLERS_COUNT is not enough, a callback can be defined where all untreated commands are directed to. The upper layer can then dynamically decide to treat certain commands or not.
#define MSG_RESPONSE_DISCARDED_CB application function of type pMsg_ResponseCb_t |
Responses that do not get treated immediately can be stored in an internal buffer, and they can be fetched later using MSG_ID_GETRESPONSE. Whenever this buffer runs full, the oldest response is discarded. To get notified when a response is being discarded, set this define to the callback to be called.