Documentation ¶
Overview ¶
Copyright (c) 2014-2019 Cesanta Software Limited All rights reserved
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright (c) 2014-2019 Cesanta Software Limited All rights reserved
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright (c) 2014-2019 Cesanta Software Limited All rights reserved
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright (c) 2014-2019 Cesanta Software Limited All rights reserved
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- func SetConfig(ctx context.Context, dc DevConn, devConf *DevConf, setArgTmpl *ConfigSetArg) (bool, error)
- func UsageSummary() string
- type Client
- func (c *Client) CreateDevConn(ctx context.Context, connectAddr string, reconnect bool) (*MosDevConn, error)
- func (c *Client) CreateDevConnWithOpts(ctx context.Context, connectAddr string, reconnect bool, tlsConfig *tls.Config, ...) (*MosDevConn, error)
- func (c *Client) PostProcessFlags(fs *flag.FlagSet) error
- func (c *Client) RegisterFlags(fs *flag.FlagSet)
- func (c *Client) RunWithTimeout(ctx context.Context, f func(context.Context) error) error
- type ConfigSetArg
- type ConfigSetResp
- type DevConf
- type DevConn
- type GetInfoResult
- type GetInfoResultWifi
- type MosDevConn
- func (dc *MosDevConn) Call(ctx context.Context, method string, args interface{}, resp interface{}) error
- func (dc *MosDevConn) CallB(ctx context.Context, method string, args interface{}) ([]byte, error)
- func (dc *MosDevConn) CallRaw(ctx context.Context, method string, args interface{}) (json.RawMessage, error)
- func (dc *MosDevConn) Connect(ctx context.Context, reconnect bool) error
- func (dc *MosDevConn) ConnectWithOpts(ctx context.Context, reconnect bool, tlsConfig *tls.Config, ...) error
- func (dc *MosDevConn) Disconnect(ctx context.Context) error
- func (dc *MosDevConn) GetTimeout() time.Duration
- func (dc *MosDevConn) IsConnected() bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func UsageSummary ¶
func UsageSummary() string
Types ¶
type Client ¶
func (*Client) CreateDevConn ¶
func (c *Client) CreateDevConn( ctx context.Context, connectAddr string, reconnect bool, ) (*MosDevConn, error)
CreateDevConn creates a direct connection to the device at a given address, which could be e.g. "serial:///dev/ttyUSB0", "serial://COM7", "tcp://192.168.0.10", etc.
func (*Client) CreateDevConnWithOpts ¶
func (*Client) RegisterFlags ¶
type ConfigSetArg ¶
type ConfigSetResp ¶
type ConfigSetResp struct {
Saved bool `json:"saved,omitempty"`
}
type DevConf ¶
type DevConf struct {
// contains filtered or unexported fields
}
DevConf represents configuration of a device
func GetConfigLevel ¶
func (*DevConf) Get ¶
Get takes a path like "wifi.sta.ssid" and tries to get config value at the given path.
type GetInfoResult ¶
type GetInfoResult struct { App *string `json:"app,omitempty"` Arch *string `json:"arch,omitempty"` Fs_free *int64 `json:"fs_free,omitempty"` Fs_size *int64 `json:"fs_size,omitempty"` Fw_id *string `json:"fw_id,omitempty"` Fw_version *string `json:"fw_version,omitempty"` Mac *string `json:"mac,omitempty"` RAMFree *int64 `json:"ram_free,omitempty"` RAMMinFree *int64 `json:"ram_min_free,omitempty"` RAMSize *int64 `json:"ram_size,omitempty"` Uptime *int64 `json:"uptime,omitempty"` Wifi *GetInfoResultWifi `json:"wifi,omitempty"` }
type GetInfoResultWifi ¶
type MosDevConn ¶
type MosDevConn struct { ConnectAddr string RPC mgrpc.MgRPC Dest string Reconnect bool // contains filtered or unexported fields }
func (*MosDevConn) Call ¶
func (dc *MosDevConn) Call(ctx context.Context, method string, args interface{}, resp interface{}) error
func (*MosDevConn) CallRaw ¶
func (dc *MosDevConn) CallRaw(ctx context.Context, method string, args interface{}) (json.RawMessage, error)
func (*MosDevConn) Connect ¶
func (dc *MosDevConn) Connect(ctx context.Context, reconnect bool) error
func (*MosDevConn) ConnectWithOpts ¶
func (*MosDevConn) Disconnect ¶
func (dc *MosDevConn) Disconnect(ctx context.Context) error
func (*MosDevConn) GetTimeout ¶
func (dc *MosDevConn) GetTimeout() time.Duration
func (*MosDevConn) IsConnected ¶
func (dc *MosDevConn) IsConnected() bool