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: Joining procedure details

Part Number: CC1310

Hi,

Figure 40 in:  http://dev.ti.com/tirex/content/simplelink_cc13x0_sdk_1_30_00_06/docs/ti154stack/ti154stack-sdg/ti154stack-sdg/TI%2015.4-Stack%20Overview.html#phase-2-proprietary-association-procedure-to-inform-coordinator-of-the-network-join-this-is-an-optional-step 

shows that there is a MAC Data Request which is sent from the sensor after the sensor has sent an Association Request and also before the sensor will receive the Association Response sent from the Collector. I cannot find where in the code that this MAC Data Request is initiated. I would also like to know what the purpose of this data message is.

Thanks

dev.ti.com/.../TI 15.4-Stack Overview.html

  • Hei HC,

    this data request is sent automatically by the stack, the purpose of this is to poll the collector to see if there are any messages for the sensor since the sensor doesn't have its receiver ON at all times. Basically the way it works is the sensor sends this data request then in the Ack received there will be a bit set if there is pending data for the sensor, if that is the case then the sensor will turn the receiver ON for certain amount of time and the collector should send the packets during this time.
  • Hei Hector,
    Ok, so as far as I understand the data request command is sent automatically by the stack when configured to do so by some high level settings. Additionally, the high level poll request is another "manual" high level API to initiate a data request as well.
    So the only purpose of the data request in the "join" figure is to ask if the collector has some pending data for the sensor, since the sensor may have been orphaned for a long time etc. The collector would like to send the configuration frame as soon as possible as well, perhaps this is the intended pending frame?
  • A quick followup question: In order for the commStatusIndCB to return ApiMac_commStatusReason_assocRsp and ApiMac_status_success, does this imply that the collector actually received both the Data Request sent from the sensor and the Associate-Response-ACK sent from the sensor? If this is true, the commStatusIndCB could be used to validate the sensor to have the correct key installed since Data Request is one of the secured frames.
  • Hei Hector,
    Since MAC Data Requests are sent both due to application layer API (ApiMac_mlmePollReq) and automatically by the stack, how can I enable "securityFill" for the automatic MAC Data Request? I see that I have the ability to define security for outgoing MAC Data Requests from ApiMac_mlmePollReq, but I am unsure of how to enable this for the automatic behind the curtains MAC Data Requests...

    When are automatic MAC Data Requests sent? The reason I ask is because the example uses the API level one (ApiMac_mlmePollReq). Is it only once during the association procedure? Or are these automatic MAC Data Requests also sent for other purposes, and it that case, which ones?
  • I found some PIB APIs which seems to be related. See below. However, it seems that these PIB settings for the auto MAC Data Requests are related to Beacon Enabled devices, and not for the one single auto MAC Data Request during the association phase, correct? I would like to enable security for this single MAC Data Request, and I would also like to know if there is an API for indication of received auto generated MAC Data Request (I know there are POLL indications, but not aware of any indications for auto generated ones).

            status = ApiMac_mlmeSetSecurityReqArray(
                                    ApiMac_securityAttribute_autoRequestKeySource,
                                    (void *) Jdllc_keySource);
            if(status != ApiMac_status_success)
            {
                System_printf("Error ApiMac_securityAttribute_autoRequestKeySource: %d\r\n", status);
            }
    
            status = ApiMac_mlmeSetSecurityReqUint8(
                                    ApiMac_securityAttribute_autoRequestSecurityLevel,
                                    NORMAL_AUTO_REQUEST_SEC_LEVEL);
            if(status != ApiMac_status_success)
            {
                System_printf("Error ApiMac_securityAttribute_autoRequestSecurityLevel: %d\r\n", status);
            }
    
            status = ApiMac_mlmeSetSecurityReqUint8(
                                    ApiMac_securityAttribute_autoRequestKeyIdMode,
                                    NORMAL_AUTO_REQUEST_KEY_ID_MODE);
            if(status != ApiMac_status_success)
            {
                System_printf("Error ApiMac_securityAttribute_autoRequestKeyIdMode: %d\r\n", status);
            }
    
            status = ApiMac_mlmeSetSecurityReqUint8(
                                    ApiMac_securityAttribute_autoRequestKeyIndex,
                                    NORMAL_AUTO_REQUEST_KEY_INDEX);
            if(status != ApiMac_status_success)
            {
                System_printf("Error ApiMac_securityAttribute_autoRequestKeyIndex: %d\r\n", status);
            }

    (I do not use Beacon mode, so the SecurityLevel is not overwritten to 0.)

  • Hei HC,

    So in summary there are 2 cases where a poll data request will be sent, one would be by the application for polling and the other one will be automatically by the stack when it sees that the data pending bit is set on an ack or a data packet.

    All the autorequest attributes are related to beacon enabled mode and are not related to the automatic polling data request triggered by the stack.

    If you want to enable security on the polling data request I believe you can do it by doing something like the code I have written below after you have added the key:

    #define MAC_FRAME_TYPE_COMMAND          3
            ApiMac_securityPibKeyUsageEntry_t newKeyUsageEntry;
            newKeyUsageEntry.keyIndex = 0;
            newKeyUsageEntry.keyUsageIndex = 1;//make sure you use index 1 since index 0 will already be taken by MAC_FRAME_TYPE_DATA, MAC_DATA_REQ_FRAME
            newKeyUsageEntry.usageEntry.cmdFrameId = MAC_DATA_REQ_FRAME;
            newKeyUsageEntry.usageEntry.frameType = MAC_FRAME_TYPE_COMMAND;        
            ApiMac_mlmeSetSecurityReqStruct(ApiMac_securityAttribute_keyUsageEntry, &newKeyUsageEntry);