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

Function getOAdvertisementData

VScode Platformio/src/sourapple.cpp:58–80  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

56}
57
58BLEAdvertisementData getOAdvertisementData() {
59 BLEAdvertisementData advertisementData = BLEAdvertisementData();
60 uint8_t i = 0;
61
62 packet[i++] = 16; // Packet Length
63 packet[i++] = 0xFF; // Packet Type (Manufacturer Specific)
64 packet[i++] = 0x4C; // Packet Company ID (Apple, Inc.)
65 packet[i++] = 0x00; // ...
66 packet[i++] = 0x0F; // Type
67 packet[i++] = 0x05; // Length
68 packet[i++] = 0xC1; // Action Flags
69 const uint8_t types[] = { 0x27, 0x09, 0x02, 0x1e, 0x2b, 0x2d, 0x2f, 0x01, 0x06, 0x20, 0xc0 };
70 packet[i++] = types[rand() % sizeof(types)]; // Action Type
71 esp_fill_random(&packet[i], 3); // Authentication Tag
72 i += 3;
73 packet[i++] = 0x00; // ???
74 packet[i++] = 0x00; // ???
75 packet[i++] = 0x10; // Type ???
76 esp_fill_random(&packet[i], 3);
77
78 advertisementData.addData(std::string((char *)packet, 17));
79 return advertisementData;
80}
81
82void sourappleSetup(){
83

Callers 1

sourappleLoopFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected