Macros | |
#define | ZAF_CP_HEADER_SIZE 4 |
#define | ZAF_CP_ELEMENT_SIZE 16 |
#define | ZAF_CP_STORAGE_SIZE(num_elements) (ZAF_CP_HEADER_SIZE + (num_elements) * ZAF_CP_ELEMENT_SIZE) |
#define | ZAF_CP_STORAGE(name, num_elements) union { void *align; uint8_t storage[ZAF_CP_STORAGE_SIZE(num_elements)]; } name |
Typedefs | |
typedef void * | CP_Handle_t |
typedef void(* | zaf_cp_subscriberFunction_t) (void *pSubscriberContext, void *pRxPackage) |
Functions | |
CP_Handle_t | ZAF_CP_Init (void *pStorage, uint8_t numSubscribers) |
bool | ZAF_CP_SubscribeToAll (CP_Handle_t handle, void *pSubscriberContext, zaf_cp_subscriberFunction_t pFunction) |
bool | ZAF_CP_SubscribeToCC (CP_Handle_t handle, void *pSubscriberContext, zaf_cp_subscriberFunction_t pFunction, uint16_t CmdClass) |
bool | ZAF_CP_SubscribeToCmd (CP_Handle_t handle, void *pSubscriberContext, zaf_cp_subscriberFunction_t pFunction, uint16_t CmdClass, uint8_t Cmd) |
bool | ZAF_CP_UnsubscribeToAll (CP_Handle_t handle, void *pSubscriberContext, zaf_cp_subscriberFunction_t pFunction) |
bool | ZAF_CP_UnsubscribeToCC (CP_Handle_t handle, void *pSubscriberContext, zaf_cp_subscriberFunction_t pFunction, uint16_t CmdClass) |
bool | ZAF_CP_UnsubscribeToCmd (CP_Handle_t handle, void *pSubscriberContext, zaf_cp_subscriberFunction_t pFunction, uint16_t CmdClass, uint8_t Cmd) |
void | ZAF_CP_CommandPublish (CP_Handle_t handle, void *pRxPackage) |
#define ZAF_CP_ELEMENT_SIZE 16 |
#define ZAF_CP_HEADER_SIZE 4 |
#define ZAF_CP_STORAGE | ( | name, | |
num_elements ) union { void *align; uint8_t storage[ZAF_CP_STORAGE_SIZE(num_elements)]; } name |
#define ZAF_CP_STORAGE_SIZE | ( | num_elements | ) | (ZAF_CP_HEADER_SIZE + (num_elements) * ZAF_CP_ELEMENT_SIZE) |
typedef void* CP_Handle_t |
Handle to the Cmd Publisher "object"
typedef void(* zaf_cp_subscriberFunction_t) (void *pSubscriberContext, void *pRxPackage) |
Callback function triggered by ZAF_CP_CommandPublish, when corresponding subscriber gets notified.
pSubscriberContext | Subscribers context to be passed to subscriber |
pRxPackage | Received Frame |
void ZAF_CP_CommandPublish | ( | CP_Handle_t | handle, |
void * | pRxPackage ) |
Informs all relevant subscribers about incoming frame. Based on incoming frame, it will decide which type of subscribers should be notified It should be called when the receive queue is emptied
handle | Handle to Cmd Publisher module |
pRxPackage | Received frame. It will be passed to subscribers |
CP_Handle_t ZAF_CP_Init | ( | void * | pStorage, |
uint8_t | numSubscribers ) |
Initializes Command publisher module
pStorage | Stores the subscribers list. Should be allocated with ZAF_CP_STORAGE |
numSubscribers | Number of subscribers |
bool ZAF_CP_SubscribeToAll | ( | CP_Handle_t | handle, |
void * | pSubscriberContext, | ||
zaf_cp_subscriberFunction_t | pFunction ) |
Subscribe a function with pHandle to all command classes.
handle | Handle to Cmd Publisher module |
pSubscriberContext | Context of the subscriber |
pFunction | Subscribers callback function |
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.
handle | Handle to Cmd Publisher module |
pSubscriberContext | Context of the subscriber |
pFunction | Subscribers callback function |
CmdClass | Command Class to subscribe to |
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.
handle | Handle to Cmd Publisher module |
pSubscriberContext | Context of the subscriber |
pFunction | Subscribers callback function |
CmdClass | Command Class to subscribe to |
Cmd | Specific command to subscribe to |
bool ZAF_CP_UnsubscribeToAll | ( | CP_Handle_t | handle, |
void * | pSubscriberContext, | ||
zaf_cp_subscriberFunction_t | pFunction ) |
Unsubscribe from previously subscribed handle
handle | Handle to Cmd Publisher module |
pSubscriberContext | Context of the subscriber |
pFunction | Subscribers callback function |
bool ZAF_CP_UnsubscribeToCC | ( | CP_Handle_t | handle, |
void * | pSubscriberContext, | ||
zaf_cp_subscriberFunction_t | pFunction, | ||
uint16_t | CmdClass ) |
Unsubscribe from previously subscribed command class
handle | Handle to Cmd Publisher module |
pSubscriberContext | Context of the subscriber |
pFunction | Subscribers callback function |
CmdClass | Command Class to unsubscribe from |
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
handle | Handle to Cmd Publisher module |
pSubscriberContext | Context of the subscriber |
pFunction | Subscribers callback function |
CmdClass | Command Class to unsubscribe from |
Cmd | Specific command to unsubscribe from |