Lines Matching refs:s_dev

749 static esp_ble_hidd_dev_t *s_dev = NULL;  variable
753 if (!s_dev) { in esp_hidd_gatts_event_handler()
763 s_dev->info_svc.gatt_if = gatts_if; in esp_hidd_gatts_event_handler()
765 s_dev->bat_svc.gatt_if = gatts_if; in esp_hidd_gatts_event_handler()
766 …_id >= ESP_GATT_UUID_HID_SVC && param->reg.app_id < (ESP_GATT_UUID_HID_SVC + s_dev->devices_len)) { in esp_hidd_gatts_event_handler()
768s_dev->devices[param->reg.app_id - ESP_GATT_UUID_HID_SVC].hid_svc.gatt_if = gatts_if; in esp_hidd_gatts_event_handler()
779 if (s_dev->bat_svc.gatt_if && gatts_if == s_dev->bat_svc.gatt_if) { in esp_hidd_gatts_event_handler()
780 bat_event_handler(s_dev, event, gatts_if, param); in esp_hidd_gatts_event_handler()
781 } else if (s_dev->info_svc.gatt_if && gatts_if == s_dev->info_svc.gatt_if) { in esp_hidd_gatts_event_handler()
782 info_event_handler(s_dev, event, gatts_if, param); in esp_hidd_gatts_event_handler()
784 int devi = get_device_map_index_by_gatts_if (s_dev, gatts_if); in esp_hidd_gatts_event_handler()
786 hid_event_handler(s_dev, devi, event, gatts_if, param); in esp_hidd_gatts_event_handler()
797 if (!s_dev) { in esp_ble_hidd_dev_deinit()
802 if (s_dev != dev) { in esp_ble_hidd_dev_deinit()
806 s_dev = NULL; in esp_ble_hidd_dev_deinit()
818 return (dev != NULL && s_dev == dev && dev->connected); in esp_ble_hidd_dev_connected()
825 if (!dev || s_dev != dev) { in esp_ble_hidd_dev_battery_set()
848 if (!dev || s_dev != dev) { in esp_ble_hidd_dev_input_set()
880 if (!dev || s_dev != dev) { in esp_ble_hidd_dev_feature_set()
920 if (!dev || s_dev != dev) { in esp_ble_hidd_dev_event_handler_register()
929 if (!dev || s_dev != dev) { in esp_ble_hidd_dev_event_handler_unregister()
937 if (s_dev) { in ble_hidd_dev_free()
938 ble_hid_free_config(s_dev); in ble_hidd_dev_free()
939 free(s_dev); in ble_hidd_dev_free()
940 s_dev = NULL; in ble_hidd_dev_free()
948 if (s_dev) { in esp_ble_hidd_dev_init()
953 s_dev = (esp_ble_hidd_dev_t *)calloc(1, sizeof(esp_ble_hidd_dev_t)); in esp_ble_hidd_dev_init()
954 if (s_dev == NULL) { in esp_ble_hidd_dev_init()
960 s_dev->bat_level = 100; in esp_ble_hidd_dev_init()
961 s_dev->bat_ccc.value = 0; in esp_ble_hidd_dev_init()
962 s_dev->control = ESP_HID_CONTROL_EXIT_SUSPEND; in esp_ble_hidd_dev_init()
963 s_dev->protocol = ESP_HID_PROTOCOL_MODE_REPORT; in esp_ble_hidd_dev_init()
964 s_dev->event_loop_handle = NULL; in esp_ble_hidd_dev_init()
965 s_dev->dev = dev_p; in esp_ble_hidd_dev_init()
966 s_dev->sem = xSemaphoreCreateBinary(); in esp_ble_hidd_dev_init()
967 if (s_dev->sem == NULL) { in esp_ble_hidd_dev_init()
981 ret = esp_event_loop_create(&event_task_args, &s_dev->event_loop_handle); in esp_ble_hidd_dev_init()
988 ret = ble_hid_init_config(s_dev, config); in esp_ble_hidd_dev_init()
994 dev_p->dev = s_dev; in esp_ble_hidd_dev_init()
1003 …ret = esp_ble_hidd_dev_event_handler_register(s_dev, esp_hidd_process_event_data_handler, ESP_EVEN… in esp_ble_hidd_dev_init()
1010 ret = esp_ble_hidd_dev_event_handler_register(s_dev, callback, ESP_EVENT_ANY_ID); in esp_ble_hidd_dev_init()
1017 ret = ble_hid_start_gatts(s_dev); in esp_ble_hidd_dev_init()