Device Manager

All web applications hosted on the Senza platform must provide settings information to the end user.

The settings information must include:

  • Device ID
  • Senza Community
  • Senza Tenant

The Client Library API described below allows the HTML5 Web App to retrieve the device information.

️ Service Level Agreement

Failure of an application to provide the listed information in the web application is listed as an exemption in the Senza Service Level Agreement, Section 4.9 "Exceptions to target monthly availability"

Functions

getDeviceInfo() (deprecated from 3.19.0)

Deprecated: use deviceManager.deviceInfo instead. Returns the device information, including device id, connection id, community, tenant, client ip and country code

Constants

envInfo

getDeviceInfo() (deprecated from 3.19.0)

Returns the device information, including device ID, connection ID, community, tenant and client ip.

Deprecated: use deviceManager.deviceInfo instead.

Kind: global function

envInfo (from version 3.1.1)

Kind: global constant
Properties

NameTypeDescription
envInfo.remoteBrowserIpstringThe IP of the remote browser, can be used for remote debugging
envInfo.sdkVersionstringThe version of the Client Library

Example

import { envInfo } from 'senza-sdk';
console.info(envInfo.remoteBrowserIp)

Modules

deviceManagerDeviceManager

Classes

DeviceManager

DeviceManager is a singleton class that manages the device

Typedefs

WiFiInfo : Object

deviceManager ⇒ DeviceManager

Returns: DeviceManager - pointer to the DeviceManager singleton
Example

import { deviceManager } from "senza-sdk";
const wifiInfo = await deviceManager.getWifiInfo();
console.info(wifiInfo.ssid);
await deviceManager.clearWifi();
deviceManager.reboot();

DeviceManager

DeviceManager is a singleton class that manages the device

Kind: global class

deviceManager.deviceInfo

Kind: instance property of DeviceManager
Properties

NameTypeDescription
DeviceInfoobject
DeviceInfo.deviceIdstring
DeviceInfo.connectionIdstring
DeviceInfo.communitystring
DeviceInfo.tenantstring
DeviceInfo.clientIpstring
DeviceInfo.countryCodestringA 2-letter code as defined in ISO_3166-1

deviceManager.wifiInfo

Deprecated

Kind: instance property of DeviceManager
Properties

NameType
WifiInfoobject
WifiInfo.levelnumber
WifiInfo.qualitynumber
WifiInfo.ssidstring
WifiInfo.bssidstring

deviceManager.reboot() ⇒ Promise

Reboot the device

Kind: instance method of DeviceManager
Returns: Promise - Promise which is resolved when the reboot command has been successfully processed.
Failure to process the reboot command will result in the promise being rejected.

deviceManager.clearWifi() ⇒ Promise

Delete current wifi configuration and forget network

Kind: instance method of DeviceManager
Returns: Promise - Promise which is resolved when the clearWifi command has been successfully processed.
Failure to process the clearWifi command will result in the promise being rejected.

deviceManager.sendDataToDevice(data) ⇒ Promise

Send raw data directly to a customer's device via the USB serial connection of a Senza device.
This function is specifically designed for customers who have their devices connected to a Senza device.
Using this API, these customers can transmit messages or data directly to their connected devices.
The transmission occurs through the Senza device's USB serial interface, facilitating direct communication
between the customer's web application and their device.

Kind: instance method of DeviceManager
Returns: Promise - Promise which is resolved when the command has been successfully processed.
Failure to process the command will result in the promise being rejected.

ParamTypeDescription
dataStringraw data to be passed to the device

deviceManager.factoryReset([reboot]) ⇒ Promise

Perform device factory reset.

Kind: instance method of DeviceManager
Returns: Promise - Promise which is resolved when factoryReset has been successfully performed
Failure to factoryReset for any reason, result in the promise being rejected.

ParamTypeDefaultDescription
[reboot]Booleantruea flag that is passed to the device to indicate whether it should reboot after the factory reset. defaults to true.

deviceManager.getWifiInfo() ⇒ WiFiInfo

Get Wi-Fi info - access point data and status (the status is cached for 5 seconds)

Kind: instance method of DeviceManager
Returns: WiFiInfo - An object containing the Wi-Fi info
Alpha: API has not yet been released

"wifiInfoUpdated"

Deprecated

Kind: event emitted by DeviceManager
Example

deviceManager.addEventListener("wifiInfoUpdated", () => {
  console.info("Wifi info has been updated to", deviceManager.wifiInfo);
});

WiFiInfo : Object

Kind: global typedef
Properties

NameTypeDescription
ssidstringthe name of the Wi-Fi network that the device is connected to
bssidstringthe unique identifier of the Wi-Fi access point
standardstringthe Wi-Fi standard in use, such as 802.11a/b/g/n/ac/ax
securitystringthe type of security protocol used by the Wi-Fi network, such as WEP, WPA, WPA2, or WPA3
device-macstringthe MAC address of the device
device-ip4stringthe IPv4 address assigned to the device on the Wi-Fi network
channelnumberthe number of the Wi-Fi channel currently being used
widthnumberwidth of the Wi-Fi channel in megahertz, e.g. 20MHz or 40 MHz channel
levelnumbera measure of the received signal strength, in the range 0 to 100 (the higher, the better). The level value is 100+RSSI (RSSI is the signal strength, measured in decibels)
qualitynumbera measure of the signal quality, in the range 0 to 100 (the higher, the better). The quality value is derived from the signal EVM.

What’s Next