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

Function getOAdvertisementData

nRFBox_V2/sourapple.cpp:64–86  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 1

sourappleLoopFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected