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.

RTOS/CC1310: 15.4 Stack Collector Example Add Node to Collector programmatically

Part Number: CC1310
Other Parts Discussed in Thread: UNIFLASH

Tool/software: TI-RTOS

Hi

Im looking for solution in Collector example:

1.How to programmatically add sensor MAC to nodes table and save this MAC in FLASH memory.

2.How to make never connected device(sensor with MAC added above) connects automatically to collector.

I am assume that collector will still be able to add sensor thru normal assoctiation procedure.

Thanks Pawel

  • Hi Pawel,

    Are you working with the 15.4 stack collector example? In that case, you can use the Cllc_addSecDevice() API to add a device.
  • Hello
    Yes i am working on 15.4 stack collector example
    I wrote this function:

    static void addStaticDevice(void)
    {
    ApiMac_deviceDescriptor_t pDevInfo;

    // 1: 00 12 4B 00 16 7C 90 2B
    // 2: 00 12 4B 00 0E 07 ED 6C

    pDevInfo.panID = 1;
    pDevInfo.shortAddress = 4;
    pDevInfo.extAddress[7] = 00;
    pDevInfo.extAddress[6] = 0x12;
    pDevInfo.extAddress[5] = 0x4B;
    pDevInfo.extAddress[4] = 0x00;
    pDevInfo.extAddress[3] = 0x0E;
    pDevInfo.extAddress[2] = 0x07;
    pDevInfo.extAddress[1] = 0xED;
    pDevInfo.extAddress[0] = 0x6C;

    Cllc_addSecDevice(pDevInfo.panID,
    pDevInfo.shortAddress,
    &pDevInfo.extAddress, 0);

    return;
    }

    But this is not working.
    Still i need to switch "PermitJoin" on collector to add sensor and even "pDevInfo.shortAddress = 4" i get sensor short address 1.

    Best regards,
    Pawel
  • Hi Pawel,

    Are you doing this along or instead of the provided add device function?

    You should use the provided shortAddess - not give a value yourself. E.g. in the collector example, you get the shortAddress from the stack. ApiMac_assocStatus_t cllcDeviceJoiningCB( ApiMac_deviceDescriptor_t *pDevInfo, ApiMac_capabilityInfo_t *pCapInfo) call.

    Do you mean permitJoining?
  • Hi Marie,

    ad) "Do you mean permitJoining?"
    Yes i mean permitJoining

    ad) "Are you doing this along or instead of the provided add device function?"
    I doing it along provided function.

    This is the scenario:
    version 1) User reads sensor MAC address from sticker and input it to Collector then collector accpets this sensor
    version 2) User switches on permitJoining and sensor adds to collector (in the normal assoctiation procedure)

    Best regards,
    Pawel
  • Hey Pawel,

    To have a device automatically join the network without associating you will need to program the NV on both the sensor and collector devices. One simple way to do this is to have the devices associate, then use SmartRF Flash Programmer 2/UniFlash to read back the Flash memory range where NV resides (check the linker .cmd file or map file for this range). Then you can write this back to any new devices to have them automatically in the network.

    The other option is to populate a ApiMac_mlmeAssociateInd_t from user input and then call the assocIndCb. This will "fake" the receiving of an association request and the collector can then process the infofmation and then send out a response (sensor receiver must be on).