各位大神
z-stack里面有个发送队列,就是最多能存3个设备,最多能存9条数据的那个队列的名称叫什么?
还有,那个队列我能操作吗?
拜托拜托!
gaoyang9992006:
OSAL的消息队列
每一个消息都包含一个消息头osal_msg_hdr_t和用户自定义的消息,osal_msg_hdr_t结构体定义如下:
typedef struct
{
void *next;
uint16 len;
uint8 dest_id;
} osal_msg_hdr_t;
在事件处理函数SampleApp_ProcessEvent()中,从消息队列中接收到一个消息,后才调用SampleApp_MessageMSGCB,接收到的消息中如何就包含了用户接收的数据消息呢?
是这样子的:每个消息都有一个用户自定义的消息部分,协调器收到数据后,将数据打包,存放在用户自定义消息部分,然后将其插入到消息队列,用户就可以从消息队列接收该消息
接收到数据后的消息格式如下图所示。
AF层的数据包结构体:afIncomingMSGPacket_t
typedef struct
{
osal_event_hdr_t hdr; /* OSAL Message header */
uint16 groupId; /* Message's group ID – 0 if not set */
uint16 clusterId; /* Message's cluster ID */
afAddrType_t srcAddr; /* Source Address, if endpoint is STUBAPS_INTER_PAN_EP,
it's an InterPAN message */
uint16 macDestAddr; /* MAC header destination short address */
uint8 endPoint; /* destination endpoint */
uint8 wasBroadcast; /* TRUE if network destination was a broadcast address */
uint8 LinkQuality; /* The link quality of the received data frame */
uint8 correlation; /* The raw correlation value of the received data frame */
int8 rssi; /* The received RF power in units dBm */
uint8 SecurityUse; /* deprecated */
uint32 timestamp; /* receipt timestamp from MAC */
afMSGCommandFormat_t cmd; /* Application Data */
} afIncomingMSGPacket_t;af地址类型
typedef struct
{
union
{
uint16 shortAddr; //16位网络地址
ZLongAddr_t extAddr; //设备IEEE64位物理地址
} addr;
afAddrMode_t addrMode;
byte endPoint;
uint16 panId;
} afAddrType_t;数据传输模式
typedef enum
{
afAddrNotPresent = AddrNotPresent,
afAddr16Bit = Addr16Bit, //点播
afAddr64Bit = Addr64Bit,
afAddrGroup = AddrGroup, //组播
afAddrBroadcast = AddrBroadcast //广播
} afAddrMode_t;afStatus_t AF_DataRequest( afAddrType_t *dstAddr, endPointDesc_t *srcEP,
uint16 cID, uint16 len, uint8 *buf, uint8 *transID,
uint8 options, uint8 radius )
天空:
回复 gaoyang9992006:
不好意思,不是这个队列
Aries Lord:
回复 天空:
这个队列是实现什么功能的?