NAME
     achat - talk over /net/aether

SYNOPSIS
     achat
     achat peer
     achat -r N
     achat -l

DESCRIPTION
     Achat is chat done through the namespace.  Everything it does, it does by
     opening files under /net/aether: it reads clone to get a conversation,
     writes connect peer to that conversation's ctl, and then reads and writes
     data.  See aether(3) for the protocol those files speak.

     Because it only touches files, it does not care where the radio is.  On a
     deck with its own LoRa radio /net/aether is served by the firmware; on a
     deck whose /net/aether is mounted from a gateway over Bluetooth or DECT,
     the same commands work unchanged.  The namespace is the abstraction, not
     the radio.

     With no argument, achat lists the nodes it has heard on the network and
     asks you to pick one.  Type its number to start a directed conversation,
     L for the broadcast lobby, or q to leave.

     Given a peer, achat opens a conversation to that node and gives you a
     prompt.  Each line you type is one reliable datagram.  A peer is a mesh
     address -- aa:bb:cc:dd:ee:ff in full, or ee:ff for the last two bytes -- or
     a node name learned from service discovery, as shown by who(1).  A name
     claimed by two live nodes is an error rather than a guess; dial that one
     by address.

     Sending and receiving take two shells, because a read of data blocks.
     Achat prints the conversation number when it starts; run achat -r with
     that number in a second shell to see the replies.

     Ctrl-D ends a directed conversation and hangs it up.  In the lobby,
     Ctrl-D backgrounds it: the lobby stays open, incoming messages keep
     arriving, and the unread count appears in the status chrome.  F12 shows
     the history.

OPTIONS
     -r N Watch conversation N.  Prints datagrams as they arrive and nothing
          else.  This is the receiving half of a conversation someone else's
          shell is sending on.  Ctrl-C stops it.

     -l   Listen.  Opens a fresh conversation, announces it, and prints every
          datagram any peer sends to this node, each prefixed with its
          sender's address.  Use it to receive without having started
          anything.

EXAMPLES
     Talk to a node named in who(1), watching from a second shell:

          shell 1>  achat kingfisher
                    Chatting with kingfisher on conversation 0.
          shell 2>  achat -r 0

     The same thing by address, short form:

          achat 3f:a1

     Wait for whoever calls:

          achat -l

FILES
     /net/aether/clone
          Read it to get a conversation.

     /net/aether/N/ctl
          Where connect and hangup are written.

     /net/aether/N/data
          The messages, one datagram per write and per read.

     /net/aether/peers
          The nodes heard, from which names are resolved.

SOURCE
     skel/rc/achat
          The same program written in rc, kept as the readable reference.  The
          built-in is C for stack reasons, not for speed.

SEE ALSO
     chat(1), who(1), aether(3)

NOTES
     Chat is the raw mesh: best-effort broadcast, no conversation, no
     addressing.  Achat is the namespace: a conversation with one named peer,
     delivered reliably and in order, or a broadcast lobby if you ask for one.
     When you want to reach one deck and know whether it heard you, this is
     the one.

     A write that returns -11 (EAGAIN) means the radio is busy or a route is
     still forming, not that the message failed; achat retries for eight
     seconds before it complains.

FRST Computer                                                         ACHAT(1)
