-
Notifications
You must be signed in to change notification settings - Fork 7.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into docs/preferences-getbool
- Loading branch information
Showing
13 changed files
with
213 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/* | ||
BLE2901.h | ||
GATT Descriptor 0x2901 Characteristic User Description | ||
The value of this description is a user-readable string | ||
describing the characteristic. | ||
The Characteristic User Description descriptor | ||
provides a textual user description for a characteristic | ||
value. | ||
If the Writable Auxiliary bit of the Characteristics | ||
Properties is set then this descriptor is written. Only one | ||
User Description descriptor exists in a characteristic | ||
definition. | ||
*/ | ||
|
||
#include "soc/soc_caps.h" | ||
#if SOC_BLE_SUPPORTED | ||
|
||
#include "sdkconfig.h" | ||
#if defined(CONFIG_BLUEDROID_ENABLED) | ||
|
||
#include "BLE2901.h" | ||
|
||
BLE2901::BLE2901() : BLEDescriptor(BLEUUID((uint16_t)0x2901)) {} // BLE2901 | ||
|
||
/** | ||
* @brief Set the Characteristic User Description | ||
*/ | ||
void BLE2901::setDescription(String userDesc) { | ||
if (userDesc.length() > ESP_GATT_MAX_ATTR_LEN) { | ||
log_e("Size %d too large, must be no bigger than %d", userDesc.length(), ESP_GATT_MAX_ATTR_LEN); | ||
return; | ||
} | ||
setValue(userDesc); | ||
} | ||
|
||
#endif | ||
#endif /* SOC_BLE_SUPPORTED */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* | ||
BLE2901.h | ||
GATT Descriptor 0x2901 Characteristic User Description | ||
The value of this description is a user-readable string | ||
describing the characteristic. | ||
The Characteristic User Description descriptor | ||
provides a textual user description for a characteristic | ||
value. | ||
If the Writable Auxiliary bit of the Characteristics | ||
Properties is set then this descriptor is written. Only one | ||
User Description descriptor exists in a characteristic | ||
definition. | ||
*/ | ||
|
||
#ifndef COMPONENTS_CPP_UTILS_BLE2901_H_ | ||
#define COMPONENTS_CPP_UTILS_BLE2901_H_ | ||
#include "soc/soc_caps.h" | ||
#if SOC_BLE_SUPPORTED | ||
|
||
#include "sdkconfig.h" | ||
#if defined(CONFIG_BLUEDROID_ENABLED) | ||
|
||
#include "BLEDescriptor.h" | ||
|
||
class BLE2901 : public BLEDescriptor { | ||
public: | ||
BLE2901(); | ||
void setDescription(String desc); | ||
}; // BLE2901 | ||
|
||
#endif /* CONFIG_BLUEDROID_ENABLED */ | ||
#endif /* SOC_BLE_SUPPORTED */ | ||
#endif /* COMPONENTS_CPP_UTILS_BLE2901_H_ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Oops, something went wrong.