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.

LP-EM-CC2340R5: data_stream doesn't send back string when I sent a 184 byte string

Part Number: LP-EM-CC2340R5

I used a 184 bytes string"{ "set_web_user_login": { "errno": 0, "errmsg": "", "lang": "en", "cgisid": "fooKLcuissxSXaS0JSSCD6oZmRRfI", "cgitoken": "k7TLuuoFakPbtuG5LHuDz8Oh3C7mf", "group": 0, "timeout": 180 } }" to test data_stream, but I did't get echo in my simplelink connect app.

I used sniffer to debug this issue, I can see the string be sented many times, but there is not any response from LP-EM-CC2340R5:

I also increase BLE PDU to 255 bytes and UART2 driver ring buffer size to 256, but those actions don't help in this issue.

  • Hi,

    Let's take a step back, the 184 bytes long string you want to echo is entered in the central side (in this case your phone with the TI SimpleLink Connect App)?

    Once you've wrote the value it doesn't show up on the echoing value on the central as well?

    If the answer is yes, have you enable the notifications on the next characteristic?

    If not, are you able to echo smaller string?

    regards,

  • Hi Guillaume,

    My iPhoneXR run simplelink connect app as Central and LP-EM-CC2340R5 run data_stream as Peripheral.

    Yes, I turn on notifications on simplelink connect app.

  • Does the application shows any warning?

    Did you change the format to UTF-8?

    Can you cut the string and trying to send the message in different packets?

    regards,

  • I always use "UTF-8" in this test.

    Some time Mobile App and console would show "Data size is too long", but the frequency is not high. In most cases, you can see mobile app send out full 184 byte packet to cc2340 by sniffer, but CC2340 console does't show any error and no echo string back to mobile app, so we don't know where real data length limitation is in mobile app and data_stream.

    When I used sub-string(under 128 bytes) to test, CC2340 can echo sub-string to mobile app, although capitalization is a bit messed up.

    In our real application scenario, the length of the json string may over 200 bytes, how to modify data_stream to meet our request ?

  • I reproduced your issue, once I entered a string over 128 bytes I receive the message "Data size is too long". Seems that the behaviour is slightly different from a OS to another and either from a application to another.

    For your application I suggest to sub-string your message. I will dive deeper into the code to see the limitation.

    What do you mean by capitalization is a bit messed up? Like it doesn't work properly or you think the feature is not useful (you can remove it if you are not interested in it).

    In the sniffer log, when you are saying "I can see the string be sent many times", there are different packets with the same information? Can you provide me the log it should be useful.

    regards,

  • OK, I checked data_stream descrption "The response is sensitive case, a message in capital letters will be in small letters in response and vice versa.", so capitalization issue is a feature not a bug.

    There are different packets with the same information, here is sniffer log, you can set "btatt" in wireshark filter :

    One more thing, I found "DS_incomingDataCB" function of data_stream show "Data size is too long" and send back the error to mobile app when "len == 0"(The incoming data length was too large), when I trace call flow for the "len == 0" issue, I couldn't find who call DSP_incomingDataCB, so I don't know who fill 0 in dataln->len. Looks like TI hide something, please dig deep into this issue, thanks. 

    static void DSP_incomingDataCB( char *pValue )
    {
      DSS_dataIn_t *dataIn = ( DSS_dataIn_t * )pValue;
    
      if ( dsp_appCB && dsp_appCB->pfnIncomingDataCB )
      {
        dsp_appCB->pfnIncomingDataCB( dataIn->connHandle, dataIn->pValue, dataIn->len );
      }
    }

  • Hello,

    I'm not able to open your sniffer logs, please zip it or forward differently.

    You can find in the data_stream_server.h file located in common>Services>data_stream folder a define called DSS_MAX_DATA_IN_LEN, its length is set to 128 bytes here. You can change its value with your one.

    regards,