Re: New modem won't answer to AT commands

2021-09-23 Thread Martin Hundebøll
.07, Fabio Forni wrote: Hi Martin and thanks, On 23/09/21 11:18, Martin Hundebøll wrote: Can you share the AT logs up the point where it stops answering? It varies. I'll provide a couple of logs demonstrating this. Here ./test/enable-modem completed the execution but the AT+CPIN? request remain

Re: New modem won't answer to AT commands

2021-09-23 Thread Martin Hundebøll
Hi Fabio, Can you share the AT logs up the point where it stops answering? // Martin On 23/09/2021 09.49, Fabio Forni wrote: Hi oFono list, This is the first time I'm patching oFono so please excuse me for mistakes or misunderstandings. I am trying to add support for Quectel EG912Y. This

Re: Bug/Oversight in gatchat/gatresult.c with negative numbers

2021-08-09 Thread Martin Hundebøll
On Fri, Aug 06, 2021 at 10:02:18AM -0500, Denis Kenzior wrote: > > Yeah ok - what name do you suggest? > > So there's a few things you can do actually: > - We do have g_at_result_next_unquoted_string. You could try using that to > obtain the negative and then just sscanf/strtol or whatever to >

Re: [PATCH 2/2] quectel: Power on/off with a gpio pulse

2020-09-25 Thread Martin Hundebøll
Hi Lars, On 25/09/2020 10.11, Lars Poeschel wrote: On Fri, Sep 25, 2020 at 08:43:15AM +0200, Martin Hundebøll wrote: Hi Lars and Janez, On 24/09/2020 13.02, Martin Hundebøll wrote: Hi Lars, On 24/09/2020 12.38, poesc...@lemonage.de wrote: From: Lars Poeschel Current implementation uses

Re: [PATCH 2/2] quectel: Power on/off with a gpio pulse

2020-09-25 Thread Martin Hundebøll
Hi Lars and Janez, On 24/09/2020 13.02, Martin Hundebøll wrote: Hi Lars, On 24/09/2020 12.38, poesc...@lemonage.de wrote: From: Lars Poeschel Current implementation uses a gpio level of 1 for powering on quectel modems using a gpio and a level of 0 for powering off. We actually

Re: [PATCH 2/2] quectel: Power on/off with a gpio pulse

2020-09-24 Thread Martin Hundebøll
Hi Lars, On 24/09/2020 12.38, poesc...@lemonage.de wrote: From: Lars Poeschel Current implementation uses a gpio level of 1 for powering on quectel modems using a gpio and a level of 0 for powering off. We actually implemented this on the M95 by keeping the POWER pin always high, and then

Re: [RFC PATCH 4/4] plugins: gemalto: fix incomplete at-chat shutdown

2020-08-18 Thread Martin Hundebøll
Hi Denis and Sergey, On 17/08/2020 21.54, Denis Kenzior wrote: diff --git a/plugins/gemalto.c b/plugins/gemalto.c index 238c7cc4..321c8c1b 100644 --- a/plugins/gemalto.c +++ b/plugins/gemalto.c @@ -222,6 +222,8 @@ static void sim_state_cb(gboolean present, gpointer user_data)   struct

Re: [PATCH v2] udevng: Add support for Quectel BG96 modem

2020-07-10 Thread Martin Hundebøll
Hi Denis, Did this patch (and Sean's original one from november) never reach the mailing list? // Martin On 28/02/2020 12.07, Sean Nyekjaer wrote: --- Changes since v1: - Removed signoff plugins/udevng.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/udevng.c

Re: Expose MBPI api over d-bus

2020-03-02 Thread Martin Hundebøll
Hi, On 02/03/2020 14.49, nick83ola wrote: Hi all, In regarding to this I found the provision plugin and at line 53 it uses the mbpi lookup to provision for the default apns but at line 53 it does apns = mbpi_lookup_apn(mcc, mnc, FALSE, ); that gives an error in case of multiple providers. ->

Re: [PATCH] udevng: Add support for Quectel BG96 modem

2019-11-25 Thread Martin Hundebøll
Hi Sean, On 11/25/19 9:26 AM, Sean Nyekjaer wrote: Signed-off-by: Sean Nyekjaer No signoff when submitting to ofono. // Martin --- plugins/udevng.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/udevng.c b/plugins/udevng.c index 40ed2b02..cc294c94 100644 ---

Re: [PATCH] gatmux: don't free cmux data until watchers are destroyed

2019-10-08 Thread Martin Hundebøll
On 08/10/2019 06.06, Denis Kenzior wrote: On 10/7/19 1:37 PM, Martin Hundebøll wrote: Why not do something like: g_at_mux_ref(mux); for (i = 1; i <= MAX_CHANNELS && !mux->shutdown; i++) { int offset = i / 8;   

Re: [PATCHv2] gatmux: take reference to mux object while processing incoming data

2019-10-08 Thread Martin Hundebøll
Hi Denis, On 08/10/2019 06.08, Denis Kenzior wrote: @@ -646,13 +653,6 @@ void g_at_mux_unref(GAtMux *mux)   }   } -static void read_watcher_destroy_notify(gpointer user_data) -{ -    GAtMux *mux = user_data; - -    mux->read_watch = 0; -} -   gboolean g_at_mux_start(GAtMux *mux)   {  

[PATCHv3 2/2] gatmux: disable destroy notification on read watcher

2019-10-08 Thread Martin Hundebøll
With the reference in place in received_data(), the address sanitizer now encounters a use-after-free when the destroy notification is dispatched for the read watcher (see below). Fix this by remove the destroy notification callback, as it isn't really used except in the shutdown function.

[PATCHv3 1/2] gatmux: take reference to mux object while processing incoming data

2019-10-08 Thread Martin Hundebøll
When closing down a cmux object, the address sanitizer detects a use-after-free in gatmux.c (see below). Avoid this by taking a reference to the mux object during the processing in received_data(). ofonod[3640549]: ../git/plugins/quectel.c:cfun_disable() 0x61000b40 ofonod[3640549]:

[PATCHv3 2/2] quectel: support own cmux implementation over kernel line discipline

2019-10-07 Thread Martin Hundebøll
The in-kernel implementation of gsm0710 causes deadlocks in the kernel[1], so switch the default back to the user-space implementation in ofono. The change also removes the timeout-callback used to defer disabling the n_gsm line discipline, as that is no longer needed[2] To enable use of the

[PATCHv3 1/2] quectel: rework sim detection

2019-10-07 Thread Martin Hundebøll
Use at_util_sim_state_query_new() to query the sim inserted state. Once that returns, the locked state is queried by issuing a AT+CPIN? command. If not locked, a timer is started to query the quectel init status of the sim. Once the init status is ready, the sim atom is created, and the modem is

Re: [PATCH] gatmux: don't free cmux data until watchers are destroyed

2019-10-07 Thread Martin Hundebøll
On 30/09/2019 22.59, Denis Kenzior wrote: Hi Martin, @@ -227,12 +227,15 @@ static void dispatch_sources(GAtMuxChannel *channel, GIOCondition condition)   static gboolean received_data(GIOChannel *channel, GIOCondition cond,   gpointer data)   { -    GAtMux *mux =

[PATCHv2] gatmux: take reference to mux object while processing incoming data

2019-10-07 Thread Martin Hundebøll
When closing down a cmux object, the address sanitizer detects a use-after-free in gatmux.c (see below). Avoid this by taking a reference to the mux object during the processing in received_data(). ofonod[3640549]: ../git/plugins/quectel.c:cfun_disable() 0x61000b40 ofonod[3640549]:

Re: [PATCH] gatmux: don't free cmux data until watchers are destroyed

2019-10-07 Thread Martin Hundebøll
On 07/10/2019 20.37, Martin Hundebøll wrote: Why not do something like: g_at_mux_ref(mux); for (i = 1; i <= MAX_CHANNELS && !mux->shutdown; i++) { int offset = i / 8; i

Re: [PATCH] gatmux: don't free cmux data until watchers are destroyed

2019-10-07 Thread Martin Hundebøll
Hi Denis, On 30/09/2019 22.59, Denis Kenzior wrote: @@ -227,12 +227,15 @@ static void dispatch_sources(GAtMuxChannel *channel, GIOCondition condition)   static gboolean received_data(GIOChannel *channel, GIOCondition cond,   gpointer data)   { -    GAtMux *mux =

Re: [PATCH 3/4] quectel: rework sim detection

2019-09-30 Thread Martin Hundebøll
Hi Denis, On 27/09/2019 00.10, Denis Kenzior wrote: On 9/26/19 2:27 PM, Martin Hundebøll wrote: Simplify sim handling by querying cpin state directly from quectel_pre_sim(). Don't initiate commands from pre_sim/post_sim/post_online callbacks please.  There's almost never a reason to. Ok

Re: [PATCH 4/4] quectel: use own cmux implementation over kernel line discipline

2019-09-30 Thread Martin Hundebøll
Hi Denis, On 30/09/2019 21.55, Denis Kenzior wrote: Hi Martin, So I wonder whether instead of fully reverting back to CMUX (only to put in n_gsm in later) you might want to just keep both around and use a /etc/quectel.conf or OFONO_QUECTEL_MUX=n_gsm|internal instead? I'd prefer a single

[PATCHv2 1/2] quectel: rework sim detection

2019-09-30 Thread Martin Hundebøll
Use at_util_sim_state_query_new() to query the sim inserted state. Once that returns, the locked state is queried by issuing a AT+CPIN? command. If not locked, a timer is started to query the quectel init status of the sim. Once the init status is ready, the sim atom is created, and the modem is

[PATCHv2 2/2] quectel: use own cmux implementation over kernel line discipline

2019-09-30 Thread Martin Hundebøll
The in-kernel implementation of gsm0710 causes deadlocks in the kernel[1], so switch back to the user-space implementation in ofono. [1] https://lore.kernel.org/lkml/4b2455c0-25ba-0187-6df6-c63b4ccc6...@geanix.com/ --- Changes since v1: * none plugins/quectel.c | 253

Re: [PATCH 4/4] quectel: use own cmux implementation over kernel line discipline

2019-09-30 Thread Martin Hundebøll
Hi Denis, On 27/09/2019 03.00, Denis Kenzior wrote: On 9/26/19 2:27 PM, Martin Hundebøll wrote: The in-kernel implementation of gsm0710 causes deadlocks in the kernel[1], so switch back to the user-space implementation in ofono. [1] https://lore.kernel.org/lkml/4b2455c0-25ba-0187-6df6

Re: [PATCH] gatmux: don't free cmux data until watchers are destroyed

2019-09-30 Thread Martin Hundebøll
Uh, Forgot to change the subject. Feel free to use: gatmux: take reference to mux object in received_data() // Martin On 30/09/2019 19.35, Martin Hundebøll wrote: When closing down a cmux object, the address sanitizer detects a use-after-free in gatmux.c (see below). Avoid

[PATCH] gatmux: don't free cmux data until watchers are destroyed

2019-09-30 Thread Martin Hundebøll
When closing down a cmux object, the address sanitizer detects a use-after-free in gatmux.c (see below). Avoid this by taking a reference to the mux object during the processing in received_data(). ofonod[3640549]: ../git/plugins/quectel.c:cfun_disable() 0x61000b40 ofonod[3640549]:

[RFC] gatmux: don't free cmux data until watchers are destroyed

2019-09-26 Thread Martin Hundebøll
When closing down a cmux object, the address sanitizer detects a use-after-free in gatmux.c (see below). It is caused by glib sources not being entirely removed in g_at_mux_shutdown(), an so their callbacks can be called with a freed mux object. Avoid this by deferring the free of the mux object

[PATCH] gprs: free interface name in gprs_context_remove()

2019-09-26 Thread Martin Hundebøll
--- src/gprs.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gprs.c b/src/gprs.c index 8df983a9..a8702958 100644 --- a/src/gprs.c +++ b/src/gprs.c @@ -2794,6 +2794,7 @@ static void gprs_context_remove(struct ofono_atom *atom) if (gc->driver && gc->driver->remove)

[PATCH 1/4] atmodem: sim: remove quectel serial vendor quirk

2019-09-26 Thread Martin Hundebøll
The sim inserted/initialized state is handled properly in the quectel plugin now, so remove the "auto-initialized" quirk from the atmodem sim driver. --- drivers/atmodem/sim.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/atmodem/sim.c b/drivers/atmodem/sim.c index dd42cac4..e750a139

[PATCH 4/4] quectel: use own cmux implementation over kernel line discipline

2019-09-26 Thread Martin Hundebøll
The in-kernel implementation of gsm0710 causes deadlocks in the kernel[1], so switch back to the user-space implementation in ofono. [1] https://lore.kernel.org/lkml/4b2455c0-25ba-0187-6df6-c63b4ccc6...@geanix.com/ --- plugins/quectel.c | 250 -- 1

[PATCH 2/4] quectel: remove leftover reset of wakeup command

2019-09-26 Thread Martin Hundebøll
--- plugins/quectel.c | 1 - 1 file changed, 1 deletion(-) diff --git a/plugins/quectel.c b/plugins/quectel.c index 1d21d6dd..a0e435b5 100644 --- a/plugins/quectel.c +++ b/plugins/quectel.c @@ -968,7 +968,6 @@ static void ate_cb(int ok, GAtResult *result, void *user_data) DBG("%p",

[PATCH 3/4] quectel: rework sim detection

2019-09-26 Thread Martin Hundebøll
Simplify sim handling by querying cpin state directly from quectel_pre_sim(). The query is conducted by issuing a AT+CPIN?, where only CME errors are catched by the command response handler. The +CPIN: response is instead catched by a listener. The CME handler allows proper handling of the

Re: [PATCHv3] quectel: handle sim states

2019-09-26 Thread Martin Hundebøll
Hi Denis, On 24/09/2019 22.40, Denis Kenzior wrote: I tried implementing what you suggest - see the attached patch. But I still get "SMS not supported by this modem.". The attached log shows quectel_post_sim() being called (line 584) way before QINISTAT returns 3 (line 686). Is this

Re: [PATCH v2 1/1] ublox: rework device initialization sequence

2019-09-25 Thread Martin Hundebøll
Hi Jonas, On 9/25/19 5:44 AM, Jonas Bonn wrote: On 24/09/2019 21:20, Martin Hundebøll wrote: On 24/09/2019 20.09, Martin Hundebøll wrote: On 24/09/2019 19.23, Denis Kenzior wrote: Furthermore, there's not an AT command sent every 500 ms.  The command gets requeued after 500ms, but it doesn't

Re: [PATCHv3] quectel: handle sim states

2019-09-24 Thread Martin Hundebøll
Hi Denis, On 24/09/2019 22.44, Martin Hundebøll wrote: Hi Denis, On 24/09/2019 04.50, Denis Kenzior wrote: I've tried to work-around quectel_post_sim() being called after the PIN is entered, but before I call ofono_sim_initialized_notify(): ../git/drivers/atmodem/sim.c:at_crsm_read_cb

Re: [PATCHv3] quectel: handle sim states

2019-09-24 Thread Martin Hundebøll
Hi Denis, On 24/09/2019 04.50, Denis Kenzior wrote: I've tried to work-around quectel_post_sim() being called after the PIN is entered, but before I call ofono_sim_initialized_notify(): ../git/drivers/atmodem/sim.c:at_crsm_read_cb() crsm_read_cb: 90, 00, 1

Re: [PATCH v2 1/1] ublox: rework device initialization sequence

2019-09-24 Thread Martin Hundebøll
Hi, On 24/09/2019 20.09, Martin Hundebøll wrote: On 24/09/2019 19.23, Denis Kenzior wrote: Furthermore, there's not an AT command sent every 500 ms.  The command gets requeued after 500ms, but it doesn't actually go out until the modem responds to the first one... not quite sure why

Re: [PATCH v2 1/1] ublox: rework device initialization sequence

2019-09-24 Thread Martin Hundebøll
Hi, On 24/09/2019 19.23, Denis Kenzior wrote: Furthermore, there's not an AT command sent every 500 ms.  The command gets requeued after 500ms, but it doesn't actually go out until the modem responds to the first one... not quite sure why this works, to be honest. Funny.  But not real

Re: [PATCHv3] quectel: handle sim states

2019-09-23 Thread Martin Hundebøll
Hi Denis, On 10/09/2019 16.10, Denis Kenzior wrote: Hi Martin, On 9/5/19 5:33 AM, Martin Hundebøll wrote: The quectel M95 and MC60 modems are picky about when the sim is properly initialized, so the logic to detect this needs to be in the quectel plugin. After doing basic initialization

Re: [RFC] gatchat: implement timeout setting for commands

2019-09-05 Thread Martin Hundebøll
Hi Denis, On 02/09/2019 23.25, Denis Kenzior wrote: Hi Martin, On 9/2/19 4:10 PM, Martin Hundebøll wrote: The adds a function to the set a chat-wide timeout for at commands. It allows plugins to handle cases where the modem fails to respond with either an OK or an error. Okay, this is sort

[PATCHv2] gatchat: implement timeout setting for commands

2019-09-05 Thread Martin Hundebøll
The adds a function to the set a chat-wide timeout for at commands. It allows plugins to handle cases where the modem fails to respond with either an OK or an error. Without these timeouts, the plugin is never notified about a hanging command, and it has no way to detect it; effectively leaving

[PATCHv3] quectel: handle sim states

2019-09-05 Thread Martin Hundebøll
The quectel M95 and MC60 modems are picky about when the sim is properly initialized, so the logic to detect this needs to be in the quectel plugin. After doing basic initialization, a CPIN query is issued to detect sim state. If the sim is unlocked and ready, a timer is created to wait for the

[PATCH] atmodem: sms: don't request URC buffering for Quectel UC15 modems

2019-09-05 Thread Martin Hundebøll
Add a vendor quirk to avoid an error being returned when setting up sms notification for Quectel UC15 modems. --- drivers/atmodem/sms.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/atmodem/sms.c b/drivers/atmodem/sms.c index 442cfc58..d502da72 100644 --- a/drivers/atmodem/sms.c +++

Re: [PATCHv2] quectel: swap cmuxed ports

2019-09-02 Thread Martin Hundebøll
On 02/09/2019 23.17, Martin Hundebøll wrote: According to the manual, when using CMUX on the UC15, it outputs unsolicited indications on port 2 (i.e. /dev/gsmtty2), so the quectel plugin must use this when registering for such. Sorry, this should have been a separate patch instead of a v2

[PATCHv2] quectel: swap cmuxed ports

2019-09-02 Thread Martin Hundebøll
According to the manual, when using CMUX on the UC15, it outputs unsolicited indications on port 2 (i.e. /dev/gsmtty2), so the quectel plugin must use this when registering for such. --- plugins/quectel.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/quectel.c

[PATCHv2] quectel: handle sim states

2019-09-02 Thread Martin Hundebøll
The quectel M95 and MC60 modems are picky about when the sim is properly initialized, so the logic to detect this needs to be in the quectel plugin. After doing basic initialization, a CPIN query is issued to detect sim state. If the sim is unlocked and ready, a timer is created to wait for the

[RFC] gatchat: implement timeout setting for commands

2019-09-02 Thread Martin Hundebøll
The adds a function to the set a chat-wide timeout for at commands. It allows plugins to handle cases where the modem fails to respond with either an OK or an error. Without these timeouts, the plugin is never notified about a hanging command, and it has no way to detect it; effectively leaving

Re: Handle broken AT command process

2019-08-19 Thread Martin Hundebøll
Hi Denis, On 19/08/2019 21.55, Denis Kenzior wrote: Hi Martin, On 8/19/19 2:29 PM, Martin Hundebøll wrote: Does ofono have a way to handle lacking OK/error messages? I seems like my modem (Quectel M95) is buggy when it comes to unsolicited indications and (as far as I have seen) SIM commands

Handle broken AT command process

2019-08-19 Thread Martin Hundebøll
Hi, Does ofono have a way to handle lacking OK/error messages? I seems like my modem (Quectel M95) is buggy when it comes to unsolicited indications and (as far as I have seen) SIM commands: > AT+CRSM=178,28614,3,4,8 < +CRSM: 144,0,"" < OK > AT+CRSM=178,28614,4,4,8 <

[PATCH 1/2] doc: convert quectel power event reasons to lower case

2019-08-13 Thread Martin Hundebøll
--- doc/quectel-hardware-api.txt | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/doc/quectel-hardware-api.txt b/doc/quectel-hardware-api.txt index 139a0dc1..c2433282 100644 --- a/doc/quectel-hardware-api.txt +++ b/doc/quectel-hardware-api.txt @@ -16,9 +16,9 @@

[PATCH 2/2] quectel: replace g_at_chat_set_wakeup_command() with g_at_chat_retry()

2019-08-12 Thread Martin Hundebøll
If the modem isn't powered on, the use of g_at_chat_set_wakeup_command() makes ofono send out AT strings in an endless loop. Avoid this by using g_at_chat_retry() in a timer instead. --- plugins/quectel.c | 64 +++ 1 file changed, 53 insertions(+), 11

[PATCH 1/2] gatchat: add g_at_chat_retry()

2019-08-12 Thread Martin Hundebøll
The current API doesn't support canceling an in-progress command; instead g_at_chat_cancel() simply removes the callback. In cases where the modem doesn't respond at all to a command, a chat is simply stalled without any way to write new commands to the modem. Support that case by adding a

[PATCHv3 3/4] quectel: implement dbus signals for modem power notifications

2019-07-19 Thread Martin Hundebøll
The Quectel modems issues unsolicited strings in case of power related events. The UC15 uses +QIND: for the events, while M95 and MC60 uses descriptive strings. (UC15 also uses a string for normal power down). Register listeners for these strings/codes. The handler emits an appropriate dbus

[PATCHv3 2/4] doc: add documentaion for Quectel hardware API

2019-07-19 Thread Martin Hundebøll
--- Changes since v2: * none Changes since v1: * new patch split out from PATCHv1 6/7 * added documentation of charge status and level doc/quectel-hardware-api.txt | 33 + 1 file changed, 33 insertions(+) create mode 100644 doc/quectel-hardware-api.txt diff

[PATCHv3 1/4] quectel: add dbus hardware interface

2019-07-19 Thread Martin Hundebøll
For now the interface only exposes the modem supply voltage, but is added as a preparation for signaling power events. --- Changes since v2: * updated commit message Changes since v1: * use and export int32_t for all three properties * place dbus functions below close_serial() * remove doc/

[PATCHv3 4/4] doc: document power-event signals for quectel Hardware API

2019-07-19 Thread Martin Hundebøll
--- Changes since v2: * Use Voltage{High,Low} instead of {High,Low}Power Changes since v1: * new patch split out from PATCHv1 7/7 doc/quectel-hardware-api.txt | 19 +++ 1 file changed, 19 insertions(+) diff --git a/doc/quectel-hardware-api.txt b/doc/quectel-hardware-api.txt

Re: [PATCHv2 4/4] doc: document power-event signals for quectel Hardware API

2019-07-19 Thread Martin Hundebøll
Hi Pavel, On 19/07/2019 13.04, Pavel Machek wrote: On Fri 2019-07-19 12:19:14, Martin Hundebøll wrote: --- Changes since v1: * new patch split out from PATCHv1 7/7 doc/quectel-hardware-api.txt | 19 +++ 1 file changed, 19 insertions(+) diff --git a/doc/quectel-hardware

[PATCH 2/2] quectel: pass vendor id to gprs and gprs-context

2019-07-19 Thread Martin Hundebøll
The gprs-context does special casing on the quectel serial modem when probing the supported layer 2 protocols, so pass the vendor id when setting up the atoms. --- plugins/quectel.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/plugins/quectel.c b/plugins/quectel.c

[PATCH 1/2] atmodem: gprs-context: parse list-less CGDATA response

2019-07-19 Thread Martin Hundebøll
The Quectel M95 and MC60 modems respond to AT+CGDATA=? with a single +CGDATA="PPP", but the callback in gprs-context expects a list of protocols. Avoid falling back to the old-style ATD*99 by not expecting a list of protocols for serial quectel modems. --- drivers/atmodem/gprs-context.c | 8

Re: [PATCHv2 1/4] quectel: add dbus hardware interface

2019-07-19 Thread Martin Hundebøll
On 19/07/2019 12.19, Martin Hundebøll wrote: For now the interface only exposes the modem supply voltage, but is added as a preparation for signaling power events. This is obviously not true, since the API also exposes charge status and level on the UC15 modem. Feel free to update the text

[PATCHv2 2/4] doc: add documentaion for Quectel hardware API

2019-07-19 Thread Martin Hundebøll
--- Changes since v1: * new patch split out from PATCHv1 6/7 * added documentation of charge status and level doc/quectel-hardware-api.txt | 33 + 1 file changed, 33 insertions(+) create mode 100644 doc/quectel-hardware-api.txt diff --git

[PATCHv2 1/4] quectel: add dbus hardware interface

2019-07-19 Thread Martin Hundebøll
For now the interface only exposes the modem supply voltage, but is added as a preparation for signaling power events. --- Changes since v1: * use and export int32_t for all three properties * place dbus functions below close_serial() * remove doc/ changes * update comments for charge status

[PATCHv2 4/4] doc: document power-event signals for quectel Hardware API

2019-07-19 Thread Martin Hundebøll
--- Changes since v1: * new patch split out from PATCHv1 7/7 doc/quectel-hardware-api.txt | 19 +++ 1 file changed, 19 insertions(+) diff --git a/doc/quectel-hardware-api.txt b/doc/quectel-hardware-api.txt index 6aafbfd8..411afcd1 100644 --- a/doc/quectel-hardware-api.txt +++

[PATCHv2 3/4] quectel: implement dbus signals for modem power notifications

2019-07-19 Thread Martin Hundebøll
The Quectel modems issues unsolicited strings in case of power related events. The UC15 uses +QIND: for the events, while M95 and MC60 uses descriptive strings. (UC15 also uses a string for normal power down). Register listeners for these strings/codes. The handler emits an appropriate dbus

[PATCHv2] test: process-context-settings: add argument for default connection

2019-07-19 Thread Martin Hundebøll
Add an optional argument to specify an interface to as default connection for the system. This changes the constructed commands so that the gateway is configured as default route, and nameservers are written to resolv.conf. --- I decided to drop the print-instead-execute approach, and simply add

Re: [PATCH 1/4] test: process-context-settings: use ip instead of ifconfig/route

2019-07-18 Thread Martin Hundebøll
On 18/07/2019 18.38, Pavel Machek wrote: On Thu 2019-07-18 13:49:34, Martin Hundebøll wrote: --- test/process-context-settings | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/process-context-settings b/test/process-context-settings index 1d30b30d..a536a771

[PATCH 1/4] test: process-context-settings: use ip instead of ifconfig/route

2019-07-18 Thread Martin Hundebøll
--- test/process-context-settings | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/process-context-settings b/test/process-context-settings index 1d30b30d..a536a771 100755 --- a/test/process-context-settings +++ b/test/process-context-settings @@ -41,14 +41,14 @@ for

[PATCH 4/4] test: process-context-settings: add argument for default connection

2019-07-18 Thread Martin Hundebøll
Add an optional argument to specify an interface to as default connection for the system. This changes the printet commands so that the gateway is configured as default route, and nameservers are written to resolv.conf. Output without a default interface: root@iwg26:/usr/lib/ofono/test#

[PATCH 3/4] test: process-context-settings: print commands instead of running them

2019-07-18 Thread Martin Hundebøll
Collect the setup commands and print them to stdout at the end of the script. This allows users to evaluate the standard output to apply settings. --- test/process-context-settings | 12 +--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/test/process-context-settings

[PATCH 2/4] test: process-context-settings: print settings to stderr

2019-07-18 Thread Martin Hundebøll
Prepare the test to print commands to execute and let the caller evaluate those. In that way, more commands can be added to also set up name servers and default routes without secretly breaking the existing system network setup. --- test/process-context-settings | 20 +--- 1 file

[PATCH 1/7] gatresult: strip trailing spaces from unquoted strings

2019-07-16 Thread Martin Hundebøll
Some vendors might print trailing spaces after unsolicited result codes. Avoid duplicating and stripping the string after calling g_at_result_iter_next_unquoted_string() by stripping the spaces in gatresult instead. --- gatchat/gatresult.c | 8 +++- 1 file changed, 7 insertions(+), 1

[PATCH 7/7] quectel: implement dbus signals for modem power notifications

2019-07-16 Thread Martin Hundebøll
The Quectel modems issues unsolicited strings in case of power related events. The UC15 uses +QIND: for the events, while M95 and MC60 uses descriptive strings. (UC15 also uses a string for normal power down). Register listeners for these strings/codes. The handler emits an appropriate dbus

[PATCH 5/7] quectel: add support for the Quectel MC60 modem

2019-07-16 Thread Martin Hundebøll
The modem is AT-compatible with the Quectel M95 modem, but also features a GNSS module. --- plugins/quectel.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/plugins/quectel.c b/plugins/quectel.c index e84e3cf1..9cac92fa 100644 --- a/plugins/quectel.c +++

[PATCH 2/7] atmodem: rename OFONO_VENDOR_QUECTEL_M95 to OFONO_VENDOR_QUECTEL_SERIAL

2019-07-16 Thread Martin Hundebøll
Other serial connected modems (i.e the MC60 model) from is AT-compatible with the M95 model, so rename the M95 vendor id to be common for both. --- drivers/atmodem/sim.c| 4 ++-- drivers/atmodem/sms.c| 4 ++-- drivers/atmodem/vendor.h | 2 +- plugins/quectel.c| 2 +- 4 files

[PATCH 3/7] quectel: enable call volume settings

2019-07-16 Thread Martin Hundebøll
--- plugins/quectel.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/quectel.c b/plugins/quectel.c index f2b765b6..61b82744 100644 --- a/plugins/quectel.c +++ b/plugins/quectel.c @@ -45,6 +45,7 @@ #include #include #include +#include #include #include #include @@

[PATCH 4/7] quectel: store model id in private data

2019-07-16 Thread Martin Hundebøll
Some Quectel models supports different features such has GNSS or different URC strings. Add a field in the quectel data structure to be used when adding support for said features. --- plugins/quectel.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/plugins/quectel.c

[PATCH 6/7] quectel: add dbus hardware interface

2019-07-16 Thread Martin Hundebøll
For now the interface only exposes the modem supply voltage, but is added as a preparation for signaling power events. --- doc/quectel-hardware-api.txt | 15 plugins/quectel.c| 154 +++ 2 files changed, 169 insertions(+) create mode 100644

Re: [PATCHv3 0/9] Quectel M95 support

2019-07-10 Thread Martin Hundebøll
ofono_modem_set_powered(modem, false), but what about the warnings? Should I just add a hardware monitor dbus interface like the gemalto/cinterion drivers do, with a signal for the warnings? Thanks, Martin On 10/07/2019 23.51, Martin Hundebøll wrote: Changes since v1/v2: * remove c types patch

[PATCHv3 1/9] atmodem: sms: add quectel m95 quirks

2019-07-10 Thread Martin Hundebøll
CNMA isn't mentioned in the m95 documentation, but trial'n'error has revealed some details: * the CSMS query returns the list (0,128) instead of a range * CNMA is enabled by setting 128 as CSMS service * once enabled, SMS deliveries are acked by sending AT+CNMA without a value setting Add

[PATCHv3 3/9] quectel: unwrap call to at_util_open_device()

2019-07-10 Thread Martin Hundebøll
--- plugins/quectel.c | 12 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/plugins/quectel.c b/plugins/quectel.c index e1a5ffa4..faad16cc 100644 --- a/plugins/quectel.c +++ b/plugins/quectel.c @@ -91,12 +91,6 @@ static void quectel_remove(struct ofono_modem *modem)

[PATCHv3 4/9] quectel: replace glib uses with ell

2019-07-10 Thread Martin Hundebøll
--- Changes since v1: * don't use l_free in plugin callback plugins/quectel.c | 8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/plugins/quectel.c b/plugins/quectel.c index faad16cc..6e93f45a 100644 --- a/plugins/quectel.c +++ b/plugins/quectel.c @@ -26,7 +26,7 @@

[PATCHv3 2/9] quectel: always print modem pointer in debug messages

2019-07-10 Thread Martin Hundebøll
--- plugins/quectel.c | 12 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/plugins/quectel.c b/plugins/quectel.c index 37969097..e1a5ffa4 100644 --- a/plugins/quectel.c +++ b/plugins/quectel.c @@ -127,7 +127,7 @@ static void cpin_notify(GAtResult *result, gpointer

[PATCHv3 9/9] quectel: initialize call, phonebook and sms when ready

2019-07-10 Thread Martin Hundebøll
The Quectel M95 modem issues a "Call ready" notification when call and phonebook are ready, so set up a listener for that. The only way to know when sms is ready is to issue QINITSTAT queries. Since sms is always ready after call and phonebook, the queries are initiated after creating

[PATCHv3 7/9] quectel: configure flow control when enabled

2019-07-10 Thread Martin Hundebøll
--- plugins/quectel.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/plugins/quectel.c b/plugins/quectel.c index 3f9c93f8..bfae31c0 100644 --- a/plugins/quectel.c +++ b/plugins/quectel.c @@ -495,7 +495,13 @@ static int open_serial(struct ofono_modem *modem) *

[PATCHv3 8/9] quectel: query device model to enable vendor quirks

2019-07-10 Thread Martin Hundebøll
--- plugins/quectel.c | 37 ++--- 1 file changed, 34 insertions(+), 3 deletions(-) diff --git a/plugins/quectel.c b/plugins/quectel.c index bfae31c0..8bf9a963 100644 --- a/plugins/quectel.c +++ b/plugins/quectel.c @@ -51,6 +51,7 @@ static const char

[PATCHv3 6/9] quectel: support gpio to power on/off the modem

2019-07-10 Thread Martin Hundebøll
This adds support for configuring a gpio in udev to control the modem power. To enable gpio control, specify OFONO_QUECTEL_GPIO_CHIP and OFONO_QUECTEL_GPIO_OFFSET in the udev environment, for example: KERNEL=="ttymxc0", ENV{OFONO_DRIVER}="quectel", \

[PATCHv3 5/9] quectel: add basic support for serial connected modems

2019-07-10 Thread Martin Hundebøll
Setup GSM 07.10 multiplexing using the kernel n_gsm line discpline driver, and use the virtual tty devices as Aux and Modem channels. The driver supports rts/cts on the underlying serial device. This is enabled with OFONO_QUECTED_RTSCTS udev environment, e.g.: KERNEL=="ttymxc0",

[PATCHv3 0/9] Quectel M95 support

2019-07-10 Thread Martin Hundebøll
Changes since v1/v2: * remove c types patch * add patch with m95 sms quirks * add patch to query device model * add patch to create voicecall, phonebook, and sms functionality * add patch to enable flow control on modem if configured Martin Hundebøll (9): atmodem: sms: add quectel m95

Re: [PATCH 09/10] quectel: add basic support for serial connected modems

2019-07-09 Thread Martin Hundebøll
Hi Denis, On 08/07/2019 18.12, Denis Kenzior wrote: However, there is still the fundamental issue of not being able to correlate the created ttys to the original one...  If we can fix that in the kernel, then a strong argument can be made to drop GAtMux entirely. Which is actually what I

[PATCHv2 08/10] quectel: fix initial channel/device configuration

2019-07-04 Thread Martin Hundebøll
The three-commands-in-one-go results in error on some quectel devices (e.g. m95). Add semicolons between the commands to fix it. --- plugins/quectel.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/quectel.c b/plugins/quectel.c index 3c6b9d9f..7e3c4e4a 100644

[PATCHv2 10/10] quectel: support gpio to power on/off the modem

2019-07-04 Thread Martin Hundebøll
This adds support for configuring a gpio in udev to control the modem power. To enable gpio control, specify OFONO_QUECTEL_GPIO_CHIP and OFONO_QUECTEL_GPIO_OFFSET in the udev environment, for example: KERNEL=="ttymxc0", ENV{OFONO_DRIVER}="quectel", \

[PATCH 09/10] quectel: add basic support for serial connected modems

2019-07-03 Thread Martin Hundebøll
Setup GSM 07.10 multiplexing using the kernel n_gsm line discpline driver, and use the virtual tty devices as Aux and Modem channels. The driver supports rts/cts on the underlying serial device. This is enabled with OFONO_QUECTED_RTSCTS udev environment, e.g.: KERNEL=="ttymxc0",

[PATCH 08/10] quectel: split up initial channel/device configuration

2019-07-03 Thread Martin Hundebøll
The three-commands-in-one-go results in error on some quectel devices (e.g. m95), so do the commands in three separate calls to g_at_chat_send() instead. --- plugins/quectel.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/plugins/quectel.c b/plugins/quectel.c index

[PATCH 07/10] quectel: replace glib uses with ell

2019-07-03 Thread Martin Hundebøll
--- plugins/quectel.c | 10 -- 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/plugins/quectel.c b/plugins/quectel.c index 83197991..3c6b9d9f 100644 --- a/plugins/quectel.c +++ b/plugins/quectel.c @@ -27,7 +27,7 @@ #include #include -#include +#include #include

[PATCH 10/10] quectel: support gpio to power on/off the modem

2019-07-03 Thread Martin Hundebøll
This adds support for configuring a gpio in udev to control the modem power. To enable gpio control, specify OFONO_QUECTEL_GPIO_CHIP and OFONO_QUECTEL_GPIO_OFFSET in the udev environment, for example: KERNEL=="ttymxc0", ENV{OFONO_DRIVER}="quectel", \

[PATCH 03/10] quectel: improve coding style

2019-07-03 Thread Martin Hundebøll
--- plugins/quectel.c | 31 +++ 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/plugins/quectel.c b/plugins/quectel.c index 6ab97027..f99b1ff8 100644 --- a/plugins/quectel.c +++ b/plugins/quectel.c @@ -91,8 +91,8 @@ static void quectel_remove(struct

[PATCH 06/10] quectel: unwrap call to at_util_open_device()

2019-07-03 Thread Martin Hundebøll
--- plugins/quectel.c | 12 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/plugins/quectel.c b/plugins/quectel.c index 3b57e06d..83197991 100644 --- a/plugins/quectel.c +++ b/plugins/quectel.c @@ -92,12 +92,6 @@ static void quectel_remove(struct ofono_modem *modem)

[PATCH 00/10] quectel serial support

2019-07-03 Thread Martin Hundebøll
support in ell. The cleanups are mostly done to obey my OCD wrt. coding style. Expect to see further patches adding tweaks as I get around to test pin unlocking, sms texting, calls, etc. [1] https://lists.01.org/pipermail/ofono/2018-August/018293.html Martin Hundebøll (10): gatresult: include

[PATCH 01/10] gatresult: include glib header

2019-07-03 Thread Martin Hundebøll
The gatresult data types embeds GSList members, and the function prototypes uses glib types. Add include of glib.h to allow use of gatresult.h without also including glib.h --- gatchat/gatresult.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gatchat/gatresult.h b/gatchat/gatresult.h

  1   2   >