Commit 438c0dc2 authored by Jim Mussared's avatar Jim Mussared Committed by Damien George

extmod/modbluetooh_nimble: Fix UUID conversion for 16 and 32 bit values.

parent 2ae755d9
......@@ -117,14 +117,14 @@ STATIC mp_obj_bluetooth_uuid_t create_mp_uuid(const ble_uuid_any_t *uuid) {
case BLE_UUID_TYPE_16:
result.type = MP_BLUETOOTH_UUID_TYPE_16;
result.data[0] = uuid->u16.value & 0xff;
result.data[1] = (uuid->u16.value << 8) & 0xff;
result.data[1] = (uuid->u16.value >> 8) & 0xff;
break;
case BLE_UUID_TYPE_32:
result.type = MP_BLUETOOTH_UUID_TYPE_32;
result.data[0] = uuid->u32.value & 0xff;
result.data[1] = (uuid->u32.value << 8) & 0xff;
result.data[2] = (uuid->u32.value << 16) & 0xff;
result.data[3] = (uuid->u32.value << 24) & 0xff;
result.data[1] = (uuid->u32.value >> 8) & 0xff;
result.data[2] = (uuid->u32.value >> 16) & 0xff;
result.data[3] = (uuid->u32.value >> 24) & 0xff;
break;
case BLE_UUID_TYPE_128:
result.type = MP_BLUETOOTH_UUID_TYPE_128;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment