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

Can I create Characteristic with Notification only, no Read, no Write

Can I create Characteristic with Notification only, no Read, no Write

I can remove the //char_md.char_props.write = 1; and only the Read and Notify Properties show up in MCP (or the iPhone)

When I comment out the char_md.char_props.read = 1;

Advertising stops and I can not connect to the device.

All I need is a Notification. The server collects data on three (3) sensors, and sends the data using three (3) services. 6-bytes per service, nonstop.

So actually one characteristic with a Notification per service.

Note: I guess eventually with a client app, one would Enable the Notification, and then ignore the Read property.

Any help appreciated

Parents
  • Bjørn, Yes, I mean updating the characteristic, not en/disabling of Notification.

    I actually just tested it. I call

    void our_termperature_characteristic_update(ble_os_t *p_our_service, int8_t *temperature_value)

    which calls sd_ble_gatts_hvx(p_our_service->conn_handle, &hvx_params);

    I call three (3) Characteristic updates in succession sv(1..3)_termperature_characteristic_update() One after the other, no delay, and it seems to work.

    In between the three updates, there is timer delay.

    I decreased the timer interrupt to 1ms in between the tree calls, just to test, so all looks good. In the real world I have this timer set to 2 or 3 seconds.

    I assume something else was wrong earlier.

    Thanks

Reply
  • Bjørn, Yes, I mean updating the characteristic, not en/disabling of Notification.

    I actually just tested it. I call

    void our_termperature_characteristic_update(ble_os_t *p_our_service, int8_t *temperature_value)

    which calls sd_ble_gatts_hvx(p_our_service->conn_handle, &hvx_params);

    I call three (3) Characteristic updates in succession sv(1..3)_termperature_characteristic_update() One after the other, no delay, and it seems to work.

    In between the three updates, there is timer delay.

    I decreased the timer interrupt to 1ms in between the tree calls, just to test, so all looks good. In the real world I have this timer set to 2 or 3 seconds.

    I assume something else was wrong earlier.

    Thanks

Children
No Data
Related