Difference between revisions of "GSD Ruby Interface"

From LinuxMCE
Jump to: navigation, search
Line 1: Line 1:
<table width="100%"> <tr><td bgcolor="#FFCFCF">This page was written by Pluto and imported with their permission when LinuxMCE branched off in February, 2007.  In general any information should apply to LinuxMCE.  However, this page should be edited to reflect changes to LinuxMCE and remove old references to Pluto.</td></tr> </table>Short description of available classes and methods (the list is not complete)
+
<table width="100%"> <tr><td bgcolor="#FFCFCF">This page was written by Pluto and imported with their permission when LinuxMCE branched off in February, 2007.  In general any information should apply to LinuxMCE.  However, this page should be edited to reflect changes to LinuxMCE and remove old references to Pluto.</td></tr> </table>Short description of available classes and methods. the list is not complete, but covers most of functionality.
 
== RubySerialIOConnectionWrapper ==
 
== RubySerialIOConnectionWrapper ==
 
The connection object, is the exported (already opened) connection to the device. It can be either Serial (or USB Serial) conection or a network connection (in this situation you need to specify host ip and port to connect).
 
The connection object, is the exported (already opened) connection to the device. It can be either Serial (or USB Serial) conection or a network connection (in this situation you need to specify host ip and port to connect).

Revision as of 11:40, 23 May 2006

This page was written by Pluto and imported with their permission when LinuxMCE branched off in February, 2007. In general any information should apply to LinuxMCE. However, this page should be edited to reflect changes to LinuxMCE and remove old references to Pluto.
Short description of available classes and methods. the list is not complete, but covers most of functionality.

RubySerialIOConnectionWrapper

The connection object, is the exported (already opened) connection to the device. It can be either Serial (or USB Serial) conection or a network connection (in this situation you need to specify host ip and port to connect).

It's usually accessed via conn_ variable.

Methods

  • Send (<string>) : will send the string to the device
  • Recv (<count>, <timeout>) : will put return received data (either the count was reached, or the timeout)
  • RecvDelimited(<delimiter>, <timeout>) : will return received data until the delimiter was found
  • Reconnect() : will close and then reopen the connection to the device
  • Close() : will close the connection

RubySerialWrapper

This class is the equivalent of DCECommandImpl, is the one which implements commands and most of the time your code will run in this context

Methods

  • SendCommand (<command>) : sent a command (DCEmessage, may be event)

Members

  • parent_ : parent device
  • device_ : access to the device itself
  • children_ : list of children

RubyDeviceWrapper

The wrapper for DCEDevice, will have all devicedata and other stuff

Members

  • devid_ : Device ID
  • devtemplid_ : Device Template ID
  • devdata_ : a map <int, string> with device data
  • parent_ : parent device
  • childdevices_ : a map <int, RubyDeviceWrapper> of child devices.

RubyCommandWrapper

A wraper over DCEMessage, not quite right called Command, because we can use it for both commands and events.

Members

  • devidfrom_ : device id of sender
  • devidto_ : device id of receiver
  • priority_ : message priority
  • type_ : message type (1 = command, 2 = event)
  • id_ : message ID (commandID or eventID)
  • params_ : map <int, string> whith parameters