Skip to content

Commit d362e1e

Browse files
authored
[BLE] Allows you to specify which channels are used to advertise. (#4954)
In some use cases getting rssi signal from one channel is more stable (less variance) than rssi from the three advertising channels. This change allows you to specify which channels are used to advertise.
1 parent 33d9f4a commit d362e1e

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

libraries/BLE/src/BLEAdvertising.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,10 @@ void BLEAdvertising::setAdvertisementType(esp_ble_adv_type_t adv_type){
9191
m_advParams.adv_type = adv_type;
9292
} // setAdvertisementType
9393

94+
void BLEAdvertising::setAdvertisementChannelMap(esp_ble_adv_channel_t channel_map) {
95+
m_advParams.channel_map = channel_map;
96+
} // setAdvertisementChannelMap
97+
9498
void BLEAdvertising::setMinInterval(uint16_t mininterval) {
9599
m_advParams.adv_int_min = mininterval;
96100
} // setMinInterval

libraries/BLE/src/BLEAdvertising.h

+1
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ class BLEAdvertising {
5353
void stop();
5454
void setAppearance(uint16_t appearance);
5555
void setAdvertisementType(esp_ble_adv_type_t adv_type);
56+
void setAdvertisementChannelMap(esp_ble_adv_channel_t channel_map);
5657
void setMaxInterval(uint16_t maxinterval);
5758
void setMinInterval(uint16_t mininterval);
5859
void setAdvertisementData(BLEAdvertisementData& advertisementData);

0 commit comments

Comments
 (0)