Module: AlphaSign::Protocol
- Included in:
- AlphaSign
- Defined in:
- lib/alphasign/protocol.rb
Overview
These are a pile of constants for the protocol functions
Defined Under Namespace
Classes: AlphaFile
Constant Summary collapse
- Baud =
Serial config
9600
- DataBits =
7
- Parity =
SerialPort::EVEN
- StopBits =
2
- Preamble =
this was much more complex in original, but due to packing spec effectively reduced to this, and remains voodoo but apparently necessary voodoo
[ ']', ']'].pack('x10ax10a')
- StartHeader =
everything starts with this, nulls are to auto set baud on unit
Preamble + [ 0x01 ].pack('x20C')
- StartCMD =
only handlers for :wtxt implemented so far
{ :wtxt => [ 0x02, 'A' ].pack('CA'), # write text file :rtxt => [ 0x02, 'B' ].pack('CA'), # read text file :wfctn => [ 0x02, 'E' ].pack('CA'), # write special function :rfctn => [ 0x02, 'F' ].pack('CA'), # read special function :wstr => [ 0x02, 'G' ].pack('CA'), # write string file :rstr => [ 0x02, 'H' ].pack('CA'), # read string file :wdots => [ 0x02, 'I' ].pack('CA'), # write DOTS picture file :rdots => [ 0x02, 'J' ].pack('CA'), # read DOTS picture file :wadots => [ 0x02, 'M' ].pack('CA'), # write ALPHAVISON DOTS picture file :radots => [ 0x02, 'N' ].pack('CA'), # read ALPHAVISON DOTS picture file :bulletin => [ 0x02, 'O' ].pack('CA'), # write bulletin message }
- FileType =
FileType is used in allocating sign memory
{ :txt => "A", # Text file :str => "B", # String file :dot => "D", # Dots picture file }
[0x04].pack("C")