Documentation ¶
Index ¶
- type AuthResponse
- type AuthStatus
- type Device
- type LogResponse
- type OTAStartResponse
- type Option
- type SDKProxyRequest
- type SDKProxyResponse
- type ScanResponse
- type StatusChannel
- type StatusCounter
- type StatusResponse
- type VectorBLE
- func (v *VectorBLE) Auth(key string) (*AuthResponse, error)
- func (v *VectorBLE) Close() error
- func (v *VectorBLE) ConfigureSettings(settings *VectorSettings) error
- func (v *VectorBLE) Connect(id int) error
- func (v *VectorBLE) Connected() bool
- func (v *VectorBLE) DownloadLogs() (*LogResponse, error)
- func (v *VectorBLE) GetStatus() (*StatusResponse, error)
- func (v *VectorBLE) OTACancel() ([]byte, error)
- func (v *VectorBLE) OTAStart(url string) (*OTAStartResponse, error)
- func (v *VectorBLE) SDKProxy(settings *SDKProxyRequest) (*SDKProxyResponse, error)
- func (v *VectorBLE) Scan() (*ScanResponse, error)
- func (v *VectorBLE) SendPin(pin string) error
- func (v *VectorBLE) WifiAccessPoint(enabled bool) (*WifiIPResponse, error)
- func (v *VectorBLE) WifiConnect(ssid, password string, timeout, authtype int) (*WifiConnectResponse, error)
- func (v *VectorBLE) WifiForget(ssid string) (*WifiIPResponse, error)
- func (v *VectorBLE) WifiIP() (*WifiIPResponse, error)
- func (v *VectorBLE) WifiScan() (*WifiScanResponse, error)
- type VectorSettings
- type WifiAPResponse
- type WifiConnectResponse
- type WifiForgetResponse
- type WifiIPResponse
- type WifiNetwork
- type WifiScanResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthResponse ¶
type AuthResponse struct { Status AuthStatus `json:"status,omitempty"` ClientTokenGUID string `json:"client_token_guid,omitempty"` Success bool `json:"success,omitempty"` }
AuthResponse is the unified response for Auth messages
func (*AuthResponse) Marshal ¶
func (sr *AuthResponse) Marshal() ([]byte, error)
Marshal converts a AuthResponse message to bytes
func (*AuthResponse) Unmarshal ¶
func (sr *AuthResponse) Unmarshal(b []byte) error
Unmarshal converts a AuthResponse byte slice to a AuthResponse
type AuthStatus ¶
type AuthStatus int
AuthStatus defines the status of the response message
const ( UnknownError AuthStatus = iota ConnectionError WrongAccount InvalidSessionToken AuthorizedAsPrimary AuthorizedAsSecondary )
type LogResponse ¶
type LogResponse struct {
Filename string `json:"filename,omitempty"`
}
LogResponse is the unified response for log downloading
func (*LogResponse) Marshal ¶
func (sr *LogResponse) Marshal() ([]byte, error)
Marshal converts a LogResponse message to bytes
func (*LogResponse) Unmarshal ¶
func (sr *LogResponse) Unmarshal(b []byte) error
Unmarshal converts a LogResponse byte slice to a LogResponse
type OTAStartResponse ¶
type OTAStartResponse struct {
Status int
}
OTAStartResponse is the unified response for ota start messages
func (*OTAStartResponse) Marshal ¶
func (sr *OTAStartResponse) Marshal() ([]byte, error)
Marshal converts a OTAStartResponse message to bytes
func (*OTAStartResponse) Unmarshal ¶
func (sr *OTAStartResponse) Unmarshal(b []byte) error
Unmarshal converts a OTAStartResponse byte slice to a OTAStartResponse
type Option ¶
type Option func(*options)
Option is the list of options
func WithLogDirectory ¶
WithLogDirectory sets the logger output directory
func WithStatusChan ¶
func WithStatusChan(c chan StatusChannel) Option
WithStatusChan sets a status response channel
type SDKProxyRequest ¶
SDKProxyRequest is the type required for SDK proxy messages
type SDKProxyResponse ¶
type SDKProxyResponse struct { MessageID string `json:"message_id,omitempty"` StatusCode uint16 `json:"status_code,omitempty"` ResponseType string `json:"response_type,omitempty"` ResponseBody string `json:"response_body,omitempty"` }
SDKProxyResponse is the response type of an SDKProxy request
func (*SDKProxyResponse) Marshal ¶
func (sr *SDKProxyResponse) Marshal() ([]byte, error)
Marshal converts a SDKProxyResponse message to bytes
func (*SDKProxyResponse) Unmarshal ¶
func (sr *SDKProxyResponse) Unmarshal(b []byte) error
Unmarshal converts a SDKProxyResponse byte slice to a SDKProxyResponse
type ScanResponse ¶
type ScanResponse struct {
Devices []*Device
}
ScanResponse is a list of devices the BLE adaptor has found
type StatusChannel ¶
type StatusChannel struct { LogStatus *StatusCounter OTAStatus *StatusCounter }
StatusChannel is a general struct containing status updates for things like OTA + log downloading
type StatusCounter ¶
type StatusResponse ¶
type StatusResponse struct { WifiSSID string `json:"wifi_ssid"` Version string `json:"version"` ESN string `json:"esn"` WifiState int `json:"wifi_state"` AccessPoint bool `json:"access_point"` OtaInProgress bool `json:"ota_in_progress"` HasOwner bool `json:"has_owner"` CloudAuthed bool `json:"cloud_authed"` }
StatusResponse is the unified response for status messages
func (*StatusResponse) Marshal ¶
func (sr *StatusResponse) Marshal() ([]byte, error)
Marshal converts a StatusResponse message to bytes
func (*StatusResponse) Unmarshal ¶
func (sr *StatusResponse) Unmarshal(b []byte) error
Unmarshal converts a StatusResponse byte slice to a StatusResponse
type VectorBLE ¶
type VectorBLE struct {
// contains filtered or unexported fields
}
VectorBLE contains the information required to connect, etc
func (*VectorBLE) Auth ¶
func (v *VectorBLE) Auth(key string) (*AuthResponse, error)
Auth sends a Auth message to the vector robot
func (*VectorBLE) ConfigureSettings ¶
func (v *VectorBLE) ConfigureSettings(settings *VectorSettings) error
ConfigureSettings sends the settings to the robot
func (*VectorBLE) DownloadLogs ¶
func (v *VectorBLE) DownloadLogs() (*LogResponse, error)
DownloadLogs is an appropriately named function.
func (*VectorBLE) GetStatus ¶
func (v *VectorBLE) GetStatus() (*StatusResponse, error)
GetStatus sends a GetStatus message to the vector robot
func (*VectorBLE) OTAStart ¶
func (v *VectorBLE) OTAStart(url string) (*OTAStartResponse, error)
OTAStart sends a OTAStart message to the vector robot
func (*VectorBLE) SDKProxy ¶
func (v *VectorBLE) SDKProxy(settings *SDKProxyRequest) (*SDKProxyResponse, error)
SDKProxy sends a BLE-tunneled SDK request
func (*VectorBLE) Scan ¶
func (v *VectorBLE) Scan() (*ScanResponse, error)
Scan shows a list of connectable vectors
func (*VectorBLE) WifiAccessPoint ¶
func (v *VectorBLE) WifiAccessPoint(enabled bool) (*WifiIPResponse, error)
WifiAccessPoint sends a WifiAccessPoint message to the vector robot
func (*VectorBLE) WifiConnect ¶
func (v *VectorBLE) WifiConnect(ssid, password string, timeout, authtype int) (*WifiConnectResponse, error)
WifiConnect sends a wifi connect message to the robot
func (*VectorBLE) WifiForget ¶
func (v *VectorBLE) WifiForget(ssid string) (*WifiIPResponse, error)
WifiForget sends a WifiForget message to the vector robot
func (*VectorBLE) WifiIP ¶
func (v *VectorBLE) WifiIP() (*WifiIPResponse, error)
WifiIP sends a WifiIP message to the vector robot
func (*VectorBLE) WifiScan ¶
func (v *VectorBLE) WifiScan() (*WifiScanResponse, error)
WifiScan sends a WifiScan message to the vector robot
type VectorSettings ¶
type VectorSettings struct { Timezone string `json:"timezone,omitempty"` DefaultLocation string `json:"default_location,omitempty"` Locale string `json:"locale,omitempty"` AllowDataAnalytics bool `json:"allow_data_analytics,omitempty"` MetricDistance bool `json:"metric_distance,omitempty"` MetricTemperature bool `json:"metric_temperature,omitempty"` ButtonWakeword bool `json:"button_wakeword,omitempty"` Clock24Hour bool `json:"clock_24_hour,omitempty"` AlexaOptIn bool `json:"alexaOptIn,omitempty"` }
VectorSettings is a list of settings for the robot
type WifiAPResponse ¶
WifiAPResponse is the unified response for wifi access point messages
func (*WifiAPResponse) Marshal ¶
func (sr *WifiAPResponse) Marshal() ([]byte, error)
Marshal converts a WifiAPResponse message to bytes
func (*WifiAPResponse) Unmarshal ¶
func (sr *WifiAPResponse) Unmarshal(b []byte) error
Unmarshal converts a WifiAPResponse byte slice to a WifiAPResponse
type WifiConnectResponse ¶
type WifiConnectResponse struct { WifiSSID string `json:"wifi_ssid,omitempty"` State int `json:"state,omitempty"` Result int `json:"result,omitempty"` }
WifiConnectResponse is the unified response for wifi connect messages
func (*WifiConnectResponse) Marshal ¶
func (sr *WifiConnectResponse) Marshal() ([]byte, error)
Marshal converts a WifiConnectResponse message to bytes
func (*WifiConnectResponse) Unmarshal ¶
func (sr *WifiConnectResponse) Unmarshal(b []byte) error
Unmarshal converts a WifiConnectResponse byte slice to a WifiConnectResponse
type WifiForgetResponse ¶
type WifiForgetResponse struct {
Status bool
}
WifiForgetResponse is the unified response for wifi fprget messages
func (*WifiForgetResponse) Marshal ¶
func (sr *WifiForgetResponse) Marshal() ([]byte, error)
Marshal converts a WifiForgetResponse message to bytes
func (*WifiForgetResponse) Unmarshal ¶
func (sr *WifiForgetResponse) Unmarshal(b []byte) error
Unmarshal converts a WifiForgetResponse byte slice to a WifiForgetResponse
type WifiIPResponse ¶
WifiIPResponse is the unified response for wifi ip messages
func (*WifiIPResponse) Marshal ¶
func (sr *WifiIPResponse) Marshal() ([]byte, error)
Marshal converts a WifiIPResponse message to bytes
func (*WifiIPResponse) Unmarshal ¶
func (sr *WifiIPResponse) Unmarshal(b []byte) error
Unmarshal converts a WifiIPResponse byte slice to a WifiIPResponse
type WifiNetwork ¶
type WifiNetwork struct { WifiSSID string `json:"wifi_ssid,omitempty"` SignalStrength int `json:"signal_strength,omitempty"` AuthType int `json:"auth_type,omitempty"` Hidden bool `json:"hidden,omitempty"` }
WifiNetwork is an entry for one network
type WifiScanResponse ¶
type WifiScanResponse struct {
Networks []*WifiNetwork `json:"networks,omitempty"`
}
WifiScanResponse is the unified response for wifi scan messages
func (*WifiScanResponse) Marshal ¶
func (sr *WifiScanResponse) Marshal() ([]byte, error)
Marshal converts a WifiScanResponse message to bytes
func (*WifiScanResponse) Unmarshal ¶
func (sr *WifiScanResponse) Unmarshal(b []byte) error
Unmarshal converts a WifiScanResponse byte slice to a WifiScanResponse
Source Files ¶
- auth.go
- challenge.go
- configuresettings.go
- connect.go
- connreq.go
- errors.go
- fnmaps.go
- forcedisconnect.go
- logs.go
- nonce.go
- options.go
- otacancel.go
- otastart.go
- passthroughfuncs.go
- pinexchange.go
- scan.go
- sdkproxy.go
- state.go
- status.go
- statuschannel.go
- vector.go
- watch.go
- wifiaccesspoint.go
- wificonnect.go
- wififorget.go
- wifiip.go
- wifiscan.go