Interactive function to consult enable or disable multiple modules for APEX OS
Install using npm github
npm install https://github.com/digitalcomtech/syrus4-sdk-nodejs/tarball/master- Accelerometer
Accelerometer module get information about hardware acceleration and events in ApexOS
- Apps
Apps module to start/stop/enable/disable/install third parts apps running in apex-os
- Bluetooth
Bluetooth module, get information about bluetooth state
- Counters
Counters module setup get and set counters from APEX OS
- Database
Logrotate module setup get and set counters from APEX OS
- ECU
ECU module get information about EcU monitor and vehicle in ApexOS
- Fatigue
Fatigue module, get fatigue sensor information and events
- GPS
GPS module get information about gps and location in ApexOS
- Geofences
Geofences module
- Hotspot
Hotspot module to interacte with the enable/disable Hotspot mode with Apex OS
- IButton
IButton module get information about onewire
- IOExpander
Logrotate module setup get and set counters from APEX OS
- IOS
IOS module allow to get and set status from Input and Outputs in Syrus 4 Apex OS
- Logrotate
Logrotate module setup get and set counters from APEX OS
- Network
Network module get information about networks and events in ApexOS
- PeopleCounter
PeopleCounter module setup get and set Safe engine cut of from APEX OS
- PulseCounter
Logrotate module setup get and set counters from APEX OS
- RFID
RFID module get information about RFID states
- SafeEngine
SafeEngine module setup get and set Safe engine cut of from APEX OS
- Serial
Serial module, get information about serial state
- System-Info
System module get information about ApexOS
- Technoton
Technoton module get information about Technoton fuel level
- Temperature
Temperature module get information about temperature sensors
- Update
Update module check for update and make update for ApexOS
- Utils
Utils module some utlities in ApexOS
- WIFI
WIFI module to interacte with the enable/disable WIFI mode with Apex OS
- Windows
Time Windows module setup get and set counters from APEX OS
- getInfo()
returns a JSON with the configured values in RF
- set(key, value)
Use this option to configure the network variable for mobile networks
Accelerometer module get information about hardware acceleration and events in ApexOS
Watch the motion state of the Syrus Apex accceleration hardware module
Kind: inner method of Accelerometer
| Param | Description |
|---|---|
| callback | callback to executed when motion state changes |
| errorCallback | callback to execute in case of error |
Watch for accelerations events in Apex OS. possible events: FORWARD_COLLISION, BACKWARD_COLLISION, LAT_COLLISION_FROM_RIGHT, LAT_COLLISION_FROM_LEFT, HARSH_FWD_ACCELERATION, HARD_BRAKING, CORNERING_RIGHT, CORNERING_LEFT
Kind: inner method of Accelerometer
| Param | Description |
|---|---|
| callback | callback to executed when new acceleration event received |
| errorCallback | callback to execute in case of error |
Set the state for the auto alignment procces of the APEX OS acceleration hardware
Kind: inner method of Accelerometer
| Param | Default | Description |
|---|---|---|
| state | true |
desired state of auto alignment proccess |
Set the state for the self acceleration test of the APEX OS acceleration hardware
Kind: inner method of Accelerometer
| Param | Default | Description |
|---|---|---|
| state | true |
desired state of self acceleration test proccess |
check is hardware is on state auto aligning returns a promise with the state
Kind: inner method of Accelerometer
check is hardware is on state acceleration test returns a promise with the state
Kind: inner method of Accelerometer
Check the current state of the acceloremeter hardware is moving
Kind: inner method of Accelerometer
Apps module to start/stop/enable/disable/install third parts apps running in apex-os
- Apps
- ~execute(action, app, zipPath, instance, ver)
- ~installApp(zipPath)
- ~uninstallApp(app, ver)
- ~listApps() ⇒
- ~createInstance(name, app, ver) ⇒
- ~deleteInstance(name) ⇒
- ~listInstances() ⇒
- ~startInstance(name) ⇒
- ~stopInstance(name) ⇒
- ~restartInstance(name) ⇒
- ~setConfiguration(app, newConfig)
- ~getConfiguration(app)
allows to execute commands from the apps-manager utility from ApexOs
Kind: inner method of Apps
| Param | Default | Description |
|---|---|---|
| action | action to execute | |
| app | |
the name of the App |
| zipPath | |
the zip location under where unzip the app |
| instance | |
|
| ver | |
Allows to install an app receive as parameter the name of the app and the zip location or the data of the zip in question.
Kind: inner method of Apps
| Param | Description |
|---|---|
| zipPath | the zip location |
Uninstall and deletes the data from an app
Kind: inner method of Apps
| Param | Description |
|---|---|
| app | the name of the app |
| ver |
Lists all the installed applications.
This function executes the "list-apps" action using the execute function
from the Utils module. It returns a promise that resolves with the result
of the command execution.
Kind: inner method of Apps
Returns: A promise that resolves with the list of installed applications.
Creates an instance of an application.
This function executes the "create-instance" action using the execute function
from the Utils module. It returns a promise that resolves with the result
of the command execution.
Kind: inner method of Apps
Returns: A promise that resolves with the result of the instance creation.
| Param | Type | Description |
|---|---|---|
| name | string |
The name of the instance to create. |
| app | string |
The name of the application. |
| ver | string |
The version of the application. |
Deletes an instance of an application.
This function executes the "delete-instance" action using the execute function
from the Utils module. It returns a promise that resolves with the result
of the instance deletion.
Kind: inner method of Apps
Returns: A promise that resolves with the result of the instance deletion.
| Param | Type | Description |
|---|---|---|
| name | string |
The name of the instance to delete. |
Lists all instances of an application.
This function executes the "list-instances" action using the execute function
from the Utils module. It returns a promise that resolves with the list of instances.
Kind: inner method of Apps
Returns: A promise that resolves with the list of instances.
Starts an instance of an application.
This function executes the "start-instance" action using the execute function
from the Utils module. It returns a promise that resolves with the result
of starting the instance.
Kind: inner method of Apps
Returns: A promise that resolves with the result of starting the instance.
| Param | Type | Description |
|---|---|---|
| name | string |
The name of the instance to start. |
Stops an instance of an application.
This function executes the "stop-instance" action using the execute function
from the Utils module. It returns a promise that resolves with the result
of stopping the instance.
Kind: inner method of Apps
Returns: A promise that resolves with the result of stopping the instance.
| Param | Type | Description |
|---|---|---|
| name | string |
The name of the instance to stop. |
Restarts an instance of an application.
This function executes the "restart-instance" action using the execute function
from the Utils module. It returns a promise that resolves with the result
of restarting the instance.
Kind: inner method of Apps
Returns: A promise that resolves with the result of restarting the instance.
| Param | Type | Description |
|---|---|---|
| name | string |
The name of the instance to restart. |
write .env file configuration of the app, if the .env exists, replace it
Kind: inner method of Apps
| Param | Description |
|---|---|
| app | the name of the app |
| newConfig |
Get the contents of SYRUS4G_APP_CONF_FILE file where it stored the configuration of the app
Kind: inner method of Apps
| Param | Description |
|---|---|
| app | the name of the app |
Bluetooth module, get information about bluetooth state
Counters module setup get and set counters from APEX OS
Logrotate module setup get and set counters from APEX OS
ECU module get information about EcU monitor and vehicle in ApexOS
ECU PARAM LIST from the ecu monitor
Kind: inner method of ECU
allows to subscribe for ECU parameter changes
Kind: inner method of ECU
| Param | Description |
|---|---|
| cb | calbback to execute when new ECU data arrives |
| errorCallback | errorCallback when something wrong goes with the subscription |
Get all the most recent data from ECU parameters
Kind: inner method of ECU
get ecu paramas list associated to all the pgn and id for ecu and taip tag associated
Kind: inner method of ECU
Fatigue module, get fatigue sensor information and events
GPS module get information about gps and location in ApexOS
return distance in km between two coordinates points
Kind: inner method of GPS
| Param | Description |
|---|---|
| coord1 | first coordinate to calculate the distance |
| coord2 | second coordinate to calculate the distance |
Get last current location from GPS
Kind: inner method of GPS
allows to subscribe to position events in GPS module
Kind: inner method of GPS
| Param | Description |
|---|---|
| callback | handler to execute when new gps position arrives |
| errorCallback | Errorcallback executes when is unable to get gps location |
| config | Object coniguration how evaluate criteria for watchPosition |
allows to subscribe to gps data changes in GPS module
Kind: inner method of GPS
| Param | Description |
|---|---|
| callback | handler to execute when new gps data arrives |
| errorCallback | Errorcallback executes when is unable to get gps location |
define a tracking resolution using apx-tracking tool to receive filtered data gps
Kind: inner method of GPS
| Param | Description |
|---|---|
| callback | callback to execute when new data arrive from tracking resolution |
| opts | tracking_resolution: _ namespace: The name used as a reference to identify a tracking criteria. _ _Max 30 characters _ _ heading: The heading threshold for triggering notifications based on heading _ _changes. Use 0 to disable. Range (0 - 180) _ _ time: The time limit in seconds for triggering tracking notifications. _ _Use 0 to disable. Range (0 - 86400) _ _ distance: The distance threshold in meters for triggering tracking _ _notifications based on the traveled distance. Use 0 to disable. _ *Range (0 - 100000) |
get all the active tracking resolutions`in the apex tol apx-tracking
Kind: inner method of GPS
| Param | Description |
|---|---|
| prefixed | prefix to lookup tracking_resolution |
set options for a tracking_resolution for the apex tool apx-tracking
Kind: inner method of GPS
| Param | Description |
|---|---|
| opts | tracking_resolution: _ namespace: The name used as a reference to identify a tracking criteria. _ _Max 30 characters _ _ heading: The heading threshold for triggering notifications based on heading _ _changes. Use 0 to disable. Range (0 - 180) _ _ time: The time limit in seconds for triggering tracking notifications. _ _Use 0 to disable. Range (0 - 86400) _ _ distance: The distance threshold in meters for triggering tracking _ _notifications based on the traveled distance. Use 0 to disable. _ *Range (0 - 100000) |
get options for a tracking_resolution for the apex tool apx-tracking
Kind: inner method of GPS
| Param | Description |
|---|---|
| opts | tracking_resolution: * namespace: The name used as a reference to identify a tracking criteria. |
Geofences module
Add Geofence to the apx-tool
Kind: inner method of Geofences
| Param | Description |
|---|---|
| opts | options hash name: name of the fence; lngLats: array of (lon,lat) coordinate pairs; group: group name; namespace: namespace; type: geofence type could be circular or poly; radius: radius for circular fences, in meters, must be >= 50; |
Update Geofence to the apx-tool
Kind: inner method of Geofences
| Param | Description |
|---|---|
| opts | options hash name: name of the fence; lngLats: array of (lon,lat) coordinate pairs; group: group name; namespace: namespace; type: geofence type could be circular or poly; radius: radius for circular fences, in meters, must be >= 50; |
Remove Geofence from the apx-tool
Kind: inner method of Geofences
| Param | Description |
|---|---|
| opts | options hash name: name of the fence; group: group name; namespace: namespace; |
get all available namespaces
Kind: inner method of Geofences
Get geofence state from the apx-tool
Kind: inner method of Geofences
| Param | Description |
|---|---|
| opts | options hash name: name of the fence; namespace: namespace; |
Get states from all Geofences for a given namespace
Kind: inner method of Geofences
| Param | Description |
|---|---|
| opts | options hash namespace: namespace that belongs of geofence; |
remove all Geofences from the namespace
Kind: inner method of Geofences
| Param | Description |
|---|---|
| opts | options hash namespace: namespace that belongs of geofence; |
Kind: inner method of Geofences
| Param | Description |
|---|---|
| callback | callback to execute when the device enters or exits from a geofence |
| errorCb | error callback to execute if there is an unexpected error |
| opts | options hash namespace: namespace to check if entered or exited from geofence; |
Kind: inner method of Geofences
| Param | Description |
|---|---|
| callback | callback to execute when the device enters or exits from a geofence |
| errorCb | error callback to execute if there is an unexpected error |
| opts | options hash namespace: namespace to check if entered or exited from geofence; |
Kind: inner method of Geofences
| Param | Description |
|---|---|
| callback | callback to execute when the device enters or exits a geofence group |
| errorCb | error callback to execute if something fails |
| opts | namespace: namespace to check if entered or exited from group of geofence; |
Hotspot module to interacte with the enable/disable Hotspot mode with Apex OS
returns the list of the connected clients to the hotspot
Kind: inner method of Hotspot
returns the state of the connected clients to the hotspot
Kind: inner method of Hotspot
start the hotspot service, also stop wifi service
Kind: inner method of Hotspot
stops the hotspot service
Kind: inner method of Hotspot
executes a stop-start in the same call
Kind: inner method of Hotspot
Use this option for forwarding the wlan traffic to another interface, it allows you to have internet access by specifying the output interface
Kind: inner method of Hotspot
| Param | Default | Description |
|---|---|---|
| netInterface | ppp0 |
Interface you ant allow internet access default="ppp0" |
edits the parameter received in the hotspot configuration file.
Example apx-hotspot edit wpa_passphrase myNewPass1234
Possible Values: "wpa_passphrase" | "ssid" | "max_num_sta" | "channel" | "wpa_key_mgmt"
Kind: inner method of Hotspot
| Param | Default | Description |
|---|---|---|
| parameter | wpa_passphrase |
param to edit config |
| newValue | new value for the parameter |
IButton module get information about onewire
Kind: inner class of IButton
Event published by the sdk composed of of multiple IButtonEvent authorized contains events from whitelisted ibuttons
allow to get al lthe state of the ibuttons connected
Kind: inner method of IButton
allow to get al lthe state of the ibuttons connected
Kind: inner method of IButton
allow to get al lthe state of the ibuttons connected
Kind: inner method of IButton
remove Alias from ibutton whitelist
Kind: inner method of IButton
monitor iButton notifications
Kind: inner method of IButton
Logrotate module setup get and set counters from APEX OS
IOS module allow to get and set status from Input and Outputs in Syrus 4 Apex OS
Allow to subcribe to changes in a input or output accepts sub patterns
Kind: inner method of IOS
| Param | Default | Description |
|---|---|---|
| inputName | * |
input or patter to subscribe |
| cb | callback execute everytime the input state changed, first argument contains the new state | |
| errorCallback |
get a promise that resolve the current input or output state
Kind: inner method of IOS
| Param | Default | Description |
|---|---|---|
| inputName | IGN |
the input/output requested |
Allow to change the state of an output
Kind: inner method of IOS
| Param | Default | Description |
|---|---|---|
| inputName | OUT1 |
the output to change state |
| state | true |
the new state of the output |
Get the current state of all inputs, outputs and analogs in the Syrus4 device
Kind: inner method of IOS
Logrotate module setup get and set counters from APEX OS
Network module get information about networks and events in ApexOS
Watch the network state change
Kind: inner method of Network
| Param | Description |
|---|---|
| callback | callback to executed when network state changes |
| errorCallback | callback to execute in case of error |
get the current state of the network of the APEX OS, returns a promise with the info
Kind: inner method of Network
get Network Information about specific network
Kind: inner method of Network
| Param | Description |
|---|---|
| net | network that want to know the information valid options are: eth0, ppp0, wlan0 |
get network information about all the available networks on APEX OS
Kind: inner method of Network
PeopleCounter module setup get and set Safe engine cut of from APEX OS
Logrotate module setup get and set counters from APEX OS
RFID module get information about RFID states
Kind: inner class of RFID
Event published by the sdk composed of multiple RFID authorized contains events from RFID
SafeEngine module setup get and set Safe engine cut of from APEX OS
Serial module, get information about serial state
get serial mode: Promise<"console"|"modem"|"unmanaged"|"rfid"|"mdt"|"faitgue_sensor"|"fuel_sensor"|"user">
Kind: inner method of Serial
set serial mode (console or modem)
Kind: inner method of Serial
get serial modem state
Kind: inner method of Serial
get modem buffer size
Kind: inner method of Serial
set the buffer size
Kind: inner method of Serial
send a message
Kind: inner method of Serial
System module get information about ApexOS
Get Info about the system like RAM,CPU,uptime, etc
Kind: inner method of System-Info
Get Modem about the system like RAM,CPU,uptime, etc
Kind: inner method of System-Info
handler to detect power save mode and execute callback 15 seconds before the device goes to sleep
Kind: inner method of System-Info
| Param | Description |
|---|---|
| callback | callback to execute when power save mode is on and device is about to turn off |
| errorCallback | callbac to execute in case of any error |
Get the latest wakeup reason and timestamp from sleep on from APEX OS
Kind: inner method of System-Info
Get the latest time from sleep on event from APEX OS
Kind: inner method of System-Info
Get the list of latets sleep on and wakeup events with reason and timestamp
Kind: inner method of System-Info
add a callback from stack to execute when app signal termination
Kind: inner method of System-Info
| Param | Description |
|---|---|
| callback | callback to execute when application goes offline |
remove a callback from stack to execute when app signal termination
Kind: inner method of System-Info
| Param | Description |
|---|---|
| callback | callback to remove from listener |
Technoton module get information about Technoton fuel level
Temperature module get information about temperature sensors
Kind: inner class of Temperature
Event published by the sdk composed of multiple TemperatureEvents authorized object contains events from whitelisted ibuttons
get the current temperature state
Kind: inner method of Temperature
get reading from a specific sensor, by id or alias
Kind: inner method of Temperature
set alias to a temperature sensor
Kind: inner method of Temperature
remove alias from temperature sensor
Kind: inner method of Temperature
remove aliases from all temperature sensors
Kind: inner method of Temperature
monitor temperature notifications
Kind: inner method of Temperature
Update module check for update and make update for ApexOS
Check if an update is available in the dctserver for OS apps and return a list of the latest version of the packages
Kind: inner method of Update
Utils module some utlities in ApexOS
Execute a command using sudo in the shell of the APEXOS and returns a promise with the stdout. Promise is rejected if status code is different than 0
Kind: inner method of Utils
| Param | Description |
|---|---|
| ...args | arguments to pass to the function to execute |
Fetch application prefix, uses env=SYRUS4G_APP_NAME when available otherwise it builds it from the directory where the app is running
Kind: inner method of Utils
Utility for try/catching promises in one line, avoiding the need for try/catch blocks let [response, error] = $trycatch(await awaitable())
Kind: inner method of Utils
Returns: * - {(Promise<[ any | null, Error | null ]>)}
| Param | Type |
|---|---|
| promise | Promise.<any> |
Utility for throwing errors inside a catch, reduces need for try/catch await awaitable().catch($throw)
Kind: inner method of Utils
| Param | Type |
|---|---|
| error | Error |
Sleep Utility await $sleep(10*1000)
Kind: inner method of Utils
Returns: * - {Promise}
| Param | Type |
|---|---|
| ms | number |
WIFI module to interacte with the enable/disable WIFI mode with Apex OS
It starts a WIFI scan and returns a list of SSIDs
Kind: inner method of WIFI
It returns the wifi status
Kind: inner method of WIFI
It returns the list of networks configured
Kind: inner method of WIFI
It enables the WIFI interface and starts the service for connecting with preconfigured networks
Kind: inner method of WIFI
It stops the WIFI service and disables the interface
Kind: inner method of WIFI
It executes a stop-start in the same call
Kind: inner method of WIFI
It adds a new network to the WIFI configuration file, in this case you have to include the SSID and psk as parameters. Example apx-wifi add myNet myPass
Kind: inner method of WIFI
| Param | Description |
|---|---|
| ssid | The name of SSID you want to connect |
| password | the password of the SSID |
It removes a network from the WIFI configuration file, in this case you have to include the SSID as parametes
Kind: inner method of WIFI
| Param | Description |
|---|---|
| ssid | Name of the SSID you want to remove |
Time Windows module setup get and set counters from APEX OS
returns a JSON with the configured values in RF
Use this option to configure the network variable for mobile networks
Kind: global function
| Param | Description |
|---|---|
| key | the paramter to be configured, posible values are: "apn", "user", "pin", "pass" |
| value | the new value of the parameter |
© 2020 Digitalcomtech