Documentation
¶
Index ¶
- Constants
- func Delete(ctx context.Context, params *DeleteParams, cred *config.Credentials) error
- func GetInputFromMenu(config *NetConfig) error
- func NetConfigure(ctx context.Context, boardFilters *CreateParams, NetConfig *NetConfig) error
- type CATM1Setting
- type CellularSetting
- type ConfigStatus
- type ConfigurationStates
- func (cs *ConfigurationStates) ConfigureNetwork(ctx context.Context, c *NetConfig) (ConfigStatus, error)
- func (c *ConfigurationStates) HandleStatusMessage(status int16) (ConfigStatus, error)
- func (c *ConfigurationStates) SendConnectionRequest() (ConfigStatus, error)
- func (c *ConfigurationStates) WaitForConnection() (ConfigStatus, error)
- func (c *ConfigurationStates) WaitingForConnectionCommandResult() (ConfigStatus, error)
- func (c *ConfigurationStates) WaitingForInitialStatus() (ConfigStatus, error)
- func (c *ConfigurationStates) WaitingForNetworkConfigResult() (ConfigStatus, error)
- func (c *ConfigurationStates) WaitingForNetworkOptions() (ConfigStatus, error)
- type ConnectedBoardInfos
- type CreateGenericParams
- type CreateLoraParams
- type CreateParams
- type DeleteParams
- type DeviceGenericInfo
- type DeviceInfo
- func Create(ctx context.Context, params *CreateParams, cred *config.Credentials) (*DeviceInfo, error)
- func List(ctx context.Context, params *ListParams, cred *config.Credentials) ([]DeviceInfo, error)
- func Show(ctx context.Context, deviceId string, cred *config.Credentials) (*DeviceInfo, []netCredentials, error)
- type DeviceLoraInfo
- type EthernetSetting
- type FQBNInfo
- type FrequencyPlanInfo
- type IPAddr
- type ListParams
- type LoraSetting
- type NetConfig
- type NetworkConfigure
- type ProvisionV2
- type ProvisioningV2BoardParams
- type WiFiSetting
Constants ¶
const ( CommandResponseTimeoutLong_s = 60 CommandResponseTimeoutShort_s = 30 ConnectResponseTimeout_s = 200 )
const ( MaxRetriesFlashProvSketch = 5 MaxRetriesProvisioningResult = 20 )
Variables ¶
This section is empty.
Functions ¶
func Delete ¶
func Delete(ctx context.Context, params *DeleteParams, cred *config.Credentials) error
Delete command is used to delete a device from Arduino IoT Cloud.
func GetInputFromMenu ¶
func NetConfigure ¶
func NetConfigure(ctx context.Context, boardFilters *CreateParams, NetConfig *NetConfig) error
Types ¶
type CATM1Setting ¶
type CellularSetting ¶
type ConfigStatus ¶
type ConfigStatus int
const ( NoneState ConfigStatus = iota WaitForConnection WaitingForInitialStatus WaitingForNetworkOptions BoardReady FlashProvisioningSketch GetSketchVersionRequest WaitingSketchVersion WiFiFWVersionRequest WaitingWiFiFWVersion RequestBLEMAC WaitBLEMAC SendInitialTS MissingParameter IDRequest WaitingID WaitingSignature WaitingPublicKey ClaimDevice RegisterDevice RequestReset WaitResetResponse GetNetConfigLibVersionRequest WaitingNetConfigLibVersion ConfigureNetwork SendConnectionRequest WaitingForConnectionCommandResult WaitingForNetworkConfigResult WaitingForProvisioningResult UnclaimDevice End ErrorState )
This enum represents the different states of the network configuration process of the Arduino Board Configuration Protocol.
type ConfigurationStates ¶
type ConfigurationStates struct {
// contains filtered or unexported fields
}
func NewConfigurationStates ¶
func NewConfigurationStates(configProtocol *configurationprotocol.NetworkConfigurationProtocol) *ConfigurationStates
func (*ConfigurationStates) ConfigureNetwork ¶
func (cs *ConfigurationStates) ConfigureNetwork(ctx context.Context, c *NetConfig) (ConfigStatus, error)
func (*ConfigurationStates) HandleStatusMessage ¶
func (c *ConfigurationStates) HandleStatusMessage(status int16) (ConfigStatus, error)
func (*ConfigurationStates) SendConnectionRequest ¶
func (c *ConfigurationStates) SendConnectionRequest() (ConfigStatus, error)
func (*ConfigurationStates) WaitForConnection ¶
func (c *ConfigurationStates) WaitForConnection() (ConfigStatus, error)
func (*ConfigurationStates) WaitingForConnectionCommandResult ¶
func (c *ConfigurationStates) WaitingForConnectionCommandResult() (ConfigStatus, error)
func (*ConfigurationStates) WaitingForInitialStatus ¶
func (c *ConfigurationStates) WaitingForInitialStatus() (ConfigStatus, error)
func (*ConfigurationStates) WaitingForNetworkConfigResult ¶
func (c *ConfigurationStates) WaitingForNetworkConfigResult() (ConfigStatus, error)
func (*ConfigurationStates) WaitingForNetworkOptions ¶
func (c *ConfigurationStates) WaitingForNetworkOptions() (ConfigStatus, error)
In this state the cli is waiting for the available network options as specified in the Arduino Board Configuration Protocol.
type ConnectedBoardInfos ¶
type CreateGenericParams ¶
CreateGenericParams contains the parameters needed to create a new generic device.
type CreateLoraParams ¶
type CreateLoraParams struct { CreateParams FrequencyPlan string }
CreateLoRaParams contains the parameters needed to provision a LoRa device.
type CreateParams ¶
type CreateParams struct { Name string // Device name Port *string // Serial port - Optional - If omitted then each serial port is analyzed FQBN *string // Board FQBN - Optional - If omitted then the first device found gets selected ConnectionType *string // Connection type - Optional - If omitted then the default connection type (depends on the board type) get selected }
CreateParams contains the parameters needed to find the device to be provisioned.
type DeleteParams ¶
DeleteParams contains the parameters needed to delete a device from Arduino IoT Cloud. ID and Tags parameters are mutually exclusive and one among them is required: An error is returned if they are both nil or if they are both not nil.
type DeviceGenericInfo ¶
type DeviceGenericInfo struct { DeviceInfo Password string `json:"secret_key"` }
DeviceGenericInfo contains the most interesting parameters of a generic Arduino IoT Cloud device.
func CreateGeneric ¶
func CreateGeneric(ctx context.Context, params *CreateGenericParams, cred *config.Credentials) (*DeviceGenericInfo, error)
CreateGeneric command is used to add a new generic device to Arduino IoT Cloud.
type DeviceInfo ¶
type DeviceInfo struct { Name string `json:"name"` ID string `json:"id"` Board string `json:"board"` Serial string `json:"serial_number"` FQBN string `json:"fqbn"` Tags []string `json:"tags,omitempty"` Status *string `json:"status,omitempty"` Type string `json:"type,omitempty"` ConnectionType *string `json:"connection_type,omitempty"` ThingID *string `json:"thing_id,omitempty"` }
DeviceInfo contains the most interesting parameters of an Arduino IoT Cloud device.
func Create ¶
func Create(ctx context.Context, params *CreateParams, cred *config.Credentials) (*DeviceInfo, error)
Create command is used to provision a new arduino device and to add it to Arduino IoT Cloud.
func List ¶
func List(ctx context.Context, params *ListParams, cred *config.Credentials) ([]DeviceInfo, error)
List command is used to list the devices of Arduino IoT Cloud.
func Show ¶
func Show(ctx context.Context, deviceId string, cred *config.Credentials) (*DeviceInfo, []netCredentials, error)
List command is used to list the devices of Arduino IoT Cloud.
type DeviceLoraInfo ¶
type DeviceLoraInfo struct { DeviceInfo AppEUI string `json:"app_eui"` AppKey string `json:"app_key"` EUI string `json:"eui"` }
DeviceLoraInfo contains the most interesting parameters of an Arduino IoT Cloud LoRa device.
func CreateLora ¶
func CreateLora(ctx context.Context, params *CreateLoraParams, cred *config.Credentials) (*DeviceLoraInfo, error)
CreateLora command is used to provision a new LoRa arduino device and to add it to Arduino IoT Cloud.
type EthernetSetting ¶
type FQBNInfo ¶
type FQBNInfo struct { Value string `json:"fqbn"` Name string `json:"name"` Package string `json:"package"` }
FQBNInfo contains the details of a FQBN.
type FrequencyPlanInfo ¶
type FrequencyPlanInfo struct { Name string `json:"name"` ID string `json:"id"` Advanced string `json:"advanced"` }
FrequencyPlanInfo describes a LoRa frequency plan.
func ListFrequencyPlans ¶
func ListFrequencyPlans(ctx context.Context, cred *config.Credentials) ([]FrequencyPlanInfo, error)
ListFrequencyPlans command is used to list the supported LoRa frequency plans.
type ListParams ¶
type ListParams struct { Tags map[string]string // If tags are provided, only devices that have all these tags are listed. DeviceIds string // If ids are provided, only devices with these ids are listed. Status string // If status is provided, only devices with this status are listed. }
ListParams contains the optional parameters needed to filter the devices to be listed.
type LoraSetting ¶
type NetConfig ¶
type NetConfig struct { Type int32 `json:"type"` WiFi WiFiSetting `json:"wifi,omitempty"` Eth EthernetSetting `json:"eth,omitempty"` NB CellularSetting `json:"nb,omitempty"` GSM CellularSetting `json:"gsm,omitempty"` CATM1 CATM1Setting `json:"catm1,omitempty"` CellularSetting CellularSetting `json:"cellular,omitempty"` Lora LoraSetting `json:"lora,omitempty"` }
type NetworkConfigure ¶
type NetworkConfigure struct {
// contains filtered or unexported fields
}
func NewNetworkConfigure ¶
func NewNetworkConfigure(configProtocol *configurationprotocol.NetworkConfigurationProtocol) *NetworkConfigure
type ProvisionV2 ¶
func NewProvisionV2 ¶
func NewProvisionV2(comm *arduino.Commander, iotClient *iotapiraw.IoTApiRawClient, credentials *config.Credentials, extInterface transport.TransportInterface) *ProvisionV2
func (*ProvisionV2) GetProvisioningResult ¶
func (p *ProvisionV2) GetProvisioningResult() (string, error)
* The function return the Arduino Cloud Device ID of the new created board * if the process ends successfully. Otherwise, an error
func (*ProvisionV2) Run ¶
func (p *ProvisionV2) Run(ctx context.Context, params ProvisioningV2BoardParams) error
type ProvisioningV2BoardParams ¶
type ProvisioningV2BoardParams struct {
// contains filtered or unexported fields
}