Languages

Menu
Sites
Language
bt_adapter_le_start_scan Callback was not working on Gear S3

I used the following code to search for Bluetooth LE devices around the Gear.

 

    bt_error_e ret;

	ret = bt_initialize();
	if (ret != BT_ERROR_NONE) {
		dlog_print(DLOG_ERROR, LOG_TAG, "[bt_initialize] failed.");

		return;
	}

	ret = bt_adapter_le_start_scan(scan_complete_cb, ad);
	if (ret != BT_ERROR_NONE) {
		dlog_print(DLOG_ERROR, LOG_TAG, "[bt_adapter_le_start_scan] failed.");
	} else {
		dlog_print(DLOG_INFO, LOG_TAG, "[bt_adapter_le_start_scan] registered");
	}

 

Gears S2 calls scan_complete_cb every time they search for the device normally, but when running the same app in Gears S3, scan_complete_cb is never called.

Is there any problems on my code? Or is there any reported issue with BLE scan in gear S3?

Responses

5 Replies
Mango Bar

Is it shows any error or it always goes to  "if (ret != BT_ERROR_NONE)" block and return ?

Did you add bluetooth privilege in manifest file?

June Heo

There is no errors on calling bt_initialize / bt_adapter_le_start_scan functions. And http://tizen.org/privilege/bluetooth privilege was correctly added on manifest file.

June Heo

I have found more weird things about this issue. While testing the code to connect to the GATT service while developing using Gear S2, Gear S2 can not call scan_complete_cb like previous on Gear S3. But from that moment on, Gear S3 started calling scan_complete_cb. normally.
Are these issues caused by something I've missed, such as initialization statements? Or is there something more to consider when more than one device in the same location tries a BLE scan?

June Heo

When I turn off Bluetooth on Gear's setttings page and turn it on again, both devices started working normally. Is there was anything to advise on these issues? What statement should be added to my code to avoid this situation?