diff options
author | kolban <kolban1@kolban.com> | 2017-09-10 13:41:31 -0500 |
---|---|---|
committer | kolban <kolban1@kolban.com> | 2017-09-10 13:41:31 -0500 |
commit | 0eecee13a75bf13fd1752d3d9b6bc60709a265d2 (patch) | |
tree | 7d1492d47841ffa8b103cc9e111772af77b35481 /src/BLEAdvertising.h | |
parent | 0.1.0 release (diff) | |
download | thermostat-0eecee13a75bf13fd1752d3d9b6bc60709a265d2.tar.gz thermostat-0eecee13a75bf13fd1752d3d9b6bc60709a265d2.tar.bz2 thermostat-0eecee13a75bf13fd1752d3d9b6bc60709a265d2.zip |
0.2.0
Diffstat (limited to 'src/BLEAdvertising.h')
-rw-r--r-- | src/BLEAdvertising.h | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/src/BLEAdvertising.h b/src/BLEAdvertising.h new file mode 100644 index 0000000..2d0b51c --- /dev/null +++ b/src/BLEAdvertising.h @@ -0,0 +1,34 @@ +/* + * BLEAdvertising.h + * + * Created on: Jun 21, 2017 + * Author: kolban + */ + +#ifndef COMPONENTS_CPP_UTILS_BLEADVERTISING_H_ +#define COMPONENTS_CPP_UTILS_BLEADVERTISING_H_ +#include "sdkconfig.h" +#if defined(CONFIG_BT_ENABLED) +#include <esp_gap_ble_api.h> +#include "BLEUUID.h" + +/** + * @brief Perform and manage %BLE advertising. + * + * A %BLE server will want to perform advertising in order to make itself known to %BLE clients. + */ +class BLEAdvertising { +public: + BLEAdvertising(); + void start(); + void stop(); + void setAppearance(uint16_t appearance); + void setServiceUUID(const char* serviceUUID); + void setServiceUUID(BLEUUID serviceUUID); +private: + esp_ble_adv_data_t m_advData; + esp_ble_adv_params_t m_advParams; + BLEUUID m_serviceUUID; +}; +#endif /* CONFIG_BT_ENABLED */ +#endif /* COMPONENTS_CPP_UTILS_BLEADVERTISING_H_ */ |