情况是这样,我基于GenericApp修改的代码,增加的内容是
afAddrType_t dst_addr; dst_addr.addr.shortAddr = 0x0000; dst_addr.addrMode = afAddr16Bit; dst_addr.endPoint = 0x01; zclReadCmd_t cmd; cmd.numAttr = 1; cmd.attrID[0] = ATTRID_BASIC_MANUFACTURER_NAME; zcl_SendRead(GENERICAPP_ENDPOINT, &dst_addr, ZCL_CLUSTER_ID_GEN_BASIC, &cmd, ZCL_FRAME_CLIENT_SERVER_DIR, false, bdb_getZCLFrameCounter());
目的是想向协调器发送一个zcl_Read的请求,但是调试协调器时并没有发现事件被执行,通过抓包时,发现一个奇怪的地方:
IEEE 802.15.4的数据里,指向的目标地址为0x0000,但是Zigbee Network Layer的目标变成了0x0004,请问是我哪里遗漏了什么,还是写法上有什么不当?还请指教
此处为抓包内容:
Frame 488: 50 bytes on wire (400 bits), 48 bytes captured (384 bits) on interface \\.\pipe\wireshark0, id 0 IEEE 802.15.4 Data, Dst: 0x0000, Src: 0x982e Frame Control Field: 0x8861, Frame Type: Data, Acknowledge Request, PAN ID Compression, Destination Addressing Mode: Short/16-bit, Frame Version: IEEE Std 802.15.4-2003, Source Addressing Mode: Short/16-bit .... .... .... .001 = Frame Type: Data (0x1) .... .... .... 0... = Security Enabled: False .... .... ...0 .... = Frame Pending: False .... .... ..1. .... = Acknowledge Request: True .... .... .1.. .... = PAN ID Compression: True .... .... 0... .... = Reserved: False .... ...0 .... .... = Sequence Number Suppression: False .... ..0. .... .... = Information Elements Present: False .... 10.. .... .... = Destination Addressing Mode: Short/16-bit (0x2) ..00 .... .... .... = Frame Version: IEEE Std 802.15.4-2003 (0) 10.. .... .... .... = Source Addressing Mode: Short/16-bit (0x2) Sequence Number: 17 Destination PAN: 0xc517 Destination: 0x0000 Source: 0x982e [Extended Source: TexasIns_00:1d:1a:85:dc (00:12:4b:00:1d:1a:85:dc)] [Origin: 425] ZigBee Network Layer Data, Dst: 0x0004, Src: 0x982e Frame Control Field: 0x2248, Frame Type: Data, Discover Route: Enable, Security, End Device Initiator Data .... .... .... ..00 = Frame Type: Data (0x0) .... .... ..00 10.. = Protocol Version: 2 .... .... 01.. .... = Discover Route: Enable (0x1) .... ...0 .... .... = Multicast: False .... ..1. .... .... = Security: True .... .0.. .... .... = Source Route: False .... 0... .... .... = Destination: False ...0 .... .... .... = Extended Source: False ..1. .... .... .... = End Device Initiator: True Destination: 0x0004 Source: 0x982e Radius: 30 Sequence Number: 22 [Extended Source: TexasIns_00:1d:1a:85:dc (00:12:4b:00:1d:1a:85:dc)] [Origin: 425] ZigBee Security Header ZigBee Application Support Layer Data, Dst Endpt: 1, Src Endpt: 8 Frame Control Field: Data (0x00) Destination Endpoint: 1 Cluster: Basic (0x0000) Profile: Home Automation (0x0104) Source Endpoint: 8 Counter: 7 ZigBee Cluster Library Frame, Command: Read Attributes, Seq: 1 Frame Control Field: Profile-wide (0x10) Sequence Number: 1 Command: Read Attributes (0x00) Attribute: Manufacturer Name (0x0004)