Commit Graph
8 Commits
Author SHA1 Message Date
rich fa11770c13 palm-client: clock line on Node (Visor, UTC, offset, radio, system pref)
The radio clock stays ~9 h behind although Settings shows UTC -5: at
connect it was set to Visor time minus 5 h, i.e. an offset of +5 was in
effect, and later saves read the radio clock without setting it. Rather
than guess, Node now shows the Visor's clock, the computed UTC and the
offset in effect, the radio's clock as last read, and Palm OS's
prefMinutesWestOfGMT (the offset's default).
2026-11-01 16:01:10 -05:00
rich 6c7061f3f1 palm-client: real UTC timestamps (UTC offset setting) and UTF-8 names
Palm OS 3.5's clock is local time with no zone, and SessionNow used it as
UTC: outgoing messages carried times hours off, contact ages all read
'now', and clock sync set the radio (which only moves forward) to the
wrong time. SessionNow now applies a UTC offset kept as an app preference
(default from prefMinutesWestOfGMT, editable in Settings as hours, quarter
hours allowed); display converts back with SessionLocalPalm. Changing the
offset re-syncs the radio clock.

Contact, channel and node names are converted from UTF-8 when stored;
names with emoji showed missing-glyph boxes.
2026-11-01 15:41:57 -05:00
rich ece6a01c7f palm-client: message store, channel cache and background sync
messages.c keeps one record per message (conversation, times, direction,
status pending/sent/acked/failed, unread, SNR, path, sender, text in the
Visor's charset), newest 500, backed up. channels.c caches the radio's
channel slots so the conversation list works offline.

session.c now acts on pushes wherever frames are read, so an ack that
arrives during another request isn't lost: MSG_WAITING triggers a sync,
SEND_CONFIRMED marks the DM acked, adverts mark contacts changed.
SessionPoll drains input, syncs and expires overdue acks; SessionSend/
SessionRetry send with a single try (a repeated send would go out twice)
and track the ack deadline from the radio's estimate. Connect also sets the
radio clock forward from the Visor's, refreshes channels and contacts, and
pulls waiting messages. ContactsRefresh accepts a NULL count.
2026-11-01 15:24:03 -05:00
rich 7d1c84f35d palm-client: offer a radio reboot after changing radio settings
Reception stayed dead after switching to PhillyMesh until the XIAO was
rebooted: SET_RADIO_PARAMS saves and reports the new values, but the
receiver only retunes on a restart. After a radio change, Settings asks
to reboot the radio (CMD_REBOOT + "reboot"; no reply), waits for it and
reconnects.
2026-11-01 15:10:07 -05:00
rich 97b07747ae palm-client: stop duplicate commands and stale replies over USB
The bridge log showed each Refresh sending GET_CONTACTS twice: SrmSend
reports a timeout while the Visor's USB re-attaches but still delivers
the bytes it accepted, so resending the whole frame duplicated the
command, and the extra reply could be taken as the next request's.
TransportSend now only resends the unsent remainder, and each request
first drains input left over from earlier ones (still noting pushes).
2026-11-01 15:00:01 -05:00
rich d00d7fab26 palm-client: contacts (database + screen), command retry, PhillyMesh preset
Contacts: Refresh downloads GET_CONTACTS into a backed-up Palm database
(VisorMeshContacts), keeping the previous list if the download fails, and
sorts by name. The screen lists name with type and route, taps show
details (key prefix, last advert). Path lengths are decoded as hash size
(bits 7-6) + hop count (bits 5-0), since PhillyMesh uses 2-byte hashes.

session.c keeps unread received bytes across waits; before, bytes after a
completed frame in the same read were dropped, which would lose
back-to-back frames like the contact list. Settings commands get two tries
(the Visor's USB link can drop while idle). Ports moves to an Options menu.
Local presets (tools/local-presets.json, PhillyMesh) are listed before
MeshCore's and survive gen_presets.py --fetch.
2026-11-01 14:54:53 -05:00
rich 5a347be52d palm-client: Node Settings screen (name, radio preset/params, TX power, path hash)
Settings validates against the firmware's limits before sending anything,
then sends only what changed (SET_ADVERT_NAME, SET_RADIO_PARAMS with the
client-repeat byte passed through from DEVICE_INFO, SET_RADIO_TX_POWER,
SET_PATH_HASH_MODE), requires RESP_OK for each and names the step that
failed, then re-reads DEVICE_INFO/SELF_INFO.

The preset pop-up uses a snapshot of MeshCore's suggested presets
(api.meshcore.nz, 27 entries) in tools/meshcore-presets.json; src/presets.c
is generated from it by tools/gen_presets.py with exact decimal conversion.
Radio state moves into session.c; TX power is now signed; adds
fixed-point decimal parse/format helpers with host tests.
2026-11-01 12:03:48 -05:00
rich c9183dc591 palm-client: connect screen (DEVICE_QUERY + APP_START) and session layer
session.c does request/reply over the transport: waits for the wanted
reply code, skips pushes (remembering PUSH_MSG_WAITING), maps RESP_ERR,
and retries sends while the USB bridge attaches. Connect keeps the link
open and the main form shows node name, frequency, BW/SF/CR, TX power
and firmware. Adds a DEVICE_INFO parser.

Fixes the DEVICE_INFO test fixture: it was hand-typed with two bytes
shifted, and an earlier test had been adjusted to match the typo (version
at offset 62). It's now generated from the capture file; the version is
at 60, as in MeshCore's layout.
2026-11-01 11:53:30 -05:00