diff --git a/android/gatt.c b/android/gatt.c
index a4a1048..9d0b2a2 100644
--- a/android/gatt.c
+++ b/android/gatt.c
DBG("");
- if (len != sizeof(*cmd) + (cmd->number * sizeof(cmd->gatt_id[0]))) {
+ if (len != sizeof(*cmd) + (cmd->continuation ? sizeof(cmd->char_id[0]) : 0)) {
error("Invalid get characteristic size (%u bytes), terminating",
len);
raise(SIGTERM);
goto done;
}
- if (cmd->number)
+ if (cmd->continuation)
ch = queue_find(srvc->chars, match_char_by_higher_inst_id,
- INT_TO_PTR(cmd->gatt_id[0].inst_id));
+ INT_TO_PTR(cmd->char_id[0].inst_id));
else
ch = queue_peek_head(srvc->chars);
diff --git a/android/hal-gatt.c b/android/hal-gatt.c
index b1ba977..c5ea9da 100644
--- a/android/hal-gatt.c
+++ b/android/hal-gatt.c
cmd->conn_id = conn_id;
srvc_id_to_hal(&cmd->srvc_id, srvc_id);
- cmd->number = 0;
+ cmd->continuation = 0;
if (start_char_id) {
- gatt_id_to_hal(&cmd->gatt_id[0], start_char_id);
- len += sizeof(cmd->gatt_id[0]);
- cmd->number = 1;
+ gatt_id_to_hal(&cmd->char_id[0], start_char_id);
+ len += sizeof(cmd->char_id[0]);
+ cmd->continuation = 1;
}
return hal_ipc_cmd(HAL_SERVICE_ID_GATT,
diff --git a/android/hal-ipc-api.txt b/android/hal-ipc-api.txt
index 906cfc7..7a20f56 100644
--- a/android/hal-ipc-api.txt
+++ b/android/hal-ipc-api.txt
Command parameters: Connection ID (4 octets)
GATT Service ID (18 octets)
- Number of GATT ID Elements (1 octet)
- GATT ID # UUID (16 octets)
- GATT ID # Instance ID (1 octet)
+ Continuation (1 octet)
+ GATT Characteristic ID (17 octets)
...
Response parameters: <none>
Instance ID (1 octet)
Is Primary (1 octet)
- Valid Number of GATT ID Elements: 0x00
- 0x01
+ Valid GATT Characteristic ID: UUID (16 octets)
+ Instance ID (1 octet)
+
+ GATT Characteristic ID shall only be present when Continuation is non-zero.
In case of an error, the error response will be returned.
diff --git a/android/hal-msg.h b/android/hal-msg.h
index 7a49244..9fec81b 100644
--- a/android/hal-msg.h
+++ b/android/hal-msg.h
struct hal_cmd_gatt_client_get_characteristic {
int32_t conn_id;
struct hal_gatt_srvc_id srvc_id;
- uint8_t number;
- struct hal_gatt_gatt_id gatt_id[0];
+ uint8_t continuation;
+ struct hal_gatt_gatt_id char_id[0];
} __attribute__((packed));
#define HAL_OP_GATT_CLIENT_GET_DESCRIPTOR 0x0b