Documentation ¶
Index ¶
- Constants
- Variables
- type EchoReply
- type EchoRequest
- type GearConn
- func (gc *GearConn) Close()
- func (gc *GearConn) RFSend(msg RFMessage) error
- func (gc *GearConn) RFSubscribe(start int64) (<-chan RFMessage, error)
- func (gc *GearConn) SensorRead(name string, startAt, endAt, step int64) (<-chan SensorDataValue, error)
- func (gc *GearConn) SensorSendData(name string, si SensorInfo) (chan<- SensorDataValue, error)
- func (gc *GearConn) SensorSubscribe(name string, startAt int64) (<-chan SensorDataValue, error)
- type ParamGetRequest
- type ParamPutRequest
- type ParamReply
- type RFMessage
- type RFSendRequest
- type RFSubRequest
- type Reply
- type Request
- type SensorDataRequest
- type SensorDataValue
- type SensorInfo
- type SensorInfoRequest
- type SensorReadRequest
- type SensorSubRequest
Constants ¶
View Source
const ( CodeOK = iota CodeClientError CodeServerError CodeAckTimeout )
View Source
const FormatAt = "2006-01-02 15:04:05.999"
Variables ¶
View Source
var AckTimeoutError = fmt.Errorf("ACK timeout")
Functions ¶
This section is empty.
Types ¶
type EchoRequest ¶
type EchoRequest string // string to echo
Echo request - simple ping-pong test request
type GearConn ¶
type GearConn struct {
// contains filtered or unexported fields
}
func (*GearConn) RFSubscribe ¶
func (*GearConn) SensorRead ¶
func (gc *GearConn) SensorRead(name string, startAt, endAt, step int64) ( <-chan SensorDataValue, error)
func (*GearConn) SensorSendData ¶
func (gc *GearConn) SensorSendData(name string, si SensorInfo) (chan<- SensorDataValue, error)
func (*GearConn) SensorSubscribe ¶
func (gc *GearConn) SensorSubscribe(name string, startAt int64) (<-chan SensorDataValue, error)
type ParamGetRequest ¶
type ParamGetRequest struct {
Name string
}
type ParamPutRequest ¶
Put an arbitrary parameter - used to store random stuff
type ParamReply ¶
type ParamReply struct {
Value string
}
type RFMessage ¶
type RFMessage struct { At int64 // milliseconds since unix epoch Group byte // RF network group Node byte // RF node ID (Node=0 -> bcast) DoAck bool // Send with ack requested Kind byte // Message payload type ("module" numbers) Data []byte // Message payload }
RF Message
type RFSendRequest ¶
type RFSendRequest RFMessage
type RFSubRequest ¶
type RFSubRequest struct { StartAt int64 // timestamp of first message, 0=start with real-time stream Match RFMessage // matcher for messages (not yet implemented) Messages libchan.Sender // channel of RFMessage }
RFMessage Subscription request - subscribes to all RF Messages received by hub. The subscription can start in the past, in which case messages are replayed from the database and then seamlessly switched-over into the real-time stream.
type Reply ¶
type Reply struct { Code int Error string ER *EchoReply PG *ParamReply SI *SensorInfo }
type Request ¶
type Request struct { ER *EchoRequest // simple ping-pong test request RFS *RFSubRequest // subscribe to raw RF messages RF *RFSendRequest // send a raw RF message SI *SensorInfoRequest // get sensor info SD *SensorDataRequest // send sensor data SR *SensorReadRequest // read averaged sensor data SS *SensorSubRequest // subscribe to real-time sensor data PP *ParamPutRequest // put an arbitrary parameter PG *ParamGetRequest // get an arbitrary parameter Reply libchan.Sender }
"Union" of requests made over the main channel
type SensorDataRequest ¶
type SensorDataRequest struct { Name string // hierarchical sensor name & location Info SensorInfo Values libchan.Receiver // channel of SensorDataValue }
Sensor Data request
type SensorDataValue ¶
type SensorInfo ¶
type SensorInfoRequest ¶
type SensorInfoRequest struct {
Name string
}
type SensorReadRequest ¶
type SensorReadRequest struct { Name string StartAt int64 // first data point, milliseconds since unix epoch EndAt int64 // last data point (inclusive), milliseconds since unix epoch Step int64 // step in millisecsond, (EndAt-StartAt)%Step must be 0 Values libchan.Sender // channel of SensorDataValue }
Sensor Read request
Click to show internal directories.
Click to hide internal directories.