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.

LAUNCHXL-CC26X2R1: simple_peripheral format 1 byte integer modify to 2 byte

Part Number: LAUNCHXL-CC26X2R1

Hello:

I noticed that simple_peripheral UUID: FFF1  format is 1 byte integer,
Can I change to format is 2 Byte Integer?


I want to send uint16 data from android smartphone to simple_peripheral UUID: FFF1 (uint16 = 2Byte)
I changed some value uint8_t to uint16_t (simple_peripheral: FFF1 Channel), but it also failed to display correctly.

Any suggestions for me?

Thanks.

  • Do you also change the following line in your SimplePeripheral_init

        SimpleProfile_SetParameter(SIMPLEPROFILE_CHAR1, sizeof(uint8_t),
                                   &charValue1);
    

    to

        SimpleProfile_SetParameter(SIMPLEPROFILE_CHAR1, sizeof(uint16_t),
                                   &charValue1);

  • Hello:

    Yes, it has been changed to sizeof(uint16_t), but Still not work.
    When I define Android to send a 2 byte signal, simple_peripheral does not respond until I reconnect, 
    (but send a 1 byte signal, work fine)

    Thanks.

  • Hello,

    If you are modifying the length, then you must ensure that all references to the length are updated. You may have to update the length in the SimpleProfile_SetParameter() function for the SIMPLEPROFILE_CHAR2 case and throughout the program and profile. You will need to make the modification to the initialization mentioned by Yikai. I recommend referring to the Custom Profile SLA lab. Specifically, I believe you will find the Example Service Generator very useful. I recommend adding a characteristic with the length and properties you want, in order to see what code modifications would need to take place to include that characteristic. If you are planning on using the SIMPLEPROFILE_CHAR2, then this can be used as a reference to see where the length is referenced. However, I also recommend going through the entire lab as it contains very useful information on how to work with services.

    Regards,

    Jan