Hi there. I’m working on application where Gear connects to iPhone via Bluetooth LE. The next roles is selected:
Gear (Central) and iPhone (Peripheral). I have some issue (strange for me) when Gear is connecting to iPhone.
Let me describe what I do step by step. I’ll put only Tizen calls without error processing and my internal logic.
Initialization
bt_initialize();
bt_adapter_get_state(&state);
if (state == BT_ADAPTER_DISABLED)
{
return error;
}
Connection via Bluetooth LE
Hi there. I’m working on application where Gear connects to iPhone via Bluetooth LE. The next roles is selected:
Gear (Central) and iPhone (Peripheral). I have some issue (strange for me) when Gear is connecting to iPhone.
Let me describe what I do step by step. I’ll put only Tizen calls without error processing and my internal logic.
bt_initialize(); bt_adapter_get_state(&state); if (state == BT_ADAPTER_DISABLED) { return error; }bt_gatt_set_connection_state_changed_cb( __bt_gatt_connection_state_changed_cb, NULL); bt_adapter_le_start_scan(__bt_adapter_le_scan_result_cb, NULL);I see in system logs that service with requested UUID is found.01-10 17:25:36.179+0200 W/WECONN ( 2498): <__on_change_gatt_client:366> { 01-10 17:25:36.179+0200 W/WECONN ( 2498): <__on_change_gatt_client:370> chage_type : 0, service_uuid : 00001101-0000-1000-8000-00805f9b3400 01-10 17:25:36.179+0200 D/WECONN ( 2498): <__on_change_gatt_client:846> remote_address : B4:D5 01-10 17:25:36.179+0200 W/WECONN ( 2498): <__is_device_matched_to:2565> le : B4:D5, br_edr : 99:42, identifier : B4:D5 01-10 17:25:36.179+0200 D/WECONN ( 2498): <wc_bt_get_gatt_client_service:2003> ## # I think this is a root cause why connection is not established. I don't know what is service with UUID 9a3f68e0-86ce-11e5-a309-0002a5d5c51b. # I don't have such UUID in my code at all. Error -61 means BT_ERROR_NO_DATA. 01-10 17:25:36.179+0200 E/WECONN ( 2498): <wc_bt_get_gatt_client_service:2007> ret : -61 01-10 17:25:36.179+0200 E/WECONN ( 2498): <__create_gatt_handle_into:1169> Fail wc_bt_get_gatt_client_service[9a3f68e0-86ce-11e5-a309-0002a5d5c51b]/[-61] 01-10 17:25:36.189+0200 W/WECONN ( 2498): <__on_change_gatt_client:374> } 01-10 17:25:36.189+0200 I/BLUETOOTH_FRWK_SERVICE( 2755): bt-service-event-receiver.c: __bt_adapter_property_changed_event(617) > Property LEDiscovering 01-10 17:25:36.189+0200 D/BLUETOOTH_FRWK_SERVICE( 2755): bt-service-event-receiver.c: __bt_adapter_property_changed_event(659) > LEDiscovering 0 01-10 17:25:36.189+0200 E/BLUETOOTH_FRWK_SERVICE( 2755): bt-service-event-receiver.c: __bt_adapter_property_changed_event(684) > Dbus Error GDBus.Error:org.bluez.Error.Failed: No discovery started 01-10 17:25:36.199+0200 D/BLUETOOTH_FRWK_API( 9148): bt-common.c: _bt_check_privilege(1884) > Sync Request => type=service_type, fn=service_function(0x159) 01-10 17:25:36.199+0200 D/BLUETOOTH_FRWK_SERVICE( 2755): bt-request-handler.c: __bt_service_method(163) > Method[service_request] Object Path[/org/projectx/bt_service] Interface Name[org.projectx.bt] 01-10 17:25:36.199+0200 D/BLUETOOTH_FRWK_SERVICE( 2755): bt-request-handler.c: __bt_service_method(236) > Service type = 4, fn = BT_CONNECT_LE (0x159) 01-10 17:25:36.199+0200 I/BLUETOOTH_FRWK_API( 9148): bt-device.c: bluetooth_connect_le(354) > [32m ### Connect LE [0m 01-10 17:25:36.199+0200 I/BLUETOOTH_FRWK_API( 9148): bt-device.c: bluetooth_connect_le(357) > [32m Async Request => type=BT_BLUEZ_SERVICE, fn=BT_CONNECT_LE(0x159) [0m01-10 17:25:36.209+0200 D/BLUETOOTH_FRWK_SERVICE( 2755): bt-request-handler.c: __bt_service_method(163) > Method[service_request] Object Path[/org/projectx/bt_service] Interface Name[org.projectx.bt] 01-10 17:25:36.209+0200 D/BLUETOOTH_FRWK_SERVICE( 2755): bt-request-handler.c: __bt_service_method(224) > Request ID: 21 01-10 17:25:36.209+0200 D/BLUETOOTH_FRWK_SERVICE( 2755): bt-request-handler.c: __bt_service_method(236) > Service type = 0, fn = BT_CONNECT_LE (0x159) 01-10 17:25:36.209+0200 E/BLUETOOTH_FRWK_SERVICE( 2755): bt-service-adapter-le.c: _bt_hold_current_advertising(505) > It's NOT advertising 01-10 17:25:36.209+0200 E/BLUETOOTH_FRWK_SERVICE( 2755): bt-service-device.c: _bt_connect_le_device(1947) > Unable to hold advertising 01-10 17:25:36.279+0200 D/BLUETOOTH_FRWK_API( 9148): bt-device.c: bluetooth_is_device_connected(320) > Sync Request => type=BT_BLUEZ_SERVICE, fn=BT_IS_DEVICE_CONNECTED(0x5a) 01-10 17:25:36.329+0200 I/BLUETOOTH_FRWK_SERVICE( 2755): bt-service-device.c: __bt_connect_le_device_internal(1880) > Connect LE [6F:0B:DA:7A:B4:XX] 01-10 17:25:36.329+0200 D/BLUETOOTH_FRWK_SERVICE( 2755): bt-request-handler.c: __bt_service_method(279) > INSERT INTO REQ LIST 01-10 17:25:36.329+0200 D/BLUETOOTH_FRWK_SERVICE( 2755): bt-request-handler.c: __bt_service_method(163) > Method[service_request] Object Path[/org/projectx/bt_service] Interface Name[org.projectx.bt] 01-10 17:25:36.329+0200 D/BLUETOOTH_FRWK_SERVICE( 2755): bt-request-handler.c: __bt_service_method(236) > Service type = 0, fn = BT_IS_DEVICE_CONNECTED (0x5a) 01-10 17:25:36.329+0200 D/BLUETOOTH_FRWK_SERVICE( 2755): bt-service-device.c: _bt_is_device_connected(1609) > 6F:0B:DA:7A:B4:XX connection_type: 64 # I suppose that 1 means true and there is a connection. 01-10 17:25:36.399+0200 D/BLUETOOTH_FRWK_SERVICE( 2755): bt-service-device.c: _bt_is_gatt_connected(1578) > gatt is connected : 1 01-10 17:25:36.399+0200 D/BLUETOOTH_FRWK_SERVICE( 2755): bt-request-handler.c: __bt_bluez_request(926) > is_connected: 1 01-10 17:25:36.399+0200 I/BLUETOOTH_FRWK_API( 9148): bt-gatt-client.c: bluetooth_gatt_get_primary_services(320) > + 01-10 17:25:36.399+0200 D/BLUETOOTH_FRWK_SERVICE( 2755): bt-service-adapter.c: _bt_get_discovering_property(2803) > discoverable_v:0 01-10 17:25:36.409+0200 D/BLUETOOTH_FRWK_SERVICE( 2755): bt-service-event-sender.c: _bt_send_event(44) > event_type [3], event [13] 01-10 17:25:36.409+0200 D/BLUETOOTH_FRWK_SERVICE( 2755): bt-service-event-sender.c: _bt_send_event(391) > Path : /org/projectx/bt/le/adapter 01-10 17:25:36.409+0200 I/BLUETOOTH_FRWK_SERVICE( 2755): bt-service-event-sender.c: _bt_send_event(392) > [32m Signal : LEDiscoveryFinished [0m 01-10 17:25:36.409+0200 D/BLUETOOTH_FRWK_API( 9148): bt-request-sender.c: __send_request_cb(300) > + 01-10 17:25:36.409+0200 D/BLUETOOTH_FRWK_API( 9148): bt-request-sender.c: __bt_get_event_info(117) > service_function : BT_CONNECT_LE (0x159) 01-10 17:25:36.409+0200 D/BLUETOOTH_FRWK_API( 9148): bt-request-sender.c: __send_request_cb(401) > - 01-10 17:25:36.549+0200 I/BLUETOOTH_FRWK_API( 9148): bt-gatt-client.c: bluetooth_gatt_get_service_property(257) > ======> Service : 00001101-0000-1000-8000-00805f9b3400 [Unknown] 01-10 17:25:36.549+0200 D/BLUETOOTH_FRWK_API( 9148): bt-gatt-client.c: bluetooth_gatt_get_service_property(287) > Characteristics count : 1 01-10 17:25:36.589+0200 I/BLUETOOTH_FRWK_API( 9148): bt-gatt-client.c: bluetooth_gatt_get_service_property(257) > ======> Service : 89d3502b-0f36-433a-8ef4-c502ad55f8dc [Apple Media Service] 01-10 17:25:36.589+0200 D/BLUETOOTH_FRWK_API( 9148): bt-gatt-client.c: bluetooth_gatt_get_service_property(287) > Characteristics count : 3 01-10 17:25:36.639+0200 I/BLUETOOTH_FRWK_API( 9148): bt-gatt-client.c: bluetooth_gatt_get_service_property(257) > ======> Service : 7905f431-b5ce-4e99-a40f-4b1e122d00d0 [Apple Notification Center Service] 01-10 17:25:36.639+0200 D/BLUETOOTH_FRWK_API( 9148): bt-gatt-client.c: bluetooth_gatt_get_service_property(287) > Characteristics count : 3 01-10 17:25:36.689+0200 I/BLUETOOTH_FRWK_API( 9148): bt-gatt-client.c: bluetooth_gatt_get_service_property(257) > ======> Service : 0000180a-0000-1000-8000-00805f9b34fb [Device Information] 01-10 17:25:36.689+0200 D/BLUETOOTH_FRWK_API( 9148): bt-gatt-client.c: bluetooth_gatt_get_service_property(287) > Characteristics count : 2 01-10 17:25:36.739+0200 I/BLUETOOTH_FRWK_API( 9148): bt-gatt-client.c: bluetooth_gatt_get_service_property(257) > ======> Service : 00001805-0000-1000-8000-00805f9b34fb [Current Time Service] 01-10 17:25:36.739+0200 D/BLUETOOTH_FRWK_API( 9148): bt-gatt-client.c: bluetooth_gatt_get_service_property(287) > Characteristics count : 2 01-10 17:25:36.789+0200 I/BLUETOOTH_FRWK_API( 9148): bt-gatt-client.c: bluetooth_gatt_get_service_property(257) > ======> Service : 0000180f-0000-1000-8000-00805f9b34fb [Battery Service] 01-10 17:25:36.789+0200 D/BLUETOOTH_FRWK_API( 9148): bt-gatt-client.c: bluetooth_gatt_get_service_property(287) > Characteristics count : 1 01-10 17:25:36.839+0200 I/BLUETOOTH_FRWK_API( 9148): bt-gatt-client.c: bluetooth_gatt_get_service_property(257) > ======> Service : 9fa480e0-4967-4542-9390-d343dc5d04ae [Unknown] 01-10 17:25:36.839+0200 D/BLUETOOTH_FRWK_API( 9148): bt-gatt-client.c: bluetooth_gatt_get_service_property(287) > Characteristics count : 1 01-10 17:25:36.889+0200 I/BLUETOOTH_FRWK_API( 9148): bt-gatt-client.c: bluetooth_gatt_get_service_property(257) > ======> Service : d0611e78-bbb4-4591-a5f8-487910ae4366 [Unknown] 01-10 17:25:36.889+0200 D/BLUETOOTH_FRWK_API( 9148): bt-gatt-client.c: bluetooth_gatt_get_service_property(287) > Characteristics count : 1 01-10 17:25:36.939+0200 I/BLUETOOTH_FRWK_API( 9148): bt-gatt-client.c: bluetooth_gatt_get_service_property(257) > ======> Service : 00001801-0000-1000-8000-00805f9b34fb [Generic Attribute] 01-10 17:25:36.939+0200 D/BLUETOOTH_FRWK_API( 9148): bt-gatt-client.c: bluetooth_gatt_get_service_property(287) > Characteristics count : 1 01-10 17:25:36.989+0200 I/BLUETOOTH_FRWK_API( 9148): bt-gatt-client.c: bluetooth_gatt_get_service_property(257) > ======> Service : 00001800-0000-1000-8000-00805f9b34fb [Generic Access] 01-10 17:25:36.989+0200 D/BLUETOOTH_FRWK_API( 9148): bt-gatt-client.c: bluetooth_gatt_get_service_property(287) > Characteristics count : 2After that I see error logs from my app denoting that timeout has expired (I set 10 seconds to give enough time).As I see error happened on function wc_bt_get_gatt_client_service() with error code -61 (BT_ERROR_NO_DATA). I have no idea what is the mysterious UUID 9a3f68e0-86ce-11e5-a309-0002a5d5c51b and why it requested.
Thank you in advance.
BY
16 Apr 2025
Tizen Studio
BY
04 Nov 2024
Tizen Studio
BY
02 Apr 2024
Tizen Studio