Defined BLE setAdvertisementType (#3535)
Currently we have no way to set BLE Advertisement Type.
We have an initial value of ADV_TYPE_IND and the member is private.
iBeacon should advertise with ADV_TYPE_NONCONN_IND.
esp-idf's example code specifies this value.
93a8603c54/examples/bluetooth/bluedroid/ble/ble_ibeacon/main/ibeacon_demo.c (L57)
This commit is contained in:
parent
c2b37d95e0
commit
915d45de7d
@ -65,6 +65,7 @@ void setBeacon() {
|
|||||||
|
|
||||||
pAdvertising->setAdvertisementData(oAdvertisementData);
|
pAdvertising->setAdvertisementData(oAdvertisementData);
|
||||||
pAdvertising->setScanResponseData(oScanResponseData);
|
pAdvertising->setScanResponseData(oScanResponseData);
|
||||||
|
pAdvertising->setAdvertisementType(ADV_TYPE_NONCONN_IND);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -85,6 +85,10 @@ void BLEAdvertising::setAppearance(uint16_t appearance) {
|
|||||||
m_advData.appearance = appearance;
|
m_advData.appearance = appearance;
|
||||||
} // setAppearance
|
} // setAppearance
|
||||||
|
|
||||||
|
void BLEAdvertising::setAdvertisementType(esp_ble_adv_type_t adv_type){
|
||||||
|
m_advParams.adv_type = adv_type;
|
||||||
|
} // setAdvertisementType
|
||||||
|
|
||||||
void BLEAdvertising::setMinInterval(uint16_t mininterval) {
|
void BLEAdvertising::setMinInterval(uint16_t mininterval) {
|
||||||
m_advParams.adv_int_min = mininterval;
|
m_advParams.adv_int_min = mininterval;
|
||||||
} // setMinInterval
|
} // setMinInterval
|
||||||
|
@ -52,6 +52,7 @@ public:
|
|||||||
void start();
|
void start();
|
||||||
void stop();
|
void stop();
|
||||||
void setAppearance(uint16_t appearance);
|
void setAppearance(uint16_t appearance);
|
||||||
|
void setAdvertisementType(esp_ble_adv_type_t adv_type);
|
||||||
void setMaxInterval(uint16_t maxinterval);
|
void setMaxInterval(uint16_t maxinterval);
|
||||||
void setMinInterval(uint16_t mininterval);
|
void setMinInterval(uint16_t mininterval);
|
||||||
void setAdvertisementData(BLEAdvertisementData& advertisementData);
|
void setAdvertisementData(BLEAdvertisementData& advertisementData);
|
||||||
@ -76,4 +77,4 @@ private:
|
|||||||
|
|
||||||
};
|
};
|
||||||
#endif /* CONFIG_BT_ENABLED */
|
#endif /* CONFIG_BT_ENABLED */
|
||||||
#endif /* COMPONENTS_CPP_UTILS_BLEADVERTISING_H_ */
|
#endif /* COMPONENTS_CPP_UTILS_BLEADVERTISING_H_ */
|
||||||
|
Loading…
Reference in New Issue
Block a user