File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -234,6 +234,7 @@ void BLEAdvertisedDevice::parseAdvertisement(uint8_t* payload) {
234
234
uint8_t ad_type;
235
235
uint8_t sizeConsumed = 0 ;
236
236
bool finished = false ;
237
+ setPayload (payload);
237
238
238
239
while (!finished) {
239
240
length = *payload; // Retrieve the length of the record.
@@ -506,7 +507,13 @@ std::string BLEAdvertisedDevice::toString() {
506
507
return ss.str ();
507
508
} // toString
508
509
510
+ uint8_t * BLEAdvertisedDevice::getPayload () {
511
+ return m_payload;
512
+ }
509
513
514
+ void BLEAdvertisedDevice::setPayload (uint8_t * payload) {
515
+ m_payload = payload;
516
+ }
510
517
511
518
512
519
#endif /* CONFIG_BT_ENABLED */
Original file line number Diff line number Diff line change @@ -39,9 +39,10 @@ class BLEAdvertisedDevice {
39
39
BLEUUID getServiceDataUUID ();
40
40
BLEUUID getServiceUUID ();
41
41
int8_t getTXPower ();
42
+ uint8_t * getPayload ();
42
43
43
44
44
- bool isAdvertisingService (BLEUUID uuid);
45
+ bool isAdvertisingService (BLEUUID uuid);
45
46
bool haveAppearance ();
46
47
bool haveManufacturerData ();
47
48
bool haveName ();
@@ -69,6 +70,7 @@ class BLEAdvertisedDevice {
69
70
void setServiceUUID (const char * serviceUUID);
70
71
void setServiceUUID (BLEUUID serviceUUID);
71
72
void setTXPower (int8_t txPower);
73
+ void setPayload (uint8_t * payload);
72
74
73
75
74
76
bool m_haveAppearance;
@@ -92,6 +94,7 @@ class BLEAdvertisedDevice {
92
94
int8_t m_txPower;
93
95
std::string m_serviceData;
94
96
BLEUUID m_serviceDataUUID;
97
+ uint8_t * m_payload;
95
98
};
96
99
97
100
/* *
You can’t perform that action at this time.
0 commit comments