extmod/modbluetooh_nimble: Fix UUID conversion for 16 and 32 bit values.
This commit is contained in:
parent
2ae755d9e1
commit
438c0dc2a4
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user