The screen bits go into a VisorMeshShots record (shots.c, segment 1, no
globals: the delayed one runs from a procedure alarm inside whatever loop is
running, so menus and popups can be captured). make shots fetches the
database over HotSync and tools/shots.py writes PNGs to build/shots/.
Pins are kept by key prefix (pins.c, segment 4, up to 8), so they work for
senders who aren't contacts; those get a Pin-only popup. Pinned DMs sort
first, most recent first among themselves; the rest keep their order.
RowList gets an optional hold callback: the pen still (3 px) on a row for half
a second unhighlights it, and lifting calls the callback (DMs fall back to a
tap). The channel actions take a slot, with the menu versions wrapping them.
Checks add the messages they pulled (outside muted channels) to a pending
table in unsaved prefs, with names looked up while they have globals; the
display launch lists up to five conversations and 'N more elsewhere'.
make_icon.sh takes a PNG and thresholds the 1-bit icons instead of dithering.
Channel menu only on Home (Add) and in a channel conversation (Add, Leave,
Mute, Scope); DMs and the other screens get Go and Options. The Contacts
list now has the menu too.
The alarm now stays set while the app is open (checks skip) and is set as
soon as the interval changes; each check records what it got to, shown as
'Last 8:11 no radio, next 8:16'.
The alarm launch sublaunches the app with globals to connect without the
channel/contact refresh, sync queued messages and play the sound; new
messages keep the alarm for display, which shows an alert with Open.
Untested on the device.
Login on a repeater opens the console (rooms: More > Admin Console). A
command line sends CLI commands (SEND_TXT_MSG with txt_type CLI); replies,
which the radio delivers as CLI-type DMs, go to the console instead of the
conversation. Status (SEND_STATUS_REQ -> 0x87) shows the repeater's
RepeaterStats: battery, uptime, queue, noise, last RSSI/SNR, packet counts,
airtime, dups and errors. Telem (SEND_TELEMETRY_REQ -> 0x8B) decodes the
Cayenne LPP readings. Cmds lists common commands and Read settings (ten
gets); items ending in ... go into the command line to finish. One request
at a time, the rest queued; no answer is reported after the radio's
estimate plus 8 s.
remote_fmt.c (builders, parsers, text) is pure C and host-tested; the
console and screen are in segment 3 (12.4 KB).
Contact detail (new screen, segment 3): type, route, last advert, the full
key, and every time the radio heard the node directly with SNR/RSSI.
Message, Login (rooms and repeaters, password prompt), More: Reset Path,
Remove.
Signal history comes from the radio's RX log pushes (0x88), which it
already sends for every packet: a zero-hop advert names its sender; a
flooded packet's last path hash names the repeater we heard it from.
Hearings of the same node within a minute merge. 48 entries, kept in an
unsaved preference across launches. Parser host-tested, including
transport codes and direct routes (no 'from').
Rooms: Message logs in first if needed (SEND_LOGIN, then the
LOGIN_SUCCESS/FAIL push, waiting as long as the radio estimates). Room
posts are signed messages: the author's 4-byte prefix is now parsed and
the transcript shows the author's name instead of the room's.
Add Contact (Contacts > Add): name, type and 64-hex-digit key, sent with
ADD_UPDATE_CONTACT with an unknown path, for messaging a node whose advert
hasn't been heard.
Segment 1 was back at 27 KB. Settings, Contacts, Channel, Home, Node,
convos, messages, contacts, channels, rowlist and draw move to vmcode2:
segment 1 is now 10.3 KB, segment 2 23.4 KB. tools/sect2.py adds the
VM_SECT2 static declarations.
Checked in the compiled code, the rules in sections.h were too cautious:
literals in a vmcode2 function are emitted into vmcode2, a file's static
const data and calls to unannotated functions go through the __text__
base, and taking a vmcode2 function's address (event handlers, callbacks)
gives its real address. The real traps are shared extern const tables and
-fwritable-strings (PC-relative into .data). tools/check_sections.py runs
after every link and fails the build on any PC-relative reference from
vmcode2 to outside it; python3 added to the toolchain image for it.
Unicode: characters past Latin-1 all became '?', and Windows-1252 quotes
and dashes had no glyph in the small font. Now arrows, check marks, stars,
bullets and node-type marks map to the font's UI symbols, typographic
quotes and dashes to ASCII, any emoji to a new smiley glyph, and
variation selectors / zero-width joiners are dropped.
The single-line compose field didn't scroll, so typing past its width was
blind; it's now a two-line multi-line field (Palm scrolls it to keep the
cursor visible; the transcript is 8 px shorter). Graffiti return still
sends: the form catches linefeed before the field.
Screens treated every frmUpdateEvent as new data and only redrew their own
content, so after the on-screen keyboard (frmRedrawUpdateCode) the field,
buttons and counter weren't redrawn. Conversation, Home, Contacts and Node
now redraw the form for frmRedrawUpdateCode.
Options > Add Channel: a #hashtag channel's key is the first 16 bytes of
SHA-256 of its UTF-8 name, '#' included (companion_protocol.md: #test ->
9cd8fcf2...); a private channel is joined with its 32-hex-digit key. It
goes in the first free slot via CMD_SET_CHANNEL and opens the new
conversation. Options > Leave Channel empties the open channel's slot
(empty name, zero secret) after asking. Creating a private channel isn't
offered: the Visor has no good randomness for a key.
SHA-256 is plain C in the second segment, host-tested against 'abc', the
documented #test key and every padding boundary. Adds VmParseHex and
VmBuildSetChannel with tests. sections.h leaves the attribute off under
clang so the editor's checker stops flagging it.
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.
Home is now the conversation list (channels in slot order, then direct
conversations most recent first) with markers, unread badges, failed
marks, ages and previews; it connects on launch with the saved link.
The conversation screen shows day dividers, sender chips, time column,
wrapped text and SNR or delivery marks (pending, waiting for ack, acked,
failed), with a compose field, a UTF-8 byte counter, Send (or Graffiti
return), and tap-to-retry on failed messages. Contacts pins our node and
shows type marks, heard ages and routes; Message opens a DM. The old main
screen becomes Node with Advert and Done. One Options menu everywhere;
while connected the event loop polls every half second and posts a form
update when messages or contacts change.
Font Preview showed garbled text: the bundled PilRC's FONT compiler writes
a broken NFNT header (first/last char words missing, later fields shifted,
height lost), reproduced with a two-glyph test font. gen_font.py now builds
the NFNT itself (header, glyph strip, location and offset/width tables),
decodes it back and checks every glyph, and PilRC includes it as a DATA
resource. Resources now rebuild when the font changes.
tools/gen_font.py builds an NFNT (app font 0x80) from X.org's public-domain
misc-fixed 4x6 BDF plus hand-drawn MeshTerm-style symbols (star, node-type
marks, ack/fail/pending, lock) in 0x80-0x9F, reusing Windows-1252's slots for
ellipsis and angle quotes. It also writes glyphs.h and a width table for host
tests. src/ui/draw.c registers the font and adds section, chip, cut and
right-align helpers. Options > Font Preview draws sample screens so the font
can be judged on the Visor's LCD before the real screens use it.
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.
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.
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.
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.
The Ports screen showed the Neo's Serial Manager drivers, including
'HsUd' (USB, the GENERIC port). The app gets a Serial/USB link switch
(USB default); Query radio retries since the bridge needs a moment to
attach, and SrmSendWait is gone (it can block over USB with no host).
tools/visor_bridge.py (stdlib + libusb via ctypes) finds the GENERIC
port from the Visor's connection info and forwards bytes to the radio's
serial port, logging each companion frame. Ports shows one line per
driver so all of them fit.
The Ports screen lists Serial Manager drivers (creator, feature flags,
max baud, description) to find which one reaches the USB cradle, as a
first step toward a USB bridge for testing before the boards arrive.
make editor copies the SDK headers out of the image and writes
compile_flags.txt so the editor stops flagging Palm OS types.
prc-tools-remix 2.3.6 + PilRC + Palm OS 3.5 SDK (pinned) in a Docker
image; make builds visormesh.prc there when the toolchain isn't local.
App has a main form whose Query button sends CMD_DEVICE_QUERY over the
Serial Manager transport. Companion framing is plain C with host tests.
make install pushes the .prc to a Pi with the USB cradle (untested).