1.4.3.10 MMHI_CommandCallbackRegister Function
C
MMHI_RESULT MMHI_CommandCallbackRegister (
uint8_t cmdCode,
MMHI_CMD_FRAME_IND_CALLBACK callback
);
Summary
Allows a client to register a new command code in MM host interface.
Description
This function allows a client to register a handling function for the MMHI to call back when the command code has been detected.
Parameters
| Param | Description |
|---|---|
| cmdCode | New Command code to be registered in MMHI protocol |
| callback |
Pointer to the callback function. See MMHI_CMD_FRAME_IND_CALLBACK Typedef |
Returns
None.
Example
#define APP_MMHI_CMD_SET_STBY 0xA0
void APP_CmdSetStbyCallback(uint8_t* data, uint8_t length)
{
if (length > 0)
{
}
}
MMHI_CommandCallbackRegister(APP_MMHI_CMD_SET_STBY, APP_CmdSetStbyCallback);
Remarks
Command code must be different than the internal reserved command values used in MMHI.
Callback can be set to a NULL pointer to stop receiving notifications.
