TIwilliam hill官网
直播中

王晶

7年用户 138经验值
私信 关注

知道中断64位地址,请问协调器如何用64位地址点播该地址的节点?

本帖最后由 一只耳朵怪 于 2018-5-24 11:22 编辑

ZLongAddr_t ZLA_t_2=[0x00,0x12,0x4b,0x00,0x05,0x3c,0xec,0x38];//节点64位真实地址
ZLongAddr_t ZLA_t_3=[0x00,0x12,0x4b,0x00,0x01,0x16,0xda,0x52];//节点64位真实地址
我的点播函数
void GenericApp_SendTheMessage_etx(ZLongAddr_t ZLA_t_x,uint8 clustor_x)
[
  uint8 i;
  afAddrType_t P2P_DstAddr;
  P2P_DstAddr.addrMode = (afAddrMode_t)Addr64Bit;
  P2P_DstAddr.endPoint = GENERICAPP_ENDPOINT;
  
  for(i=0;i<8;i++)
  [
   P2P_DstAddr.addr.extAddr =ZLA_t_x; //向etx设备发送消息
  ]
  
  //osal_memcpy(&P2P_DstAddr.addr.extAddr, &ZLA_t_x, 1);
  if ( AF_DataRequest( &P2P_DstAddr, &GenericApp_epDesc,
                       clustor_x,
                       2,
                       RxBuf,
                       &GenericApp_TransID,
                       AF_DISCV_ROUTE, AF_DEFAULT_RADIUS ) == afStatus_SUCCESS )
  [
    // Successfully requested to be sent.
  ]
  else
  [
    // Error occurred in request to send.
  ]
]

GenericApp_SendTheMessage_etx(ZLA_t_2,GENERICAPP_CLUSTERID);
GenericApp_SendTheMessage_etx(ZLA_t_3,GENERICAPP_CLUSTERID);


   switch ( pkt->clusterId )
   [
    case GENERICAPP_CLUSTERID://1
    LED1=1;
我这个方法没能实现点亮灯,请问具体如何实现

回帖(5)

阮浙临

2018-5-22 07:23:25
  byte *buf = NULL;  
  GenericApp_DstAddr.addrMode = (afAddrMode_t)Addr64Bit;
  GenericApp_DstAddr.endPoint = GENERICAPP_ENDPOINT;
  buf = GenericApp_DstAddr.addr.extAddr;
//  00 12 4B 00 03 46 E3 41
  buf[0] = 0x41;
  buf[1] = 0xe3;
  buf[2] = 0x46;
  buf[3] = 0x03;
  buf[4] = 0x00;
  buf[5] = 0x4b;
  buf[6] = 0x12;
  buf[7] = 0x00;   

 AF_DataRequest( &GenericApp_DstAddr, &GenericApp_epDesc,
                  TEST,
                  8,
                  tmp,
                  &GenericApp_TransID,
                  AF_DISCV_ROUTE, AF_DEFAULT_RADIUS );

可以使用IEEE地址单播,实测会出现严重丢包和收到重复的包,效果还不如使用0xffff广播
举报

阮浙临

2018-5-22 07:38:30
你的mac地址填反了,cc2530是小端,低地址对应低字节。
P2P_DstAddr.addr.extAddr[0] = 0x38;
P2P_DstAddr.addr.extAddr[1] = 0xec;
P2P_DstAddr.addr.extAddr[7] = 0x00;
举报

王晶

2018-5-22 07:44:36
引用: MarsShu 发表于 2018-5-22 07:23
  byte *buf = NULL;  
  GenericApp_DstAddr.addrMode = (afAddrMode_t)Addr64Bit;
  GenericApp_DstAddr.endPoint = GENERICAPP_ENDPOINT;

you are DASHEN 级人物
举报

王晶

2018-5-22 07:53:41
引用: MarsShu 发表于 2018-5-22 07:23
  byte *buf = NULL;  
  GenericApp_DstAddr.addrMode = (afAddrMode_t)Addr64Bit;
  GenericApp_DstAddr.endPoint = GENERICAPP_ENDPOINT;

好厉害啊
举报

更多回帖

发帖
×
20
完善资料,
赚取积分