Lines Matching refs:device_index
258 static esp_err_t create_hid_db(esp_ble_hidd_dev_t *dev, int device_index) in create_hid_db() argument
261 for (uint8_t i = 0; i < dev->devices[device_index].reports_len; i++) { in create_hid_db()
262 if (dev->devices[device_index].reports[i].report_type == ESP_HID_REPORT_TYPE_INPUT) { in create_hid_db()
267 if (dev->devices[device_index].reports[i].protocol_mode == ESP_HID_PROTOCOL_MODE_REPORT) { in create_hid_db()
291 …, HIDD_LE_REPORT_MAP_MAX_LEN, dev->devices[device_index].reports_map.len, (uint8_t *)dev->devices[… in create_hid_db()
296 for (uint8_t i = 0; i < dev->devices[device_index].reports_len; i++) { in create_hid_db()
297 hidd_le_report_item_t *report = &dev->devices[device_index].reports[i]; in create_hid_db()
335 …p_ble_gatts_create_attr_tab(_last_db, dev->devices[device_index].hid_svc.gatt_if, index, device_in… in create_hid_db()
445 static void hid_event_handler(esp_ble_hidd_dev_t *dev, int device_index, esp_gatts_cb_event_t event… in hid_event_handler() argument
449 ESP_LOGV(TAG, "HID REG[%d] App ID: 0x%x", device_index, param->reg.app_id); in hid_event_handler()
451 if (device_index == (dev->devices_len - 1)) { in hid_event_handler()
458 dev->devices[device_index].hid_svc.handle = param->add_attr_tab.handles[HIDD_LE_IDX_SVC]; in hid_event_handler()
459 …dev->devices[device_index].hid_control_handle = param->add_attr_tab.handles[HIDD_LE_IDX_HID_CTNL_P… in hid_event_handler()
460 …dev->devices[device_index].hid_protocol_handle = param->add_attr_tab.handles[HIDD_LE_IDX_PROTO_MOD… in hid_event_handler()
461 …_LOGV(TAG, "HID CREAT_ATTR_TAB[%u] service handle = %d", device_index, dev->devices[device_index].… in hid_event_handler()
463 link_report_handles(&dev->devices[device_index], param->add_attr_tab.handles); in hid_event_handler()
464 esp_ble_gatts_start_service(dev->devices[device_index].hid_svc.handle); in hid_event_handler()
465 if ((device_index + 1) < dev->devices_len) { in hid_event_handler()
466 create_hid_db(dev, device_index + 1);//add next device in hid_event_handler()
471 ESP_LOGD(TAG, "HID START[%d] status: 0x%02x", device_index, param->start.status); in hid_event_handler()
472 if (device_index == (dev->devices_len - 1)) { in hid_event_handler()
478 ESP_LOGD(TAG, "HID CONNECT[%d] conn_id = %x", device_index, param->connect.conn_id); in hid_event_handler()
479 if (!dev->connected && device_index == (dev->devices_len - 1)) { in hid_event_handler()
494 ESP_LOGD(TAG, "HID DISCONNECT[%d] 0x%x", device_index, param->disconnect.reason); in hid_event_handler()
507 …ESP_LOGV(TAG, "HID READ[%d] %8s %7s %6s id: %d, need_resp: %d", device_index, esp_hid_usage_str(ma… in hid_event_handler()
513 if (param->write.handle == dev->devices[device_index].hid_control_handle) { in hid_event_handler()
519 cb_param.control.map_index = device_index; in hid_event_handler()
521 } else if (param->write.handle == dev->devices[device_index].hid_protocol_handle) { in hid_event_handler()
527 cb_param.protocol_mode.map_index = device_index; in hid_event_handler()
534 …LOGV(TAG, "HID CCC[%d] %8s %7s %6s id: %d, Notify: %s, Indicate: %s", device_index, esp_hid_usage_… in hid_event_handler()
560 p_cb_param->output.map_index = device_index; in hid_event_handler()
568 p_cb_param->feature.map_index = device_index; in hid_event_handler()
585 …ESP_LOGV(TAG, "HID SET[%d] %8s %7s %6s id: %d, status: 0x%02x", device_index, esp_hid_usage_str(ma… in hid_event_handler()
591 …ESP_LOGV(TAG, "HID CONF[%d] status: 0x%02x, len: %d", device_index, param->conf.status, param->con… in hid_event_handler()
596 ESP_LOGV(TAG, "HID[%d] MTU = %d", device_index, param->mtu.mtu); in hid_event_handler()
600 ESP_LOGV(TAG, "HID[%d] %s", device_index, gatts_evt_str(event)); in hid_event_handler()