@signageos/front-applet 8.1.2 → 8.1.4
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/dist/bundle.js +1 -1
- package/dist/bundle.js.map +1 -1
- package/docs/sos/browser.md +66 -14
- package/docs/sos/command.md +52 -6
- package/docs/sos/debug.md +21 -2
- package/docs/sos/deviceInfo.md +31 -0
- package/docs/sos/display.md +34 -3
- package/docs/sos/fileSystem.md +1135 -59
- package/docs/sos/hardware/barcodeScanner.md +58 -15
- package/docs/sos/hardware/index.md +72 -15
- package/docs/sos/hardware/led.md +32 -3
- package/docs/sos/index.md +3 -3
- package/docs/sos/input.md +42 -1
- package/docs/sos/monitors.md +8 -0
- package/docs/sos/native/mdc.md +69 -23
- package/docs/sos/offline/cache.md +376 -30
- package/docs/sos/offline/index.md +127 -24
- package/docs/sos/osd.md +8 -1
- package/docs/sos/proofOfPlay.md +28 -0
- package/docs/sos/stream.md +78 -78
- package/docs/sos/sync.md +228 -21
- package/docs/sos/video.md +73 -73
- package/docs/sos_management/app.md +11 -11
- package/docs/sos_management/audio.md +3 -3
- package/docs/sos_management/firmware.md +11 -11
- package/docs/sos_management/index.md +9 -9
- package/docs/sos_management/network.md +10 -10
- package/docs/sos_management/package.md +6 -6
- package/docs/sos_management/power.md +27 -27
- package/docs/sos_management/screen.md +17 -17
- package/docs/sos_management/security.md +3 -3
- package/docs/sos_management/time.md +8 -8
- package/docs/sos_management/wifi.md +12 -12
- package/es6/FrontApplet/Browser/Browser.d.ts +25 -9
- package/es6/FrontApplet/Browser/Browser.js +25 -9
- package/es6/FrontApplet/Browser/Browser.js.map +1 -1
- package/es6/FrontApplet/Browser/IOpenLinkOptions.d.ts +7 -0
- package/es6/FrontApplet/Browser/IOpenLinkOptions.js.map +1 -1
- package/es6/FrontApplet/Browser/events.d.ts +6 -0
- package/es6/FrontApplet/Browser/events.js.map +1 -1
- package/es6/FrontApplet/Command/Command.d.ts +15 -6
- package/es6/FrontApplet/Command/Command.js +15 -6
- package/es6/FrontApplet/Command/Command.js.map +1 -1
- package/es6/FrontApplet/Command/ICommand.d.ts +7 -0
- package/es6/FrontApplet/Command/ICommandEvent.d.ts +6 -0
- package/es6/FrontApplet/Debug/Debug.d.ts +11 -3
- package/es6/FrontApplet/Debug/Debug.js +11 -3
- package/es6/FrontApplet/Debug/Debug.js.map +1 -1
- package/es6/FrontApplet/DeviceInfo/DeviceInfo.d.ts +19 -0
- package/es6/FrontApplet/DeviceInfo/DeviceInfo.js +20 -2
- package/es6/FrontApplet/DeviceInfo/DeviceInfo.js.map +1 -1
- package/es6/FrontApplet/Display/Display.d.ts +22 -14
- package/es6/FrontApplet/Display/Display.js +22 -14
- package/es6/FrontApplet/Display/Display.js.map +1 -1
- package/es6/FrontApplet/Display/IDisplay.d.ts +4 -0
- package/es6/FrontApplet/FileSystem/FileSystem.d.ts +429 -41
- package/es6/FrontApplet/FileSystem/FileSystem.js +427 -39
- package/es6/FrontApplet/FileSystem/FileSystem.js.map +1 -1
- package/es6/FrontApplet/FileSystem/HashAlgorithm.d.ts +4 -1
- package/es6/FrontApplet/FileSystem/types.d.ts +46 -0
- package/es6/FrontApplet/FileSystem/types.js.map +1 -1
- package/es6/FrontApplet/Hardware/BarcodeScanner/BarcodeScanner.d.ts +36 -8
- package/es6/FrontApplet/Hardware/BarcodeScanner/BarcodeScanner.js +34 -2
- package/es6/FrontApplet/Hardware/BarcodeScanner/BarcodeScanner.js.map +1 -1
- package/es6/FrontApplet/Hardware/BarcodeScanner/IBarcodeScanner.d.ts +5 -0
- package/es6/FrontApplet/Hardware/Hardware.d.ts +34 -5
- package/es6/FrontApplet/Hardware/Hardware.js +33 -5
- package/es6/FrontApplet/Hardware/Hardware.js.map +1 -1
- package/es6/FrontApplet/Hardware/ISerialPort.d.ts +17 -1
- package/es6/FrontApplet/Hardware/ISerialPortDataMessage.d.ts +3 -0
- package/es6/FrontApplet/Hardware/ISerialPortOptions.d.ts +6 -0
- package/es6/FrontApplet/Hardware/ISerialPortOptions.js +3 -0
- package/es6/FrontApplet/Hardware/ISerialPortOptions.js.map +1 -1
- package/es6/FrontApplet/Hardware/Led/Led.d.ts +19 -3
- package/es6/FrontApplet/Hardware/Led/Led.js +19 -3
- package/es6/FrontApplet/Hardware/Led/Led.js.map +1 -1
- package/es6/FrontApplet/Input/IKeyUpEvent.d.ts +9 -0
- package/es6/FrontApplet/Input/IKeyUpEvent.js +6 -0
- package/es6/FrontApplet/Input/IKeyUpEvent.js.map +1 -1
- package/es6/FrontApplet/Input/Input.d.ts +17 -1
- package/es6/FrontApplet/Input/Input.js +17 -1
- package/es6/FrontApplet/Input/Input.js.map +1 -1
- package/es6/FrontApplet/Monitors/Monitors.d.ts +5 -0
- package/es6/FrontApplet/Monitors/Monitors.js +5 -0
- package/es6/FrontApplet/Monitors/Monitors.js.map +1 -1
- package/es6/FrontApplet/NativeCommands/MDC/INativeMdcCommands.d.ts +1 -0
- package/es6/FrontApplet/NativeCommands/MDC/Mdc.d.ts +32 -11
- package/es6/FrontApplet/NativeCommands/MDC/Mdc.js +14 -11
- package/es6/FrontApplet/NativeCommands/MDC/Mdc.js.map +1 -1
- package/es6/FrontApplet/OSD/OSD.d.ts +5 -1
- package/es6/FrontApplet/OSD/OSD.js +5 -1
- package/es6/FrontApplet/OSD/OSD.js.map +1 -1
- package/es6/FrontApplet/Offline/Cache/Cache.d.ts +205 -28
- package/es6/FrontApplet/Offline/Cache/Cache.js +205 -28
- package/es6/FrontApplet/Offline/Cache/Cache.js.map +1 -1
- package/es6/FrontApplet/Offline/IAddFont.js.map +1 -1
- package/es6/FrontApplet/Offline/IFileType.js.map +1 -1
- package/es6/FrontApplet/Offline/ISaveFile.d.ts +3 -0
- package/es6/FrontApplet/Offline/ISaveFile.js.map +1 -1
- package/es6/FrontApplet/Offline/Offline.d.ts +58 -15
- package/es6/FrontApplet/Offline/Offline.js +56 -13
- package/es6/FrontApplet/Offline/Offline.js.map +1 -1
- package/es6/FrontApplet/ProofOfPlay/IRecordItemOptions.d.ts +3 -0
- package/es6/FrontApplet/ProofOfPlay/ProofOfPlay.d.ts +15 -1
- package/es6/FrontApplet/ProofOfPlay/ProofOfPlay.js +15 -1
- package/es6/FrontApplet/ProofOfPlay/ProofOfPlay.js.map +1 -1
- package/es6/FrontApplet/Sync/Sync.d.ts +101 -18
- package/es6/FrontApplet/Sync/Sync.js +84 -10
- package/es6/FrontApplet/Sync/Sync.js.map +1 -1
- package/package.json +1 -1
|
@@ -4,36 +4,39 @@ sidebar_position: 0
|
|
|
4
4
|
|
|
5
5
|
# barcodeScanner
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
The `sos.hardware.barcodeScanner` API provides methods for working with barcode scanners.
|
|
8
|
+
It allows starting and stopping the scanner, as well as listening for scanned data and errors.
|
|
8
9
|
|
|
9
|
-
|
|
10
|
+
:::note
|
|
11
|
+
This API is experimental and may change in the future.
|
|
12
|
+
:::
|
|
10
13
|
|
|
11
|
-
|
|
14
|
+
## Methods
|
|
12
15
|
|
|
13
|
-
|
|
16
|
+
### getVersion()
|
|
14
17
|
|
|
15
|
-
|
|
18
|
+
The `getVersion()` method returns the version of the barcode scanner.
|
|
16
19
|
|
|
17
20
|
```ts expandable
|
|
18
21
|
getVersion(): Promise<string>;
|
|
19
22
|
```
|
|
20
23
|
|
|
21
|
-
|
|
24
|
+
#### Return value
|
|
22
25
|
|
|
23
|
-
|
|
26
|
+
Returns a promise that resolves to the version of the barcode scanner.
|
|
24
27
|
|
|
25
|
-
|
|
28
|
+
#### Possible errors
|
|
26
29
|
|
|
27
|
-
|
|
30
|
+
If the version cannot be retrieved.
|
|
28
31
|
|
|
29
|
-
|
|
32
|
+
<Separator />
|
|
33
|
+
|
|
34
|
+
### start()
|
|
35
|
+
|
|
36
|
+
The `start()` starts the barcode scanner and starts listening for scanned data.
|
|
30
37
|
|
|
31
38
|
```ts expandable
|
|
32
|
-
start(userOptions?: Omit<IBarcodeScannerOptions, 'scannerId'>): Promise<
|
|
33
|
-
stop: () => Promise<void>;
|
|
34
|
-
onData: (listener: (data: string) => void) => void;
|
|
35
|
-
onError: (listener: (error: Error) => void) => void;
|
|
36
|
-
}>;
|
|
39
|
+
start(userOptions?: Omit<IBarcodeScannerOptions, 'scannerId'>): Promise<IBarcodeScannerResponse>;
|
|
37
40
|
// show-more
|
|
38
41
|
interface IBarcodeScannerOptions {
|
|
39
42
|
timeout?: number;
|
|
@@ -41,4 +44,44 @@ interface IBarcodeScannerOptions {
|
|
|
41
44
|
scannerId?: number;
|
|
42
45
|
}
|
|
43
46
|
|
|
47
|
+
interface IBarcodeScannerResponse {
|
|
48
|
+
stop: () => Promise<void>;
|
|
49
|
+
onData: (listener: (data: string) => void) => void;
|
|
50
|
+
onError: (listener: (error: Error) => void) => void;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
#### Params
|
|
56
|
+
|
|
57
|
+
| Name | Type | Required | Description |
|
|
58
|
+
|------------------------------|---------------------------------------------|-----------------|-------------------------------------------------------------------------------------------|
|
|
59
|
+
| `userOptions` | `Omit<IBarcodeScannerOptions, "scannerId">` | <div>No</div> | User options to configure the scanner. |
|
|
60
|
+
| `userOptions.timeout` | `number` | <div>No</div> | The maximum time to wait for a scan before timing out. |
|
|
61
|
+
| `userOptions.cancelPrevious` | `boolean` | <div>No</div> | If set to `true`, it will cancel any previous scanner instance with the same `scannerId`. |
|
|
62
|
+
|
|
63
|
+
#### Return value
|
|
64
|
+
|
|
65
|
+
Returns a promise that resolves to an object with methods to stop the scanner and listen for scanned data and errors.
|
|
66
|
+
|
|
67
|
+
#### Possible errors
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
- If the scanner cannot be started.
|
|
71
|
+
- If the scanner is already running and `cancelPrevious` option is not set to `true`.
|
|
72
|
+
- If any other error occurs while starting the scanner.
|
|
73
|
+
|
|
74
|
+
#### Example
|
|
75
|
+
|
|
76
|
+
```ts
|
|
77
|
+
// Start the barcode scanner with default options
|
|
78
|
+
const scanner = await sos.hardware.barcodeScanner.start();
|
|
79
|
+
// Listen for scanned data
|
|
80
|
+
scanner.onData((data) => {
|
|
81
|
+
console.log(`Scanned data: ${data}`);
|
|
82
|
+
});
|
|
83
|
+
// Listen for errors
|
|
84
|
+
scanner.onError((error) => {
|
|
85
|
+
console.error(`Scanner error: ${error.message}`);
|
|
86
|
+
});
|
|
44
87
|
```
|
|
@@ -4,21 +4,39 @@ sidebar_position: 0
|
|
|
4
4
|
|
|
5
5
|
# hardware
|
|
6
6
|
|
|
7
|
-
The `sos.hardware` API groups together methods for working with hardware. It allows opening
|
|
7
|
+
The `sos.hardware` API groups together methods for working with hardware. It allows opening serial ports, using bar scanner or controlling LEDs.
|
|
8
|
+
|
|
9
|
+
:::warning
|
|
10
|
+
- Before using this API, ensure that the display [supports](/sdk/sos/display#supports) serial via `sos.display.supports("SERIAL")`.
|
|
11
|
+
- Samsung Kiosk serial connection only works over serial ports, not over USB ports.
|
|
12
|
+
:::
|
|
13
|
+
|
|
14
|
+
### List of supported serial ports
|
|
15
|
+
Bellow is example list of serial ports that can be used with `sos.hardware.openSerialPort()` method.
|
|
16
|
+
|
|
17
|
+
| Device type | Default value | Other available values |
|
|
18
|
+
|:----|:-----|:------|
|
|
19
|
+
| RaspberryPi / Linux | `/dev/ttyS0` | `/dev/ttyS1`, `/dev/ttyUSB0`, `/dev/ttyUSB1` |
|
|
20
|
+
| Windows | `COM3` | `COM1`, `COM2`, `COM4` etc. Usually it's always `COM3` |
|
|
21
|
+
| Samsung Kiosk | `PORT1` | `PORT2`, `PORT3`, `PORT4` |
|
|
22
|
+
| Android | `/dev/ttyusb0` | `/dev/ttyusb1`, `/dev/ttyusb2` |
|
|
23
|
+
| BrightSign | `0` | `0` (Serial Jack as `/dev/ttyS0`), `1` (GPIO port as `/dev/ttyS1`), `USB:A/0` (USB-to-serial as `/dev/ttyUSB0`) |
|
|
8
24
|
|
|
9
25
|
## Methods
|
|
10
26
|
|
|
11
27
|
### openSerialPort()
|
|
12
28
|
|
|
13
|
-
|
|
14
|
-
Learn more about using this API [here](https://developers.signageos.io/docs/applets/api-guides/serial-port)
|
|
15
|
-
</Admonition>
|
|
16
|
-
|
|
17
|
-
The `openSerialPort()` method opens a serial port for reading/writing. After the port is opened the method returns ISerialPort interface.
|
|
29
|
+
The `openSerialPort()` method opens a serial port for reading/writing. After the port is opened the method returns
|
|
18
30
|
|
|
19
31
|
```ts expandable
|
|
20
32
|
openSerialPort(options: ISerialPortOptions): Promise<ISerialPort>;
|
|
21
33
|
// show-more
|
|
34
|
+
/**
|
|
35
|
+
* Options for opening a serial port used by the `sos.hardware.openSerialPort()` method.
|
|
36
|
+
*
|
|
37
|
+
* @remarks
|
|
38
|
+
* All properties are optional except `baudRate`.
|
|
39
|
+
*/
|
|
22
40
|
interface ISerialPortOptions {
|
|
23
41
|
device?: string;
|
|
24
42
|
baudRate: number;
|
|
@@ -36,14 +54,27 @@ enum Parity {
|
|
|
36
54
|
SPACE = "space"
|
|
37
55
|
}
|
|
38
56
|
|
|
57
|
+
/**
|
|
58
|
+
* Returned by sos.hardware.openSerialPort() method.
|
|
59
|
+
* This interface provides methods to read/write data from/to the serial port.
|
|
60
|
+
*/
|
|
39
61
|
interface ISerialPort {
|
|
40
62
|
/**
|
|
41
63
|
* The `onData()` method sets up a listener, which is called whenever new data are received. The listener will stop after the serial port
|
|
42
64
|
* is closed.
|
|
65
|
+
*
|
|
66
|
+
* @param listener A function that will be called with the received data as a Uint8Array.
|
|
67
|
+
* @returns {void} Returns when the listener is set up.
|
|
43
68
|
*/
|
|
44
69
|
onData(listener: (data: Uint8Array) => void): void;
|
|
45
70
|
/**
|
|
46
|
-
* The `write()` method writes data to the serial port. The data can be a string of hexadecimal digits, array of numbers or Uint8Array
|
|
71
|
+
* The `write()` method writes data to the serial port. The data can be a string of hexadecimal digits, array of numbers or Uint8Array.
|
|
72
|
+
*
|
|
73
|
+
* @param data The data to write to the serial port.
|
|
74
|
+
* @returns {Promise<void>} Returns a promise that resolves when the data is successfully written to the serial port.
|
|
75
|
+
* @throws {Error} If the data cannot be written to the serial port.
|
|
76
|
+
* @throws {Error} If the serial port is not open.
|
|
77
|
+
* @throws {Error} If any other error occurs while writing to the serial port.
|
|
47
78
|
*
|
|
48
79
|
* @example
|
|
49
80
|
* // serial port instance previously created via sos.hardware.openSerialPort()
|
|
@@ -54,6 +85,9 @@ interface ISerialPort {
|
|
|
54
85
|
write(data: string | number[] | Uint8Array): Promise<void>;
|
|
55
86
|
/**
|
|
56
87
|
* The `close()` method closes the serial port.
|
|
88
|
+
*
|
|
89
|
+
* @returns {Promise<void>} Returns a promise that resolves when the serial port is successfully closed.
|
|
90
|
+
* @throws {Error} If the serial port cannot be closed.
|
|
57
91
|
*/
|
|
58
92
|
close(): Promise<void>;
|
|
59
93
|
}
|
|
@@ -62,14 +96,37 @@ interface ISerialPort {
|
|
|
62
96
|
|
|
63
97
|
#### Params
|
|
64
98
|
|
|
65
|
-
| Name
|
|
66
|
-
|
|
67
|
-
| `options.device`
|
|
68
|
-
| `options.baudRate`
|
|
69
|
-
| `options.parity`
|
|
70
|
-
| `options.databits`
|
|
71
|
-
| `options.stopbits`
|
|
72
|
-
| `options.rtscts`
|
|
99
|
+
| Name | Type | Required | Description |
|
|
100
|
+
|--------------------|-----------|------------------|---------------------------------------------------------------------------------------------------------------------|
|
|
101
|
+
| `options.device` | `string` | <div>No</div> | Specifies the address of the external device, check the table above for ports. |
|
|
102
|
+
| `options.baudRate` | `number` | <div>Yes</div> | Specifies the data transmission speed in bits per second. |
|
|
103
|
+
| `options.parity` | `Parity` | <div>No</div> | Specifies the form of error checking, whether (or what) extra bits are added to a byte. |
|
|
104
|
+
| `options.databits` | `number` | <div>No</div> | Specifies the number of bits in a byte. |
|
|
105
|
+
| `options.stopbits` | `number` | <div>No</div> | Specifies the number of bits used to signal the end of a communication packet. |
|
|
106
|
+
| `options.rtscts` | `boolean` | <div>No</div> | Enables or disables RTS/CTS handshaking over the serial port. Currently supported by selected models of BrightSign. |
|
|
107
|
+
|
|
108
|
+
#### Return value
|
|
109
|
+
|
|
110
|
+
Returns a promise that resolves to an instance of
|
|
111
|
+
|
|
112
|
+
#### Possible errors
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
- If the serial port cannot be opened.
|
|
116
|
+
- If the device address is not supported by the platform.
|
|
117
|
+
- If the device fails to process the data.
|
|
118
|
+
- If any other error occurs while opening the serial port.
|
|
119
|
+
|
|
120
|
+
#### Example
|
|
121
|
+
|
|
122
|
+
```ts
|
|
123
|
+
// Open serial port on BrightSign with default settings
|
|
124
|
+
const serialPort = await sos.hardware.openSerialPort({
|
|
125
|
+
device: '0',
|
|
126
|
+
baudRate: 9600,
|
|
127
|
+
});
|
|
128
|
+
serialPort.write('68656c6c6f'); // Write "hello" in hexadecimal
|
|
129
|
+
```
|
|
73
130
|
|
|
74
131
|
## API Example
|
|
75
132
|
|
package/docs/sos/hardware/led.md
CHANGED
|
@@ -4,19 +4,48 @@ sidebar_position: 0
|
|
|
4
4
|
|
|
5
5
|
# led
|
|
6
6
|
|
|
7
|
-
The `sos.hardware.led` API groups together methods for controlling LEDs of the device.
|
|
8
|
-
|
|
7
|
+
The `sos.hardware.led` API groups together methods for controlling LEDs of the device.
|
|
8
|
+
|
|
9
|
+
:::warning
|
|
10
|
+
This is currently only supported by Phillips devices.
|
|
11
|
+
:::
|
|
9
12
|
|
|
10
13
|
## Methods
|
|
11
14
|
|
|
12
15
|
### setColor()
|
|
13
16
|
|
|
14
|
-
The `setColor()` methods sets the LED color
|
|
17
|
+
The `setColor()` methods sets the LED color.
|
|
15
18
|
|
|
16
19
|
```ts expandable
|
|
17
20
|
setColor(color: string | null): Promise<void>;
|
|
18
21
|
```
|
|
19
22
|
|
|
23
|
+
#### Params
|
|
24
|
+
|
|
25
|
+
| Name | Type | Required | Description |
|
|
26
|
+
|---------|------------------|------------------|-------------------------------------------------------------------------------------------------------------------|
|
|
27
|
+
| `color` | `string \| null` | <div>Yes</div> | The color to set the LED to, in hexadecimal format (e.g. `#FF0000` for red). If `null`, it will turn off the LED. |
|
|
28
|
+
|
|
29
|
+
#### Return value
|
|
30
|
+
|
|
31
|
+
Returns a promise that resolves when the color is successfully set.
|
|
32
|
+
|
|
33
|
+
#### Possible errors
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
- If the color is not a valid hexadecimal string or is not a string at all.
|
|
37
|
+
- If the LED cannot be controlled by the device.
|
|
38
|
+
- If any other error occurs while setting the color.
|
|
39
|
+
|
|
40
|
+
#### Example
|
|
41
|
+
|
|
42
|
+
```ts
|
|
43
|
+
// Set the LED color to red
|
|
44
|
+
await sos.hardware.led.setColor('#FF0000');
|
|
45
|
+
// Turn off the LED
|
|
46
|
+
await sos.hardware.led.setColor(null);
|
|
47
|
+
```
|
|
48
|
+
|
|
20
49
|
## API Example
|
|
21
50
|
|
|
22
51
|
```ts
|
package/docs/sos/index.md
CHANGED
|
@@ -69,9 +69,9 @@ onReady(listener?: () => void): Promise<void>;
|
|
|
69
69
|
|
|
70
70
|
#### Params
|
|
71
71
|
|
|
72
|
-
| Name
|
|
73
|
-
|
|
74
|
-
| `listener`
|
|
72
|
+
| Name | Type | Required | Description |
|
|
73
|
+
|------------|--------------|-----------------|--------------------------------------------------------------|
|
|
74
|
+
| `listener` | `() => void` | <div>No</div> | Optional listener which is called when the sos API is ready. |
|
|
75
75
|
|
|
76
76
|
#### Return value
|
|
77
77
|
|
package/docs/sos/input.md
CHANGED
|
@@ -4,25 +4,39 @@ sidebar_position: 0
|
|
|
4
4
|
|
|
5
5
|
# input
|
|
6
6
|
|
|
7
|
+
The `sos.input` API groups together all input-related functionality, such as remote control key events. With this API, you can
|
|
8
|
+
listen to key events from the remote control and handle them in your application.
|
|
9
|
+
|
|
7
10
|
## Methods
|
|
8
11
|
|
|
9
12
|
### onKeyUp()
|
|
10
13
|
|
|
11
|
-
The `onKeyUp` method sets up a listeners, which is called on every
|
|
14
|
+
The `onKeyUp` method sets up a listeners, which is called on every keystroke of the remote controller. For the specific logic of an
|
|
12
15
|
application (games for example), binding the remote control inputs can be helpful. Only a subset of all remote control keys is
|
|
13
16
|
supported on the specific device. Only numerical digits are guaranteed to be supported.
|
|
14
17
|
|
|
18
|
+
:::note
|
|
15
19
|
This feature must be tested by users on real devices.
|
|
20
|
+
:::
|
|
16
21
|
|
|
17
22
|
```ts expandable
|
|
18
23
|
onKeyUp(listener: (event: IKeyUpEvent) => void): void;
|
|
19
24
|
// show-more
|
|
25
|
+
/**
|
|
26
|
+
* KeyUp event interface for handling key release events.
|
|
27
|
+
*/
|
|
20
28
|
interface IKeyUpEvent {
|
|
21
29
|
type: 'keyup';
|
|
22
30
|
keyCode: KeyUpEventMap;
|
|
23
31
|
keyName: keyof typeof KeyUpEventMap;
|
|
24
32
|
}
|
|
25
33
|
|
|
34
|
+
/**
|
|
35
|
+
* Enum of supported key codes for KeyUp events.
|
|
36
|
+
*
|
|
37
|
+
* @remarks
|
|
38
|
+
* If a key is not listed here, it will show warning in the console.
|
|
39
|
+
*/
|
|
26
40
|
enum KeyUpEventMap {
|
|
27
41
|
UNKNOWN = 0,
|
|
28
42
|
NUM_0 = 1,
|
|
@@ -56,6 +70,22 @@ enum KeyUpEventMap {
|
|
|
56
70
|
|
|
57
71
|
```
|
|
58
72
|
|
|
73
|
+
#### Params
|
|
74
|
+
|
|
75
|
+
| Name | Type | Required | Description |
|
|
76
|
+
|------------|--------------------------------|------------------|------------------------------------------------------------------|
|
|
77
|
+
| `listener` | `(event: IKeyUpEvent) => void` | <div>Yes</div> | The listener function that will be called on every key up event. |
|
|
78
|
+
|
|
79
|
+
#### Return value
|
|
80
|
+
|
|
81
|
+
Resolves when the listener is successfully set up.
|
|
82
|
+
|
|
83
|
+
#### Possible errors
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
- If listener is not valid function.
|
|
87
|
+
- If listener is unregistered.
|
|
88
|
+
|
|
59
89
|
<Separator />
|
|
60
90
|
|
|
61
91
|
### removeEventListener()
|
|
@@ -66,6 +96,17 @@ The `removeEventListener()` method removes all event listeners for a specific ev
|
|
|
66
96
|
removeEventListener(event: 'keyup', listener: (...args: any[]) => void): void;
|
|
67
97
|
```
|
|
68
98
|
|
|
99
|
+
#### Params
|
|
100
|
+
|
|
101
|
+
| Name | Type | Required | Description |
|
|
102
|
+
|------------|----------------------------|------------------|-----------------------------------------------------------------------------------------|
|
|
103
|
+
| `event` | `"keyup"` | <div>Yes</div> | The name of the event to remove the listener for. Currently, only `keyup` is supported. |
|
|
104
|
+
| `listener` | `(...args: any[]) => void` | <div>Yes</div> | The listener function to remove. |
|
|
105
|
+
|
|
106
|
+
#### Return value
|
|
107
|
+
|
|
108
|
+
Resolves when the listener is successfully removed.
|
|
109
|
+
|
|
69
110
|
<Separator />
|
|
70
111
|
|
|
71
112
|
### removeEventListeners()
|
package/docs/sos/monitors.md
CHANGED
|
@@ -6,6 +6,10 @@ sidebar_position: 0
|
|
|
6
6
|
|
|
7
7
|
The `sos.monitors` API groups together methods for providing information about monitors connected to the device.
|
|
8
8
|
|
|
9
|
+
:::note
|
|
10
|
+
This API is available only on Linux devices.
|
|
11
|
+
:::
|
|
12
|
+
|
|
9
13
|
## Methods
|
|
10
14
|
|
|
11
15
|
### getList()
|
|
@@ -24,6 +28,10 @@ interface IConnectedMonitor {
|
|
|
24
28
|
|
|
25
29
|
```
|
|
26
30
|
|
|
31
|
+
#### Return value
|
|
32
|
+
|
|
33
|
+
A promise that resolves to an array of connected monitors.
|
|
34
|
+
|
|
27
35
|
## API Example
|
|
28
36
|
|
|
29
37
|
```ts
|
package/docs/sos/native/mdc.md
CHANGED
|
@@ -7,15 +7,11 @@ sidebar_position: 0
|
|
|
7
7
|
The `sos.native.mdc` API groups together methods for controlling Tizen devices using MDC commands.
|
|
8
8
|
|
|
9
9
|
:::warning
|
|
10
|
-
|
|
11
10
|
This API is currently available on Tizen devices only.
|
|
12
|
-
|
|
13
11
|
:::
|
|
14
12
|
|
|
15
13
|
:::info
|
|
16
|
-
|
|
17
14
|
You can ensure that the device supports MDC commands via `sos.management.supports("NATIVE_COMMANDS_MDC")`.
|
|
18
|
-
|
|
19
15
|
:::
|
|
20
16
|
|
|
21
17
|
## Methods
|
|
@@ -27,6 +23,26 @@ The `sendOne()` method sends an MDC command to another Tizen device on the same
|
|
|
27
23
|
```ts expandable
|
|
28
24
|
sendOne(ipAddress: IpAddressType, command: CodesMDC, data?: number[]): Promise<IMDCResponse>;
|
|
29
25
|
// show-more
|
|
26
|
+
/**
|
|
27
|
+
* Response object returned by Tizen Core App.
|
|
28
|
+
*/
|
|
29
|
+
interface IMDCResponse {
|
|
30
|
+
/**
|
|
31
|
+
* The type of the response, either 'ACK' for acknowledgment or 'NACK' for negative acknowledgment.
|
|
32
|
+
*/
|
|
33
|
+
type: 'ACK' | 'NACK';
|
|
34
|
+
/**
|
|
35
|
+
* The command type that was executed, represented as a number.
|
|
36
|
+
* Should match the command number in {@link CodesMDC}.
|
|
37
|
+
*/
|
|
38
|
+
commandType: number;
|
|
39
|
+
/**
|
|
40
|
+
* The result of the command execution, represented as a number.
|
|
41
|
+
* This value can vary depending on the command executed.
|
|
42
|
+
*/
|
|
43
|
+
result: number;
|
|
44
|
+
}
|
|
45
|
+
|
|
30
46
|
/**
|
|
31
47
|
* This enum contains valid command codes for Tizen MDC communication.
|
|
32
48
|
*/
|
|
@@ -177,31 +193,36 @@ enum CodesMDC {
|
|
|
177
193
|
REPLY = 255
|
|
178
194
|
}
|
|
179
195
|
|
|
180
|
-
interface IMDCResponse {
|
|
181
|
-
type: 'ACK' | 'NACK';
|
|
182
|
-
commandType: number;
|
|
183
|
-
result: number;
|
|
184
|
-
}
|
|
185
|
-
|
|
186
196
|
```
|
|
187
197
|
|
|
188
198
|
#### Params
|
|
189
199
|
|
|
190
|
-
| Name
|
|
191
|
-
|
|
192
|
-
| `ipAddress`
|
|
193
|
-
| `command`
|
|
194
|
-
| `data`
|
|
200
|
+
| Name | Type | Required | Description |
|
|
201
|
+
|-------------|------------|------------------|------------------------------------------------------|
|
|
202
|
+
| `ipAddress` | `string` | <div>Yes</div> | The IP address of the device to send the command to. |
|
|
203
|
+
| `command` | `CodesMDC` | <div>Yes</div> | The MDC command to send |
|
|
204
|
+
| `data` | `number[]` | <div>No</div> | The optional data to send with the command. |
|
|
205
|
+
|
|
206
|
+
#### Return value
|
|
207
|
+
|
|
208
|
+
MDC response object containing the result of the command execution.
|
|
209
|
+
|
|
210
|
+
#### Possible errors
|
|
211
|
+
|
|
212
|
+
|
|
213
|
+
- If the `ipAddress` is not a valid string or if the `command` is not a valid number.
|
|
214
|
+
- If the `data` is not an array of numbers.
|
|
215
|
+
- If any error occurs during the command execution.
|
|
195
216
|
|
|
196
217
|
#### Example
|
|
197
218
|
|
|
198
219
|
```ts
|
|
199
|
-
await sos.native.mdc.sendOne('localhost', CodesMDC.BRIGHTNESS_CONTROL);
|
|
200
|
-
await sos.native.mdc.sendOne('192.168.0.10', CodesMDC.VOLUME_CONTROL, [50]);
|
|
201
|
-
await sos.native.mdc.sendOne('192.168.0.10', CodesMDC.PICTURE_CONTROL, [0x54, 0x03]);
|
|
220
|
+
await sos.native.mdc.sendOne('localhost', CodesMDC.BRIGHTNESS_CONTROL);
|
|
221
|
+
await sos.native.mdc.sendOne('192.168.0.10', CodesMDC.VOLUME_CONTROL, [50]);
|
|
222
|
+
await sos.native.mdc.sendOne('192.168.0.10', CodesMDC.PICTURE_CONTROL, [0x54, 0x03]);
|
|
202
223
|
|
|
203
224
|
// You can also send custom number if we don't have predefined command in our enum
|
|
204
|
-
await sos.native.mdc.sendOne('192.168.0.10', 0x01, []);
|
|
225
|
+
await sos.native.mdc.sendOne('192.168.0.10', 0x01, []);
|
|
205
226
|
```
|
|
206
227
|
|
|
207
228
|
<Separator />
|
|
@@ -215,9 +236,23 @@ but without explicitly specifying the command.
|
|
|
215
236
|
sendOneRaw(ipAddress: IpAddressType, data: number[] | [
|
|
216
237
|
]): Promise<IMDCResponse>;
|
|
217
238
|
// show-more
|
|
239
|
+
/**
|
|
240
|
+
* Response object returned by Tizen Core App.
|
|
241
|
+
*/
|
|
218
242
|
interface IMDCResponse {
|
|
243
|
+
/**
|
|
244
|
+
* The type of the response, either 'ACK' for acknowledgment or 'NACK' for negative acknowledgment.
|
|
245
|
+
*/
|
|
219
246
|
type: 'ACK' | 'NACK';
|
|
247
|
+
/**
|
|
248
|
+
* The command type that was executed, represented as a number.
|
|
249
|
+
* Should match the command number in {@link CodesMDC}.
|
|
250
|
+
*/
|
|
220
251
|
commandType: number;
|
|
252
|
+
/**
|
|
253
|
+
* The result of the command execution, represented as a number.
|
|
254
|
+
* This value can vary depending on the command executed.
|
|
255
|
+
*/
|
|
221
256
|
result: number;
|
|
222
257
|
}
|
|
223
258
|
|
|
@@ -225,10 +260,21 @@ interface IMDCResponse {
|
|
|
225
260
|
|
|
226
261
|
#### Params
|
|
227
262
|
|
|
228
|
-
| Name | Type | Description
|
|
229
|
-
|
|
230
|
-
| `ipAddress` | `string` | The IP address of the device to send the command to.
|
|
231
|
-
| `data` | `number[] \| []` | The data to send with the command.
|
|
263
|
+
| Name | Type | Required | Description |
|
|
264
|
+
|-------------|------------------|------------------|------------------------------------------------------------------------------------|
|
|
265
|
+
| `ipAddress` | `string` | <div>Yes</div> | The IP address of the device to send the command to. |
|
|
266
|
+
| `data` | `number[] \| []` | <div>Yes</div> | The data as array of numbers to send with the command. It can be also empty array. |
|
|
267
|
+
|
|
268
|
+
#### Return value
|
|
269
|
+
|
|
270
|
+
MDC response object containing the result of the command execution.
|
|
271
|
+
|
|
272
|
+
#### Possible errors
|
|
273
|
+
|
|
274
|
+
|
|
275
|
+
- If the `ipAddress` is not a valid string or if the `command` is not a valid number.
|
|
276
|
+
- If the `data` is not an array of numbers.
|
|
277
|
+
- If any error occurs during the command execution.
|
|
232
278
|
|
|
233
279
|
#### Example
|
|
234
280
|
|