int err = bt_adapter_le_get_scan_result_service_data_list(
info, BT_ADAPTER_LE_PACKET_ADVERTISING, &dataList, &count);
if (err == BT_ERROR_NO_DATA)
- return std::nullopt; // This is normal and often occuring situation
+ return std::nullopt; // This is normal and often occurring situation
if (err != BT_ERROR_NONE) {
TRY_LOG_ERROR("bt_adapter_le_get_scan_result_service_data_list() returned " << err);
return err;
// Allow running the callback and await the scan stop.
// Special care needs to be taken in the StopLEScan() function not to call g_main_loop_quit()
// before the g_main_loop_run() starts processing events. Otherwise the g_main_loop_run()
- // will be uninterrupted, indefinetely waiting for g_main_loop_quit() that already happened.
+ // will be uninterrupted, indefinitely waiting for g_main_loop_quit() that already happened.
g_main_loop_run(m_mainloop);
// Stop the scan
err = bt_adapter_le_stop_scan();
// g_main_context_invoke_full() cannot be used here, because we need to defer the callback
// to be run INSIDE g_main_loop_run() in StartLEScanAndAwaitStop(), otherwise
// g_main_loop_quit() will succeed, but the yet unstarted g_main_loop_run() will be left
- // uninterrupted indefinetely waiting for g_main_loop_quit() that already happened.
+ // uninterrupted indefinitely waiting for g_main_loop_quit() that already happened.
m_scanCancellationCallbackId = g_timeout_add_full(
G_PRIORITY_HIGH,
0,
nullptr);
// Allow the main thread to continue. This could cause a deadlock if some handler
// would wait for the mutex, blocking the main loop. The main loop does internal locking and
- // may not release the interal lock until the handler exits. This would make the above
+ // may not release the internal lock until the handler exits. This would make the above
// g_timeout_add_full() wait indefinitely creating a deadlock.
guard.unlock(); // may throw
return;
};
try {
err = m_bluetooth->StartLEAdvertScanAndAwaitStop(callback, &cryptoData); // may throw
- // If Cancel() occurrs here i.e. after the scan completes, it will be ignored.
+ // If Cancel() occurs here i.e. after the scan completes, it will be ignored.
// That is because we reinitialize bluetooth before starting the new scan.
guard.lock();
} catch (...) {