module Extron::SIS::Response
Overview
Parsers for responses and asynchronous messages originating from Extron SIS devices.
Included Modules
- Pars
Defined in:
extron/sis/response.crConstant Summary
-
Clock =
Raw.map do |date| Time.parse_utc(date, "%a, %d %b %Y %T") end
-
Part of the copyright banner, but appears on a new line so will tokenize as as standalone message.
-
Copyright =
((Parse.string("(c) Copyright")) + Raw).map(&.join)
-
Copyright message shown on connect.
-
DeviceError =
(Parse.char('E')) >> Parse.integer.map do |e| SIS::Error.new(e.to_i) end
-
Error codes returned from the device.
-
Empty =
(Parse.string("\r\n")) >> (Parse.const(nil))
-
GroupMute =
Parse.do({(_) <= (Parse.string("GrpmD")), group <= (num(Int32)), (_) <= (Parse.char('*')), state <= BoolField, Parse.const({state, group})})
-
Group audio mute update / response. Level are provided in the raw device range of -1000..0.
-
GroupVolume =
Parse.do({(_) <= (Parse.string("GrpmD")), group <= (num(Int32)), (_) <= (Parse.char('*')), (_) <= (Parse.char('-')), level <= (num(Int32)).map do |val| val * -1 end, Parse.const({level, group})})
-
Group volume update / response. Level are provided in the raw device range of -1000..0.
-
MatrixSize =
Parse.do({inputs <= (num(Input)), (_) <= (Parse.char('X')), outputs <= (num(Output)), Parse.const(SIS::MatrixSize.new(inputs, outputs))})
-
Qik =
(Parse.string("Qik")) >> (Parse.const(Ok.new))
-
Quick response, occurs following quick tie, or switching interaction from the device's front panel.
-
Raw =
(((Parse.char ^ Delimiter) * (0..)) << (Delimiter * (0..1))).map(&.join)
-
Parse a full command response as a String. Delimiter is optional as it may have already been dropped by an upstream tokenizer.
-
Switch =
Parse.do({input <= ((Parse.string("In")) >> (num(Input))), (_) <= (Parse.char(' ')), layer <= (word_as_enum(MatrixLayer)), Parse.const(SIS::Switch.new(input, layer))})
-
Broadcast or single output route update.
-
SwitcherInformation =
Parse.do({(_) <= (Parse.char('V')), video <= MatrixSize, (_) <= (Parse.char(' ')), (_) <= (Parse.char('A')), audio <= MatrixSize, Parse.const(SIS::SwitcherInformation.new(video, audio))})
-
Tie =
Parse.do({output <= ((Parse.string("Out")) >> (num(Output))), (_) <= (Parse.char(' ')), input <= ((Parse.string("In")) >> (num(Input))), (_) <= (Parse.char(' ')), layer <= (word_as_enum(MatrixLayer)), Parse.const(SIS::Tie.new(input, output, layer))})
-
Matrix signal route update.
-
Unsolicited =
(((DeviceError | Tie) | Copyright) | Clock) | Empty
-
Async messages that can be expected outside of a command -> response flow.
Class Method Summary
-
.parse(data : String, as parser : Parser(T)) forall T
Parses a response packet with specified parser.
-
.parse(data : Bytes, as parser : Parser(T)) forall T
Parses a response packet with specified parser.
Class Method Detail
Parses a response packet with specified parser.
Returns the parser output, a parse error or a device error.
Parses a response packet with specified parser.
Returns the parser output, a parse error or a device error.