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
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
Name | Type | Description |
---|---|---|
envInfo.remoteBrowserIp | string | The IP of the remote browser, can be used for remote debugging |
envInfo.sdkVersion | string | The version of the Client Library |
Example
import { envInfo } from 'senza-sdk';
console.info(envInfo.remoteBrowserIp)
Modules
Classes
- DeviceManager
DeviceManager is a singleton class that manages the device
Typedefs
- WiFiInfo :
Object
deviceManager ⇒ 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
.wifiInfo- .reboot() ⇒
Promise
- .clearWifi() ⇒
Promise
- .sendDataToDevice(data) ⇒
Promise
- .factoryReset([reboot]) ⇒
Promise
- .getWifiInfo() ⇒
WiFiInfo
"wifiInfoUpdated"
deviceManager.deviceInfo
Kind: instance property of DeviceManager
Properties
Name | Type | Description |
---|---|---|
DeviceInfo | object | |
DeviceInfo.deviceId | string | |
DeviceInfo.connectionId | string | |
DeviceInfo.community | string | |
DeviceInfo.tenant | string | |
DeviceInfo.clientIp | string | |
DeviceInfo.countryCode | string | A 2-letter code as defined in ISO_3166-1 |
deviceManager.wifiInfo
Deprecated
Kind: instance property of DeviceManager
Properties
Name | Type |
---|---|
WifiInfo | object |
WifiInfo.level | number |
WifiInfo.quality | number |
WifiInfo.ssid | string |
WifiInfo.bssid | string |
deviceManager.reboot() ⇒ Promise
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
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
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.
Param | Type | Description |
---|---|---|
data | String | raw data to be passed to the device |
deviceManager.factoryReset([reboot]) ⇒ Promise
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.
Param | Type | Default | Description |
---|---|---|---|
[reboot] | Boolean | true | a flag that is passed to the device to indicate whether it should reboot after the factory reset. defaults to true. |
deviceManager.getWifiInfo() ⇒ WiFiInfo
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
Object
Kind: global typedef
Properties
Name | Type | Description |
---|---|---|
ssid | string | the name of the Wi-Fi network that the device is connected to |
bssid | string | the unique identifier of the Wi-Fi access point |
standard | string | the Wi-Fi standard in use, such as 802.11a/b/g/n/ac/ax |
security | string | the type of security protocol used by the Wi-Fi network, such as WEP, WPA, WPA2, or WPA3 |
device-mac | string | the MAC address of the device |
device-ip4 | string | the IPv4 address assigned to the device on the Wi-Fi network |
channel | number | the number of the Wi-Fi channel currently being used |
width | number | width of the Wi-Fi channel in megahertz, e.g. 20MHz or 40 MHz channel |
level | number | a 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) |
quality | number | a measure of the signal quality, in the range 0 to 100 (the higher, the better). The quality value is derived from the signal EVM. |
Updated 22 days ago