Utilities and Helpers
Engine comes packaged with some handy helper functions that make interfacing with the wide variety of common IoT protocols easier.
Functions and Constants
These can be included into your driver class
include ::Orchestrator::ConstantsHelper
Type
Description
On, Down, Open
true
Constants that can make code more readable
Off, Up, Close, Short
false
Constants that can make code more readable
in_range(input_number, max, min = 0)
returns a number in the range
if input exceeds the limits, the limit is returned
is_affirmative? value
returns true if value is affirmative
values such as: true 'yes' :On
is_negatory? value
returns true if value is negative
values such as: false 'no' :Inactive
The Constants include module also contains Configuration Helpers
include ::Orchestrator::TranscoderHelper
Type
Description
hex_to_byte(data)
returns binary string
accepts any string containing hex characters and supports common formatting such as "0xDEADBEEF", "De:ad:Be:ef" etc
byte_to_hex(data)
returns an ASCII string
accepts binary strings or arrays of bytes
str_to_array(data)
returns an array of bytes
accepts strings
array_to_str(data)
returns a binary string
accepts array of bytes
Protocols
WebSockets
Enables WebSocket communication using a standard TCP socket driver.
For more details on the websocket API see https://github.com/faye/websocket-driver-ruby#driver-api
Telnet
Implements the telnet standard so that it is easy to communicate with devices that implement control codes or require negotiation.
KNX
Constructs KNX standard datagrams that make it easy to communicate with devices on KNX networks.
For more information see: https://github.com/acaprojects/ruby-knx
BACnet
Constructs BACnet datagrams that make it easy to communicate with devices on BACnet networks.
For more information see: https://github.com/acaprojects/ruby-bacnet
OAuth
For secure delegated access to services that implement it see wikipedia for details
SNMP
Provides an evented IO proxy for ruby-netsnmp
SOAP Services
Probably the easiest way to use these services at the moment via a Logic module. There are a number of supported ruby gems:
Savon usage:
Handsoap usage:
Wake on LAN
Wake on LAN is available to drivers of all types
ICMP (ping)
Uses the operating systems ping utility to perform a connectivity check.
CRC Checks
github project and supported CRC checks
gem install crc
Usage
Last updated
Was this helpful?