CMD_Publisher#
Typedefs#
Handle to the Cmd Publisher "object".
Callback function triggered by ZAF_CP_CommandPublish, when corresponding subscriber gets notified.
Functions#
Initializes Command publisher module.
Subscribe a function with pHandle to all command classes.
Subscribe a function with pHandle to an entire command class.
Subscribe a function with pHandle to a specific command of the given command class.
Unsubscribe from previously subscribed handle.
Unsubscribe from previously subscribed command class.
Unsubscribe from previously subscribed command.
Informs all relevant subscribers about incoming frame.
Macros#
Typedef Documentation#
zaf_cp_subscriberFunction_t#
typedef void(* zaf_cp_subscriberFunction_t) (void *pSubscriberContext, void *pRxPackage) )(void *pSubscriberContext, void *pRxPackage)
Callback function triggered by ZAF_CP_CommandPublish, when corresponding subscriber gets notified.
Type | Direction | Argument Name | Description |
---|---|---|---|
N/A | pSubscriberContext | Subscribers context to be passed to subscriber | |
N/A | pRxPackage | Received Frame |
Function Documentation#
ZAF_CP_Init#
CP_Handle_t ZAF_CP_Init (void * pStorage, uint8_t numSubscribers)
Initializes Command publisher module.
Type | Direction | Argument Name | Description |
---|---|---|---|
void * | N/A | pStorage | Stores the subscribers list. Should be allocated with ZAF_CP_STORAGE |
uint8_t | N/A | numSubscribers | Number of subscribers |
Note
ZAF_CP_STORAGE must be called before this
Returns
handle to the initialized content
ZAF_CP_SubscribeToAll#
bool ZAF_CP_SubscribeToAll (CP_Handle_t handle, void * pSubscriberContext, zaf_cp_subscriberFunction_t pFunction)
Subscribe a function with pHandle to all command classes.
Type | Direction | Argument Name | Description |
---|---|---|---|
CP_Handle_t | N/A | handle | Handle to Cmd Publisher module |
void * | N/A | pSubscriberContext | Context of the subscriber |
zaf_cp_subscriberFunction_t | N/A | pFunction | Subscribers callback function |
Returns
true if new subscription went OK, false if not
ZAF_CP_SubscribeToCC#
bool ZAF_CP_SubscribeToCC (CP_Handle_t handle, void * pSubscriberContext, zaf_cp_subscriberFunction_t pFunction, uint16_t CmdClass)
Subscribe a function with pHandle to an entire command class.
Type | Direction | Argument Name | Description |
---|---|---|---|
CP_Handle_t | N/A | handle | Handle to Cmd Publisher module |
void * | N/A | pSubscriberContext | Context of the subscriber |
zaf_cp_subscriberFunction_t | N/A | pFunction | Subscribers callback function |
uint16_t | N/A | CmdClass | Command Class to subscribe to |
Returns
true if new subscription went OK, false if not
ZAF_CP_SubscribeToCmd#
bool ZAF_CP_SubscribeToCmd (CP_Handle_t handle, void * pSubscriberContext, zaf_cp_subscriberFunction_t pFunction, uint16_t CmdClass, uint8_t Cmd)
Subscribe a function with pHandle to a specific command of the given command class.
Type | Direction | Argument Name | Description |
---|---|---|---|
CP_Handle_t | N/A | handle | Handle to Cmd Publisher module |
void * | N/A | pSubscriberContext | Context of the subscriber |
zaf_cp_subscriberFunction_t | N/A | pFunction | Subscribers callback function |
uint16_t | N/A | CmdClass | Command Class to subscribe to |
uint8_t | N/A | Cmd | Specific command to subscribe to |
Returns
true if new subscription went OK, false if not
ZAF_CP_UnsubscribeToAll#
bool ZAF_CP_UnsubscribeToAll (CP_Handle_t handle, void * pSubscriberContext, zaf_cp_subscriberFunction_t pFunction)
Unsubscribe from previously subscribed handle.
Type | Direction | Argument Name | Description |
---|---|---|---|
CP_Handle_t | N/A | handle | Handle to Cmd Publisher module |
void * | N/A | pSubscriberContext | Context of the subscriber |
zaf_cp_subscriberFunction_t | N/A | pFunction | Subscribers callback function |
Returns
true if unsubscribing went OK, false if not
ZAF_CP_UnsubscribeToCC#
bool ZAF_CP_UnsubscribeToCC (CP_Handle_t handle, void * pSubscriberContext, zaf_cp_subscriberFunction_t pFunction, uint16_t CmdClass)
Unsubscribe from previously subscribed command class.
Type | Direction | Argument Name | Description |
---|---|---|---|
CP_Handle_t | N/A | handle | Handle to Cmd Publisher module |
void * | N/A | pSubscriberContext | Context of the subscriber |
zaf_cp_subscriberFunction_t | N/A | pFunction | Subscribers callback function |
uint16_t | N/A | CmdClass | Command Class to unsubscribe from |
Returns
true if unsubscribing went OK, false if not
ZAF_CP_UnsubscribeToCmd#
bool ZAF_CP_UnsubscribeToCmd (CP_Handle_t handle, void * pSubscriberContext, zaf_cp_subscriberFunction_t pFunction, uint16_t CmdClass, uint8_t Cmd)
Unsubscribe from previously subscribed command.
Type | Direction | Argument Name | Description |
---|---|---|---|
CP_Handle_t | N/A | handle | Handle to Cmd Publisher module |
void * | N/A | pSubscriberContext | Context of the subscriber |
zaf_cp_subscriberFunction_t | N/A | pFunction | Subscribers callback function |
uint16_t | N/A | CmdClass | Command Class to unsubscribe from |
uint8_t | N/A | Cmd | Specific command to unsubscribe from |
Returns
true if unsubscribing went OK, false if not
ZAF_CP_CommandPublish#
void ZAF_CP_CommandPublish (CP_Handle_t handle, void * pRxPackage)
Informs all relevant subscribers about incoming frame.
Type | Direction | Argument Name | Description |
---|---|---|---|
CP_Handle_t | N/A | handle | Handle to Cmd Publisher module |
void * | N/A | pRxPackage | Received frame. It will be passed to subscribers |
Based on incoming frame, it will decide which type of subscribers should be notified It should be called when the receive queue is emptied