Open kengdehenkeng opened 8 years ago
Which bits do you want to change? Could you share more information? Such as an code snippet or use-case?
0xFFFFFF in to 0x0027
for example gatttool -b 00:15:83:00:6B:08 --char-write-req -a 0x25 -n 0x31 like this code in test.c 0x25 is the UUID and 0x31 is the write_data, right? and where is the UUID and write_data in the test.c?
You can set the opt_handle = 0x25, and opt_value="0x31", then call characteristics_write_req. Or BLE_init/send API
sorry, i am confussed. I want to write 0xFFFFFF in to 0x0027 and when I code like gatttool -b 'my MAC' --char-write-req -a 0x0027 -n 0xFFFFFF it worked, but the the type of 'opt_handle' is int, 0x0027 is larger than int so, if I want to write 0xFFFFFF in to 0x0027, what should I do? thx
In "-a 0x0027 -n 0xFFFFFF", the opt_handle=0x27 is an int(not larger than int), and opt_value="0xFFFFFF" is a char *
in your code chan = gatt_connect(NULL, "00:15:83:00:6B:08s", g_strdup("public"), g_strdup("low"), 0, 0, connect_cb, &gerr); is that right? There is a 's' at the end of MAC
and I changed your code
static int opt_handle =0x27; static char *opt_value = "0xFFFFFF"; chan = gatt_connect(NULL, "my MAC s", g_strdup("public"), g_strdup("low"), 0, 0, connect_cb, &gerr);
and run test.c
it shows like this bluetoothd[10151]: +gatt_connect psm=0 bluetoothd[10151]: l2cap_connect sock=4 cid=0x4 dst_type=1 bluetoothd[10151]: -l2cap_connect bluetoothd[10151]: Connected! bluetoothd[10151]: +connect_cb connect_cb sock=4 bluetoothd[10151]: gatt_write_char value=0x0 bluetoothd[10151]: -connect_cb
and stop here.
Thx
Please check the BLE_init/BLE_send, the 's' as the end of MAC is a typo
sorry, I can't get your point, I have not know the BLE a lot. I just want to connect my device and sent 0xFFFFFF to 0x0027 could you tell me what should I do?
Please check the BLE_init and BLE_send, change the 0x25 to 0x27, and 0x31/0x30 to 0xFFFFFF
where is BLE_init? and I changed it but it shows like this bluetoothd[10151]: +gatt_connect psm=0 bluetoothd[10151]: l2cap_connect sock=4 cid=0x4 dst_type=1 bluetoothd[10151]: -l2cap_connect bluetoothd[10151]: Connected! bluetoothd[10151]: +connect_cb connect_cb sock=4 bluetoothd[10151]: gatt_write_char value=0x0 bluetoothd[10151]: -connect_cb
and stop here.
git pull to get the BLE_init, it is in the gatttool.c file
hello no it shows like this: connect_cb error: Transport endpoint is not connected (107)
use the hciconfig tool to check if hci0 is okay ?
it shows : hci0: Type: BR/EDR Bus: UART BD Address: B8:27:EB:B9:8F:44 ACL MTU: 1021:8 SCO MTU: 64:1 UP RUNNING RX bytes:2601 acl:19 sco:0 events:167 errors:0 TX bytes:5420 acl:19 sco:0 commands:112 errors:0
hello I want to write bits in the particular uuid, where should I change in the test.c? the MAC, UUID, write_data?