iot

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

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

Go to latest
Published: Mar 13, 2024 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client can perform actions on Arduino IoT Cloud.

func NewClient

func NewClient(cred *config.Credentials) (*Client, error)

NewClient returns a new client implementing the Client interface. It needs client Credentials for cloud authentication.

func (*Client) CertificateCreate

func (cl *Client) CertificateCreate(ctx context.Context, id, csr string) (*iotclient.ArduinoCompressedv2, error)

CertificateCreate allows to upload a certificate on Arduino IoT Cloud. It returns the certificate parameters populated by the cloud.

func (*Client) DashboardCreate

func (cl *Client) DashboardCreate(ctx context.Context, dashboard *iotclient.Dashboardv2) (*iotclient.ArduinoDashboardv2, error)

DashboardCreate adds a new dashboard on Arduino IoT Cloud.

func (*Client) DashboardDelete

func (cl *Client) DashboardDelete(ctx context.Context, id string) error

DashboardDelete deletes a dashboard from Arduino IoT Cloud.

func (*Client) DashboardList

func (cl *Client) DashboardList(ctx context.Context) ([]iotclient.ArduinoDashboardv2, error)

DashboardList returns a list of dashboards on Arduino IoT Cloud.

func (*Client) DashboardShow

func (cl *Client) DashboardShow(ctx context.Context, id string) (*iotclient.ArduinoDashboardv2, error)

DashboardShow allows to retrieve a specific dashboard, given its id, from Arduino IoT Cloud.

func (*Client) DeviceCreate

func (cl *Client) DeviceCreate(ctx context.Context, fqbn, name, serial, dType string, cType *string) (*iotclient.ArduinoDevicev2, error)

DeviceCreate allows to create a new device on Arduino IoT Cloud. It returns the newly created device, and an error.

func (*Client) DeviceDelete

func (cl *Client) DeviceDelete(ctx context.Context, id string) error

DeviceDelete deletes the device corresponding to the passed ID from Arduino IoT Cloud.

func (*Client) DeviceList

func (cl *Client) DeviceList(ctx context.Context, tags map[string]string) ([]iotclient.ArduinoDevicev2, error)

DeviceList retrieves and returns a list of all Arduino IoT Cloud devices belonging to the user performing the request.

func (*Client) DeviceLoraCreate

func (cl *Client) DeviceLoraCreate(ctx context.Context, name, serial, devType, eui, freq string) (*iotclient.ArduinoLoradevicev1, error)

DeviceLoraCreate allows to create a new LoRa device on Arduino IoT Cloud. It returns the LoRa information about the newly created device, and an error.

func (*Client) DeviceOTA

func (cl *Client) DeviceOTA(ctx context.Context, id string, file *os.File, expireMins int) error

DeviceOTA performs an OTA upload request to Arduino IoT Cloud, passing the ID of the device to be updated and the actual file containing the OTA firmware.

func (*Client) DevicePassSet

func (cl *Client) DevicePassSet(ctx context.Context, id string) (*iotclient.ArduinoDevicev2Pass, error)

DevicePassSet sets the device password to the one suggested by Arduino IoT Cloud. Returns the set password.

func (*Client) DeviceShow

func (cl *Client) DeviceShow(ctx context.Context, id string) (*iotclient.ArduinoDevicev2, error)

DeviceShow allows to retrieve a specific device, given its id, from Arduino IoT Cloud.

func (*Client) DeviceTagsCreate

func (cl *Client) DeviceTagsCreate(ctx context.Context, id string, tags map[string]string) error

DeviceTagsCreate allows to create or overwrite tags on a device of Arduino IoT Cloud.

func (*Client) DeviceTagsDelete

func (cl *Client) DeviceTagsDelete(ctx context.Context, id string, keys []string) error

DeviceTagsDelete deletes the tags of a device of Arduino IoT Cloud, given the device id and the keys of the tags.

func (*Client) LoraFrequencyPlansList

func (cl *Client) LoraFrequencyPlansList(ctx context.Context) ([]iotclient.ArduinoLorafreqplanv1, error)

LoraFrequencyPlansList retrieves and returns the list of all supported LoRa frequency plans.

func (*Client) ThingCreate

func (cl *Client) ThingCreate(ctx context.Context, thing *iotclient.ThingCreate, force bool) (*iotclient.ArduinoThing, error)

ThingCreate adds a new thing on Arduino IoT Cloud.

func (*Client) ThingDelete

func (cl *Client) ThingDelete(ctx context.Context, id string) error

ThingDelete deletes a thing from Arduino IoT Cloud.

func (*Client) ThingList

func (cl *Client) ThingList(ctx context.Context, ids []string, device *string, props bool, tags map[string]string) ([]iotclient.ArduinoThing, error)

ThingList returns a list of things on Arduino IoT Cloud.

func (*Client) ThingShow

func (cl *Client) ThingShow(ctx context.Context, id string) (*iotclient.ArduinoThing, error)

ThingShow allows to retrieve a specific thing, given its id, from Arduino IoT Cloud.

func (*Client) ThingTagsCreate

func (cl *Client) ThingTagsCreate(ctx context.Context, id string, tags map[string]string) error

ThingTagsCreate allows to create or overwrite tags on a thing of Arduino IoT Cloud.

func (*Client) ThingTagsDelete

func (cl *Client) ThingTagsDelete(ctx context.Context, id string, keys []string) error

ThingTagsDelete deletes the tags of a thing of Arduino IoT Cloud, given the thing id and the keys of the tags.

func (*Client) ThingUpdate

func (cl *Client) ThingUpdate(ctx context.Context, id string, thing *iotclient.ThingUpdate, force bool) error

ThingUpdate updates a thing on Arduino IoT Cloud.

Jump to

Keyboard shortcuts

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