This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

关于组播的两个问题,删除组和改组的,求大神

在我的代码中

想以这种方式改设备在的组:

case 0x10:
            aps_RemoveAllGroup(SampleApp_TransID);                                      //删除之前的组
           Donghe_Group_DstAddr.addrMode = (afAddrMode_t)AddrGroup;    //重新配置组
           Donghe_Group_DstAddr.endPoint = SAMPLEAPP_ENDPOINT;
           Donghe_Group_DstAddr.addr.shortAddr = Donghe_Group_1;
           Donghe_Group.ID = Donghe_Group_1;
           osal_memcpy(Donghe_Group.name,"Group 1",7);
           aps_AddGroup(SAMPLEAPP_ENDPOINT,&Donghe_Group);
     break;
case 0x20:
          aps_RemoveAllGroup(SampleApp_TransID);
         Donghe_Group_DstAddr.addrMode = (afAddrMode_t)AddrGroup;
         Donghe_Group_DstAddr.endPoint = SAMPLEAPP_ENDPOINT;
         Donghe_Group_DstAddr.addr.shortAddr = Donghe_Group_2;
         Donghe_Group.ID = Donghe_Group_2;
         osal_memcpy(Donghe_Group.name,"Group 2",7);
         aps_AddGroup(SAMPLEAPP_ENDPOINT,&Donghe_Group);
      break;
case 0x40:
        aps_RemoveAllGroup(SampleApp_TransID);
        Donghe_Group_DstAddr.addrMode = (afAddrMode_t)AddrGroup;
        Donghe_Group_DstAddr.endPoint = SAMPLEAPP_ENDPOINT;
        Donghe_Group_DstAddr.addr.shortAddr = Donghe_Group_3;
        Donghe_Group.ID = Donghe_Group_3;
        osal_memcpy(Donghe_Group.name,"Group 3",7);
        aps_AddGroup(SAMPLEAPP_ENDPOINT,&Donghe_Group);
   break;
case 0x80:
       aps_RemoveAllGroup(SampleApp_TransID);
       Donghe_Group_DstAddr.addrMode = (afAddrMode_t)AddrGroup;
       Donghe_Group_DstAddr.endPoint = SAMPLEAPP_ENDPOINT;
       Donghe_Group_DstAddr.addr.shortAddr = Donghe_Group_4;
       Donghe_Group.ID = Donghe_Group_4;
       osal_memcpy(Donghe_Group.name,"Group 4",7);
       aps_AddGroup(SAMPLEAPP_ENDPOINT,&Donghe_Group);
   break;
default:
break;

结果我发现    根本不行    就算执行了,并不是更改了,而是多配置了一个组,能收到新配置的组和之前配置的组的消息。

而且我试了一下   仅仅用按键执行   aps_RemoveAllGroup(SampleApp_TransID);    发现还是能收到组的消息,为什么???  这个函数还有存在的意义?