53 #define WPAN_ENVELOPE_CLUSTER_FLAGS 0x00FF 54 #define WPAN_ENVELOPE_BROADCAST_ADDR 0x0100 56 #define WPAN_ENVELOPE_BROADCAST_EP 0x0200 58 #define WPAN_ENVELOPE_RX_APS_ENCRYPT 0x0400 69 #define WPAN_STACK_PROFILE_PROPRIETARY 0x0 71 #define WPAN_STACK_PROFILE_ZIGBEE 0x1 73 #define WPAN_STACK_PROFILE_ZIGBEE_PRO 0x2 80 #define WPAN_PROFILE_ZDO 0x0000 84 #define WPAN_PROFILE_SMART_ENERGY 0x0109 87 #define WPAN_PROFILE_DIGI 0xC105 96 #define WPAN_MANUFACTURER_DIGI 0x101E 98 #define WPAN_MANUFACTURER_DIGI2 0x1087 102 #define WPAN_MANUFACTURER_TEST1 0xFFF1 103 #define WPAN_MANUFACTURER_TEST2 0xFFF2 105 #define WPAN_MANUFACTURER_TEST3 0xFFF3 112 #define WPAN_ENDPOINT_ZDO 0x00 114 #define WPAN_ENDPOINT_DIGI_SE 0x5E 116 #define WPAN_ENDPOINT_DDO 0xE6 118 #define WPAN_ENDPOINT_DIGI_DEVICE WPAN_ENDPOINT_DDO 119 #define WPAN_ENDPOINT_DIGI_DATA 0xE8 121 #define WPAN_ENDPOINT_BROADCAST 0xFF 142 DIGI_CLUST_INDIRECT_ROUTE_ERR = 0x00B0,
225 #define WPAN_CLUST_FLAG_NONE 0x00 227 #define WPAN_CLUST_FLAG_INPUT 0x01 229 #define WPAN_CLUST_FLAG_OUTPUT 0x02 231 #define WPAN_CLUST_FLAG_INOUT 0x03 233 #define WPAN_CLUST_FLAG_SERVER WPAN_CLUST_FLAG_INPUT 235 #define WPAN_CLUST_FLAG_CLIENT WPAN_CLUST_FLAG_OUTPUT 237 #define WPAN_CLUST_FLAG_ENCRYPT 0x10 242 #define WPAN_CLUST_FLAG_ENCRYPT_UNICAST 0x20 247 #define WPAN_CLUST_FLAG_NOT_ZCL 0x80 283 #define WPAN_CLUSTER_END_OF_LIST 0xFFFF 287 #define WPAN_CLUST_ENTRY_LIST_END { WPAN_CLUSTER_END_OF_LIST } 325 #define WPAN_SEND_FLAG_NONE 0x0000 327 #define WPAN_SEND_FLAG_ENCRYPTED 0x0001 407 #define WPAN_FLAG_NONE 0x0000 408 #define WPAN_FLAG_JOINED 0x0001 410 #define WPAN_FLAG_AUTHENTICATED 0x0002 412 #define WPAN_FLAG_AUTHENTICATION_ENABLED 0x0004 426 #define WPAN_DEV_IS_JOINED(dev) ((dev)->flags & WPAN_FLAG_JOINED) 432 #define WPAN_DEV_IS_AUTHENTICATED(dev) ((dev)->flags & WPAN_FLAG_AUTHENTICATED) 435 #define WPAN_ENDPOINT_END_OF_LIST 0xFF 439 #define WPAN_ENDPOINT_TABLE_END { WPAN_ENDPOINT_END_OF_LIST } 461 #define WPAN_APS_PROFILE_ANY 0xFFFF 500 #define WPAN_CONVERSATION_END 1 501 #define WPAN_CONVERSATION_CONTINUE 2 518 #ifndef WPAN_MAX_CONVERSATIONS 519 #define WPAN_MAX_CONVERSATIONS 3 523 #ifndef WPAN_CONVERSATION_TIMEOUT 524 #define WPAN_CONVERSATION_TIMEOUT 30 551 #endif // __WPAN_APS_H int wpan_conversation_register(wpan_ep_state_t FAR *state, wpan_response_fn handler, const void FAR *context, uint16_t timeout)
Add a conversation to the table of tracked conversations.
Definition: wpan_aps.c:299
uint8_t flags
flags that apply to this cluster, see WPAN_CLUST_FLAG_* macros
Definition: aps.h:218
Used to track conversations (outstanding requests) on an endpoint.
Definition: aps.h:505
Unsolicited Watchport sensor.
Definition: aps.h:137
int wpan_envelope_dispatch(wpan_envelope_t *envelope)
Find the matching endpoint for the provided envelope and have it process the frame.
Definition: wpan_aps.c:622
uint8_t device_version
Lower 4 bits are used, upper 4 are reserved and should be 0.
Definition: aps.h:273
uint16_t flags
Bitfield describing the device's capabilities (maybe CAN_SLEEP, nodetype, etc.) and state...
Definition: aps.h:406
WPAN datatypes and support functions, valid for ZigBee and DigiMesh.
const wpan_cluster_table_entry_t * cluster_table
Pointers to a list of clusters that ends with WPAN_CLUST_ENTRY_LIST_END.
Definition: aps.h:278
#define FAR
On platforms with "far" pointers, define to the proper keyword; empty definition if not required...
Definition: platform.h:396
int wpan_tick(wpan_dev_t *dev)
Calls the underlying hardware tick function to process received frames, and times out expired convers...
Definition: wpan_aps.c:860
Information on each cluster associated with an endpoint.
Definition: aps.h:199
Serial data.
Definition: aps.h:130
#define WPAN_MAX_CONVERSATIONS
Number of outstanding requests to track in a wpan_ep_state_t associated with an endpoint.
Definition: aps.h:519
Neighbor FW update.
Definition: aps.h:146
int(* wpan_response_fn)(struct wpan_conversation_t FAR *conversation, const wpan_envelope_t FAR *envelope)
Handler registered with wpan_conversation_register() to process responses to outstanding requests...
Definition: aps.h:493
FW update response.
Definition: aps.h:148
#define XBEE_BEGIN_DECLS
Macro defined to.
Definition: platform.h:41
void wpan_envelope_dump(const wpan_envelope_t FAR *envelope)
Debugging function to dump the contents of an envelope to stdout.
Definition: wpan_aps.c:823
wpan_endpoint_send_fn endpoint_send
send frame to an endpoint
Definition: aps.h:393
uint16_t profile_id
This endpoint's profile ID.
Definition: aps.h:259
Remote Command Request.
Definition: aps.h:134
Remote FW update.
Definition: aps.h:147
Digi NR Command.
Definition: aps.h:135
uint16_t cluster_id
16-bit cluster id, in host byte order.
Definition: aps.h:205
int(* wpan_ep_handler_fn)(const wpan_envelope_t FAR *envelope, struct wpan_ep_state_t FAR *ep_state)
General handler used in the endpoint table.
Definition: aps.h:193
const wpan_endpoint_table_entry_t * endpoint_table
Pointer to a table of the device's endpoints, ending with WPAN_ENDPOINT_TABLE_END.
Definition: aps.h:418
uint16_t network_address
remote 16-bit address
Definition: aps.h:44
void wpan_conversation_delete(wpan_conversation_t FAR *conversation)
Delete a conversation from an endpoint's conversation table.
Definition: wpan_aps.c:349
uint16_t device_id
This endpoint's device ID.
Definition: aps.h:270
wpan_address_t address
IEEE/MAC and network addresses.
Definition: aps.h:396
Volatile part of an endpoint record used to track conversations (requests waiting for responses)...
Definition: aps.h:529
int wpan_envelope_reply(wpan_envelope_t FAR *reply, const wpan_envelope_t FAR *original)
Create a reply envelope based on the envelope received from a remote node.
Definition: wpan_aps.c:752
const wpan_endpoint_table_entry_t * wpan_endpoint_match(wpan_dev_t *dev, uint8_t endpoint, uint16_t profile_id)
Walk a device's endpoint table looking for a matching endpoint ID and profile ID. ...
Definition: wpan_aps.c:160
const wpan_endpoint_table_entry_t * wpan_endpoint_get_next(wpan_dev_t *dev, const wpan_endpoint_table_entry_t *ep)
Function used to walk a device's endpoint table.
Definition: wpan_aps.c:105
uint8_t dest_endpoint
endpoint on recipient (dest)
Definition: aps.h:50
struct wpan_ep_state_t FAR * ep_state
Structure used to track transactions and conversations on ZDO/ZDP and ZCL endpoints.
Definition: aps.h:267
Unsolicited I/O data sample.
Definition: aps.h:136
wpan_tick_fn tick
read and dispatch frames
Definition: aps.h:392
uint16_t length
number of bytes in payload
Definition: aps.h:62
const void FAR * payload
contents of message
Definition: aps.h:61
wpan_endpoint_get_next_fn endpoint_get_next
walk endpoint table
Definition: aps.h:394
int(* wpan_endpoint_send_fn)(const wpan_envelope_t FAR *envelope, uint16_t flags)
Function called by the WPAN APS layer to send a frame out on the network.
Definition: aps.h:318
unsigned short uint16_t
16-bit unsigned integer
Definition: platform_config.h:41
Start OTA update of PXBee App.
Definition: aps.h:143
int wpan_envelope_send(const wpan_envelope_t FAR *envelope)
Send a message to an endpoint using address and payload information stored in a wpan_envelope_t struc...
Definition: wpan_aps.c:790
addr64 ieee_address
remote 64-bit address
Definition: aps.h:43
int(* _wpan_config_fn)(struct wpan_dev_t *dev,...)
Function called by the WPAN APS layer to configure the underlying network device. ...
Definition: aps.h:345
unsigned char uint8_t
8-bit unsigned integer
Definition: platform_config.h:39
const wpan_endpoint_table_entry_t * wpan_endpoint_of_envelope(const wpan_envelope_t *env)
Look up the endpoint table entry for the source endpoint of an envelope.
Definition: wpan_aps.c:204
wpan_aps_handler_fn handler
Function to receive all frames for this cluster, or NULL to have endpoint's handler process the frame...
Definition: aps.h:209
Single structure to hold an 802.15.4 device's 64-bit IEEE/MAC address and 16-bit network address...
Definition: types.h:98
Node ID Message.
Definition: aps.h:138
Digi ND Command.
Definition: aps.h:132
struct wpan_dev_t * dev
interface received on/to send to
Definition: aps.h:42
uint16_t timeout
Time to expire conversation (0 for never or lower 16 bits of xbee_seconds_timer) – limited to 9 hour...
Definition: aps.h:512
wpan_ep_handler_fn handler
Function to receive all frames for invalid clusters, or clusters with a NULL handler.
Definition: aps.h:263
uint16_t profile_id
Profile ID.
Definition: aps.h:45
const wpan_cluster_table_entry_t * wpan_cluster_match(uint16_t match, uint8_t mask, const wpan_cluster_table_entry_t *entry)
Search a cluster table for a matching cluster ID.
Definition: wpan_aps.c:62
const wpan_endpoint_table_entry_t *(* wpan_endpoint_get_next_fn)(struct wpan_dev_t *dev, const wpan_endpoint_table_entry_t *ep)
Custom function for walking the endpoint table.
Definition: aps.h:376
Serial loopback transmit.
Definition: aps.h:131
Digi NR Response.
Definition: aps.h:141
uint8_t wpan_endpoint_next_trans(const wpan_endpoint_table_entry_t *ep)
Increment and return the endpoint's transaction ID counter.
Definition: wpan_aps.c:493
uint8_t endpoint
Endpoint ID, 0 to 254. 255 (0xFF) is used as an end-of-table marker.
Definition: aps.h:255
int(* wpan_aps_handler_fn)(const wpan_envelope_t FAR *envelope, void FAR *context)
General handler used in the cluster table.
Definition: aps.h:169
Typedef used to hold a 64-bit IEEE address, represented as 8 bytes, 4 16-bit values or 2 32-bit value...
Definition: types.h:34
Digi Remote Command Response.
Definition: aps.h:140
Digi DN Response.
Definition: aps.h:139
uint8_t source_endpoint
endpoint on sender (source)
Definition: aps.h:49
#define XBEE_END_DECLS
Macro defined to.
Definition: platform.h:42
uint16_t payload
max bytes in RF payload, need to refresh if encryption enabled/disabled
Definition: aps.h:399
const void FAR * context
Declared const so initializers can use const or non-const pointers.
Definition: aps.h:215
Digi DN Command.
Definition: aps.h:133
int(* wpan_tick_fn)(struct wpan_dev_t *dev)
Function called by the WPAN APS layer to have the underlying device read and dispatch frames...
Definition: aps.h:356
Information on each endpoint on this device.
Definition: aps.h:252
const wpan_endpoint_table_entry_t * wpan_endpoint_of_cluster(wpan_dev_t *dev, uint16_t profile_id, uint16_t cluster_id, uint8_t mask)
Walk a device's endpoint table looking for a matching profile ID and cluster ID.
Definition: wpan_aps.c:243
DigiMesh Sleeping Router Sync.
Definition: aps.h:129
The "envelope" is used to gather all necessary information about a given frame on the network...
Definition: aps.h:40
Structure used by the WPAN/ZigBee layers.
Definition: aps.h:390
wpan_clust_digi
Digi Data cluster IDs (endpoint WPAN_ENDPOINT_DIGI_DATA)
Definition: aps.h:127
uint16_t cluster_id
Cluster ID.
Definition: aps.h:46
int wpan_conversation_response(wpan_ep_state_t FAR *state, uint8_t transaction_id, const wpan_envelope_t FAR *envelope)
Searches the endpoint's table of active conversations (outstanding requests waiting for responses) fo...
Definition: wpan_aps.c:427
void wpan_envelope_create(wpan_envelope_t *envelope, wpan_dev_t *dev, const addr64 FAR *ieee, uint16_t network_addr)
Starting with a blank envelope, fill in the device, 64-bit IEEE address and 16-bit network address of...
Definition: wpan_aps.c:712