hfp_ag: fix compile warning

This commit is contained in:
Matthias Ringwald 2024-08-14 15:17:42 +02:00
parent 678408a1ef
commit 959f2ebc25
2 changed files with 4 additions and 3 deletions

View File

@ -163,6 +163,7 @@ extern "C" {
#define HFP_APPLE_ACCESSORY_STATE "+IPHONEACCEV"
#define HFP_APPLE_SIRI_STATE "+APLSIRI"
#define HFP_APPLE_SIRI_EYES_FREE_MODE "+APLEFM"
#define HFP_APPLE_ACCESSORY_VERSION_LEN 16
#define HFP_OK "OK"
#define HFP_ERROR "ERROR"
@ -658,7 +659,7 @@ typedef struct hfp_connection {
uint16_t apple_accessory_vendor_id;
uint8_t apple_accessory_features;
uint8_t apple_accessory_key;
char apple_accessory_version[16];
char apple_accessory_version[HFP_APPLE_ACCESSORY_VERSION_LEN];
// HF: AT Command, AG: Unsolicited Result Code
const char * send_custom_message;

View File

@ -909,8 +909,8 @@ static void hfp_ag_emit_general_simple_event(uint8_t event_subtype){
}
static void hfp_ag_emit_apple_accessory_information(hfp_connection_t *hfp_connection){
uint8_t event[40];
uint16_t version_len = strlen(hfp_connection->apple_accessory_version);
uint8_t event[11 + HFP_APPLE_ACCESSORY_VERSION_LEN];
uint8_t version_len = (uint8_t) strlen(hfp_connection->apple_accessory_version);
event[0] = HCI_EVENT_HFP_META;
event[1] = 9 + version_len;
event[2] = HFP_SUBEVENT_APPLE_ACCESSORY_INFORMATION;