Astarte.Device.start_link
You're seeing just the function
start_link
, go back to Astarte.Device module for more information.
Link to this function
start_link(device_options)
Specs
start_link(opts :: device_options()) :: :gen_statem.start_ret()
Start an Astarte.Device
.
Device Options
pairing_url
- base URL of the Astarte Pairing API instance the device will connect to, e.g.https://astarte.api.example.com/pairing
orhttp://localhost:4003
for a local installation.realm
- Realm which the device belongs to.device_id
- Device ID of the device. The device ID must be 128-bit long and must be encoded with url-safe base64 without padding. You can generate a random one with:crypto.strong_rand_bytes(16) |> Base.url_encode64(padding: false)
.credentials_secret
- The credentials secret obtained when registering the device using Pairing API (to register a device useAstarte.API.Pairing.Agent.register_device/2
or see https://docs.astarte-platform.org/latest/api/index.html?urls.primaryName=Pairing API#/agent/registerDevice).interface_provider
- A tuple{module, args}
wheremodule
is a module implementingAstarte.Device.InterfaceProvider
behaviour andargs
are the arguments passed to its init function. It's also possible to pass a path containing the JSON interfaces the device will use, and that path will be passed toAstarte.Device.FilesystemInterfaceProvider
.credential_storage
(optional) - A tuple{module, args}
wheremodule
is a module implementingAstarte.Device.CredentialStorage
behaviour andargs
are the arguments passed to its init function. If not provided,Astarte.Device.InMemoryStorage
will be used.handler
(optional) - A tuple{module, args}
wheremodule
is a module implementingAstarte.Device.Handler
behaviour andargs
are the arguments passed to itsinit_state
function. If not provided,Astarte.Device.DefaultHandler
will be used.ignore_ssl_errors
(optional) - Defaults tofalse
, iftrue
the device will ignore SSL errors during connection. Useful if you're using the Device to connect to a test instance of Astarte with self signed certificates, it is not recommended to leave thistrue
in production.max_http_redirects
(optional) - The maximum number of HTTP redirects that will be followed by the Pairing HTTP client. Defaults to 5.