auto-pts: send response for BTP_GATT_OP_CFG_NOTIFY and BTP_GATT_OP_CFG_INDICATE

This commit is contained in:
Matthias Ringwald 2020-01-23 11:29:09 +01:00
parent bb6eca40f0
commit 6984013401

View File

@ -1482,18 +1482,19 @@ static void btp_gatt_handler(uint8_t opcode, uint8_t controller_index, uint16_t
uint8_t data[2];
little_endian_store_16(data, 0, enable ? GATT_CLIENT_CHARACTERISTICS_CONFIGURATION_NOTIFICATION : 0);
gatt_client_write_value_of_characteristic(&gatt_client_packet_handler, remote_handle, ccc_handle, sizeof(data), data);
btp_send(BTP_SERVICE_ID_GATT, opcode, controller_index, 0, NULL);
}
break;
case BTP_GATT_OP_CFG_INDICATE:
MESSAGE("BTP_GATT_OP_CFG_INDICATE");
response_len = 0;
response_service_id = BTP_SERVICE_ID_GATT;
response_op = opcode;
if (controller_index == 0){
uint8_t enable = data[7];
uint16_t ccc_handle = little_endian_read_16(data, 8);
uint8_t data[2];
little_endian_store_16(data, 0, enable ? GATT_CLIENT_CHARACTERISTICS_CONFIGURATION_INDICATION : 0);
gatt_client_write_value_of_characteristic(&gatt_client_packet_handler, remote_handle, ccc_handle, sizeof(data), data);
btp_send(BTP_SERVICE_ID_GATT, opcode, controller_index, 0, NULL);
}
break;
default: