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

[S132, S140] char_props.write=0 doesn't prevent writing

Hello,

There is a characteristic with properties:

memset(&char_md, 0, sizeof(char_md));
...
attr_md.vloc    = BLE_GATTS_VLOC_USER;
...
char_md.char_props.write = 0;
char_md.char_props.read = 1;
attr_char_value.init_len = 16
attr_char_value.max_len = 16
attr_char_value.p_value = device_data;

When reading with gatttool, 16 bytes are read. But, after writing (char-write-rec) to this char., the length becames to be a number of bytes that was written, e.g., after writing 1 byte, 1 byte of data will be read then (instead of 16 that must always be).

Questions:

  1. Why props.write=0 doesn't prevent writing and length corruption on the stack level?
  2. How to prevent length corruption when data is stored on the user location?
Parents Reply Children
No Data
Related