forward control signal ind from rfcomm to spp

allow SPP to receive/handle signal changed for DTR, RTS, RI, DCD
forward PORT_PortNegInd() to allow changing baudrate, parity, stop bit
also need to add PORT_GetPeerState()
change the control_ind event struct
increase SDP_MAX_PAD_LEN to 500 for large hid descriptor
fix hid descriptor len is larger than 256 causing incorrect SDP record in stack
add support for SDP device information profile (vendor/product/version) for bluetooth classic
fix protocol mode and vendor report
This commit is contained in:
hathach 2022-08-01 20:48:24 +07:00
parent af9038aa06
commit df57568cbe
No known key found for this signature in database
GPG key ID: 26FAB84F615C3C52
18 changed files with 236 additions and 8 deletions

View file

@ -105,6 +105,11 @@ typedef struct {
uint8_t subclass; /*!< HID device subclass */
uint8_t *desc_list; /*!< HID descriptor list */
int desc_list_len; /*!< size in bytes of HID descriptor list */
// Adafruit modification by hathach
uint16_t vendor_id;
uint16_t product_id;
uint16_t version;
} esp_hidd_app_param_t;
/**

View file

@ -79,6 +79,10 @@ typedef enum {
ESP_SPP_SRV_STOP_EVT = 35, /*!< When SPP server stopped, the event comes */
ESP_SPP_VFS_REGISTER_EVT = 36, /*!< When SPP VFS register, the event comes */
ESP_SPP_VFS_UNREGISTER_EVT = 37, /*!< When SPP VFS unregister, the event comes */
// Adafruit EZ-Link
ESP_SPP_CONTROL_IND_EVT = 100,
ESP_SPP_PORTNEG_IND_EVT = 101,
} esp_spp_cb_event_t;
@ -211,6 +215,21 @@ typedef union {
struct spp_vfs_unregister_evt_param {
esp_spp_status_t status; /*!< status */
} vfs_unregister; /*!< SPP callback param of ESP_SPP_VFS_UNREGISTER_EVT */
/* hathach */
struct spp_control_ind_evt_param {
esp_spp_status_t status; /*!< status */
uint32_t handle; /*!< The connection handle */
uint8_t modem_signal_change;
uint8_t modem_signal;
} control_ind;
struct spp_portneg_ind_evt_param {
esp_spp_status_t status; /*!< status */
uint32_t handle; /*!< The connection handle */
uint8_t port_state[9]; // following tPORT_STATE layout
} portneg_ind;
} esp_spp_cb_param_t; /*!< SPP callback parameter union type */
/**

View file

@ -175,6 +175,19 @@ void bta_hd_register_act(tBTA_HD_DATA *p_data)
p_app_data->subclass, p_app_data->d_len, p_app_data->d_data);
bta_sys_add_uuid(UUID_SERVCLASS_HUMAN_INTERFACE);
tBTA_DI_RECORD di_record =
{
.vendor = p_app_data->vendor_id,
.vendor_id_source = 0x0002, // assigned by USB-IF
.product = p_app_data->product_id,
.version = p_app_data->version,
.primary_record = TRUE
};
UINT32 temp32;
BTA_DmSetLocalDiRecord(&di_record, &temp32);
HID_DevSetIncomingQos(p_app_data->in_qos.service_type, p_app_data->in_qos.token_rate,
p_app_data->in_qos.token_bucket_size, p_app_data->in_qos.peak_bandwidth,
p_app_data->in_qos.access_latency, p_app_data->in_qos.delay_variation);

View file

@ -114,9 +114,16 @@ extern void BTA_HdRegisterApp(tBTA_HD_APP_INFO *p_app_info, tBTA_HD_QOS_INFO *p_
p_buf->subclass = p_app_info->subclass;
p_buf->d_len = p_app_info->descriptor.dl_len;
memcpy(p_buf->d_data, p_app_info->descriptor.dsc_list, p_app_info->descriptor.dl_len);
// Adafruit modification by hathach
p_buf->vendor_id = p_app_info->vendor_id;
p_buf->product_id = p_app_info->product_id;
p_buf->version = p_app_info->version;
// copy qos data as-is
memcpy(&p_buf->in_qos, p_in_qos, sizeof(tBTA_HD_QOS_INFO));
memcpy(&p_buf->out_qos, p_out_qos, sizeof(tBTA_HD_QOS_INFO));
bta_sys_sendmsg(p_buf);
}
}

View file

@ -77,6 +77,11 @@ typedef struct {
uint8_t d_data[BTA_HD_APP_DESCRIPTOR_LEN];
tBTA_HD_QOS_INFO in_qos;
tBTA_HD_QOS_INFO out_qos;
// Adafruit modification by hathach
uint16_t vendor_id;
uint16_t product_id;
uint16_t version;
} tBTA_HD_REGISTER_APP;
#define BTA_HD_REPORT_LEN HID_DEV_MTU_SIZE

View file

@ -70,6 +70,11 @@ typedef struct {
char *p_provider;
uint8_t subclass;
tBTA_HD_DEV_DESCR descriptor;
// Adafruit modification by hathach
uint16_t vendor_id;
uint16_t product_id;
uint16_t version;
} tBTA_HD_APP_INFO;
typedef struct {

View file

@ -160,7 +160,10 @@ typedef UINT8 tBTA_JV_CONN_STATE;
#define BTA_JV_RFCOMM_WRITE_EVT 33 /* the result for BTA_JvRfcommWrite*/
#define BTA_JV_RFCOMM_SRV_OPEN_EVT 34 /* open status of Server RFCOMM connection */
#define BTA_JV_FREE_SCN_EVT 35 /* FREE an SCN */
#define BTA_JV_MAX_EVT 36 /* max number of JV events */
#define BTA_JV_RFCOMM_CONTROL_IND_EVT 36 /* hathach: RFCOMM ControlInd: DTR, RTS, RI, DCD */
#define BTA_JV_RFCOMM_PORTNEG_IND_EVT 37 /* hathach: RFCOMM PortNegInd: baudrate, stop, parity */
#define BTA_JV_MAX_EVT 38 /* max number of JV events */
typedef UINT16 tBTA_JV_EVT;
@ -332,6 +335,21 @@ typedef struct {
BOOLEAN cong; /* TRUE, congested. FALSE, uncongested */
} tBTA_JV_RFCOMM_CONG;
/* hathach */
typedef struct {
tBTA_JV_STATUS status;
UINT32 handle;
UINT8 modem_signal_change;
UINT8 modem_signal;
} tBTA_JV_RFCOMM_CONTROL_IND;
/* hathach */
typedef struct {
tBTA_JV_STATUS status;
UINT32 handle;
UINT8 port_state[9]; // following tPORT_STATE layout
} tBTA_JV_RFCOMM_PORTNEG_IND;
/* data associated with BTA_JV_RFCOMM_READ_EVT */
typedef struct {
tBTA_JV_STATUS status; /* Whether the operation succeeded or failed. */
@ -412,6 +430,9 @@ typedef union {
tBTA_JV_RFCOMM_WRITE rfc_write; /* BTA_JV_RFCOMM_WRITE_EVT */
tBTA_JV_DATA_IND data_ind; /* BTA_JV_L2CAP_DATA_IND_EVT
BTA_JV_RFCOMM_DATA_IND_EVT */
tBTA_JV_RFCOMM_CONTROL_IND rfc_control_ind; /* hathach BTA_JV_RFCOMM_CONTROL_IND_EVT */
tBTA_JV_RFCOMM_PORTNEG_IND rfc_portneg_ind; /* hathach BTA_JV_RFCOMM_PORTNEG_IND_EVT */
tBTA_JV_FREE_SCN free_scn; /* BTA_JV_FREE_SCN_EVT */
#if BTA_JV_L2CAP_INCLUDED
tBTA_JV_L2CAP_LE_OPEN l2c_le_open; /* BTA_JV_L2CAP_OPEN_EVT */

View file

@ -2067,6 +2067,43 @@ static void bta_jv_port_event_sr_cback(UINT32 code, UINT16 port_handle)
p_cb->p_cback(BTA_JV_RFCOMM_CONG_EVT, &evt_data, user_data);
}
if (code & (PORT_EV_DSR | PORT_EV_CTS | PORT_EV_RING | PORT_EV_RLSD | PORT_EV_BREAK)) {
evt_data.rfc_control_ind.status = BTA_JV_SUCCESS;
evt_data.rfc_control_ind.handle = p_pcb->handle;
UINT8 changed_signals = 0;
if ( code & PORT_EV_DSR ) changed_signals |= PORT_DTRDSR_ON;
if ( code & PORT_EV_CTS ) changed_signals |= PORT_CTSRTS_ON;
if ( code & PORT_EV_RING ) changed_signals |= PORT_RING_ON;
if ( code & PORT_EV_RLSD ) changed_signals |= PORT_DCD_ON;
evt_data.rfc_control_ind.modem_signal_change = changed_signals;
PORT_GetModemStatus(port_handle, &evt_data.rfc_control_ind.modem_signal);
p_cb->p_cback(BTA_JV_RFCOMM_CONTROL_IND_EVT, &evt_data, user_data);
}
if (code & PORT_EV_PORTNEG) {
tPORT_STATE port_state;
PORT_GetPeerState(port_handle, &port_state);
evt_data.rfc_portneg_ind.status = BTA_JV_SUCCESS;
evt_data.rfc_portneg_ind.handle = p_pcb->handle;
evt_data.rfc_portneg_ind.port_state[0] = port_state.baud_rate;
evt_data.rfc_portneg_ind.port_state[1] = port_state.byte_size;
evt_data.rfc_portneg_ind.port_state[2] = port_state.stop_bits;
evt_data.rfc_portneg_ind.port_state[3] = port_state.parity;
evt_data.rfc_portneg_ind.port_state[4] = port_state.parity_type;
evt_data.rfc_portneg_ind.port_state[5] = port_state.fc_type;
evt_data.rfc_portneg_ind.port_state[6] = port_state.rx_char1;
evt_data.rfc_portneg_ind.port_state[7] = port_state.xon_char;
evt_data.rfc_portneg_ind.port_state[8] = port_state.xoff_char;
p_cb->p_cback(BTA_JV_RFCOMM_PORTNEG_IND_EVT, &evt_data, user_data);
}
if (code & PORT_EV_TXEMPTY) {
bta_jv_pm_conn_idle(p_pcb->p_pm_cb);
}

View file

@ -76,7 +76,8 @@ enum {
};
#ifndef BTA_JV_RFC_EV_MASK
#define BTA_JV_RFC_EV_MASK (PORT_EV_RXCHAR | PORT_EV_TXEMPTY | PORT_EV_FC | PORT_EV_FCS)
#define BTA_JV_RFC_EV_MASK (PORT_EV_RXCHAR | PORT_EV_TXEMPTY | PORT_EV_FC | PORT_EV_FCS | \
PORT_EV_DSR | PORT_EV_CTS | PORT_EV_RING | PORT_EV_RLSD /* hathach */ )
#endif
/* data type for BTA_JV_API_ENABLE_EVT */

View file

@ -328,6 +328,11 @@ static void btc_hd_register_app(esp_hidd_app_param_t *p_app_param, esp_hidd_qos_
btc_hd_cb.app_info.subclass = p_app_param->subclass;
btc_hd_cb.app_info.descriptor.dl_len = p_app_param->desc_list_len;
// Adafruit modification by hathach
btc_hd_cb.app_info.vendor_id = p_app_param->vendor_id;
btc_hd_cb.app_info.product_id = p_app_param->product_id;
btc_hd_cb.app_info.version = p_app_param->version;
btc_hd_cb.in_qos.service_type = p_in_qos->service_type;
btc_hd_cb.in_qos.token_rate = p_in_qos->token_rate;
btc_hd_cb.in_qos.token_bucket_size = p_in_qos->token_bucket_size;

View file

@ -1290,6 +1290,27 @@ void btc_spp_cb_handler(btc_msg_t *msg)
#endif
btc_spp_cb_to_app(ESP_SPP_UNINIT_EVT, &param);
break;
case BTA_JV_RFCOMM_CONTROL_IND_EVT:
if (spp_local_param.spp_mode == ESP_SPP_MODE_CB) {
param.control_ind.status = p_data->rfc_control_ind.status;
param.control_ind.handle = p_data->rfc_control_ind.handle;
param.control_ind.modem_signal_change = p_data->rfc_control_ind.modem_signal_change;
param.control_ind.modem_signal = p_data->rfc_control_ind.modem_signal;
btc_spp_cb_to_app(ESP_SPP_CONTROL_IND_EVT, &param);
}
break;
case BTA_JV_RFCOMM_PORTNEG_IND_EVT:
if (spp_local_param.spp_mode == ESP_SPP_MODE_CB) {
param.portneg_ind.status = p_data->rfc_portneg_ind.status;
param.portneg_ind.handle = p_data->rfc_portneg_ind.handle;
memcpy(param.portneg_ind.port_state, p_data->rfc_portneg_ind.port_state, sizeof(param.portneg_ind.port_state));
btc_spp_cb_to_app(ESP_SPP_PORTNEG_IND_EVT, &param);
}
break;
default:
BTC_TRACE_DEBUG("%s: Unhandled event (%d)!", __FUNCTION__, msg->act);
break;

View file

@ -550,6 +550,7 @@
#endif
#ifndef BT_TRACE_VERBOSE
// #define BT_TRACE_VERBOSE TRUE
#define BT_TRACE_VERBOSE FALSE
#endif
@ -1476,7 +1477,7 @@
#endif
#ifndef SDP_MAX_PAD_LEN
#define SDP_MAX_PAD_LEN 300
#define SDP_MAX_PAD_LEN 500
#endif
/* The maximum length, in bytes, of an attribute. */

View file

@ -218,6 +218,8 @@ tHID_STATUS HID_DevAddRecord(uint32_t handle, char *p_name, char *p_description,
bool result = TRUE;
HIDD_TRACE_API("%s", __func__);
HIDD_TRACE_API("desc_len = %d, p_desc_data = %02x %02X %02X %02X", desc_len, p_desc_data[0], p_desc_data[1], p_desc_data[2], p_desc_data[3]);
HIDD_TRACE_API("subclass = 0x%02X, name = %s, description = %s, provider = %s", subclass, p_name, p_description, p_provider);
// Service Class ID List
if (result) {
@ -294,20 +296,39 @@ tHID_STATUS HID_DevAddRecord(uint32_t handle, char *p_name, char *p_description,
{
static uint8_t cdt = 0x22;
uint8_t *p_buf;
uint8_t seq_len = 4 + desc_len;
uint16_t seq_len = 4 + desc_len + (desc_len > 255 ? 1 : 0);
p_buf = (uint8_t *)osi_malloc(2048);
if (p_buf == NULL) {
HIDD_TRACE_ERROR("%s: Buffer allocation failure for size = 2048 ", __func__);
return HID_ERR_NOT_REGISTERED;
}
p = p_buf;
UINT8_TO_BE_STREAM(p, (DATA_ELE_SEQ_DESC_TYPE << 3) | SIZE_IN_NEXT_BYTE);
UINT8_TO_BE_STREAM(p, seq_len);
if (seq_len <= 255)
{
UINT8_TO_BE_STREAM(p, (DATA_ELE_SEQ_DESC_TYPE << 3) | SIZE_IN_NEXT_BYTE);
UINT8_TO_BE_STREAM(p, seq_len);
}else
{
UINT8_TO_BE_STREAM(p, (DATA_ELE_SEQ_DESC_TYPE << 3) | SIZE_IN_NEXT_WORD);
UINT16_TO_BE_STREAM(p, seq_len);
}
UINT8_TO_BE_STREAM(p, (UINT_DESC_TYPE << 3) | SIZE_ONE_BYTE);
UINT8_TO_BE_STREAM(p, cdt);
UINT8_TO_BE_STREAM(p, (TEXT_STR_DESC_TYPE << 3) | SIZE_IN_NEXT_BYTE);
UINT8_TO_BE_STREAM(p, desc_len);
if (desc_len <= 255)
{
UINT8_TO_BE_STREAM(p, (TEXT_STR_DESC_TYPE << 3) | SIZE_IN_NEXT_BYTE);
UINT8_TO_BE_STREAM(p, desc_len);
}else
{
UINT8_TO_BE_STREAM(p, (TEXT_STR_DESC_TYPE << 3) | SIZE_IN_NEXT_WORD);
UINT16_TO_BE_STREAM(p, desc_len);
}
ARRAY_TO_BE_STREAM(p, p_desc_data, (int)desc_len);
result &= SDP_AddAttribute(handle, ATTR_ID_HID_DESCRIPTOR_LIST, DATA_ELE_SEQ_DESC_TYPE, p - p_buf, p_buf);
osi_free(p_buf);
}

View file

@ -140,6 +140,8 @@ typedef struct {
#define PORT_EV_FC 0x00010000 /* data flow enabled flag changed by remote */
#define PORT_EV_FCS 0x00020000 /* data flow enable status true = enabled */
#define PORT_EV_PORTNEG 0x01000000 /* hathach PORT_PortNegInd */
/*
** To register for events application should provide bitmask with
** corresponding bit set
@ -381,6 +383,9 @@ extern int PORT_GetRxQueueCnt (UINT16 handle, UINT16 *p_rx_queue_count);
*******************************************************************************/
extern int PORT_GetState (UINT16 handle, tPORT_STATE *p_settings);
// hathach
extern int PORT_GetPeerState (UINT16 handle, tPORT_STATE *p_settings);
/*******************************************************************************
**

View file

@ -674,6 +674,31 @@ int PORT_GetState (UINT16 handle, tPORT_STATE *p_settings)
}
int PORT_GetPeerState (UINT16 handle, tPORT_STATE *p_settings)
{
tPORT *p_port;
RFCOMM_TRACE_API ("PORT_GetPeerState() handle:%d", handle);
/* Check if handle is valid to avoid crashing */
if ((handle == 0) || (handle > MAX_RFC_PORTS)) {
return (PORT_BAD_HANDLE);
}
p_port = &rfc_cb.port.port[handle - 1];
if (!p_port->in_use || (p_port->state == PORT_STATE_CLOSED)) {
return (PORT_NOT_OPENED);
}
if (p_port->line_status) {
return (PORT_LINE_ERR);
}
*p_settings = p_port->peer_port_pars;
return (PORT_SUCCESS);
}
/*******************************************************************************
**
** Function PORT_Control

View file

@ -554,6 +554,8 @@ void PORT_PortNegInd (tRFC_MCB *p_mcb, UINT8 dlci, tPORT_STATE *p_pars,
tPORT *p_port = port_find_mcb_dlci_port (p_mcb, dlci);
RFCOMM_TRACE_EVENT ("PORT_PortNegInd");
RFCOMM_TRACE_EVENT ("baudrate = %u, byte = %u, stop = %u, parity = %u, parity_type = %u, fc_type = %u",
p_pars->baud_rate, p_pars->byte_size, p_pars->stop_bits, p_pars->parity, p_pars->parity_type, p_pars->fc_type);
if (!p_port) {
/* This can be a first request for this port */
@ -568,6 +570,10 @@ void PORT_PortNegInd (tRFC_MCB *p_mcb, UINT8 dlci, tPORT_STATE *p_pars,
/* Check if the flow control is acceptable on local side */
p_port->peer_port_pars = *p_pars;
RFCOMM_PortNegRsp (p_mcb, dlci, p_pars, param_mask);
if (p_port->p_callback) {
(p_port->p_callback)(PORT_EV_PORTNEG, p_port->inx);
}
}

View file

@ -416,6 +416,7 @@ BOOLEAN SDP_AddAttribute (UINT32 handle, UINT16 attr_id, UINT8 attr_type,
(attr_type == UUID_DESC_TYPE) ||
(attr_type == DATA_ELE_SEQ_DESC_TYPE) ||
(attr_type == DATA_ELE_ALT_DESC_TYPE)) {
#if 0
UINT8 num_array[400];
UINT32 i;
UINT32 len = (attr_len > 200) ? 200 : attr_len;
@ -426,6 +427,16 @@ BOOLEAN SDP_AddAttribute (UINT32 handle, UINT16 attr_id, UINT8 attr_type,
}
SDP_TRACE_DEBUG("SDP_AddAttribute: handle:%X, id:%04X, type:%d, len:%d, p_val:%p, *p_val:%s\n",
handle, attr_id, attr_type, attr_len, p_val, num_array);
#else
SDP_TRACE_DEBUG("SDP_AddAttribute: handle:%X, id:%04X, type:%d, len:%d, p_val:%p, *p_val:",
handle, attr_id, attr_type, attr_len, p_val);
for(int i=0; i<attr_len; i++)
{
if (i && i%16==0) printf("\n");
printf("%02X ", p_val[i]);
}
printf("\n");
#endif
} else if (attr_type == BOOLEAN_DESC_TYPE) {
SDP_TRACE_DEBUG("SDP_AddAttribute: handle:%X, id:%04X, type:%d, len:%d, p_val:%p, *p_val:%d\n",
handle, attr_id, attr_type, attr_len, p_val, *p_val);

View file

@ -136,6 +136,8 @@ static esp_err_t bt_hidd_init_config(esp_bt_hidd_dev_t *dev, const esp_hid_devic
free(rmap);
return ESP_ERR_NO_MEM;
}
// ESP_LOGE(TAG, "rmap->reports_len = %u", rmap->reports_len);
for (uint8_t r = 0; r < rmap->reports_len; r++) {
dev->devices[d].reports[r].map_index = d;
dev->devices[d].reports[r].report_id = rmap->reports[r].report_id;
@ -143,6 +145,10 @@ static esp_err_t bt_hidd_init_config(esp_bt_hidd_dev_t *dev, const esp_hid_devic
dev->devices[d].reports[r].report_type = rmap->reports[r].report_type;
dev->devices[d].reports[r].usage = rmap->reports[r].usage;
dev->devices[d].reports[r].value_len = rmap->reports[r].value_len;
// hidd_report_item_t* item = &dev->devices[d].reports[r];
// ESP_LOGE(TAG, "reports[%u]: id = %u, protocol_mode = %u, type = %u, usage = %u, value_len = %u",
// r, item->report_id, item->protocol_mode, item->report_type, item->usage, item->value_len);
}
free(rmap->reports);
free(rmap);
@ -291,6 +297,9 @@ static void bt_hidd_init_app(void)
s_hidd_param.app_param.subclass = get_subclass_by_appearance(s_hidd_param.dev->appearance);
s_hidd_param.app_param.desc_list = (uint8_t *)s_hidd_param.dev->devices[0].reports_map.data;
s_hidd_param.app_param.desc_list_len = s_hidd_param.dev->devices[0].reports_map.len;
s_hidd_param.app_param.vendor_id = p_config->vendor_id;
s_hidd_param.app_param.product_id = p_config->product_id;
s_hidd_param.app_param.version = p_config->version;
}
static void bt_hidd_init_qos(void)
@ -607,6 +616,7 @@ void bt_hidd_cb(esp_hidd_cb_event_t event, esp_hidd_cb_param_t *param)
param->open.bd_addr[2], param->open.bd_addr[3], param->open.bd_addr[4], param->open.bd_addr[5]);
osi_mutex_lock(&s_hidd_param.mutex, OSI_MUTEX_MAX_TIMEOUT);
s_hidd_param.dev->connected = true;
s_hidd_param.dev->protocol_mode = 0x01; // hathach: default to report each connection
memcpy(s_hidd_param.dev->remote_bda, param->open.bd_addr, ESP_BD_ADDR_LEN);
osi_mutex_unlock(&s_hidd_param.mutex);
} else {
@ -647,6 +657,7 @@ void bt_hidd_cb(esp_hidd_cb_event_t event, esp_hidd_cb_param_t *param)
&map_index);
if (p_rpt == NULL) {
ESP_LOGE(TAG, "Can not find report!");
ESP_LOGE(TAG, "ESP_HIDD_GET_REPORT_EVT: report id = %u, type = %u", param->get_report.report_id, param->get_report.report_type);
esp_bt_hid_device_report_error(ESP_HID_PAR_HANDSHAKE_RSP_ERR_INVALID_REP_ID);
break;
}
@ -688,6 +699,7 @@ void bt_hidd_cb(esp_hidd_cb_event_t event, esp_hidd_cb_param_t *param)
&map_index);
if (p_rpt == NULL) {
ESP_LOGE(TAG, "Can not find report!");
ESP_LOGE(TAG, "ESP_HIDD_SET_REPORT_EVT report id = %u, type = %u", param->set_report.report_id, param->set_report.report_type);
esp_bt_hid_device_report_error(ESP_HID_PAR_HANDSHAKE_RSP_ERR_INVALID_REP_ID);
break;
}
@ -724,6 +736,7 @@ void bt_hidd_cb(esp_hidd_cb_event_t event, esp_hidd_cb_param_t *param)
break;
}
case ESP_HIDD_SET_PROTOCOL_EVT: {
ESP_LOGE(TAG, "Set protocol mode = %s", param->set_protocol.protocol_mode ? "REPORT" : "BOOT");
if (param->set_protocol.protocol_mode != ESP_HIDD_UNSUPPORTED_MODE) {
if (s_hidd_param.dev->protocol_mode == param->set_protocol.protocol_mode) {
break;
@ -747,6 +760,13 @@ void bt_hidd_cb(esp_hidd_cb_event_t event, esp_hidd_cb_param_t *param)
&map_index);
if (p_rpt == NULL) {
ESP_LOGE(TAG, "Can not find report!");
ESP_LOGE(TAG, "ESP_HIDD_INTR_DATA_EVT report id = %u, report = %u, protocol = %u",
param->intr_data.report_id, ESP_HID_REPORT_TYPE_OUTPUT, s_hidd_param.dev->protocol_mode);
/* for(uint32_t i=0; i<param->intr_data.len; i++)
{
printf("%02X ", param->intr_data.data[i]);
}
printf("\n"); */
break;
}