bt_nus_send data type

I'm sending a short data string from a NUS application. For some reason I cannot read the data as bytes, only string, even if the sent array is uint8_t.

Is there a specifier for the service as to what data type it sends? I couldn't find anything.

Cheers

Parents Reply Children
  • I also cannot understand what's wrong. I am now suspecting that something's wrong with MIT's App Inventor API. I can register and receive data as string, and as shorts (16bit), but cannot get the data as byte or integers.

    Whatever. I'm receiving the data as 16bit shorts and compose from two short a long if needed, or decompose to two bytes.

    Unless someone knows of a type that BLE advertises for master, I don't think there's anything to ask here.

    Thanks!

  • Hello matangk,

    I am not familiar with the MIT Inventor App myself, but I too would find it strange if it was only able to display data received as strings.

    matangk said:
    Unless someone knows of a type that BLE advertises for master, I don't think there's anything to ask here.

    I am not sure what you are asking about here, but as qwertynoon said it is all just bytes being transferred which will depend on the receiver to decode them correctly.
    There is also no advertising going on from the central device (if this is what you meant by 'master') - they only scan for advertisements sent by peripheral devices.
    You phone would be the central device in the case you describe, most likely.

    Best regards,
    Karl

Related