Documentation ¶
Index ¶
- Constants
- func ByteToIP(bytes []byte) net.IP
- func GenMessageID() uint32
- func IPV4Address() *net.TCPAddr
- func Int32ToIP(in uint32) net.IP
- type BLECharacteristic
- type BluetoothConnection
- func (conn *BluetoothConnection) Close()
- func (conn *BluetoothConnection) Connect(device int, params bluetooth.ConnectionParams) error
- func (conn *BluetoothConnection) Read(uuid string) ([]byte, error)
- func (conn *BluetoothConnection) Scan() error
- func (conn *BluetoothConnection) ScanUUID(uuid string) error
- func (conn *BluetoothConnection) Service(uuid string) *bluetooth.DeviceService
- func (conn *BluetoothConnection) Write(uuid string, data []byte) error
- type IP
- type Protobuf
- type Stopwatch
- type TCPConnection
- type Talker
- func (t *Talker) Listen(m chan int, message_id uint32, ...)
- func (t *Talker) Receive(message []byte, message_id uint32) error
- func (t *Talker) RecieveAck(msg []byte, message_id uint32) (pr.Message, error)
- func (t *Talker) RecieveDataBuffer(msg []byte, message_id uint32) (pr.Message, error)
- func (t *Talker) RecieveDeviceProfile(msg []byte, message_id uint32) (pr.Message, error)
- func (t *Talker) RecieveError(msg []byte, message_id uint32) (pr.Message, error)
- func (t *Talker) RecieveMultiDataBuffer(msg []byte, message_id uint32) (pr.Message, error)
- func (t *Talker) SendAck(message_id uint32) error
- func (t *Talker) SendCommand(message_id uint32) error
- func (t *Talker) SendCommandBufferQueue(message_id uint32) error
- func (t *Talker) SendDataBuffer(message_id uint32) error
- func (t *Talker) SendError(message_id uint32) error
- func (t *Talker) SendGetDeviceProfile(message_id uint32) error
- func (t *Talker) SendGetProfile(message_id uint32) error
- func (t *Talker) SendMultiDataBuffer(message_id uint32) error
- func (t *Talker) SendStart(message_id uint32) error
- func (t *Talker) SendStop(message_id uint32) error
- func (t *Talker) SendSyncCommandBufferQueue(message_id uint32) error
Constants ¶
View Source
const ( UUID = "22e0e945-cc6e-4a9a-955f-f8f12350cb14" SSID_CHARACTERISTIC = "22e0e946-cc6e-4a9a-955f-f8f12350cb14" PASS_CHARACTERISTIC = "22e0e947-cc6e-4a9a-955f-f8f12350cb14" IP_CHARACTERISTIC = "22e0e948-cc6e-4a9a-955f-f8f12350cb14" PORT_CHARACTERISTIC = "22e0e949-cc6e-4a9a-955f-f8f12350cb14" UUID_CHARACTERISTIC = "22e0e950-cc6e-4a9a-955f-f8f12350cb14" DONE_CHARACTERISTIC = "22e0e951-cc6e-4a9a-955f-f8f12350cb14" BLE_ON = 1 BLE_OFF = 0 BLE_SCANNING = 2 BLE_CONNECTING = 3 BLE_CONNECTED = 4 BLE_DISCONNECTED = 5 BLE_ERROR = 6 BLE_FOUND = 7 BLE_SUCCESS = 8 MAX_BLE_BYTES = 96 )
View Source
const ( NO_DEVICE = iota DEVICE_CONNECTED DEVICE_SCANNING DEVICE_ON DEVICE_DISCONNECTED KILL CONTINUE )
View Source
const ( GPR_RECIEVE = 1 GPR_ERROR = 2 )
View Source
const ACK = 7
View Source
const APPLICATION_PORT = 9060
View Source
const ARBITRATE = 5
View Source
const BUSY = 10
View Source
const CONNECTED = 2
View Source
const CS_BLUE = "\033[34m"
View Source
const CS_GREEN = "\033[32m"
View Source
const CS_RED = "\033[31m"
View Source
const CS_WHITE = "\033[37m"
View Source
const CS_YELLOW = "\033[33m"
View Source
const DEFAULT_BAUD = 9600
View Source
const DISCONNECTED = 3
View Source
const ERROR = 11
View Source
const EXIT = 1
View Source
const HANDSHAKE = 2
View Source
const IDLE = 0
View Source
const MAX_LOSS_RATE = 0.1
View Source
const NACK = 8
View Source
const NOT_READY = 0
View Source
const OUTBOX = 9
View Source
const READY = 1
View Source
const RECONNECTED = 4
View Source
const RESOLVED = 6
View Source
const TIMEOUT = 30
Connection Status
Variables ¶
This section is empty.
Functions ¶
func GenMessageID ¶
func GenMessageID() uint32
func IPV4Address ¶
Types ¶
type BLECharacteristic ¶
type BLECharacteristic struct {
// contains filtered or unexported fields
}
type BluetoothConnection ¶
type BluetoothConnection struct { Names map[string]string Status chan int // contains filtered or unexported fields }
func NewBluetoothConnection ¶
func NewBluetoothConnection() (*BluetoothConnection, error)
func (*BluetoothConnection) Close ¶
func (conn *BluetoothConnection) Close()
func (*BluetoothConnection) Connect ¶
func (conn *BluetoothConnection) Connect(device int, params bluetooth.ConnectionParams) error
func (*BluetoothConnection) Read ¶
func (conn *BluetoothConnection) Read(uuid string) ([]byte, error)
func (*BluetoothConnection) Scan ¶
func (conn *BluetoothConnection) Scan() error
Available returns a list of available devices
func (*BluetoothConnection) ScanUUID ¶
func (conn *BluetoothConnection) ScanUUID(uuid string) error
func (*BluetoothConnection) Service ¶
func (conn *BluetoothConnection) Service(uuid string) *bluetooth.DeviceService
type Protobuf ¶
type Protobuf struct { Ack proto.Ack Cmd proto.Command CmdBufferQueue proto.CommandBufferQueue SyncCmdBufferQueue proto.SyncCommandBufferQueue DataBuffer proto.DataBuffer MultiDataBuffer proto.MultiDataBuffer Start proto.Start Stop proto.Stop GetProfile proto.GetProfile DeviceProfile proto.DeviceProfile Error proto.Error // contains filtered or unexported fields }
func NewProtobuf ¶
func NewProtobuf() *Protobuf
type TCPConnection ¶
type TCPConnection struct { Conn *net.TCPConn Addr *net.TCPAddr MyAddr *net.TCPAddr Talker *Talker Status int }
TCPConnection is a struct that contains the TCP connection, address, and message
func NewTCPConnection ¶
func NewTCPConnection(addressport string) (*TCPConnection, error)
TCPBroadcast is a function that sends a TCP broadcast message, we send a specialized message for connection
func (*TCPConnection) Close ¶
func (u *TCPConnection) Close()
type Talker ¶
type Talker struct { Mode int // Send/Recieve Mode Local Protobuf Remote Protobuf Connection *TCPConnection }
func NewTalker ¶
func NewTalker(conn *TCPConnection) *Talker
func (*Talker) RecieveAck ¶
func (*Talker) RecieveDataBuffer ¶
func (*Talker) RecieveDeviceProfile ¶
func (*Talker) RecieveError ¶
func (*Talker) RecieveMultiDataBuffer ¶
func (*Talker) SendCommand ¶
func (*Talker) SendCommandBufferQueue ¶
func (*Talker) SendDataBuffer ¶
func (*Talker) SendGetDeviceProfile ¶
func (*Talker) SendGetProfile ¶
func (*Talker) SendMultiDataBuffer ¶
func (*Talker) SendSyncCommandBufferQueue ¶
Click to show internal directories.
Click to hide internal directories.