Modules#
Utilities for sending and receiving ZigBee AMI InterPAN messages. See Sending and Receiving Messages for documentation.
DeprecatedThe ami-inter-pan library is deprecated and will be removed in a future release. Similar functionality is available in the Inter-PAN plugin in Application Framework.
License#
Copyright 2018 Silicon Laboratories Inc. www.silabs.com
The licensor of this software is Silicon Laboratories Inc. Your use of this software is governed by the terms of Silicon Labs Master Software License Agreement (MSLA) available at www.silabs.com/about-us/legal/master-software-license-agreement. This software is distributed to you in Source Code format and is governed by the sections of the MSLA applicable to Source Code.
/***************************************************************************/
#ifndef AMI_INTER_PAN_H
#define AMI_INTER_PAN_H
// The three types of inter-PAN messages. The values are actually the
// corresponding APS frame controls.
//
// 0x03 is the special interPAN message type. Unicast mode is 0x00,
// broadcast mode is 0x08, and multicast mode is 0x0C.
//
#define INTER_PAN_UNICAST 0x03
#define INTER_PAN_BROADCAST 0x0B
#define INTER_PAN_MULTICAST 0x0F
// Frame control, sequence, dest PAN ID, dest, source PAN ID, source.
#define MAX_INTER_PAN_MAC_SIZE (2 + 1 + 2 + 8 + 2 + 8)
// Short form has a short destination.
// NWK stub frame has two control bytes.
#define STUB_NWK_SIZE 2
#define STUB_NWK_FRAME_CONTROL 0x000B
// APS frame control, group ID, cluster ID, profile ID
#define MAX_STUB_APS_SIZE (1 + 2 + 2 + 2)
// Short form has no group ID.
#define MAX_INTER_PAN_HEADER_SIZE \
(MAX_INTER_PAN_MAC_SIZE + STUB_NWK_SIZE + MAX_STUB_APS_SIZE)
typedef struct {
uint8_t messageType; // one of the INTER_PAN_...CAST values
// MAC addressing
// For outgoing messages this is the destination. For incoming messages
// it is the source, which always has a long address.
uint16_t panId;
bool hasLongAddress; // always true for incoming messages
EmberNodeId shortAddress;
EmberEUI64 longAddress;
// APS data
uint16_t profileId;
uint16_t clusterId;
uint16_t groupId; // only used for INTER_PAN_MULTICAST
} InterPanHeader;
EmberMessageBuffer makeInterPanMessage(InterPanHeader *headerData,
EmberMessageBuffer payload);
uint8_t parseInterPanMessage(EmberMessageBuffer message,
uint8_t startOffset,
InterPanHeader *headerData);
#endif // AMI_INTER_PAN_H
Macros#
Functions#
Create an interpan message suitable for passing to emberSendRawMessage().
Meant to be called on the message and offset values passed to emberMacPassthroughMessageHandler(...). The header is parsed and the various fields are written to the InterPanHeader. The returned value is the offset of the payload in the message, or 0 if the message is not a correctly formed AMI interPAN message.
Macro Definition Documentation#
INTER_PAN_UNICAST#
#define INTER_PAN_UNICASTValue:
0x03
39
of file app/util/zigbee-framework/ami-inter-pan.h
INTER_PAN_BROADCAST#
#define INTER_PAN_BROADCASTValue:
0x0B
40
of file app/util/zigbee-framework/ami-inter-pan.h
INTER_PAN_MULTICAST#
#define INTER_PAN_MULTICASTValue:
0x0F
41
of file app/util/zigbee-framework/ami-inter-pan.h
MAX_INTER_PAN_MAC_SIZE#
#define MAX_INTER_PAN_MAC_SIZEValue:
(2 + 1 + 2 + 8 + 2 + 8)
44
of file app/util/zigbee-framework/ami-inter-pan.h
STUB_NWK_SIZE#
#define STUB_NWK_SIZEValue:
2
48
of file app/util/zigbee-framework/ami-inter-pan.h
STUB_NWK_FRAME_CONTROL#
#define STUB_NWK_FRAME_CONTROLValue:
0x000B
49
of file app/util/zigbee-framework/ami-inter-pan.h
MAX_STUB_APS_SIZE#
#define MAX_STUB_APS_SIZEValue:
(1 + 2 + 2 + 2)
52
of file app/util/zigbee-framework/ami-inter-pan.h
MAX_INTER_PAN_HEADER_SIZE#
#define MAX_INTER_PAN_HEADER_SIZEValue:
(MAX_INTER_PAN_MAC_SIZE + STUB_NWK_SIZE + MAX_STUB_APS_SIZE)
55
of file app/util/zigbee-framework/ami-inter-pan.h
Function Documentation#
makeInterPanMessage#
EmberMessageBuffer makeInterPanMessage (InterPanHeader * headerData, EmberMessageBuffer payload)
Create an interpan message suitable for passing to emberSendRawMessage().
N/A | headerData | |
N/A | payload |
81
of file app/util/zigbee-framework/ami-inter-pan.h
parseInterPanMessage#
uint8_t parseInterPanMessage (EmberMessageBuffer message, uint8_t startOffset, InterPanHeader * headerData)
Meant to be called on the message and offset values passed to emberMacPassthroughMessageHandler(...). The header is parsed and the various fields are written to the InterPanHeader. The returned value is the offset of the payload in the message, or 0 if the message is not a correctly formed AMI interPAN message.
N/A | message | |
N/A | startOffset | |
N/A | headerData |
91
of file app/util/zigbee-framework/ami-inter-pan.h