MCPcopy Create free account
hub / github.com/cifertech/nRFBox / getAdvertismentData

Function getAdvertismentData

nRFBox_V2/spoofer.cpp:84–102  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

82};
83
84BLEAdvertisementData getAdvertismentData() {
85 BLEAdvertisementData oAdvertisementData = BLEAdvertisementData();
86
87 if (device_choice == 0) {
88 oAdvertisementData.addData(std::string((char*)DEVICES[device_index], 31));
89 }
90
91
92 int adv_type_choice = random(3);
93 if (adv_type_choice == 0) {
94 pAdvertising->setAdvertisementType(ADV_TYPE_IND);
95 } else if (adv_type_choice == 1) {
96 pAdvertising->setAdvertisementType(ADV_TYPE_SCAN_IND);
97 } else {
98 pAdvertising->setAdvertisementType(ADV_TYPE_NONCONN_IND);
99 }
100
101 return oAdvertisementData;
102}
103
104void updateDisplay() {
105 u8g2.clearBuffer();

Callers 1

toggleAdvertisingFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected