fix(bt): Don't constrain local icon (appearance) values

This commit is contained in:
Nebojsa Cvetkovic 2024-06-29 23:57:09 +01:00
parent e7070e777a
commit 4ff95bc4f6

View File

@ -295,83 +295,17 @@ esp_err_t esp_ble_gap_config_local_privacy (bool privacy_enable)
esp_err_t esp_ble_gap_config_local_icon (uint16_t icon) esp_err_t esp_ble_gap_config_local_icon (uint16_t icon)
{ {
esp_err_t ret;
btc_msg_t msg = {0}; btc_msg_t msg = {0};
btc_ble_gap_args_t arg; btc_ble_gap_args_t arg;
ESP_BLUEDROID_STATUS_CHECK(ESP_BLUEDROID_STATUS_ENABLED); ESP_BLUEDROID_STATUS_CHECK(ESP_BLUEDROID_STATUS_ENABLED);
switch (icon) { msg.sig = BTC_SIG_API_CALL;
case ESP_BLE_APPEARANCE_GENERIC_PHONE: msg.pid = BTC_PID_GAP_BLE;
case ESP_BLE_APPEARANCE_GENERIC_COMPUTER: msg.act = BTC_GAP_BLE_ACT_CONFIG_LOCAL_ICON;
case ESP_BLE_APPEARANCE_GENERIC_REMOTE: arg.cfg_local_icon.icon = icon;
case ESP_BLE_APPEARANCE_GENERIC_THERMOMETER:
case ESP_BLE_APPEARANCE_THERMOMETER_EAR: return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gap_args_t), NULL, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
case ESP_BLE_APPEARANCE_GENERIC_HEART_RATE:
case ESP_BLE_APPEARANCE_HEART_RATE_BELT:
case ESP_BLE_APPEARANCE_GENERIC_BLOOD_PRESSURE:
case ESP_BLE_APPEARANCE_BLOOD_PRESSURE_ARM:
case ESP_BLE_APPEARANCE_BLOOD_PRESSURE_WRIST:
case ESP_BLE_APPEARANCE_GENERIC_PULSE_OXIMETER:
case ESP_BLE_APPEARANCE_PULSE_OXIMETER_FINGERTIP:
case ESP_BLE_APPEARANCE_PULSE_OXIMETER_WRIST:
case ESP_BLE_APPEARANCE_GENERIC_GLUCOSE:
case ESP_BLE_APPEARANCE_GENERIC_WEIGHT:
case ESP_BLE_APPEARANCE_GENERIC_WALKING:
case ESP_BLE_APPEARANCE_WALKING_IN_SHOE:
case ESP_BLE_APPEARANCE_WALKING_ON_SHOE:
case ESP_BLE_APPEARANCE_WALKING_ON_HIP:
case ESP_BLE_APPEARANCE_GENERIC_WATCH:
case ESP_BLE_APPEARANCE_SPORTS_WATCH:
case ESP_BLE_APPEARANCE_GENERIC_EYEGLASSES:
case ESP_BLE_APPEARANCE_GENERIC_DISPLAY:
case ESP_BLE_APPEARANCE_GENERIC_MEDIA_PLAYER:
case ESP_BLE_APPEARANCE_GENERIC_BARCODE_SCANNER:
case ESP_BLE_APPEARANCE_HID_BARCODE_SCANNER:
case ESP_BLE_APPEARANCE_GENERIC_HID:
case ESP_BLE_APPEARANCE_HID_KEYBOARD:
case ESP_BLE_APPEARANCE_HID_MOUSE:
case ESP_BLE_APPEARANCE_HID_JOYSTICK:
case ESP_BLE_APPEARANCE_HID_GAMEPAD:
case ESP_BLE_APPEARANCE_HID_DIGITIZER_TABLET:
case ESP_BLE_APPEARANCE_HID_CARD_READER:
case ESP_BLE_APPEARANCE_HID_DIGITAL_PEN:
case ESP_BLE_APPEARANCE_UNKNOWN:
case ESP_BLE_APPEARANCE_GENERIC_CLOCK:
case ESP_BLE_APPEARANCE_GENERIC_TAG:
case ESP_BLE_APPEARANCE_GENERIC_KEYRING:
case ESP_BLE_APPEARANCE_GENERIC_CYCLING:
case ESP_BLE_APPEARANCE_CYCLING_COMPUTER:
case ESP_BLE_APPEARANCE_CYCLING_SPEED:
case ESP_BLE_APPEARANCE_CYCLING_CADENCE:
case ESP_BLE_APPEARANCE_CYCLING_POWER:
case ESP_BLE_APPEARANCE_CYCLING_SPEED_CADENCE:
case ESP_BLE_APPEARANCE_GENERIC_PERSONAL_MOBILITY_DEVICE:
case ESP_BLE_APPEARANCE_POWERED_WHEELCHAIR:
case ESP_BLE_APPEARANCE_MOBILITY_SCOOTER:
case ESP_BLE_APPEARANCE_GENERIC_CONTINUOUS_GLUCOSE_MONITOR:
case ESP_BLE_APPEARANCE_GENERIC_INSULIN_PUMP:
case ESP_BLE_APPEARANCE_INSULIN_PUMP_DURABLE_PUMP:
case ESP_BLE_APPEARANCE_INSULIN_PUMP_PATCH_PUMP:
case ESP_BLE_APPEARANCE_INSULIN_PEN:
case ESP_BLE_APPEARANCE_GENERIC_MEDICATION_DELIVERY:
case ESP_BLE_APPEARANCE_GENERIC_OUTDOOR_SPORTS:
case ESP_BLE_APPEARANCE_OUTDOOR_SPORTS_LOCATION:
case ESP_BLE_APPEARANCE_OUTDOOR_SPORTS_LOCATION_AND_NAV:
case ESP_BLE_APPEARANCE_OUTDOOR_SPORTS_LOCATION_POD:
case ESP_BLE_APPEARANCE_OUTDOOR_SPORTS_LOCATION_POD_AND_NAV:
case ESP_BLE_APPEARANCE_STANDALONE_SPEAKER:
msg.sig = BTC_SIG_API_CALL;
msg.pid = BTC_PID_GAP_BLE;
msg.act = BTC_GAP_BLE_ACT_CONFIG_LOCAL_ICON;
arg.cfg_local_icon.icon = icon;
ret = (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gap_args_t), NULL, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
break;
default:
ret = ESP_ERR_INVALID_ARG;
break;
}
return ret;
} }
esp_err_t esp_ble_gap_update_whitelist(bool add_remove, esp_bd_addr_t remote_bda, esp_ble_wl_addr_type_t wl_addr_type) esp_err_t esp_ble_gap_update_whitelist(bool add_remove, esp_bd_addr_t remote_bda, esp_ble_wl_addr_type_t wl_addr_type)