Age | Commit message (Collapse) | Author |
|
This will make it slightly easier to port mm_port_serial_at_command() to
use GTask, since we won't have to keep a pointer to the result in GTask
after _finish() has been called.
In most cases the caller needs the value anyway, so this doesn't add too
much hasle.
|
|
GCC 13 is unhappy to cast a MMLogLevel to a guint32:
[188/539] Compiling C object src/plugins/test-shared-icera.p/icera_tests_test-modem-helpers-icera.c.o
In file included from ../src/plugins/icera/tests/test-modem-helpers-icera.c:27:
../src/mm-log-test.h:25:1: warning: conflicting types for ‘_mm_log’ due to enum/integer mismatch; have ‘void(void *, const gchar *, const gchar *, const gchar *, guint32, const gchar *, ...)’ {aka ‘void(void *, const char *, const char *, const char *, unsigned int, const char *, ...)’} [-Wenum-int-mismatch]
25 | _mm_log (gpointer obj,
| ^~~~~~~
In file included from ../src/mm-log-test.h:20:
../src/mm-log.h:61:6: note: previous declaration of ‘_mm_log’ with type ‘void(void *, const gchar *, const gchar *, const gchar *, MMLogLevel, const gchar *, ...)’ {aka ‘void(void *, const char *, const char *, const char *, MMLogLevel, const char *, ...)’}
61 | void _mm_log (gpointer obj,
| ^~~~~~~
That's perfectly fine, just use the enum type directly.
|
|
GCC 13 is unhappy about mixing enums and ints. However, if we fix the
type un mmtty's _mm_log() prototype, the compiler will find something
else to be irritiated about:
[1/2] Compiling C object test/mmtty.p/mmtty.c.o
../test/mmtty.c: In function ‘_mm_log’:
../test/mmtty.c:283:5: warning: enumeration value ‘MM_LOG_LEVEL_MSG’ not handled in switch [-Wswitch-enum]
283 | switch (level) {
| ^~~~~~
[2/2] Linking target test/mmtty
Fix that first.
|
|
So that we simulate enabling the spew control, as we do during
probing.
|
|
|
|
The _mm_log() implementation provided in 'mm-log-test.h' relies on
g_test_verbose() to decide whether the logs are printed or not. We are
not running under the GTest setup in mmtty, so that would not work
properly.
Just provide a custom _mm_log() method that checks for the
verbose_flag instead.
|
|
|
|
|
|
So that we can provide the specific object id in every log associated
to a given object.
|
|
g_type_init() has been deprecated (and also marked with the attribute
'deprecated') since glib 2.36 as the type system is automatically
initialized. Since the minimum version of glib required by ModemManager
is 2.36, calling g_type_init() isn't necessarily in the ModemManager
code.
|
|
|
|
The new tester allows to play with the AT-capable TTY using the same code as
ModemManager itself.
$ sudo ./test/mmtty -d /dev/ttyHS0 --verbose
opening serial port '/dev/ttyHS0'...
(ttyHS0) opening serial port...
(ttyHS0): port attributes not fully set
(ttyHS0) device open count is 1 (open)
flashing serial port '/dev/ttyHS0'...
ready
> AT+GCAP
(ttyHS0): --> 'AT+GCAP<LF><CR>'
(ttyHS0): <-- '<CR><LF>+GCAP: +CGSM,+DS,+ES<CR><LF><CR><LF>OK<CR><LF>'
+GCAP: +CGSM,+DS,+ES
> AT+GMI
(ttyHS0): --> 'AT+GMI<LF><CR>'
(ttyHS0): <-- '<CR><LF>Option N.V.<CR><LF><CR><LF>OK<CR><LF>'
Option N.V.
> ^C
cancelling the main loop...
(ttyHS0) device open count is 0 (close)
(ttyHS0) closing serial port...
(ttyHS0) serial port closed
(ttyHS0) forced to close port
|