mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-06-19 20:34:19 -07:00
Sync from OFW PR --nobuild
This commit is contained in:
@@ -130,7 +130,7 @@ Prints a string by Alt+Numpad method - works only on Windows!
|
||||
**Parameters**
|
||||
|
||||
- A string to print
|
||||
- (optional) delay between key presses
|
||||
- *(optional)* delay between key presses
|
||||
|
||||
**Examples**
|
||||
```js
|
||||
@@ -145,7 +145,7 @@ Same as `altPrint` but ended with "ENTER" press.
|
||||
**Parameters**
|
||||
|
||||
- A string to print
|
||||
- (optional) delay between key presses
|
||||
- *(optional)* delay between key presses
|
||||
|
||||
**Examples**
|
||||
```js
|
||||
|
||||
@@ -144,7 +144,7 @@ Wrappers around `ArrayBuffer` objects, with dedicated types such as:
|
||||
**Fields**
|
||||
|
||||
- byteLength: The length of the buffer in bytes
|
||||
- length: The length of the buffer in bytestyped elements
|
||||
- length: The length of the buffer in typed elements
|
||||
- buffer: The underlying `ArrayBuffer`
|
||||
<br>
|
||||
|
||||
@@ -313,4 +313,3 @@ Checks whether all of the specified extra features are supported by the interpre
|
||||
```js
|
||||
checkSdkFeatures(["gui-widget"]);
|
||||
```
|
||||
<br>
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
# Flipper module {#js_flipper}
|
||||
|
||||
The module contains methods and values to query device information and properties. Call the `require` function to load the module before first using its methods:
|
||||
|
||||
```js
|
||||
let flipper = require("flipper");
|
||||
```
|
||||
|
||||
# Values
|
||||
|
||||
## firmwareVendor
|
||||
String representing the firmware installed on the device.
|
||||
Original firmware reports `"flipperdevices"`.
|
||||
Do **NOT** use this to check the presence or absence of features, refer to [other ways to check SDK compatibility](#js_builtin_sdk_compatibility).
|
||||
|
||||
## jsSdkVersion
|
||||
Version of the JavaScript SDK.
|
||||
Do **NOT** use this to check the presence or absence of features, refer to [other ways to check SDK compatibility](#js_builtin_sdk_compatibility).
|
||||
|
||||
<br>
|
||||
|
||||
---
|
||||
|
||||
# Methods
|
||||
|
||||
## getModel()
|
||||
Returns the device model.
|
||||
|
||||
**Example**
|
||||
```js
|
||||
flipper.getModel(); // "Flipper Zero"
|
||||
```
|
||||
|
||||
<br>
|
||||
|
||||
## getName()
|
||||
Returns the name of the virtual dolphin.
|
||||
|
||||
**Example**
|
||||
```js
|
||||
flipper.getName(); // "Fur1pp44"
|
||||
```
|
||||
|
||||
<br>
|
||||
|
||||
## getBatteryCharge()
|
||||
Returns the battery charge percentage.
|
||||
|
||||
**Example**
|
||||
```js
|
||||
flipper.getBatteryCharge(); // 100
|
||||
```
|
||||
@@ -18,5 +18,3 @@ Displays a file picker and returns the selected file, or undefined if cancelled.
|
||||
**Returns**
|
||||
|
||||
A `string` path, or `undefined`.
|
||||
|
||||
<br>
|
||||
|
||||
@@ -9,6 +9,7 @@ For an example, refer to the `gui.js` example script.
|
||||
|
||||
## getBuiltin()
|
||||
Gets a built-in firmware icon by its name.
|
||||
All known icons bundled with firmware are supported.
|
||||
|
||||
**Parameters**
|
||||
- `icon`: name of the icon
|
||||
@@ -29,5 +30,3 @@ It will be automatically unloaded when the script exits.
|
||||
**Returns**
|
||||
|
||||
An `IconData` object.
|
||||
|
||||
<br>
|
||||
|
||||
@@ -77,7 +77,7 @@ Read from serial port until line break character.
|
||||
|
||||
**Parameters**
|
||||
|
||||
*(optional)* Timeout value in ms.
|
||||
- *(optional)* Timeout value in ms.
|
||||
|
||||
**Returns**
|
||||
|
||||
@@ -93,11 +93,11 @@ serial.readln(5000); // Read with 5s timeout
|
||||
<br>
|
||||
|
||||
## readAny()
|
||||
Read any available amount of data from serial port, can help avoid starving your loop with small reads
|
||||
Read any available amount of data from serial port, can help avoid starving your loop with small reads.
|
||||
|
||||
**Parameters**
|
||||
|
||||
*(optional)* Timeout value in ms
|
||||
- *(optional)* Timeout value in ms
|
||||
|
||||
**Returns**
|
||||
|
||||
|
||||
@@ -507,5 +507,3 @@ Deinitialize virtual mount api.
|
||||
**Returns**
|
||||
|
||||
Nothing on success, error on failure.
|
||||
|
||||
<br>
|
||||
|
||||
Reference in New Issue
Block a user