_code/posts/tdd-intro/cmock-tutorial/ExampleCode/code/src/sensors_service.c
/* Handler for read requests, that is BLE_EVT_GATTS_READ_REQ */
Handler for read requests, that is BLE_EVT_GATTS_READ_REQ
Handler for read requests that is BLE_EVT_GATTS_READ_REQ
static void handle_read_req(ble_service_t *svc, const ble_evt_gatts_read_req_t *evt)
{
        sensors_service_t *ss = (sensors_service_t *) svc;
        if (evt->handle == ss->temp_int_value_h) {
                read_temp_int_value(ss, evt);
        }
        else if (evt->handle == ss->acc_int_value_h) {
                read_acc_int_value(ss, evt); 
        }
        else {
                ble_gatts_read_cfm(evt->conn_idx, evt->handle, ATT_ERROR_READ_NOT_PERMITTED, 0, NULL);
        }
}
static void handle_read_req ( ble_service_t * svc , const ble_evt_gatts_read_req_t * evt ) { sensors_service_t * ss = ( sensors_service_t * ) svc ; if ( evt -> handle == ss -> temp_int_value_h ) { read_temp_int_value ( ss , evt ) ; } else if ( evt -> handle == ss -> acc_int_value_h ) { read_acc_int_value ( ss , evt ) ; } else { ble_gatts_read_cfm ( evt -> conn_idx , evt -> handle , ATT_ERROR_READ_NOT_PERMITTED , 0 , NULL ) ; } }
Handler for read requests, that is BLE_EVT_GATTS_READ_REQ
Handler for read requests that is BLE_EVT_GATTS_READ_REQ
/*
         * Identify for which attribute handle the read request has been sent to
         * and call the appropriate function.
         */