* [PATCH BlueZ] adapter: Fix discovery trigger for 0 second delay
@ 2021-03-12 10:52 Frédéric Danis
2021-03-12 11:09 ` [BlueZ] " bluez.test.bot
0 siblings, 1 reply; 2+ messages in thread
From: Frédéric Danis @ 2021-03-12 10:52 UTC (permalink / raw)
To: linux-bluetooth
When calling `StartDiscovery` the effective start can take around 10 ms or
up to 700 ms.
g_timeout_add_seconds() call doesn't ensure the time for the first call of
the timer if the delay is less or equal to 1 second.
---
src/adapter.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/src/adapter.c b/src/adapter.c
index cc0849f99..daa4c18b7 100644
--- a/src/adapter.c
+++ b/src/adapter.c
@@ -1797,6 +1797,12 @@ static void trigger_start_discovery(struct btd_adapter *adapter, guint delay)
if (!btd_adapter_get_powered(adapter))
return;
+ if (!delay) {
+ adapter->discovery_idle_timeout = g_idle_add(start_discovery_timeout,
+ adapter);
+ return;
+ }
+
adapter->discovery_idle_timeout = g_timeout_add_seconds(delay,
start_discovery_timeout, adapter);
}
--
2.18.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* RE: [BlueZ] adapter: Fix discovery trigger for 0 second delay
2021-03-12 10:52 [PATCH BlueZ] adapter: Fix discovery trigger for 0 second delay Frédéric Danis
@ 2021-03-12 11:09 ` bluez.test.bot
0 siblings, 0 replies; 2+ messages in thread
From: bluez.test.bot @ 2021-03-12 11:09 UTC (permalink / raw)
To: linux-bluetooth, frederic.danis
[-- Attachment #1: Type: text/plain, Size: 1341 bytes --]
This is automated email and please do not reply to this email!
Dear submitter,
Thank you for submitting the patches to the linux bluetooth mailing list.
This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=446939
---Test result---
##############################
Test: CheckPatch - FAIL
Output:
adapter: Fix discovery trigger for 0 second delay
WARNING:LONG_LINE: line length of 85 exceeds 80 columns
#20: FILE: src/adapter.c:1801:
+ adapter->discovery_idle_timeout = g_idle_add(start_discovery_timeout,
- total: 0 errors, 1 warnings, 12 lines checked
NOTE: For some of the reported defects, checkpatch may be able to
mechanically convert to the typical style using --fix or --fix-inplace.
"[PATCH] adapter: Fix discovery trigger for 0 second delay" has style problems, please review.
NOTE: Ignored message types: COMMIT_MESSAGE COMPLEX_MACRO CONST_STRUCT FILE_PATH_CHANGES MISSING_SIGN_OFF PREFER_PACKED SPLIT_STRING SSCANF_TO_KSTRTO
NOTE: If any of the errors are false positives, please report
them to the maintainer, see CHECKPATCH in MAINTAINERS.
##############################
Test: CheckGitLint - PASS
##############################
Test: CheckBuild - PASS
##############################
Test: MakeCheck - PASS
---
Regards,
Linux Bluetooth
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-03-12 11:09 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-03-12 10:52 [PATCH BlueZ] adapter: Fix discovery trigger for 0 second delay Frédéric Danis
2021-03-12 11:09 ` [BlueZ] " bluez.test.bot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).