mirror of
https://github.com/esphome/esphome.git
synced 2024-12-22 05:24:53 +01:00
Allow to set manufacturer data for BLEAdvertising (#3179)
This commit is contained in:
parent
3bf042dce9
commit
e7dd6c52ac
2 changed files with 6 additions and 0 deletions
|
@ -42,6 +42,11 @@ void BLEAdvertising::remove_service_uuid(ESPBTUUID uuid) {
|
|||
this->advertising_uuids_.end());
|
||||
}
|
||||
|
||||
void BLEAdvertising::set_manufacturer_data(uint8_t *data, uint16_t size) {
|
||||
this->advertising_data_.p_manufacturer_data = data;
|
||||
this->advertising_data_.manufacturer_len = size;
|
||||
}
|
||||
|
||||
void BLEAdvertising::start() {
|
||||
int num_services = this->advertising_uuids_.size();
|
||||
if (num_services == 0) {
|
||||
|
|
|
@ -20,6 +20,7 @@ class BLEAdvertising {
|
|||
void remove_service_uuid(ESPBTUUID uuid);
|
||||
void set_scan_response(bool scan_response) { this->scan_response_ = scan_response; }
|
||||
void set_min_preferred_interval(uint16_t interval) { this->advertising_data_.min_interval = interval; }
|
||||
void set_manufacturer_data(uint8_t *data, uint16_t size);
|
||||
|
||||
void start();
|
||||
void stop();
|
||||
|
|
Loading…
Reference in a new issue