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.

CC2530: Create Blacklist using MAC address ( IEEE addr)

Part Number: CC2530
Other Parts Discussed in Thread: Z-STACK

I am trying to create blacklist in CC2530 which will use IEEE address instead of PAN ID. I have referred the wiki.tiprocessors.com/.../Black_list_implementation ,but it is using PAN ID to create an blacklist. I need the solution for creating blacklist using IEEE Addr.

Thank you....

  • If a ZED tries to join ZC, you want to implement this IEEE address blacklist on ZED or ZC?
  • I want to implement in ZED.
  • extendedPANID of pNwkDesc in ZDApp_NwkDescListProcessing is the IEEE address of ZC responding to beacon requests so you can use it as blacklist.
  • Okay Thank you...

    And also I want the solution for my case:

    Consider this scenario, In particular area I have some 25 number of ZC and more than 500 ZED's (In my scenario there is no ZED, only ZR) . The particular ZR should be connected with one particular ZC. It should not connect with any other ZC. Suppose if it is connected with different ZC, I will be sending leave request to the particular ZR, then ZR will leave from the particular network. But this should not be happen again and again. So I am trying to add the IEEE addr of ZC ( which sent the Leave Request to ZR) into ZR's Blacklist. So that I wont connect with the particular network.

    and also I have some queries..
    1. Is ZR will get the IEEE addr of ZC before joining into the network?( I mean, while sending/ receiving Beacon).
    2. How to write the IEEE addr into the NV RAM of ZR after receiving Leave request.

  • 1. Yes, ZDApp_NwkDescListProcessing will be called before joining into the network.
    2. You can use osal_nv_write to write the IEEE addr into the NV RAM of ZR
  • I have planned to do the following things...
    1. In ZC side, I want to check where it will receive the permit join request from the ZR.
    2. In ZR request, is IEEE addr will be available to ZC?
    3. If ZR's IEEE addr is available means I will check that IEEE addr in my NV RAM ( I will create an list in NV RAM ).
    4. If the particular address is matching, then ZC will allow the ZR to join into the network.

    If this is possible, I want to know I ZC will receive the permit join request and where it will get the address of the ZR?
  • Can you elaborate what you mean it will receive the permit join request from the ZR in ZC side?
  • ZR will send the request to ZC. In that request ZR will ask the permission to join into it's network.
    How ZC will receive the request and how it will process the same.
  • This part is handled by Z-Stack. You can try to check ZMacAssociateRsp() to see if you can control it from there.
  • Is it possible with ZDSecMgrStoredDeviceList to add the IEEE addr of ZR and allowing the particular ZR to join into the network?
  • No. ZDSecMgrStoredDeviceList is not used in Z-Stack other than test purpose.
  • Any other similar function is there to do the same?
  • You can try to save a blacklist by yourself and check the blacklist in ZMacAssociateRsp(). If a device is on blacklist which is checked in ZMacAssociateRsp, you can try not to call MAC_MlmeAssociateRsp() and return false.
  • How to write IEEE addr into NV RAM using osal_nv_write().
    Suppose my IEEE addr is 0x0124B0009E9AA100.
  • You can refer to my example code in e2e.ti.com/.../1867237
  • I have tried to write the IEEE address into the NV RAM like below.

    uint16 nv_test=0x0401;
    uint64 write= 0x00124B0009E9AA10;

    osal_nv_item_init(nv_test, 1, NULL);
    osal_nv_write(nv_test, 0, 8, &write);
    osal_nv_read(nv_test, 0, 8, &write);



    But I am getting an error as "Error[Pe023]: integer constant is too large". But the address length is 64 bit only. Then what is the issue?
  • You should use a byte array to store IEEE address and use it as write buffer .
  • Hi,
    I have written the IEEE address in NV_RAM like below...

    uint16 nv_test=0x0401;
    uint8 write[Z_EXTADDR_LEN] ={ 0x00, 0x12, 0x4B, 0x00, 0x09, 0xE9, 0xA4, 0xAA }; //0x00 12 4B 00 09 E9 A4 AA

    osal_nv_item_init(nv_test, 1, NULL);
    osal_nv_write(nv_test, 0, 8, &write);
    osal_nv_read(nv_test, 0, 8, &write);
    This I have done Zmain.c for now..

    I want to know how to check this address in ZMacAssociateRsp(). Which function should be checked with osal_nv_read(nv_test, 0, 8, &write) in MacAssociateRsp().
  • I couldn't understand you question. Can you elaborate?
  • I have written the particular IEEE address into the NV RAM.
    As you said, I have to check the particular address in MacAssociateRsp() before sending MAC_MlmeAssociateRsp() to the Router.

    How to check the Router's IEEE address in MacAssociateRsp()?
  • There is "ZLongAddr_t DeviceAddress" in "ZMacAssociateRsp_t *pData" and you can check it.
  • This is what I have done..

    uint8 ZMacAssociateRsp( ZMacAssociateRsp_t *pData )

    {

     uint16 nv_test=0x0401; //0x00 12 4B 00 09 E9 AA 10

      uint8*    restricted;

      uint8     index;

      uint8 status;

     uint8 Write[NV_WRITE_STORED_DEVICES][Z_EXTADDR_LEN] =

      {

        { 0x00, 0x12, 0x4B, 0x00, 0x09, 0xE9, 0xA4, 0xAA },

        { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 },

        { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },

      };

     pData->Sec.SecurityLevel = false;

     osal_nv_item_init(nv_test, 1, NULL);

     osal_nv_item_init(nv_test, 1, NULL);

     osal_nv_write(nv_test, 0, 8, &Write);

     //osal_nv_read(nv_test, 0, 8, &Write);

     for ( index = 0; index < NV_WRITE_STORED_DEVICES; index++ )

    {

       restricted = Write[index];

       if ( AddrMgrExtAddrEqual( restricted, pData-> DeviceAddress)  == TRUE )

       {

         // return as unknown device in regards to validation

         status = ZNwkUnknownDevice;

         return 0;

       }

    else

     {

     return ( MAC_MlmeAssociateRsp( (macMlmeAssociateRsp_t *) pData ) );

     }

    }

    }

    after modifying the code like above also, ZR is joining into the network. Is there any modifications required? or any other changes?

  • I suggest you to set breakpoint in ZMacAssociateRsp and check if it still calls MAC_MlmeAssociateRsp.
  • This is solved.

            The actual issue is I have to give the MSB bits of the Address first. Then I have changed that and that is fixed.

    Now I have one issue in that, the first device in the list only not connecting with the network. second and third devices are connecting with the ZC. How to make it possible that it should not connect with any device which is in that list.

    I mean

    uint8 Write[NV_WRITE_STORED_DEVICES][Z_EXTADDR_LEN] =

      {

        { 0xC5, 0x4E, 0xA4, 0x0A, 0x00, 0x4B, 0x12, 0x00 },   ==> This is not connecting with ZC

        { 0x97, 0xA4, 0xE9, 0x09, 0x00, 0x4B, 0x12, 0x00 },    ==> This is connecting with ZC

        { 0xAA, 0xA4, 0xE9, 0x09, 0x00, 0x4B, 0x12, 0x00 },   ==> This also connecting with ZC

      };

    If this is possible, I want to know the maximum number of devices can be added into this list.

  • If you want to block the device to join from all ZRs and ZC, you have to implement a way to transmit the list to all ZRs and ZC.