extmod/modbluetooth: Fix so it builds in peripheral-only mode.
This commit is contained in:
committed by
Damien George
parent
43ceadac55
commit
3c7ca2004c
@@ -96,6 +96,13 @@ STATIC ble_uuid_t *create_nimble_uuid(const mp_obj_bluetooth_uuid_t *uuid, ble_u
|
||||
}
|
||||
}
|
||||
|
||||
// modbluetooth (and the layers above it) work in BE for addresses, Nimble works in LE.
|
||||
STATIC void reverse_addr_byte_order(uint8_t *addr_out, const uint8_t *addr_in) {
|
||||
for (int i = 0; i < 6; ++i) {
|
||||
addr_out[i] = addr_in[5 - i];
|
||||
}
|
||||
}
|
||||
|
||||
#if MICROPY_PY_BLUETOOTH_ENABLE_CENTRAL_MODE
|
||||
|
||||
STATIC mp_obj_bluetooth_uuid_t create_mp_uuid(const ble_uuid_any_t *uuid) {
|
||||
@@ -123,13 +130,6 @@ STATIC mp_obj_bluetooth_uuid_t create_mp_uuid(const ble_uuid_any_t *uuid) {
|
||||
return result;
|
||||
}
|
||||
|
||||
// modbluetooth (and the layers above it) work in BE for addresses, Nimble works in LE.
|
||||
STATIC void reverse_addr_byte_order(uint8_t *addr_out, const uint8_t *addr_in) {
|
||||
for (int i = 0; i < 6; ++i) {
|
||||
addr_out[i] = addr_in[5 - i];
|
||||
}
|
||||
}
|
||||
|
||||
STATIC ble_addr_t create_nimble_addr(uint8_t addr_type, const uint8_t *addr) {
|
||||
ble_addr_t addr_nimble;
|
||||
addr_nimble.type = addr_type;
|
||||
|
||||
Reference in New Issue
Block a user