dea.hc
Interface Icontroller

All Known Implementing Classes:
TimeCommanderPlus, WebDemo

public interface Icontroller

Title: Controller interface
Description: Interface for talking to controllers. Examples given in comments are for TimeComannder Plus
Copyright: Copyright (c) 2004
Company: RMRR

@author David Abigt
@version 1.0


Field Summary
static int DEV_ANY
           
static int DEV_LIGHT
           
 
Method Summary
 java.lang.String getInfo(java.lang.String cmd, java.lang.String endKey)
          Send command to controller and read reply.
 boolean isLive()
          Returns true if the class can send commands and read directly from a controller.
 java.lang.String readStatus()
          get controller status
format is:
Ver 2.28
Sched Name: JUSTRAIN
Schedule status: running
02/12/05 22:42:45
Sunrise: 8:35 Sunset: 19:30
Lat: 33, Lon: 117, DST: 0
Mem Use = 7%
Refresh value: 15
Security seed: 15
Answer on Ring: 0
IO Status
1111111
12345678 90123456
-------- --------
Opto 00100110 00000000
Relay 00000000

Analog 1 2 3 4 5 6 7 8
030 076 081 079 073 073 039 067
##0
 java.lang.String readTime()
          read controller clock
 void sendCmd(java.lang.String cmd)
          Send a command but don't read reply
 void sendX10(char hc, int unit, int val)
          BRIGHT and DIM not currently supported
todo: add them
 

Field Detail

DEV_ANY

public static final int DEV_ANY
See Also:
Constant Field Values

DEV_LIGHT

public static final int DEV_LIGHT
See Also:
Constant Field Values
Method Detail

isLive

public boolean isLive()
Returns true if the class can send commands and read directly from a controller. Retunrs false if only interacts with the DB.

Returns:
boolean

readTime

public java.lang.String readTime()
read controller clock

Returns:
String with the time the Time Commander is set to.

readStatus

public java.lang.String readStatus()
get controller status
format is:
Ver 2.28
Sched Name: JUSTRAIN
Schedule status: running
02/12/05 22:42:45
Sunrise: 8:35 Sunset: 19:30
Lat: 33, Lon: 117, DST: 0
Mem Use = 7%
Refresh value: 15
Security seed: 15
Answer on Ring: 0
IO Status
1111111
12345678 90123456
-------- --------
Opto 00100110 00000000
Relay 00000000

Analog 1 2 3 4 5 6 7 8
030 076 081 079 073 073 039 067
##0

Returns:
Sting containing status of Time Commander

getInfo

public java.lang.String getInfo(java.lang.String cmd,
                                java.lang.String endKey)
Send command to controller and read reply.
This is really a major hack to try and make sure you get something from the controller. We send the command and wait up to 5 secs for a response. If we get nothing or the AT S0= line then we resend the command up to 5 times since the controller does not seem to always respond. If endKey is provided we keep resetting the retries back to zero (on each good line received), without clearing the buffer, till we get it.

Parameters:
cmd -
Returns:
the reply from the Time Commander

sendX10

public void sendX10(char hc,
                    int unit,
                    int val)
BRIGHT and DIM not currently supported
todo: add them

Parameters:
hc -
unit -
val -

sendCmd

public void sendCmd(java.lang.String cmd)
Send a command but don't read reply

Parameters:
cmd -


Copyright © 2001-2005 Round Mountain Rescue Ranch. All Rights Reserved.