_code/posts/tdd-intro/cmock-tutorial/ExampleCode/code/src/sensors_service.c
/* This function is called upon read requests to characteristic attribue value */
This function is called upon read requests to characteristic attribue value
This function is called upon read requests to characteristic attribue value
static void read_acc_int_value(sensors_service_t *ss, const ble_evt_gatts_read_req_t *evt)
{
        if (!ss->cb || !ss->cb->acc_get_characteristic_value) {
                ble_gatts_read_cfm(evt->conn_idx, evt->handle, ATT_ERROR_READ_NOT_PERMITTED, 0, NULL);
                return;
        }
        ss->cb->acc_get_characteristic_value(&ss->svc, evt->conn_idx);
}
static void read_acc_int_value ( sensors_service_t * ss , const ble_evt_gatts_read_req_t * evt ) { if ( ! ss -> cb || ! ss -> cb -> acc_get_characteristic_value ) { ble_gatts_read_cfm ( evt -> conn_idx , evt -> handle , ATT_ERROR_READ_NOT_PERMITTED , 0 , NULL ) ; return ; } ss -> cb -> acc_get_characteristic_value ( & ss -> svc , evt -> conn_idx ) ; }
This function is called upon read requests to characteristic attribue value
This function is called upon read requests to characteristic attribue value
/*
         * Check whether the application has defined a callback function
         * for handling the event.
         */ /* The application should provide the requested data to the peer device.  */ // callback executed properly