aboutsummaryrefslogtreecommitdiff
path: root/test/mmtty.c
AgeCommit message (Collapse)Author
2025-05-22serial-parsers,port-serial-at: move echo removal into serial parserDan Williams
Mainly because we need somewhere to stash the call end regex, and it's silly to have a 3rd instance of that in MMPortSerialAt when we already have one in the serial parsers that MMPortSerialAt relies on pretty heavily. Signed-off-by: Dan Williams <dan@ioncontrol.co>
2025-03-11treewide: Fix typosGuido Günther
Signed-off-by: Guido Günther <agx@sigxcpu.org>
2023-04-11port-serial-at: make mm_port_serial_at_command_finish() transfer ownershipLubomir Rintel
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.
2023-04-10test: fix _mm_log() prototypesLubomir Rintel
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.
2023-04-10mmtty: handle MM_LOG_LEVEL_MSG in _mm_log()Lubomir Rintel
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.
2021-03-31mmtty: new --spew-control optionAleksander Morgado
So that we simulate enabling the spew control, as we do during probing.
2021-03-31mmtty: allow enabling LF with --send-lfAleksander Morgado
2021-03-31mmtty: fix printing logs with --verboseAleksander Morgado
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.
2021-03-31mmtty: make sure \r\n is removed from the user lineAleksander Morgado
2020-04-08log: common logging method definition for all testers and helpersAleksander Morgado
2020-04-08log: new object logging supportAleksander Morgado
So that we can provide the specific object id in every log associated to a given object.
2017-02-03glib: remove invocations of g_type_init()Ben Chan
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.
2015-12-02core: use G_SOURCE_REMOVE and G_SOURCE_CONTINUE in GSourceFuncsAleksander Morgado
2015-02-11test: new 'mmtty' utilityAleksander Morgado
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