Skip to content

Commit

Permalink
Fix compiler warning.
Browse files Browse the repository at this point in the history
  • Loading branch information
h2zero committed Jul 24, 2024
1 parent 2cedbf5 commit 5567365
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/NimBLEAdvertising.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -973,7 +973,7 @@ void NimBLEAdvertisementData::setServices(const bool complete, const uint8_t siz
*/
void NimBLEAdvertisementData::setServiceData(const NimBLEUUID &uuid, const std::string &data) {
uint8_t size = uuid.bitSize() / 8;
char cdata[2] = {1 + size, BLE_HS_ADV_TYPE_SVC_DATA_UUID16};
char cdata[2] = {static_cast<char>(1 + size), BLE_HS_ADV_TYPE_SVC_DATA_UUID16};
switch (size) {
case 2: {
// [Len] [0x16] [UUID16] data
Expand Down
2 changes: 1 addition & 1 deletion src/NimBLEExtAdvertising.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -778,7 +778,7 @@ void NimBLEExtAdvertisement::setServices(const bool complete, const uint8_t size
*/
void NimBLEExtAdvertisement::setServiceData(const NimBLEUUID &uuid, const std::string &data) {
uint8_t size = uuid.bitSize() / 8;
char cdata[2] = {1 + size, BLE_HS_ADV_TYPE_SVC_DATA_UUID16};
char cdata[2] = {static_cast<char>(1 + size), BLE_HS_ADV_TYPE_SVC_DATA_UUID16};
switch (size) {
case 2: {
// [Len] [0x16] [UUID16] data
Expand Down

0 comments on commit 5567365

Please sign in to comment.