Skip to content

Commit

Permalink
Merge pull request #133 from Polldo/api-advertising-return-type
Browse files Browse the repository at this point in the history
API: set advertising param functions return success
  • Loading branch information
facchinm authored Nov 2, 2020
2 parents fd5bc06 + d29f052 commit 51595db
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
24 changes: 12 additions & 12 deletions src/local/BLELocalDevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -184,34 +184,34 @@ int BLELocalDevice::rssi()
return 127;
}

void BLELocalDevice::setAdvertisedServiceUuid(const char* advertisedServiceUuid)
bool BLELocalDevice::setAdvertisedServiceUuid(const char* advertisedServiceUuid)
{
_advertisingData.setAdvertisedServiceUuid(advertisedServiceUuid);
return _advertisingData.setAdvertisedServiceUuid(advertisedServiceUuid);
}

void BLELocalDevice::setAdvertisedService(const BLEService& service)
bool BLELocalDevice::setAdvertisedService(const BLEService& service)
{
setAdvertisedServiceUuid(service.uuid());
return setAdvertisedServiceUuid(service.uuid());
}

void BLELocalDevice::setAdvertisedServiceData(uint16_t uuid, const uint8_t data[], int length)
bool BLELocalDevice::setAdvertisedServiceData(uint16_t uuid, const uint8_t data[], int length)
{
_advertisingData.setAdvertisedServiceData(uuid, data, length);
return _advertisingData.setAdvertisedServiceData(uuid, data, length);
}

void BLELocalDevice::setManufacturerData(const uint8_t manufacturerData[], int manufacturerDataLength)
bool BLELocalDevice::setManufacturerData(const uint8_t manufacturerData[], int manufacturerDataLength)
{
_advertisingData.setManufacturerData(manufacturerData, manufacturerDataLength);
return _advertisingData.setManufacturerData(manufacturerData, manufacturerDataLength);
}

void BLELocalDevice::setManufacturerData(const uint16_t companyId, const uint8_t manufacturerData[], int manufacturerDataLength)
bool BLELocalDevice::setManufacturerData(const uint16_t companyId, const uint8_t manufacturerData[], int manufacturerDataLength)
{
_advertisingData.setManufacturerData(companyId, manufacturerData, manufacturerDataLength);
return _advertisingData.setManufacturerData(companyId, manufacturerData, manufacturerDataLength);
}

void BLELocalDevice::setLocalName(const char *localName)
bool BLELocalDevice::setLocalName(const char *localName)
{
_scanResponseData.setLocalName(localName);
return _scanResponseData.setLocalName(localName);
}

void BLELocalDevice::setAdvertisingData(BLEAdvertisingData& advertisingData)
Expand Down
12 changes: 6 additions & 6 deletions src/local/BLELocalDevice.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@ class BLELocalDevice {

virtual int rssi();

virtual void setAdvertisedServiceUuid(const char* advertisedServiceUuid);
virtual void setAdvertisedService(const BLEService& service);
virtual void setAdvertisedServiceData(uint16_t uuid, const uint8_t data[], int length);
virtual void setManufacturerData(const uint8_t manufacturerData[], int manufacturerDataLength);
virtual void setManufacturerData(const uint16_t companyId, const uint8_t manufacturerData[], int manufacturerDataLength);
virtual void setLocalName(const char *localName);
virtual bool setAdvertisedServiceUuid(const char* advertisedServiceUuid);
virtual bool setAdvertisedService(const BLEService& service);
virtual bool setAdvertisedServiceData(uint16_t uuid, const uint8_t data[], int length);
virtual bool setManufacturerData(const uint8_t manufacturerData[], int manufacturerDataLength);
virtual bool setManufacturerData(const uint16_t companyId, const uint8_t manufacturerData[], int manufacturerDataLength);
virtual bool setLocalName(const char *localName);

virtual void setAdvertisingData(BLEAdvertisingData& advertisingData);
virtual void setScanResponseData(BLEAdvertisingData& scanResponseData);
Expand Down

0 comments on commit 51595db

Please sign in to comment.