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.

CC2651P3: Unable to modify NWK_INDIRECT_MSG_TIMEOUT

Part Number: CC2651P3
Other Parts Discussed in Thread: SYSCONFIG, Z-STACK,

I am trying to change NWK_INDIRECT_MSG_TIMEOUT from its default value of 7 seconds to 30 seconds.

First I changed the value in SysConfig Z-Stack -> Advanced -> Routing settings. This changed this line in ti_zstack_config.h:
#define NWK_INDIRECT_MSG_TIMEOUT 30

NWK_INDIRECT_MSG_TIMEOUT is referenced by this initialization code in zglobals.c:
uint8_t zgIndirectMsgTimeout = NWK_INDIRECT_MSG_TIMEOUT;

I could see that zgIndirectMsgTimeout was initialized to (30) here, but later on some library code changes it back to (7).

After some research I realized that zgIndirectMsgTimeout was being overridden by the System Config variables (Zstackapi_sysConfigReadReq() / Zstackapi_sysConfigWriteReq()). So, I added some code to use Zstackapi_sysConfigWriteReq() to set the indirectMsgTimeout variable to (30). Now, zgIndirectMsgTimeout is initialized to (30), and remains at (30) during operation.

However, even though zgIndirectMsgTimeout is at (30), the device (coordinator) behaves as if this value is (7). For example, if I queue a message for a sleepy end device, the message is sent to the device if it sends DataRequest 5 seconds after the message is queued, and the message is dropped if the end device sends DataRequest 10 seconds after the message is queued.

Please advise how the indirect message timeout can be changed.

I am using zc_sampleapp_LP_CC2651P3_tirtos7_ticlang (simplelink_cc13xx_cc26xx_sdk_6_41_00_17).

Thanks,
Andy

  • Hi Andy,

    You can change the NWK_INDIRECT_MSG_TIMEOUT at compile time through SysConfig -> Z-Stack -> Advanced -> Routing -> Network Indirect Message Timeout.  Also, did you set the has_indirectMsgTimeout of zstack_sysConfigWriteReq_t to true?  You could debug if ( pPtr->pReq->has_indirectMsgTimeout ) of processSysConfigWriteReq in zstacktask.c to confirm that the Zstackapi_sysConfigWriteReq acts as expected.  The NWK indirect message timeout also exists in _NIB.TransactionPersistenceTime and ZCD_NV_INDIRECT_MSG_TIMEOUT.

    Regards,
    Ryan

  • Hi Ryan,

    I will address each part of your response.

    You can change the NWK_INDIRECT_MSG_TIMEOUT at compile time through SysConfig -> Z-Stack -> Advanced -> Routing -> Network Indirect Message Timeout.

    Actually no, as I explained in my original post you cannot. I will quote from my post below:

    ---

    First I changed the value in SysConfig Z-Stack -> Advanced -> Routing settings. This changed this line in ti_zstack_config.h:
    #define NWK_INDIRECT_MSG_TIMEOUT 30

    NWK_INDIRECT_MSG_TIMEOUT is referenced by this initialization code in zglobals.c:
    uint8_t zgIndirectMsgTimeout = NWK_INDIRECT_MSG_TIMEOUT;

    I could see that zgIndirectMsgTimeout was initialized to (30) here, but later on some library code changes it back to (7).

    After some research I realized that zgIndirectMsgTimeout was being overridden by the System Config variables (Zstackapi_sysConfigReadReq() / Zstackapi_sysConfigWriteReq()). So, I added some code to use Zstackapi_sysConfigWriteReq() to set the indirectMsgTimeout variable to (30). Now, zgIndirectMsgTimeout is initialized to (30), and remains at (30) during operation.

    ---

    Also, did you set the has_indirectMsgTimeout of zstack_sysConfigWriteReq_t to true?  You could debug if ( pPtr->pReq->has_indirectMsgTimeout ) of processSysConfigWriteReq in zstacktask.c to confirm that the Zstackapi_sysConfigWriteReq acts as expected.

    Yes, of course I set has_indirectMsgTimeout of zstack_sysConfigWriteReq_t to true. If I had not, then I wouldn't be reading back the same value I wrote, and zgIndirectMsgTimeout would be overridden to (7) by the library code. See my quoted text above. Since I am reading back the value I wrote (30), then my write must have been successful.

    > The NWK indirect message timeout also exists in _NIB.TransactionPersistenceTime and ZCD_NV_INDIRECT_MSG_TIMEOUT.

    On my system _NIB.TransactionPersistenceTime is (7) and zgIndirectMsgTimeout  is (30). So, I assume that means that the System Config variable indirectMsgTimeout is not being used, and possibly _NIB.TransactionPersistenceTime is used instead. It looks to me like I can modify TransactionPersistenceTime using 

    uint16_t value = 30;
    NLME_SetRequest(nwkTransactionPersistenceTime, 0, &value);

    However, I started by reading the value with

    NLME_GetRequest(nwkTransactionPersistenceTime, 0, &value);

    and the value read is 0xbe1e (_NIB.TransactionPersistenceTime is a 16-bit value).

    So, I expected to read 7 and instead I read 0xbe1e. So I'm not sure how to proceed from here.

    Thanks,
    Andy

  • _NIB is a global variable so you can set _NIB.TransactionPersistenceTime = 30; inside the application.

    Regards,
    Ryan