You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I have encountered a problem when using the Bluetooth master project of SDK. Hopefully you can give me answers to my mistakes or provide me with the correct code.
The core problem is that it cannot connect to the Bluetooth module DX-BT04-E whose uuid is TYPE_16. The code modification fails
There is no example when the uuid is TYPE_16 and 32, the former is slightly different from the given TYPE_128, hope to make a tutorial or solution
Do not understand the implementation of uuid conversion
It's about the file "ble_central_api.c" and the *bt_uuid_6/32/128 of"uuid.h" MY_UUID1_USER_TXD is char[16] for 128byte with the uint8_t uuid128[16]; which used at func
ble_reverse_byte(); and memcmp().
My bluetooth device is DX-BT04-E"module. It's UUID identified as BT_UUID_TYPE_16.
So I follow the code format of char MY_UUID1_USER_TXD[16]
Found in this val cannot be converted to uuid16 properly. Reading the source code for data type or casting type is also inavailable to find a solution.
I was wondering if the recognition is TYPE16, why is the value before the conversion 4-bit hexadecimal instead of 2-bit hexadecimal.
In the file gatt.h, const struct bt_uuid *uuid; how does the bt_uuid u8_t type convert to the bt_uuid_128
The amount of data bytes is all different.It's not work when it come to the uuid16 and val use assign.
Finally I change if (memcmp((char*) uuid16, MY_UUID_2_USER_TXD, 2) == 0) to if (uuid16 == MY_UUID_2_USER_TXD) because its about u16_t and char,not the char[] and uint8.
What should I do to solve if (attr->uuid->type == BT_UUID_TYPE_16)?
I hope I will not disturb you. This is the first time I have raised an issue. Look forward to your reply. Thank you.
The text was updated successfully, but these errors were encountered:
Hello, I have encountered a problem when using the Bluetooth master project of SDK. Hopefully you can give me answers to my mistakes or provide me with the correct code.
(https://github.com/Ai-Thinker-Open/Ai-Thinker-WB2/blob/main/applications/bluetooth/ble_master/ble_master/ble_central_api.c)
A brief description of my problems,
It's about the file "ble_central_api.c" and the
*bt_uuid_6/32/128
of"uuid.h"MY_UUID1_USER_TXD
is char[16] for 128byte with theuint8_t uuid128[16];
which used at funcble_reverse_byte(); and memcmp().
My bluetooth device is
DX-BT04-E
"module. It's UUID identified asBT_UUID_TYPE_16
.So I follow the code format of
char MY_UUID1_USER_TXD[16]
uuid16 = (uint16_t) (((struct bt_uuid_16*) (attr->uuid))->val);
debug:
sprintf(buf1, "attr->uuid = uuid16_ori = %X\r\n", attr->uuid);bleuart_printf(buf1);
output :42019B40
debug:
sprintf(buf1, "attr->uuid = uuid16_ori = %X\r\n", uuid16);bleuart_printf(buf1);
output :2800
Found in this
val
cannot be converted touuid16
properly. Reading the source code for data type or casting type is also inavailable to find a solution.I was wondering if the recognition is TYPE16, why is the value before the conversion 4-bit hexadecimal instead of 2-bit hexadecimal.
In the file
gatt.h
,const struct bt_uuid *uuid;
how does thebt_uuid u8_t type
convert to thebt_uuid_128
The amount of data bytes is all different.It's not work when it come to the
uuid16
andval
useassign
.Finally I change
if (memcmp((char*) uuid16, MY_UUID_2_USER_TXD, 2) == 0)
toif (uuid16 == MY_UUID_2_USER_TXD)
because its about u16_t and char,not the char[] and uint8.What should I do to solve if (attr->uuid->type == BT_UUID_TYPE_16)?
I hope I will not disturb you. This is the first time I have raised an issue. Look forward to your reply. Thank you.
The text was updated successfully, but these errors were encountered: