Ravn::HAL::
Device class
Superclass | Ravn::Actor |
Abstract device class
Emits: - sys.device.info
Consumes: - sys.startup
Constants
- PRC163Radio
L3Harris PRC-163 radio adapter.
This device reads and write asynchronously from a USB TTY device connected to the radio. It has a thread managing the low-level IO, and a timer to periodically send the commands that turn into the events required by the BDE (
GPS
, time, etc.).Both reading and writing happen in two stages: a queue and a buffer.
write_queue -> write_buffer -> <TTY> -> read_buffer -> read_queue
Commands for the radio are appended to the
write_queue
. The IO thread pulls each command off of the queue and appends it to thewrite_buffer
, then writes as much as it can to the radio. It then reads any pending output from the radio into theread_buffer
and then breaks as many whole lines off of that as it can, appending each one to theread_queue
. Theread_queue
is then scanned for events, and those are emitted up the tree.== Emits:
-
sys.device.info
-
sys.gps.position
-
sys.gps.time
-
sys.radio.battery
-
sys.radio.channel
-
sys.radio.volume
-
sys.radio.versions
-
== Consumes:
-
sys.radio.command
This class includes code from the ruby-termios examples, used under the terms of the Ruby License. The original software does not include a copyright statement, so none is duplicated here.
Refs:
-
L3Harris Ascii Interface Design Document (RF-335M/1.3.1/February 19, 2021) obsidian://open?vault=Software%20Notes&file=Radios%2FL3Harris%20PRC-163%2Fattachments%2FL3Harris%20Ascii%20PLATFORM%20163%201.3.1.pdf
-
- RESET_THROTTLE_TIME
For fail-fast actors, throttle recovery time.
- WearOSWatch
A class representing an Android WearOS device, currently targetting a Samsung Galaxy Watch over bluetooth. (This could theoretically be used with any bluetooth connected Android display.)
Attributes
- device_info_stash R
The Hash of seen
sys.device.info
messages, keyed by the device info Hash- startup_message R
The system metadata message delivered to the device when the system starts
Public Class Methods
Register interest in the BDE startup packet.
Add some instance variables to all devices.
Public Instance Methods
Use the IO execution thread pool be default to avoid deadlocking non-io threads
Do any discovery of the adapted device that needs to be done during startup.
Send a sys.device.info
message
Return a Hash that contains information describing this device for intra-device communication.
Return the Integer identifier for this device.
Return a sys.device.info
event describing this device.
Return any sys.device.info
messages (Ravn::HAL::Message
objects) that have been seen.
Save device information to replay when this device is finished starting.
When the system startup message is seen, save it for optional later replay to connecting clients.
Actor API — start the wrapper.
Actor API — stop the wrapper.