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.

CC1352P: incomprehensible parts of the code in openthread examples

Part Number: CC1352P

Hello, I'm trying to figure out the open-thread examples, but there are a few questions that I can't get through:

        if(addr->mAddress.mFields.m16[6]==TIOP_TEMPSENSOR_DEIVCE_TYPE)
        {
            targetThermstatAddress = addr->mAddress;
            targetThermstatAddress.mFields.m16[6] = TIOP_THERMOSTAT_DEIVCE_TYPE;
            targetThermstatAddress.mFields.m16[7] = TIOP_THERMOSTAT_DEIVCE_ID;
            reportingAddress = targetThermstatAddress;
        };

This is the code section of the tempsensor example. It uses the macros TIOP_TEMPSENSOR_DEIVCE_TYPE, TIOP_THERMOSTAT_DEIVCE_TYPE and TIOP_THERMOSTAT_DEIVCE_ID
And I can’t understand where they are registered, with what exactly they are compared, I did not find these descriptions in the search about the project, there is not a word about this in the readme file either. I would be glad for any help and explanation, otherwise it is very difficult to figure it out yourself and study the technology when there is practically no background.

  • Hi,

    Thanks for checking out TI's OpenThread examples.

    At a high level, Thread implements IPv6, and effectively has potential to inherit any of the "well known" RFCs (such as DHCP).

    Short answer is, this code snippet is not used by default, since it is guarded by #if (OPENTHREAD_CONFIG_DHCP6_CLIENT_ENABLE && OPENTHREAD_ENABLE_DHCP6_MULTICAST_SOLICIT), both of which are 0.

    DHCP is used to configure information on IP devices, such as address. (In the code snippet, if DHCP is used, then the MSBits of the address are configured with the expected destination address).

    Thanks,
    Toby

  • Thank you, but there are no examples of how to configure dhсp? since it would be much more convenient to send requests to the desired device, and not use multicast.