Packagecom.sekati.thinkgear.net
Classpublic final class ThinkGearSocket
InheritanceThinkGearSocket Inheritance flash.net.Socket

ThinkGearSocket communicates with the ThinkGear Connector (TGC) & reads byte data into the reader buffer. Additionally the socket now supports optional JSON mode.



Public Properties
 PropertyDefined by
  enableRawOutput : Boolean
The ThinkGear Connector (TGC) raw output mode.
ThinkGearSocket
  format : String
The ThinkGear Connector (TGC) output format.
ThinkGearSocket
  reader : ThinkGearReader
[write-only] Buffer instance used by the socket to read byte data from the ThinkGear Connector.
ThinkGearSocket
Public Methods
 MethodDefined by
  
ThinkGearSocket(host:String = null, port:int = 0)
ThinkGearSocket Constructor
ThinkGearSocket
  
configure(format:String, enableRawOutput:Boolean):void
XXX - Not Yet Fully Implemented! Send a specialized Configuration Packet to the ThinkGear Connector (TGC).
ThinkGearSocket
  
start():void
Establishes communication with the ThinkGear Connector.
ThinkGearSocket
  
stop():void
Breaks communication with the ThinkGear Connector.
ThinkGearSocket
Public Constants
 ConstantDefined by
  TGC_HOST : String = "127.0.0.1"
[static] The ThinkGear Connector (TGC) host address, default: localhost/127.0.0.1.
ThinkGearSocket
  TGC_MODE_BINARY : String = "BinaryPacket"
[static] The ThinkGear Connector (TGC) mode descriptor for binary data feed (Default).
ThinkGearSocket
  TGC_MODE_JSON : String = "Json"
[static] The ThinkGear Connector (TGC) mode descriptor for JSON data feed (Optional).
ThinkGearSocket
  TGC_PORT : int = 13854
[static] The ThinkGear Connector (TGC) TCP port to capture data from.
ThinkGearSocket
Property detail
enableRawOutputproperty
enableRawOutput:Boolean  [read-write]

The ThinkGear Connector (TGC) raw output mode.

Implementation
    public function get enableRawOutput():Boolean
    public function set enableRawOutput(value:Boolean):void

See also

formatproperty 
format:String  [read-write]

The ThinkGear Connector (TGC) output format.

Implementation
    public function get format():String
    public function set format(value:String):void

See also

readerproperty 
reader:ThinkGearReader  [write-only]

Buffer instance used by the socket to read byte data from the ThinkGear Connector.

Implementation
    public function set reader(value:ThinkGearReader):void
Constructor detail
ThinkGearSocket()constructor
public function ThinkGearSocket(host:String = null, port:int = 0)

ThinkGearSocket Constructor

Parameters
host:String (default = null)
 
port:int (default = 0)
Method detail
configure()method
public function configure(format:String, enableRawOutput:Boolean):void

XXX - Not Yet Fully Implemented! Send a specialized Configuration Packet to the ThinkGear Connector (TGC).

Parameters
format:String — selects the data stream format. Must be: Json or BinaryPacket (Default).
 
enableRawOutput:Boolean — determines whether raw sensor data is included or not (Default: true).
start()method 
public function start():void

Establishes communication with the ThinkGear Connector. Sets up socket listeners to monitor socket activity.

stop()method 
public function stop():void

Breaks communication with the ThinkGear Connector. Destroys socket listeners.

Constant detail
TGC_HOSTconstant
public static const TGC_HOST:String = "127.0.0.1"

The ThinkGear Connector (TGC) host address, default: localhost/127.0.0.1.

TGC_MODE_BINARYconstant 
public static const TGC_MODE_BINARY:String = "BinaryPacket"

The ThinkGear Connector (TGC) mode descriptor for binary data feed (Default).

TGC_MODE_JSONconstant 
public static const TGC_MODE_JSON:String = "Json"

The ThinkGear Connector (TGC) mode descriptor for JSON data feed (Optional).

TGC_PORTconstant 
public static const TGC_PORT:int = 13854

The ThinkGear Connector (TGC) TCP port to capture data from.