This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Sending more than 8bits of data over bluetooth

I'm looking into the service creation portion of BLE, and I've made it pretty far. But one problem that I'm running into is sending more than 8 bits of data at a time back to the board. The service example provided, Immediate Alert Service (IAS), can only send 8 bits at a time. I've dug fairly deep into how they send data, and I hit that 8 bit wall every time. Is this a restriction to all services or only the examples?

So in short, is there an easy way to send more data that I am missing?

Thanks in advance!

Parents
  • Hi Alex,

    First of all, I would like to point out that all headers included in the SoftDevice package, and more specifically those prefixed by ble_, are system headers and should not be modified at all.

    The "data" member of the ble_gatts_evt_write_t is meant as a placeholder for the address in memory where the array containing the data received over the air lives.

    This means that, without modifying the header file, you can simply get the data by accessing:

    ble_gatts_evt_write_t::data[0 .. len-1]

    So assuming that ble_gatts_evt_write_t::len was 10, you could access:

    ble_gatts_evt_write_t::data[0] .. ble_gatts_evt_write_t::data[9]

    Hope that helps,

    Carles

Reply
  • Hi Alex,

    First of all, I would like to point out that all headers included in the SoftDevice package, and more specifically those prefixed by ble_, are system headers and should not be modified at all.

    The "data" member of the ble_gatts_evt_write_t is meant as a placeholder for the address in memory where the array containing the data received over the air lives.

    This means that, without modifying the header file, you can simply get the data by accessing:

    ble_gatts_evt_write_t::data[0 .. len-1]

    So assuming that ble_gatts_evt_write_t::len was 10, you could access:

    ble_gatts_evt_write_t::data[0] .. ble_gatts_evt_write_t::data[9]

    Hope that helps,

    Carles

Children
Related