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

Is BLE_GATTS_VLOC_INVALID a "valid" option?

Hello,

I want to implement some kind of control point. This means, that I want to handle BLE write events to some characteristic. I've seen that the payload of the ATT Write Request or ATT Write Command is within the event data structure. Am I'm allowed to set the 'vloc' attribute to BLE_GATTS_VLOC_INVALID?

If not, could I set the user Buffer to a one octed buffer and the receive the transmited data through the event structure?

A confused User ;-)

Parents
  • Hi Torsten,

    You mean you want to control if you accept the write request or write command base on the content of the payload ? I don't think it's possible to change vloc after you configure the characteristic. And BLE_GATTS_VLOC_INVALID is not a valid option here.

    What you need is to set the characteristic' attribute metadata to require authorization ( attr_md.wr_auth = 1) so that you will receive BLE_GATTS_EVT_RW_AUTHORIZE_REQUEST and decide if you want to accept the payload or not with sd_ble_gatts_rw_authorize_reply().

  • Hi Hung Bui, basecally I'm looking for a way to tell the softdevice that I don't want to back the characteristic value with RAM. Assume I write a bootloader that receives write requests and write commands with possible large MTU sizes. The bootloader or the soft device have to reserve RAM for the characteristic, the event will contain the same values and needs the same amount of RAM. So I have to reserve twice as much RAM as I need.

Reply
  • Hi Hung Bui, basecally I'm looking for a way to tell the softdevice that I don't want to back the characteristic value with RAM. Assume I write a bootloader that receives write requests and write commands with possible large MTU sizes. The bootloader or the soft device have to reserve RAM for the characteristic, the event will contain the same values and needs the same amount of RAM. So I have to reserve twice as much RAM as I need.

Children
No Data
Related