Trident IoT Z-Wave SDK
 
Loading...
Searching...
No Matches
CMD_Publisher
+ Collaboration diagram for CMD_Publisher:

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)
 

Detailed Description

Macro Definition Documentation

◆ ZAF_CP_ELEMENT_SIZE

#define ZAF_CP_ELEMENT_SIZE   16

◆ ZAF_CP_HEADER_SIZE

#define ZAF_CP_HEADER_SIZE   4

◆ ZAF_CP_STORAGE

#define ZAF_CP_STORAGE ( name,
num_elements )   union { void *align; uint8_t storage[ZAF_CP_STORAGE_SIZE(num_elements)]; } name

◆ ZAF_CP_STORAGE_SIZE

#define ZAF_CP_STORAGE_SIZE ( num_elements)    (ZAF_CP_HEADER_SIZE + (num_elements) * ZAF_CP_ELEMENT_SIZE)

Typedef Documentation

◆ CP_Handle_t

typedef void* CP_Handle_t

Handle to the Cmd Publisher "object"

◆ zaf_cp_subscriberFunction_t

typedef void(* zaf_cp_subscriberFunction_t) (void *pSubscriberContext, void *pRxPackage)

Callback function triggered by ZAF_CP_CommandPublish, when corresponding subscriber gets notified.

Parameters
pSubscriberContextSubscribers context to be passed to subscriber
pRxPackageReceived Frame

Function Documentation

◆ ZAF_CP_CommandPublish()

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

Parameters
handleHandle to Cmd Publisher module
pRxPackageReceived frame. It will be passed to subscribers

◆ ZAF_CP_Init()

CP_Handle_t ZAF_CP_Init ( void * pStorage,
uint8_t numSubscribers )

Initializes Command publisher module

Note
ZAF_CP_STORAGE must be called before this
Parameters
pStorageStores the subscribers list. Should be allocated with ZAF_CP_STORAGE
numSubscribersNumber of subscribers
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.

Parameters
handleHandle to Cmd Publisher module
pSubscriberContextContext of the subscriber
pFunctionSubscribers 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.

Parameters
handleHandle to Cmd Publisher module
pSubscriberContextContext of the subscriber
pFunctionSubscribers callback function
CmdClassCommand 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.

Parameters
handleHandle to Cmd Publisher module
pSubscriberContextContext of the subscriber
pFunctionSubscribers callback function
CmdClassCommand Class to subscribe to
CmdSpecific 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

Parameters
handleHandle to Cmd Publisher module
pSubscriberContextContext of the subscriber
pFunctionSubscribers 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

Parameters
handleHandle to Cmd Publisher module
pSubscriberContextContext of the subscriber
pFunctionSubscribers callback function
CmdClassCommand 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

Parameters
handleHandle to Cmd Publisher module
pSubscriberContextContext of the subscriber
pFunctionSubscribers callback function
CmdClassCommand Class to unsubscribe from
CmdSpecific command to unsubscribe from
Returns
true if unsubscribing went OK, false if not