linx-gateway-0.1.0.2: Implementation of the Enea LINX gateway protocol.

Safe HaskellSafe-Inferred

Network.Linx.Gateway.Signal

Description

The module is implementing the LINX signal concept, which is the user level payload exchanged between two services.

Synopsis

Documentation

data Signal Source

A signal - user lever payload data - is coded into three different fields in the gateway protocol: Signal length in bytes, including signal number. Signal number. Array of signal data. Even in the case of NoSignal the binary encoding is eight bytes.

Constructors

Signal

A full bodied signal with number and data.

Fields

sigNo :: !SigNo
 
sigData :: !ByteString
 
NumericSignal

A signal data only is carrying a signal number, but no data.

Fields

sigNo :: !SigNo
 
NoSignal

An empty signal.

Instances

Eq Signal 
Show Signal 
Binary Signal

Binary instances.

PayloadSize Signal

PayloadSize instances.

data SignalSelector Source

A signal selector is used to filter which signals to expect when calling receive. It can either be one of two specific filters - AnySignal or Cancel - or a generic filter.

Constructors

AnySignal

Accept any kind of signal.

Cancel

Cancel the last receive.

Sel

Accept any of the specified signals. The list must not be empty.

Fields

selection :: ![SigNo]
 

newtype SigNo Source

Signal number descriptor.

Constructors

SigNo Int32 

class PayloadSize a whereSource

Type class to determine the size of a signal.

Methods

payloadSize :: a -> LengthSource

Instances

encode :: Binary a => a -> ByteString

Encode a value using binary serialisation to a lazy ByteString.

decode :: Binary a => ByteString -> a

Decode a value from a lazy ByteString, reconstructing the original structure.