@signageos/front-applet 6.4.1 → 6.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/README.md +1 -1
- package/dist/bundle.js +1 -1
- package/dist/bundle.js.map +1 -1
- package/docs/content/js-command.md +5 -5
- package/docs/content/js-file-system.md +5 -17
- package/docs/content/js-hardware.md +3 -15
- package/docs/content/js-iframes.md +6 -30
- package/docs/content/js-input.md +3 -15
- package/docs/index.md +2 -2
- package/docs/management/js-management-monitoring-commands.md +1 -1
- package/docs/management/js-management-native-commands-mdc.md +74 -0
- package/docs/management/js-management-package.md +3 -15
- package/docs/management/js-management-power.md +6 -30
- package/docs/management/js-management-screen.md +1 -1
- package/docs/management/js-management-security.md +3 -15
- package/docs/management/js-management-time.md +3 -17
- package/docs/management/js-management-wifi.md +4 -15
- package/es6/FrontApplet/FrontApplet.d.ts +2 -0
- package/es6/FrontApplet/FrontApplet.js +2 -0
- package/es6/FrontApplet/FrontApplet.js.map +1 -1
- package/es6/FrontApplet/Native/MDC/CodesMDC.d.ts +149 -0
- package/es6/FrontApplet/Native/MDC/CodesMDC.js +154 -0
- package/es6/FrontApplet/Native/MDC/CodesMDC.js.map +1 -0
- package/es6/FrontApplet/Native/MDC/Mdc.d.ts +20 -0
- package/es6/FrontApplet/Native/MDC/Mdc.js +49 -0
- package/es6/FrontApplet/Native/MDC/Mdc.js.map +1 -0
- package/es6/FrontApplet/Native/Native.d.ts +10 -0
- package/es6/FrontApplet/Native/Native.js +16 -0
- package/es6/FrontApplet/Native/Native.js.map +1 -0
- package/package.json +1 -1
|
@@ -15,7 +15,7 @@ description: "[Content JS API] In some cases, you might be interested in a compl
|
|
|
15
15
|
|
|
16
16
|
In some cases, you might be interested in a complete log of what the device was doing during its operation. All of your business or technical logs can be stored in our storage for later usage. You can identify which events happened or even trigger self-repairing logic.
|
|
17
17
|
|
|
18
|
-
All commands will be available in [Applet Command REST API](https://
|
|
18
|
+
All commands will be available in [Applet Command REST API](https://developers.signageos.io/api/#tag/DeviceApplet-Command) and can be downloaded [historically as CSV export](https://developers.signageos.io/api/#tag/DeviceMonitoring/paths/~1v1~1device~1%7BdeviceUid%7D~1report/get).
|
|
19
19
|
|
|
20
20
|
## All methods
|
|
21
21
|
|
|
@@ -89,14 +89,14 @@ dispatch(command: ICommand): void;
|
|
|
89
89
|
```
|
|
90
90
|
|
|
91
91
|
:::note[GitHub Example]
|
|
92
|
-
[Rest API: Get Commands](https://
|
|
92
|
+
[Rest API: Get Commands](https://developers.signageos.io/api/#tag/DeviceApplet-Command/paths/~1v1~1device~1%7BdeviceUid%7D~1applet~1command/get)
|
|
93
93
|
|
|
94
94
|
Receiving your data dispatched from devices
|
|
95
95
|
|
|
96
96
|
:::
|
|
97
97
|
|
|
98
98
|
:::note[GitHub Example]
|
|
99
|
-
[Rest API: Monitoring/Device Reports](https://
|
|
99
|
+
[Rest API: Monitoring/Device Reports](https://developers.signageos.io/api/#tag/DeviceMonitoring/paths/~1v1~1device~1%7BdeviceUid%7D~1report/get)
|
|
100
100
|
|
|
101
101
|
Receiving historical data
|
|
102
102
|
|
|
@@ -104,7 +104,7 @@ Receiving historical data
|
|
|
104
104
|
|
|
105
105
|
## onCommand()
|
|
106
106
|
Used for sending custom messages to online connected devices.
|
|
107
|
-
This can be done through the REST API by [POST new applet command](https://
|
|
107
|
+
This can be done through the REST API by [POST new applet command](https://developers.signageos.io/api/#tag/DeviceApplet-Command/paths/~1v1~1device~1%7BdeviceUid%7D~1applet~1%7BappletUid%7D~1command/post).
|
|
108
108
|
The command will be dispatched to the device & the applet can set up the logic by subscribing `onCommand` method.
|
|
109
109
|
|
|
110
110
|
**Parameters:**
|
|
@@ -134,7 +134,7 @@ onCommand(listener: (command: ICommand) => void): void;
|
|
|
134
134
|
```
|
|
135
135
|
|
|
136
136
|
:::note[GitHub Example]
|
|
137
|
-
[Rest API: Monitoring](https://
|
|
137
|
+
[Rest API: Monitoring](https://developers.signageos.io/api/#tag/DeviceMonitoring)
|
|
138
138
|
|
|
139
139
|
Creating monitoring data
|
|
140
140
|
:::
|
|
@@ -19,21 +19,9 @@ File System API works with both in **internal and external storages** (USB flash
|
|
|
19
19
|
File System directory structure is **PERSISTENT** and is **NOT** automatically deleted through `Applet Reload` power action! Applet Reload only deletes `/data` directory which is reserved for simplified [Offline Cache API](js-offline-cache-media-files). Use `deleteFile()` to clear the device storage file system.
|
|
20
20
|
:::
|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
<div>
|
|
26
|
-
<div class="wide-box__image d-flex align-items-center">
|
|
27
|
-
<i class="fab fa-github svg-black"></i>
|
|
28
|
-
</div>
|
|
29
|
-
<div>
|
|
30
|
-
<h3 class="wide-box__title wide-box__title__small pl-85">Complete example of the File System API on our Github</h3>
|
|
31
|
-
<div class="wide-box__description">Working example on our Github</div>
|
|
32
|
-
</div>
|
|
33
|
-
</div>
|
|
34
|
-
</a>
|
|
35
|
-
</div>
|
|
36
|
-
</div>
|
|
22
|
+
:::note[GitHub Examples]
|
|
23
|
+
[Complete example of the File System API on our Github](https://github.com/signageos/applet-examples/blob/master/examples/content-js-api/file-system)
|
|
24
|
+
:::
|
|
37
25
|
|
|
38
26
|
:::note[Alternative file caching]
|
|
39
27
|
[Offline Cache for media files](js-offline-cache-media-files)
|
|
@@ -245,7 +233,7 @@ Return statement is a dynamic object! It has to be always generated and retrieve
|
|
|
245
233
|
|
|
246
234
|
### Parameters
|
|
247
235
|
|
|
248
|
-
| Param | Type | Required | Description |
|
|
236
|
+
| Param | Type | Required | Description |
|
|
249
237
|
| -------------- | ----- | :------: | ------ |
|
|
250
238
|
| `filePath` | FilePath | <div class="red">Yes</div> | Object contains storageUnit object returned by `listStorageUnits()` and `filePath` if the file or directory |
|
|
251
239
|
|
|
@@ -274,7 +262,7 @@ Download file to path within existing directory or **overrides existing file** i
|
|
|
274
262
|
|
|
275
263
|
### Parameters
|
|
276
264
|
|
|
277
|
-
|
|
|
265
|
+
| Param | Type | Required | Description |
|
|
278
266
|
| -------------- | ----- | :----: | ---- |
|
|
279
267
|
| `filePath` | FilePath | <div class="red">Yes</div> | Object contains storageUnit object returned by `listStorageUnits()` and `filePath` if the file or directory |
|
|
280
268
|
| `uri` | String | <div class="red">Yes</div> | Url address to retrieve the file from network |
|
|
@@ -40,21 +40,9 @@ Some Philips brand devices have LED lights built into them. The color of lights
|
|
|
40
40
|
sos.hardware.led.setColor("#00FF00"); // For GREEN light
|
|
41
41
|
```
|
|
42
42
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
<div>
|
|
47
|
-
<div class="wide-box__image d-flex align-items-center">
|
|
48
|
-
<i class="fab fa-github svg-black"></i>
|
|
49
|
-
</div>
|
|
50
|
-
<div>
|
|
51
|
-
<h3 class="wide-box__title wide-box__title__small pl-85">Example of Applet with LED usage</h3>
|
|
52
|
-
<div class="wide-box__description">Working example on our Github</div>
|
|
53
|
-
</div>
|
|
54
|
-
</div>
|
|
55
|
-
</a>
|
|
56
|
-
</div>
|
|
57
|
-
</div>
|
|
43
|
+
:::note[GitHub Example]
|
|
44
|
+
[Example of Applet with LED usage](https://github.com/signageos/applet-examples/blob/master/examples/content-js-api/hardware-led)
|
|
45
|
+
:::
|
|
58
46
|
|
|
59
47
|
## Errors
|
|
60
48
|
Although we are doing our best, following errors may occur when working with the hardware.
|
|
@@ -36,21 +36,9 @@ First applet, what will be as iframe in main applet. There is also **required ev
|
|
|
36
36
|
</script>
|
|
37
37
|
```
|
|
38
38
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
<div>
|
|
43
|
-
<div class="wide-box__image d-flex align-items-center">
|
|
44
|
-
<i class="fab fa-github svg-black"></i>
|
|
45
|
-
</div>
|
|
46
|
-
<div>
|
|
47
|
-
<h3 class="wide-box__title wide-box__title__small pl-85">Applet that will be in Iframe</h3>
|
|
48
|
-
<div class="wide-box__description">Working example on our Github</div>
|
|
49
|
-
</div>
|
|
50
|
-
</div>
|
|
51
|
-
</a>
|
|
52
|
-
</div>
|
|
53
|
-
</div>
|
|
39
|
+
:::note[GitHub Example]
|
|
40
|
+
[Applet that will be in Iframe](https://github.com/signageos/applet-examples/blob/master/examples/content-js-api/iframes)
|
|
41
|
+
:::
|
|
54
42
|
|
|
55
43
|
## Finally, use created applet in another applet as iframe.
|
|
56
44
|
|
|
@@ -73,18 +61,6 @@ window.addEventListener('sos.loaded', () => {
|
|
|
73
61
|
});
|
|
74
62
|
```
|
|
75
63
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
<div>
|
|
80
|
-
<div class="wide-box__image d-flex align-items-center">
|
|
81
|
-
<i class="fab fa-github svg-black"></i>
|
|
82
|
-
</div>
|
|
83
|
-
<div>
|
|
84
|
-
<h3 class="wide-box__title wide-box__title__small pl-85">How to use Iframes in Applet</h3>
|
|
85
|
-
<div class="wide-box__description">Working example on our Github</div>
|
|
86
|
-
</div>
|
|
87
|
-
</div>
|
|
88
|
-
</a>
|
|
89
|
-
</div>
|
|
90
|
-
</div>
|
|
64
|
+
:::note[GitHub Example]
|
|
65
|
+
[How to use Iframes in Applet](https://github.com/signageos/applet-examples/blob/master/examples/content-js-api/iframes)
|
|
66
|
+
:::
|
package/docs/content/js-input.md
CHANGED
|
@@ -66,18 +66,6 @@ interface IKeyUpEventListener {
|
|
|
66
66
|
onKeyUp(listener: IKeyUpEventListener): void;
|
|
67
67
|
```
|
|
68
68
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
<div>
|
|
73
|
-
<div class="wide-box__image d-flex align-items-center">
|
|
74
|
-
<i class="fab fa-github svg-black"></i>
|
|
75
|
-
</div>
|
|
76
|
-
<div>
|
|
77
|
-
<h3 class="wide-box__title wide-box__title__small pl-85">IR Input handling</h3>
|
|
78
|
-
<div class="wide-box__description">Working example on our Github</div>
|
|
79
|
-
</div>
|
|
80
|
-
</div>
|
|
81
|
-
</a>
|
|
82
|
-
</div>
|
|
83
|
-
</div>
|
|
69
|
+
:::note[GitHub Example]
|
|
70
|
+
[IR Input handling](https://github.com/signageos/applet-examples/tree/master/examples/content-js-api/remote-control)
|
|
71
|
+
:::
|
package/docs/index.md
CHANGED
|
@@ -55,7 +55,7 @@ Universal APIs for File system, access to accelerated video playback, sensor man
|
|
|
55
55
|
Device control features exposed via Javascript APIs.
|
|
56
56
|
|
|
57
57
|
:::tip
|
|
58
|
-
For **Device Management** we strongly recommend using REST APIs. [See the REST API documentation here](https://
|
|
58
|
+
For **Device Management** we strongly recommend using REST APIs. [See the REST API documentation here](https://developers.signageos.io/api/).
|
|
59
59
|
:::
|
|
60
60
|
|
|
61
61
|
|
|
@@ -94,4 +94,4 @@ See full [documentation on GitHub](https://github.com/signageos/sdk)
|
|
|
94
94
|
|
|
95
95
|
Large collection of REST API endpoints for device management and monitoring.
|
|
96
96
|
|
|
97
|
-
See full [documentation on Postman](https://
|
|
97
|
+
See full [documentation on Postman](https://developers.signageos.io/api/)
|
|
@@ -69,7 +69,7 @@ export interface ConsoleLogged {
|
|
|
69
69
|
}
|
|
70
70
|
```
|
|
71
71
|
|
|
72
|
-
To trigger some monitoring commands to be dispatched from a device. This REST API can be used to send monitoring [commands to the device](https://
|
|
72
|
+
To trigger some monitoring commands to be dispatched from a device. This REST API can be used to send monitoring [commands to the device](https://developers.signageos.io/api/#tag/DeviceApplet-Command/paths/~1v1~1device~1%7BdeviceUid%7D~1applet~1%7BappletUid%7D~1command/post). Following commands can be used:
|
|
73
73
|
|
|
74
74
|
### Typescript
|
|
75
75
|
```typescript
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Native Commands (MDC)
|
|
3
|
+
author: Josef Král
|
|
4
|
+
date: 19.3.2024
|
|
5
|
+
type: js-management-api
|
|
6
|
+
tags:
|
|
7
|
+
- applet
|
|
8
|
+
- applet_api
|
|
9
|
+
- api
|
|
10
|
+
- js_management_api
|
|
11
|
+
- mdc
|
|
12
|
+
- tizen
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
# Native Commands (MDC)
|
|
16
|
+
Native Commands API allows you to control the device using native commands.
|
|
17
|
+
|
|
18
|
+
:::warning
|
|
19
|
+
- This API is supported only on Tizen devices.
|
|
20
|
+
:::
|
|
21
|
+
|
|
22
|
+
## All methods
|
|
23
|
+
|
|
24
|
+
| Method | Description | Supported since |
|
|
25
|
+
| ------ | ------ | ------------- |
|
|
26
|
+
| `sendOne()` | Send MDC command on one IP address (or localhost) | 6.5.0 |
|
|
27
|
+
|
|
28
|
+
## sendOne()
|
|
29
|
+
Method `sendOne()` will send MDC command on one IP address (or localhost).
|
|
30
|
+
|
|
31
|
+
| Param | Type | Required | Description |
|
|
32
|
+
| -------------- | ----------------------| :-------: | -------------------- |
|
|
33
|
+
| `ipAddress` | string | <div class="red">Yes</div> | IP address or `localhost` |
|
|
34
|
+
| `command` | number | <div class="red">Yes</div> | Command to send |
|
|
35
|
+
| `data` | array | <div class="yellow">No</div> | Data for command/subcommands |
|
|
36
|
+
|
|
37
|
+
### Javascript example
|
|
38
|
+
```javascript
|
|
39
|
+
await sos.native.mdc.sendOne('localhost', CodesMDC.BRIGHTNESS_CONTROL); // Promise<IMDCResponse>
|
|
40
|
+
await sos.native.mdc.sendOne('192.168.0.10', CodesMDC.VOLUME_CONTROL, [50]); // Promise<IMDCResponse>
|
|
41
|
+
await sos.native.mdc.sendOne('192.168.0.10', CodesMDC.PICTURE_CONTROL, [0x54, 0x03]); // Promise<IMDCResponse>
|
|
42
|
+
|
|
43
|
+
// You can also send custom number if we don't have predefined command in our enum
|
|
44
|
+
await sos.native.mdc.sendOne('192.168.0.10', 0x01, []); // Promise<IMDCResponse>
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
### Example of returned object
|
|
48
|
+
```javascript
|
|
49
|
+
{
|
|
50
|
+
"type": "ACK", // or NACK
|
|
51
|
+
"commandType": 4,
|
|
52
|
+
"result": 0, // Value what command returned
|
|
53
|
+
}
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## CodesMDC
|
|
57
|
+
CodesMDC is an enum with all predefined commands, it's useful if you are writing applet in JavaScript or TypeScript.
|
|
58
|
+
|
|
59
|
+
### Example of few commands
|
|
60
|
+
```typescript
|
|
61
|
+
import { CodesMDC } from '@signageos/front-applet/es6/FrontApplet/Native/MDC/CodesMDC';
|
|
62
|
+
export enum CodesMDC {
|
|
63
|
+
STATUS_CONTROL = 0x00,
|
|
64
|
+
VIDEO_CONTROL = 0x04,
|
|
65
|
+
RGB_CONTROL = 0x06,
|
|
66
|
+
PIP_STATUS_CONTROL = 0x07,
|
|
67
|
+
MAINTENANCE_CONTROL = 0x08,
|
|
68
|
+
SOUND_CONTROL = 0x09,
|
|
69
|
+
// ...
|
|
70
|
+
}
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
|
|
@@ -43,18 +43,6 @@ await sos.management.package.install(
|
|
|
43
43
|
);
|
|
44
44
|
```
|
|
45
45
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
<div>
|
|
50
|
-
<div class="wide-box__image d-flex align-items-center">
|
|
51
|
-
<i class="fab fa-github svg-black"></i>
|
|
52
|
-
</div>
|
|
53
|
-
<div>
|
|
54
|
-
<h3 class="wide-box__title wide-box__title__small pl-85">How to install package on device</h3>
|
|
55
|
-
<div class="wide-box__description">Working example on our Github</div>
|
|
56
|
-
</div>
|
|
57
|
-
</div>
|
|
58
|
-
</a>
|
|
59
|
-
</div>
|
|
60
|
-
</div>
|
|
46
|
+
:::note[GitHub Example]
|
|
47
|
+
[How to install package on device](https://github.com/signageos/applet-examples/blob/master/examples/management-js-api/package-install/)
|
|
48
|
+
:::
|
|
@@ -35,21 +35,9 @@ Method `systemReboot()` will reboot a targeted device.
|
|
|
35
35
|
await sos.management.power.systemReboot(); // Returns void
|
|
36
36
|
```
|
|
37
37
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
<div>
|
|
42
|
-
<div class="wide-box__image d-flex align-items-center">
|
|
43
|
-
<i class="fab fa-github svg-black"></i>
|
|
44
|
-
</div>
|
|
45
|
-
<div>
|
|
46
|
-
<h3 class="wide-box__title wide-box__title__small pl-85">Management System Reboot</h3>
|
|
47
|
-
<div class="wide-box__description">Working example on our Github</div>
|
|
48
|
-
</div>
|
|
49
|
-
</div>
|
|
50
|
-
</a>
|
|
51
|
-
</div>
|
|
52
|
-
</div>
|
|
38
|
+
:::note[GitHub Example]
|
|
39
|
+
[Management System Reboot](https://github.com/signageos/applet-examples/blob/master/examples/management-js-api/system-reboot/)
|
|
40
|
+
:::
|
|
53
41
|
|
|
54
42
|
## appRestart()
|
|
55
43
|
Method `appRestart()` will restart the application on a targeted device.
|
|
@@ -182,18 +170,6 @@ const timers = await sos.management.power.getProprietaryTimers();
|
|
|
182
170
|
]
|
|
183
171
|
```
|
|
184
172
|
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
<div>
|
|
189
|
-
<div class="wide-box__image d-flex align-items-center">
|
|
190
|
-
<i class="fab fa-github svg-black"></i>
|
|
191
|
-
</div>
|
|
192
|
-
<div>
|
|
193
|
-
<h3 class="wide-box__title wide-box__title__small pl-85">How to use timer in Applet</h3>
|
|
194
|
-
<div class="wide-box__description">Working example on our Github</div>
|
|
195
|
-
</div>
|
|
196
|
-
</div>
|
|
197
|
-
</a>
|
|
198
|
-
</div>
|
|
199
|
-
</div>
|
|
173
|
+
:::note[GitHub Example]
|
|
174
|
+
[How to use timer in Applet](https://github.com/signageos/applet-examples/blob/master/examples/management-js-api/timer/)
|
|
175
|
+
:::
|
|
@@ -158,7 +158,7 @@ Method `powerOff()` turns off the targeted display.
|
|
|
158
158
|
:::warning
|
|
159
159
|
On Android devices, `powerOff()` also shuts down the webview and the Applet. It's default Android behavior that cannot be changed. Once the Applet is off, you cannot call `powerOn()` to resume the playback.
|
|
160
160
|
|
|
161
|
-
To manage the display On/Off state, use [REST API Power Actions](https://
|
|
161
|
+
To manage the display On/Off state, use [REST API Power Actions](https://developers.signageos.io/api/#tag/DevicePower-Actions) instead.
|
|
162
162
|
:::
|
|
163
163
|
|
|
164
164
|
```javascript
|
|
@@ -45,21 +45,9 @@ PIN code `0000` is not allowed according to the default PIN after boot when the
|
|
|
45
45
|
await sos.management.security.setPinCode("9999");
|
|
46
46
|
```
|
|
47
47
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
<div>
|
|
52
|
-
<div class="wide-box__image d-flex align-items-center">
|
|
53
|
-
<i class="fab fa-github svg-black"></i>
|
|
54
|
-
</div>
|
|
55
|
-
<div>
|
|
56
|
-
<h3 class="wide-box__title wide-box__title__small pl-85">Management Security PIN code</h3>
|
|
57
|
-
<div class="wide-box__description">Working example on our Github</div>
|
|
58
|
-
</div>
|
|
59
|
-
</div>
|
|
60
|
-
</a>
|
|
61
|
-
</div>
|
|
62
|
-
</div>
|
|
48
|
+
:::note[GitHub Example]
|
|
49
|
+
[Management Security PIN code](https://github.com/signageos/applet-examples/blob/master/examples/management-js-api/security-pin-code/)
|
|
50
|
+
:::
|
|
63
51
|
|
|
64
52
|
|
|
65
53
|
## generateRandomPinCode()
|
|
@@ -32,23 +32,9 @@ Method `get()` lets you check for current time with time zone.
|
|
|
32
32
|
const time = await sos.management.time.get();
|
|
33
33
|
```
|
|
34
34
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
<div>
|
|
39
|
-
<div class="wide-box__image d-flex align-items-center">
|
|
40
|
-
<i class="fab fa-github svg-black"></i>
|
|
41
|
-
</div>
|
|
42
|
-
<div>
|
|
43
|
-
<h3 class="wide-box__title wide-box__title__small pl-85">How to manage time on device</h3>
|
|
44
|
-
<div class="wide-box__description">Working example on our Github</div>
|
|
45
|
-
</div>
|
|
46
|
-
</div>
|
|
47
|
-
</a>
|
|
48
|
-
</div>
|
|
49
|
-
</div>
|
|
50
|
-
|
|
51
|
-
<br/>
|
|
35
|
+
:::note[GitHub Example]
|
|
36
|
+
[How to manage time on device](https://github.com/signageos/applet-examples/blob/master/examples/management-js-api/time)
|
|
37
|
+
:::
|
|
52
38
|
|
|
53
39
|
### Example of response
|
|
54
40
|
|
|
@@ -85,21 +85,10 @@ See [`getCountry()`](js-management-wifi#getcountry) and [`setCountry()`](js-mana
|
|
|
85
85
|
| `disabled` | Wi-Fi was set to DISABLED state
|
|
86
86
|
|
|
87
87
|
## Examples
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
<div class="wide-box__image d-flex align-items-center">
|
|
93
|
-
<i class="fab fa-github svg-black"></i>
|
|
94
|
-
</div>
|
|
95
|
-
<div>
|
|
96
|
-
<h3 class="wide-box__title wide-box__title__small pl-85">Applet with Wi-Fi Access Point</h3>
|
|
97
|
-
<div class="wide-box__description">Working example on our Github</div>
|
|
98
|
-
</div>
|
|
99
|
-
</div>
|
|
100
|
-
</a>
|
|
101
|
-
</div>
|
|
102
|
-
</div>
|
|
88
|
+
|
|
89
|
+
:::note[GitHub Example]
|
|
90
|
+
[Applet with Wi-Fi Access Point](https://github.com/signageos/applet-examples/blob/master/examples/management-js-api/wifi-access-point/)
|
|
91
|
+
:::
|
|
103
92
|
|
|
104
93
|
## isClientEnabled()
|
|
105
94
|
Returns true, if Wi-Fi is in CLIENT state. Otherwise, returns false.
|
|
@@ -19,6 +19,7 @@ import Monitors from './Monitors/Monitors';
|
|
|
19
19
|
import Sensors from './Sensors/Sensors';
|
|
20
20
|
import OSD from './OSD/OSD';
|
|
21
21
|
import ProofOfPlay from './ProofOfPlay/ProofOfPlay';
|
|
22
|
+
import Native from './Native/Native';
|
|
22
23
|
export default class FrontApplet {
|
|
23
24
|
readonly window: Window & WeinreData;
|
|
24
25
|
private messagePrefix;
|
|
@@ -46,6 +47,7 @@ export default class FrontApplet {
|
|
|
46
47
|
readonly osd: OSD;
|
|
47
48
|
readonly proofOfPlay: ProofOfPlay;
|
|
48
49
|
readonly sensors: Sensors;
|
|
50
|
+
readonly native: Native;
|
|
49
51
|
private readyEmitter;
|
|
50
52
|
private invocationResponseEmitter;
|
|
51
53
|
private javascriptLoadFileController;
|
|
@@ -34,6 +34,7 @@ const Sensors_1 = require("./Sensors/Sensors");
|
|
|
34
34
|
const Exchange_1 = require("./Exchange/Exchange");
|
|
35
35
|
const OSD_1 = require("./OSD/OSD");
|
|
36
36
|
const ProofOfPlay_1 = require("./ProofOfPlay/ProofOfPlay");
|
|
37
|
+
const Native_1 = require("./Native/Native");
|
|
37
38
|
class FrontApplet {
|
|
38
39
|
constructor(window, messagePrefix) {
|
|
39
40
|
this.window = window;
|
|
@@ -61,6 +62,7 @@ class FrontApplet {
|
|
|
61
62
|
this.osd = new OSD_1.default(messagePrefix, this.postMessage.bind(this));
|
|
62
63
|
this.proofOfPlay = new ProofOfPlay_1.default(this.command);
|
|
63
64
|
this.sensors = new Sensors_1.default(messagePrefix);
|
|
65
|
+
this.native = new Native_1.default(messagePrefix, this.postMessage.bind(this));
|
|
64
66
|
this.javascriptLoadFileController = new JavascriptLoadFileController_1.default(this.window);
|
|
65
67
|
this.window.addEventListener('message', (event) => this.handleMessage(event));
|
|
66
68
|
this.postMessage({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FrontApplet.js","sourceRoot":"","sources":["../../src/FrontApplet/FrontApplet.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,mCAAsC;AACtC,gDAAsD;AAEtD,yCAAkC;AAClC,4CAAqC;AACrC,+CAAwC;AAExC,kGAA2F;AAC3F,+CAAwC;AACxC,kDAA2C;AAC3C,+CAAwC;AACxC,4CAAqC;AACrC,yCAAkC;AAClC,yCAAkC;AAClC,yCAAkD;AAClD,wDAAiD;AACjD,+CAAwC;AACxC,4CAAqC;AACrC,sCAA+B;AAC/B,wDAAiD;AACjD,qDAA2E;AAC3E,wDAAiD;AACjD,kDAA2C;AAC3C,+CAAwC;AACxC,kDAAqD;AAC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