device

package
v0.0.0-...-88de618 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 3, 2025 License: AGPL-3.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

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.

Types

type CreateGenericParams

type CreateGenericParams struct {
	Name string // Device name
	FQBN string // Board FQBN
}

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

type DeleteParams struct {
	ID   *string
	Tags map[string]string
}

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 FQBNInfo

type FQBNInfo struct {
	Value   string `json:"fqbn"`
	Name    string `json:"name"`
	Package string `json:"package"`
}

FQBNInfo contains the details of a FQBN.

func ListFQBN

func ListFQBN(ctx context.Context) ([]FQBNInfo, error)

ListFQBN command returns a list of the supported 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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL