diff options
author | Aleksander Morgado <aleksander@aleksander.es> | 2019-03-05 10:17:25 +0100 |
---|---|---|
committer | Aleksander Morgado <aleksander@gnu.org> | 2019-03-29 10:07:29 +0000 |
commit | 0944e592522f932ec72f0e88837252c39bd4df98 (patch) | |
tree | da89013f8f9f11b108d6cb9e955c45a68fb766ab /plugins/ublox/tests | |
parent | 7330f6d5812df26c0518e04eccd3092833c6e4f3 (diff) |
ublox: parse +UGCNTRD stats as unsigned 64bit values
[1551646332.583651] (ttyACM2): --> 'AT+UGCNTRD<CR>'
[1551646332.626567] (ttyACM2): <-- '<CR><LF>+UGCNTRD: 1,0,0,0,0<CR><LF><CR><LF>+UGCNTRD: 2,1397316870,113728263578,1397316870,113728263578<CR><LF><CR><LF>OK<CR><LF>'
[1551646332.627120] Reloading stats failed: Couldn't load primary PDP context 2 statistics: Error parsing session RX bytes
Diffstat (limited to 'plugins/ublox/tests')
-rw-r--r-- | plugins/ublox/tests/test-modem-helpers-ublox.c | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/plugins/ublox/tests/test-modem-helpers-ublox.c b/plugins/ublox/tests/test-modem-helpers-ublox.c index 10f718ae..e0a7d9a8 100644 --- a/plugins/ublox/tests/test-modem-helpers-ublox.c +++ b/plugins/ublox/tests/test-modem-helpers-ublox.c @@ -909,10 +909,10 @@ test_uauthreq_less_fields (void) typedef struct { const gchar *str; guint cid; - guint session_tx_bytes; - guint session_rx_bytes; - guint total_tx_bytes; - guint total_rx_bytes; + guint64 session_tx_bytes; + guint64 session_rx_bytes; + guint64 total_tx_bytes; + guint64 total_rx_bytes; } UgcntrdResponseTest; static const UgcntrdResponseTest ugcntrd_response_tests[] = { @@ -949,6 +949,14 @@ static const UgcntrdResponseTest ugcntrd_response_tests[] = { .session_rx_bytes = 1819, .total_tx_bytes = 2724, .total_rx_bytes = 1839 + }, + { + .str = "+UGCNTRD: 2,1397316870,113728263578,1397316870,113728263578\r\n", + .cid = 2, + .session_tx_bytes = 1397316870ULL, + .session_rx_bytes = 113728263578ULL, + .total_tx_bytes = 1397316870ULL, + .total_rx_bytes = 113728263578ULL } }; @@ -960,10 +968,10 @@ test_ugcntrd_response (void) for (i = 0; i < G_N_ELEMENTS (ugcntrd_response_tests); i++) { GError *error = NULL; gboolean success; - guint session_tx_bytes = G_MAXUINT; - guint session_rx_bytes = G_MAXUINT; - guint total_tx_bytes = G_MAXUINT; - guint total_rx_bytes = G_MAXUINT; + guint64 session_tx_bytes = 0; + guint64 session_rx_bytes = 0; + guint64 total_tx_bytes = 0; + guint64 total_rx_bytes = 0; success = mm_ublox_parse_ugcntrd_response_for_cid (ugcntrd_response_tests[i].str, ugcntrd_response_tests[i].cid, |