Control Surface main
MIDI Control Surface library for Arduino
Loading...
Searching...
No Matches
esp_enums2string.c
Go to the documentation of this file.
1#ifdef ESP32
2#include <sdkconfig.h>
3#if CONFIG_BT_BLE_ENABLED
4
5#include "esp_enums2string.h"
6
7const char *esp_gatts_cb_event_to_string(esp_gatts_cb_event_t event) {
8 switch (event) {
9 case ESP_GATTS_REG_EVT: return "ESP_GATTS_REG_EVT";
10 case ESP_GATTS_READ_EVT: return "ESP_GATTS_READ_EVT";
11 case ESP_GATTS_WRITE_EVT: return "ESP_GATTS_WRITE_EVT";
12 case ESP_GATTS_EXEC_WRITE_EVT: return "ESP_GATTS_EXEC_WRITE_EVT";
13 case ESP_GATTS_MTU_EVT: return "ESP_GATTS_MTU_EVT";
14 case ESP_GATTS_CONF_EVT: return "ESP_GATTS_CONF_EVT";
15 case ESP_GATTS_UNREG_EVT: return "ESP_GATTS_UNREG_EVT";
16 case ESP_GATTS_CREATE_EVT: return "ESP_GATTS_CREATE_EVT";
17 case ESP_GATTS_ADD_INCL_SRVC_EVT: return "ESP_GATTS_ADD_INCL_SRVC_EVT";
18 case ESP_GATTS_ADD_CHAR_EVT: return "ESP_GATTS_ADD_CHAR_EVT";
19 case ESP_GATTS_ADD_CHAR_DESCR_EVT:
20 return "ESP_GATTS_ADD_CHAR_DESCR_EVT";
21 case ESP_GATTS_DELETE_EVT: return "ESP_GATTS_DELETE_EVT";
22 case ESP_GATTS_START_EVT: return "ESP_GATTS_START_EVT";
23 case ESP_GATTS_STOP_EVT: return "ESP_GATTS_STOP_EVT";
24 case ESP_GATTS_CONNECT_EVT: return "ESP_GATTS_CONNECT_EVT";
25 case ESP_GATTS_DISCONNECT_EVT: return "ESP_GATTS_DISCONNECT_EVT";
26 case ESP_GATTS_OPEN_EVT: return "ESP_GATTS_OPEN_EVT";
27 case ESP_GATTS_CANCEL_OPEN_EVT: return "ESP_GATTS_CANCEL_OPEN_EVT";
28 case ESP_GATTS_CLOSE_EVT: return "ESP_GATTS_CLOSE_EVT";
29 case ESP_GATTS_LISTEN_EVT: return "ESP_GATTS_LISTEN_EVT";
30 case ESP_GATTS_CONGEST_EVT: return "ESP_GATTS_CONGEST_EVT";
31 case ESP_GATTS_RESPONSE_EVT: return "ESP_GATTS_RESPONSE_EVT";
32 case ESP_GATTS_CREAT_ATTR_TAB_EVT:
33 return "ESP_GATTS_CREAT_ATTR_TAB_EVT";
34 case ESP_GATTS_SET_ATTR_VAL_EVT: return "ESP_GATTS_SET_ATTR_VAL_EVT";
35 case ESP_GATTS_SEND_SERVICE_CHANGE_EVT:
36 return "ESP_GATTS_SEND_SERVICE_CHANGE_EVT";
37
38 default: return "<invalid>";
39 }
40}
41
42const char *esp_ble_key_type_to_string(esp_ble_key_type_t key_type) {
43 switch (key_type) {
44 case ESP_LE_KEY_NONE: return "ESP_LE_KEY_NONE";
45 case ESP_LE_KEY_PENC: return "ESP_LE_KEY_PENC";
46 case ESP_LE_KEY_PID: return "ESP_LE_KEY_PID";
47 case ESP_LE_KEY_PCSRK: return "ESP_LE_KEY_PCSRK";
48 case ESP_LE_KEY_PLK: return "ESP_LE_KEY_PLK";
49 case ESP_LE_KEY_LLK: return "ESP_LE_KEY_LLK";
50 case ESP_LE_KEY_LENC: return "ESP_LE_KEY_LENC";
51 case ESP_LE_KEY_LID: return "ESP_LE_KEY_LID";
52 case ESP_LE_KEY_LCSRK: return "ESP_LE_KEY_LCSRK";
53 default: return "<invalid>";
54 }
55}
56
57const char *esp_ble_auth_req_to_string(esp_ble_auth_req_t auth_type) {
58 switch (auth_type) {
59 case ESP_LE_AUTH_NO_BOND: return "ESP_LE_AUTH_NO_BOND";
60 case ESP_LE_AUTH_BOND: return "ESP_LE_AUTH_BOND";
61 case ESP_LE_AUTH_REQ_MITM: return "ESP_LE_AUTH_REQ_MITM";
62 case ESP_LE_AUTH_REQ_SC_ONLY: return "ESP_LE_AUTH_REQ_SC_ONLY";
63 case ESP_LE_AUTH_REQ_SC_BOND: return "ESP_LE_AUTH_REQ_SC_BOND";
64 case ESP_LE_AUTH_REQ_SC_MITM: return "ESP_LE_AUTH_REQ_SC_MITM";
65 case ESP_LE_AUTH_REQ_SC_MITM_BOND:
66 return "ESP_LE_AUTH_REQ_SC_MITM_BOND";
67 default: return "<invalid>";
68 }
69}
70
71const char *esp_gap_ble_cb_event_to_string(esp_gap_ble_cb_event_t event) {
72 switch (event) {
73 case ESP_GAP_BLE_ADV_DATA_SET_COMPLETE_EVT:
74 return "ESP_GAP_BLE_ADV_DATA_SET_COMPLETE_EVT";
75 case ESP_GAP_BLE_SCAN_RSP_DATA_SET_COMPLETE_EVT:
76 return "ESP_GAP_BLE_SCAN_RSP_DATA_SET_COMPLETE_EVT";
77 case ESP_GAP_BLE_SCAN_PARAM_SET_COMPLETE_EVT:
78 return "ESP_GAP_BLE_SCAN_PARAM_SET_COMPLETE_EVT";
79 case ESP_GAP_BLE_SCAN_RESULT_EVT: return "ESP_GAP_BLE_SCAN_RESULT_EVT";
80 case ESP_GAP_BLE_ADV_DATA_RAW_SET_COMPLETE_EVT:
81 return "ESP_GAP_BLE_ADV_DATA_RAW_SET_COMPLETE_EVT";
82 case ESP_GAP_BLE_SCAN_RSP_DATA_RAW_SET_COMPLETE_EVT:
83 return "ESP_GAP_BLE_SCAN_RSP_DATA_RAW_SET_COMPLETE_EVT";
84 case ESP_GAP_BLE_ADV_START_COMPLETE_EVT:
85 return "ESP_GAP_BLE_ADV_START_COMPLETE_EVT";
86 case ESP_GAP_BLE_SCAN_START_COMPLETE_EVT:
87 return "ESP_GAP_BLE_SCAN_START_COMPLETE_EVT";
88 case ESP_GAP_BLE_AUTH_CMPL_EVT: return "ESP_GAP_BLE_AUTH_CMPL_EVT";
89 case ESP_GAP_BLE_KEY_EVT: return "ESP_GAP_BLE_KEY_EVT";
90 case ESP_GAP_BLE_SEC_REQ_EVT: return "ESP_GAP_BLE_SEC_REQ_EVT";
91 case ESP_GAP_BLE_PASSKEY_NOTIF_EVT:
92 return "ESP_GAP_BLE_PASSKEY_NOTIF_EVT";
93 case ESP_GAP_BLE_PASSKEY_REQ_EVT: return "ESP_GAP_BLE_PASSKEY_REQ_EVT";
94 case ESP_GAP_BLE_OOB_REQ_EVT: return "ESP_GAP_BLE_OOB_REQ_EVT";
95 case ESP_GAP_BLE_LOCAL_IR_EVT: return "ESP_GAP_BLE_LOCAL_IR_EVT";
96 case ESP_GAP_BLE_LOCAL_ER_EVT: return "ESP_GAP_BLE_LOCAL_ER_EVT";
97 case ESP_GAP_BLE_NC_REQ_EVT: return "ESP_GAP_BLE_NC_REQ_EVT";
98 case ESP_GAP_BLE_ADV_STOP_COMPLETE_EVT:
99 return "ESP_GAP_BLE_ADV_STOP_COMPLETE_EVT";
100 case ESP_GAP_BLE_SCAN_STOP_COMPLETE_EVT:
101 return "ESP_GAP_BLE_SCAN_STOP_COMPLETE_EVT";
102 case ESP_GAP_BLE_SET_STATIC_RAND_ADDR_EVT:
103 return "ESP_GAP_BLE_SET_STATIC_RAND_ADDR_EVT";
104 case ESP_GAP_BLE_UPDATE_CONN_PARAMS_EVT:
105 return "ESP_GAP_BLE_UPDATE_CONN_PARAMS_EVT";
106 case ESP_GAP_BLE_SET_PKT_LENGTH_COMPLETE_EVT:
107 return "ESP_GAP_BLE_SET_PKT_LENGTH_COMPLETE_EVT";
108 case ESP_GAP_BLE_SET_LOCAL_PRIVACY_COMPLETE_EVT:
109 return "ESP_GAP_BLE_SET_LOCAL_PRIVACY_COMPLETE_EVT";
110 case ESP_GAP_BLE_REMOVE_BOND_DEV_COMPLETE_EVT:
111 return "ESP_GAP_BLE_REMOVE_BOND_DEV_COMPLETE_EVT";
112 case ESP_GAP_BLE_CLEAR_BOND_DEV_COMPLETE_EVT:
113 return "ESP_GAP_BLE_CLEAR_BOND_DEV_COMPLETE_EVT";
114 case ESP_GAP_BLE_GET_BOND_DEV_COMPLETE_EVT:
115 return "ESP_GAP_BLE_GET_BOND_DEV_COMPLETE_EVT";
116 case ESP_GAP_BLE_READ_RSSI_COMPLETE_EVT:
117 return "ESP_GAP_BLE_READ_RSSI_COMPLETE_EVT";
118 case ESP_GAP_BLE_UPDATE_WHITELIST_COMPLETE_EVT:
119 return "ESP_GAP_BLE_UPDATE_WHITELIST_COMPLETE_EVT";
120 case ESP_GAP_BLE_UPDATE_DUPLICATE_EXCEPTIONAL_LIST_COMPLETE_EVT:
121 return "ESP_GAP_BLE_UPDATE_DUPLICATE_EXCEPTIONAL_LIST_COMPLETE_EVT";
122 case ESP_GAP_BLE_EVT_MAX: return "ESP_GAP_BLE_EVT_MAX";
123 default: return "<invalid>";
124 }
125}
126
127#endif
128#endif
Helpers for printing the names of enum values of the ESP32 Bluetooth API.
const char * esp_gatts_cb_event_to_string(esp_gatts_cb_event_t event)
const char * esp_ble_key_type_to_string(esp_ble_key_type_t key_type)
const char * esp_gap_ble_cb_event_to_string(esp_gap_ble_cb_event_t event)
const char * esp_ble_auth_req_to_string(esp_ble_auth_req_t auth_type)