mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-01-16 22:21:21 +00:00
example/gatt_heart_rate_client: skip reading Sensor Location if Characteristic not available
This commit is contained in:
parent
6d466148c0
commit
ddd48cb85d
@ -207,6 +207,11 @@ static void handle_gatt_client_event(uint8_t packet_type, uint16_t channel, uint
|
||||
state = TC_CONNECTED;
|
||||
break;
|
||||
}
|
||||
if (body_sensor_location_characteristic.value_handle == 0){
|
||||
printf("Sensor Location characteristic not available.\n");
|
||||
state = TC_CONNECTED;
|
||||
break;
|
||||
}
|
||||
state = TC_W4_HEART_RATE_MEASUREMENT_CHARACTERISTIC;
|
||||
printf("Read Body Sensor Location.\n");
|
||||
state = TC_W4_SENSOR_LOCATION;
|
||||
@ -223,6 +228,8 @@ static void handle_gatt_client_event(uint8_t packet_type, uint16_t channel, uint
|
||||
case GATT_EVENT_CHARACTERISTIC_VALUE_QUERY_RESULT:
|
||||
body_sensor_location = gatt_event_characteristic_value_query_result_get_value(packet)[0];
|
||||
printf("Sensor Location: %u\n", body_sensor_location);
|
||||
break;
|
||||
case GATT_EVENT_QUERY_COMPLETE:
|
||||
state = TC_CONNECTED;
|
||||
break;
|
||||
default:
|
||||
|
Loading…
Reference in New Issue
Block a user