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

ble_app_rscs

I have nRF52832 running ble_app_rscs as a server, sending notification to the client every hour. I know that the client can read the values also by sending bt_gatt_read to the server and the server will reply instantly with the values. However this value corresponds to the latest measurements conducted by the server, and it could be a while ago. Is there away of sending a message from the client to server so that the server can actually do the measurements instantly? In other words can the client initiate the server to sample its sensors and update gatt instead of waiting for its timer?

Please assist. 

Parents Reply Children
  • No, but it's for all practical purposes similar, you will get an BLE_GATT_EVT_RX_AUTHORIZE_REQUEST event that allow the application to decide whether or not to allow the peer to read the characteristic or not. But in your case you also use it to trigger a measurement.Best regards,
    Kenneth

  • now the question remains how do I implement GATT read with authorization, as in the client side I only see bt_gatt_read, is it something you do on the server side? 

    if it is how can I enable this as for now i do not get BLE_GATT_EVT_RX_AUTHORIZE_REQUEST when i try to read on the server. 

  • This is handled on the server yes, for instance:

    attr_md.rd_auth = 1;       
    attr_md.wr_auth = 0;

    Before calling sd_ble_gatts_characteristic_add().

    My suggestion may be further improved by: So when the application receive the RW_AUTHORIZE_REQUEST, then it can execute the measurement, and write the data using sd_gle_gatts_rw_authorize_reply(). I think you can have up to 30 seconds to do this.

    Best regards,
    Kenneth

  • I am using ble_app_rscs example and I can't seem to find where sd_ble_gatts_characteristic_add() is called, and hence where i can initialize attr_md.rd_auth to 1. 

    please assist

  • I am using ble_app_rscs example and I can't seem to find where sd_ble_gatts_characteristic_add() is called, and hence where i can initialize attr_md.rd_auth to 1. 

    I have also used bt_gatt_write and this returns error number 3, but still no BLE_GATT_EVT_RW_AUTHORIZE_REQUEST is called. 

    can you assist?