@@ -321,7 +321,7 @@ pub enum ScanDuplicate {
321321 #[ default]
322322 Disable = esp_ble_scan_duplicate_t_BLE_SCAN_DUPLICATE_DISABLE,
323323 Enable = esp_ble_scan_duplicate_t_BLE_SCAN_DUPLICATE_ENABLE,
324- #[ cfg( esp_idf_ble_50_feature_support ) ]
324+ #[ cfg( esp_idf_bt_ble_50_features_supported ) ]
325325 Reset = esp_ble_scan_duplicate_t_BLE_SCAN_DUPLICATE_ENABLE_RESET,
326326 Max = esp_ble_scan_duplicate_t_BLE_SCAN_DUPLICATE_MAX,
327327}
@@ -727,6 +727,164 @@ impl<'a> From<(esp_gap_ble_cb_event_t, &'a esp_ble_gap_cb_param_t)> for BleGapEv
727727 esp_gap_ble_cb_event_t_ESP_GAP_BLE_SET_CHANNELS_EVT => {
728728 Self :: ChannelsConfigured ( param. ble_set_channels . stat . try_into ( ) . unwrap ( ) )
729729 }
730+ // BLE 5.0 - PHY
731+ #[ cfg( esp_idf_bt_ble_50_features_supported) ]
732+ esp_gap_ble_cb_event_t_ESP_GAP_BLE_READ_PHY_COMPLETE_EVT => {
733+ Self :: ReadFeaturesConfigured ( param. read_phy )
734+ }
735+ // The `SET_PREFERED_*` events were renamed to `SET_PREFERRED_*` after ESP-IDF 4.4
736+ #[ cfg( all( esp_idf_bt_ble_50_features_supported, esp_idf_version_major = "4" ) ) ]
737+ esp_gap_ble_cb_event_t_ESP_GAP_BLE_SET_PREFERED_DEFAULT_PHY_COMPLETE_EVT => {
738+ Self :: PreferredDefaultPhyConfigured (
739+ param. set_perf_def_phy . status . try_into ( ) . unwrap ( ) ,
740+ )
741+ }
742+ #[ cfg( all( esp_idf_bt_ble_50_features_supported, not( esp_idf_version_major = "4" ) ) ) ]
743+ esp_gap_ble_cb_event_t_ESP_GAP_BLE_SET_PREFERRED_DEFAULT_PHY_COMPLETE_EVT => {
744+ Self :: PreferredDefaultPhyConfigured (
745+ param. set_perf_def_phy . status . try_into ( ) . unwrap ( ) ,
746+ )
747+ }
748+ #[ cfg( all( esp_idf_bt_ble_50_features_supported, esp_idf_version_major = "4" ) ) ]
749+ esp_gap_ble_cb_event_t_ESP_GAP_BLE_SET_PREFERED_PHY_COMPLETE_EVT => {
750+ Self :: PreferredPhyConfigured ( param. set_perf_phy . status . try_into ( ) . unwrap ( ) )
751+ }
752+ #[ cfg( all( esp_idf_bt_ble_50_features_supported, not( esp_idf_version_major = "4" ) ) ) ]
753+ esp_gap_ble_cb_event_t_ESP_GAP_BLE_SET_PREFERRED_PHY_COMPLETE_EVT => {
754+ Self :: PreferredPhyConfigured ( param. set_perf_phy . status . try_into ( ) . unwrap ( ) )
755+ }
756+ // BLE 5.0 - Extended advertising (needs the extended-advertising sub-feature, as the
757+ // corresponding fields of the callback param union are only present in that case)
758+ #[ cfg( all( esp_idf_bt_ble_50_features_supported, esp_idf_bt_ble_50_extend_adv_en) ) ]
759+ esp_gap_ble_cb_event_t_ESP_GAP_BLE_EXT_ADV_SET_RAND_ADDR_COMPLETE_EVT => {
760+ Self :: ExtendedAdvertisingRandomAddressConfigured (
761+ param. ext_adv_set_rand_addr . status . try_into ( ) . unwrap ( ) ,
762+ )
763+ }
764+ #[ cfg( all( esp_idf_bt_ble_50_features_supported, esp_idf_bt_ble_50_extend_adv_en) ) ]
765+ esp_gap_ble_cb_event_t_ESP_GAP_BLE_EXT_ADV_SET_PARAMS_COMPLETE_EVT => {
766+ Self :: ExtendedAdvertisingParametersConfigured (
767+ param. ext_adv_set_params . status . try_into ( ) . unwrap ( ) ,
768+ )
769+ }
770+ #[ cfg( all( esp_idf_bt_ble_50_features_supported, esp_idf_bt_ble_50_extend_adv_en) ) ]
771+ esp_gap_ble_cb_event_t_ESP_GAP_BLE_EXT_ADV_DATA_SET_COMPLETE_EVT => {
772+ Self :: ExtendedAdvertisingConfigured (
773+ param. ext_adv_data_set . status . try_into ( ) . unwrap ( ) ,
774+ )
775+ }
776+ #[ cfg( all( esp_idf_bt_ble_50_features_supported, esp_idf_bt_ble_50_extend_adv_en) ) ]
777+ esp_gap_ble_cb_event_t_ESP_GAP_BLE_EXT_SCAN_RSP_DATA_SET_COMPLETE_EVT => {
778+ Self :: ExtendedAdvertisingScanResponseConfigured (
779+ param. scan_rsp_set . status . try_into ( ) . unwrap ( ) ,
780+ )
781+ }
782+ #[ cfg( all( esp_idf_bt_ble_50_features_supported, esp_idf_bt_ble_50_extend_adv_en) ) ]
783+ esp_gap_ble_cb_event_t_ESP_GAP_BLE_EXT_ADV_START_COMPLETE_EVT => {
784+ Self :: ExtendedAdvertisingStarted ( param. ext_adv_start . status . try_into ( ) . unwrap ( ) )
785+ }
786+ #[ cfg( all( esp_idf_bt_ble_50_features_supported, esp_idf_bt_ble_50_extend_adv_en) ) ]
787+ esp_gap_ble_cb_event_t_ESP_GAP_BLE_EXT_ADV_STOP_COMPLETE_EVT => {
788+ Self :: ExtendedAdvertisingStopped ( param. ext_adv_stop . status . try_into ( ) . unwrap ( ) )
789+ }
790+ #[ cfg( all( esp_idf_bt_ble_50_features_supported, esp_idf_bt_ble_50_extend_adv_en) ) ]
791+ esp_gap_ble_cb_event_t_ESP_GAP_BLE_EXT_ADV_SET_REMOVE_COMPLETE_EVT => {
792+ Self :: ExtendedAdvertisingRemoved (
793+ param. ext_adv_remove . status . try_into ( ) . unwrap ( ) ,
794+ )
795+ }
796+ #[ cfg( all( esp_idf_bt_ble_50_features_supported, esp_idf_bt_ble_50_extend_adv_en) ) ]
797+ esp_gap_ble_cb_event_t_ESP_GAP_BLE_EXT_ADV_SET_CLEAR_COMPLETE_EVT => {
798+ Self :: ExtendedAdvertisingCleared ( param. ext_adv_clear . status . try_into ( ) . unwrap ( ) )
799+ }
800+ // BLE 5.0 - Periodic advertising
801+ #[ cfg( esp_idf_bt_ble_50_features_supported) ]
802+ esp_gap_ble_cb_event_t_ESP_GAP_BLE_PERIODIC_ADV_SET_PARAMS_COMPLETE_EVT => {
803+ // Note: the field name is misspelled as `peroid_adv_set_params` in ESP-IDF
804+ Self :: PeriodicAdvertisingParametersConfigured (
805+ param. peroid_adv_set_params . status . try_into ( ) . unwrap ( ) ,
806+ )
807+ }
808+ #[ cfg( esp_idf_bt_ble_50_features_supported) ]
809+ esp_gap_ble_cb_event_t_ESP_GAP_BLE_PERIODIC_ADV_DATA_SET_COMPLETE_EVT => {
810+ Self :: PeriodicAdvertisingDataSetComplete (
811+ param. period_adv_data_set . status . try_into ( ) . unwrap ( ) ,
812+ )
813+ }
814+ #[ cfg( esp_idf_bt_ble_50_features_supported) ]
815+ esp_gap_ble_cb_event_t_ESP_GAP_BLE_PERIODIC_ADV_START_COMPLETE_EVT => {
816+ Self :: PeriodicAdvertisingStarted (
817+ param. period_adv_start . status . try_into ( ) . unwrap ( ) ,
818+ )
819+ }
820+ #[ cfg( esp_idf_bt_ble_50_features_supported) ]
821+ esp_gap_ble_cb_event_t_ESP_GAP_BLE_PERIODIC_ADV_STOP_COMPLETE_EVT => {
822+ Self :: PeriodicAdvertisingStopped (
823+ param. period_adv_stop . status . try_into ( ) . unwrap ( ) ,
824+ )
825+ }
826+ #[ cfg( esp_idf_bt_ble_50_features_supported) ]
827+ esp_gap_ble_cb_event_t_ESP_GAP_BLE_PERIODIC_ADV_CREATE_SYNC_COMPLETE_EVT => {
828+ Self :: PeriodicAdvertisingSyncCreated (
829+ param. period_adv_create_sync . status . try_into ( ) . unwrap ( ) ,
830+ )
831+ }
832+ #[ cfg( esp_idf_bt_ble_50_features_supported) ]
833+ esp_gap_ble_cb_event_t_ESP_GAP_BLE_PERIODIC_ADV_SYNC_CANCEL_COMPLETE_EVT => {
834+ Self :: PeriodicAdvertisingSyncCanceled (
835+ param. period_adv_sync_cancel . status . try_into ( ) . unwrap ( ) ,
836+ )
837+ }
838+ #[ cfg( esp_idf_bt_ble_50_features_supported) ]
839+ esp_gap_ble_cb_event_t_ESP_GAP_BLE_PERIODIC_ADV_SYNC_TERMINATE_COMPLETE_EVT => {
840+ Self :: PeriodicAdvertisingSyncTerminated (
841+ param. period_adv_sync_term . status . try_into ( ) . unwrap ( ) ,
842+ )
843+ }
844+ #[ cfg( esp_idf_bt_ble_50_features_supported) ]
845+ esp_gap_ble_cb_event_t_ESP_GAP_BLE_PERIODIC_ADV_ADD_DEV_COMPLETE_EVT => {
846+ Self :: PeriodicAdvertisingDeviceListAdded (
847+ param. period_adv_add_dev . status . try_into ( ) . unwrap ( ) ,
848+ )
849+ }
850+ #[ cfg( esp_idf_bt_ble_50_features_supported) ]
851+ esp_gap_ble_cb_event_t_ESP_GAP_BLE_PERIODIC_ADV_REMOVE_DEV_COMPLETE_EVT => {
852+ Self :: PeriodicAdvertisingDeviceListRemoved (
853+ param. period_adv_remove_dev . status . try_into ( ) . unwrap ( ) ,
854+ )
855+ }
856+ #[ cfg( esp_idf_bt_ble_50_features_supported) ]
857+ esp_gap_ble_cb_event_t_ESP_GAP_BLE_PERIODIC_ADV_CLEAR_DEV_COMPLETE_EVT => {
858+ Self :: PeriodicAdvertisingDeviceListCleared (
859+ param. period_adv_clear_dev . status . try_into ( ) . unwrap ( ) ,
860+ )
861+ }
862+ // BLE 5.0 - Extended scanning
863+ #[ cfg( esp_idf_bt_ble_50_features_supported) ]
864+ esp_gap_ble_cb_event_t_ESP_GAP_BLE_SET_EXT_SCAN_PARAMS_COMPLETE_EVT => {
865+ Self :: ExtendedAdvertisingScanParametersConfigured (
866+ param. set_ext_scan_params . status . try_into ( ) . unwrap ( ) ,
867+ )
868+ }
869+ #[ cfg( esp_idf_bt_ble_50_features_supported) ]
870+ esp_gap_ble_cb_event_t_ESP_GAP_BLE_EXT_SCAN_START_COMPLETE_EVT => {
871+ Self :: ExtendedAdvertisingScanStarted (
872+ param. ext_scan_start . status . try_into ( ) . unwrap ( ) ,
873+ )
874+ }
875+ #[ cfg( esp_idf_bt_ble_50_features_supported) ]
876+ esp_gap_ble_cb_event_t_ESP_GAP_BLE_EXT_SCAN_STOP_COMPLETE_EVT => {
877+ Self :: ExtendedAdvertisingScanStopped (
878+ param. ext_scan_stop . status . try_into ( ) . unwrap ( ) ,
879+ )
880+ }
881+ // BLE 5.0 - Extended connection
882+ #[ cfg( esp_idf_bt_ble_50_features_supported) ]
883+ esp_gap_ble_cb_event_t_ESP_GAP_BLE_PREFER_EXT_CONN_PARAMS_SET_COMPLETE_EVT => {
884+ Self :: ExtendedAdvertisingExtendedConnectionParamsConfigured (
885+ param. ext_conn_params_set . status . try_into ( ) . unwrap ( ) ,
886+ )
887+ }
730888 _ => Self :: Other {
731889 raw_event : event,
732890 raw_data : EventRawData ( param) ,
0 commit comments