MyWireless Application different address assignment.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

MyWireless Application different address assignment.

1,095 Views
AmZig
Contributor I
Hej All,
 
This time i am trying to assign different short address from PAN coordinator to 4 Mc13213 SRB . For this purpose i have globally declared a variable maaddress counter and then use it in App_SendAssociateResponse . My simple code is like this , and this code is working every time its assign a unique address to  the devices, but i am facing the problem that it is assigning address to only one or 2 device at a time , and other devices were not assigned any. And after so many hits then it worked for all devices and assigned them unique short address at the same time.
 
   be assigned to it. */
    if(pMsgIn->msgData.associateInd.capabilityInfo & gCapInfoAllocAddr_c)
    {
      /* Assign a unique short address less than 0xfffe if the device requests so. */
       pAssocRes->assocShortAddress[0] = madevicecounter+01;
      pAssocRes->assocShortAddress[1] = 0x00;
        
      madevicecounter++;
                                         
     
    }
    else
    {
      /* A short address of 0xfffe means that the device is granted access to
         the PAN (Associate successful) but that long addressing is used.*/
      pAssocRes->assocShortAddress[0] = 0xFE;
      pAssocRes->assocShortAddress[1] = 0xFF;
    }
 
Regards
AmZig
Labels (1)
0 Kudos
2 Replies

279 Views
Spell
Contributor I
Try in this way:

pAssocRes->assocShortAddress[0] = madevicecounter++;
pAssocRes->assocShortAddress[1] = 0x00;
0 Kudos

279 Views
AmZig
Contributor I
Hej Spell,
 
Thank you once again , well this code did the same thing as my own code, but the problem still exist. That it cant assign the different addresses to different devices , at the same time. For e.g if one device will get a short address, when the second device would send MLME.Associate request , it would not be granted short id in MLME.Associate.Response , and it ll go into a continous loop of hitting for askin short address. Then after almost 10 to 15 tries , it could assign different short address to all devices.
 
Regards
AmZig 
0 Kudos