From 38bf567536d2a3f968dec661f914b4a0f9261eb8 Mon Sep 17 00:00:00 2001 From: Aleksander Morgado Date: Wed, 31 Aug 2016 18:33:25 +0200 Subject: ublox: longer timeout needed for AT probing When the device is reset, it needs some time before the newly exposed TTYs are able to reply to our AT commands. We increase the default timeout of the AT probing commands in order to cope with that, or we'll end up with TTYs of 'unknown' type that aren't used for anything. --- plugins/ublox/mm-plugin-ublox.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'plugins/ublox/mm-plugin-ublox.c') diff --git a/plugins/ublox/mm-plugin-ublox.c b/plugins/ublox/mm-plugin-ublox.c index 13d8df97..890f5207 100644 --- a/plugins/ublox/mm-plugin-ublox.c +++ b/plugins/ublox/mm-plugin-ublox.c @@ -28,6 +28,19 @@ G_DEFINE_TYPE (MMPluginUblox, mm_plugin_ublox, MM_TYPE_PLUGIN) MM_PLUGIN_DEFINE_MAJOR_VERSION MM_PLUGIN_DEFINE_MINOR_VERSION +/*****************************************************************************/ +/* Custom commands for AT probing */ + +/* Increase the response timeout for probe commands since the TOBY-L2 modem + * takes longer to respond after a reset. + */ +static const MMPortProbeAtCommand custom_at_probe[] = { + { "AT", 7, mm_port_probe_response_processor_is_at }, + { "AT", 7, mm_port_probe_response_processor_is_at }, + { "AT", 7, mm_port_probe_response_processor_is_at }, + { NULL } +}; + /*****************************************************************************/ static MMBaseModem * @@ -59,6 +72,7 @@ mm_plugin_create (void) MM_PLUGIN_ALLOWED_SUBSYSTEMS, subsystems, MM_PLUGIN_ALLOWED_VENDOR_IDS, vendor_ids, MM_PLUGIN_ALLOWED_AT, TRUE, + MM_PLUGIN_CUSTOM_AT_PROBE, custom_at_probe, NULL)); } -- cgit v1.2.3-70-g09d2