rbtest: timed small messages, one 50 kB message, and MT checks

`rbtest` in the shell sample sends test messages with a 16-byte header
and a counting ramp, so every byte can be checked at the other end.
`rbtest small` sends a few 32-byte messages and logs how long each took,
`rbtest large` sends one of up to 50000 bytes and only with `confirm`,
and `rbtest mt` shows the last MT and checks it. `rb9704 pattern make`
and `check` in python/ make and check the same messages.

rb9704_send_fill writes a message straight into the module's buffer, so
a large generated one is not held twice. overlay-large.conf raises the
limit to 50000 bytes; on the M5Stamp-C3 that links on the USB console
and not beside WiFi, which overflows by 11 kB.

Run against the fake modem on native_sim only; not yet on a real modem.
This commit is contained in:
scottp committed 2026-10-27 11:07:53 +11:00
1 parent 9f68104ac6
commit 144efe683e
15 files changed
+798 -6

No files matched your search

+14 -2
View File
@@ -145,12 +145,15 @@ rb9704_begin(K_SECONDS(30));
rb9704_send(RB9704_TOPIC_RAW, buf, len, K_SECONDS(10)); /* costs airtime */
rb9704_send(RB9704_TOPIC_RAW, buf, len, K_NO_WAIT); /* queues, never blocks */
rb9704_cancel(K_SECONDS(10)); /* the one in flight; -ECANCELED via mo_done */
rb9704_send_fill(RB9704_TOPIC_RAW, len, fill, user, K_SECONDS(10)); /* fill() writes it in place */
```
Every request takes a timeout and waits no longer; with `K_NO_WAIT` a send
queues and returns `-EINPROGRESS`, and its outcome, a refusal included,
comes through `mo_done`. Callbacks run on the worker thread. One modem per
system: the library keeps global state.
system: the library keeps global state. `rb9704_send_fill` hands `fill`
the module's own buffer, so a large message the application makes up as
it goes does not have to be held twice.
| Kconfig | Default | |
| --- | --- | --- |
@@ -174,7 +177,16 @@ rb9704 cancel abandon the message in flight
rb9704 spy on|off every JSPR line, both ways
```
`samples/shell` is the shell plus callbacks that print what arrives.
`samples/shell` is the shell plus callbacks that print what arrives, and
`rbtest`, airtime tests with a payload `rb9704 pattern check` can check at
the other end:
```
rbtest small <topic> [count=3] [gap_s=60] 32-byte messages one after another, each timed
rbtest large <topic> [bytes=50000] confirm one large message; without confirm, only the cost
rbtest status | stop the run so far, or no more after this one
rbtest mt the last MT, checked if it is a test message
```
## Host tools