Fixes MAC address in the BLE advertisement packet

The bug was introduced in https://github.com/rbaron/b-parasite/pull/26.
This commit is contained in:
rbaron 2022-02-12 18:38:57 +01:00
parent 1abff035cb
commit 77f398757a

View file

@ -118,8 +118,10 @@ static void init_advertisement_data() {
service_data[0] |= 1;
#endif
// Bytes 10-15 (inclusive) contain the whole MAC address.
memcpy(service_data + 10, gap_addr_.addr, 6);
// Bytes 10-15 (inclusive) contain the whole MAC address in big-endian.
for (int i = 0; i < 6; i++) {
service_data[10 + i] = gap_addr_.addr[5 - i];
}
}
void prst_ble_init() {