sforkowany z mirror/meshtastic-firmware
add crude sim getmacaddr
rodzic
2a067e7f6b
commit
94e4b30125
|
@ -4,9 +4,21 @@
|
||||||
|
|
||||||
// FIXME - move getMacAddr/setBluetoothEnable into a HALPlatform class
|
// FIXME - move getMacAddr/setBluetoothEnable into a HALPlatform class
|
||||||
|
|
||||||
|
uint32_t hwId; // fixme move into portduino
|
||||||
|
|
||||||
void getMacAddr(uint8_t *dmac)
|
void getMacAddr(uint8_t *dmac)
|
||||||
{
|
{
|
||||||
notImplemented("getMacAddr");
|
if (!hwId) {
|
||||||
|
notImplemented("getMacAddr");
|
||||||
|
hwId = random();
|
||||||
|
}
|
||||||
|
|
||||||
|
dmac[0] = 0x80;
|
||||||
|
dmac[1] = 0;
|
||||||
|
dmac[2] = 0;
|
||||||
|
dmac[3] = hwId >> 16;
|
||||||
|
dmac[4] = hwId >> 8;
|
||||||
|
dmac[5] = hwId & 0xff;
|
||||||
}
|
}
|
||||||
|
|
||||||
void setBluetoothEnable(bool on)
|
void setBluetoothEnable(bool on)
|
||||||
|
|
Ładowanie…
Reference in New Issue