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.

CC1310: Sensor/Collector: Two security keys accepted by collector from same sensor.

Part Number: CC1310

Hi,

I would like a sensor to "randomly" use either security key 1 or key 2 for outgoing frames. This works (it's able to use both defined security frames for outgoing frames).

The "issue" is that the collector must be able to accept both type of secured frames (distinguished by key index) from one specific sensor node. Since ApiMac_secAddDevice(&device) only accepts ONE security "setting" for each node (to my understanding), the collector can only accept one security setting per associated sensor node. Is this true, or is it possible for the collector to accept more than just one type of "security key" frame from the same sensor?

As a side note: Both types of security frames works (individually) if I define the correct keyIdLookupList[keyIndex] in ApiMac_secAddDevice. 

  • Hey HC,

    Yes this is possible I actually just shared some code on how you would go about doing this in your other post
    e2e.ti.com/.../2709950
  • Basically you need to call ApiMac_secAddDevice(&device) twice, each time with the different key index that you would like to use for that device, and make sure that MAX_NODE_KEY_ENTRIES is set to the maximum number of keys that you want a single device to have. in this case MAX_NODE_KEY_ENTRIES  should be 2

  • Thanks Hector, I will test this out.

    I see that the parameters are defined in macCfg (mac_cfg.c). hmac_map_direct.h has this declaration: extern macCfg_t macCfg; I did a ctrl-h search to find where the macCfg struct is used, i.e. where this data is written to the PIB or similar. But nothing comes up. I also tried to comment it out to test if there is a lib which uses it - but the clean-compile finished successfully. So how would I know this is not "dead" code?

  • macCfg is used in the libraries. The only place where it is safe to assume that there is "dead" code is in the application specific files such as collector.c, cllc.c, etc, if you comment something out there and you get no errors then it is fine.
    Anything related to the lower layers such as the stack or mac should not be commented out, you should always assume this code is being used in the libraries.

    Regards,
    Hector
  • Got it, thanks for clarifying.

    If I would like to delete one specific instance of the two instances for the single device, I would first have a look at ApiMac_secDeleteDevice(). It states "Removes MAC device table entries.". So I assume that this will delete both two instances (since they share ext addr, and that's the only parameter for the function). So if I need to delete a single instance, is there another "not simplified api" type to use? I could not find any.

    The "work around", given the API (to my knowledge) would be to use ApiMac_securityAttribute_deviceEntry and loop through all deviceIndex's, make a copy of the instance which is not to be deleted, use ApiMac_secDeleteDevice to delete both, then restore the instance again.

    Since the application only requires two key instances in the device table for a short amount of time, I would like to delete it to save RAM.

  • Easy way around this is calling ApiMac_secDeleteDevice and immediately after call ApiMac_secAddDevice to add the same device with the index and lookup data for the key that you want to use for that device.