⚠️ This Repo has been migrated, check out the new one here https://github.com/digitalcomtech/syrus4-sdk-nodejs ⚠️
Interactive function to consult enable or disable multiple modules for APEX OS
Install using npm github
$ npm install https://github.com/dctdevelop/syrus4-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
- Serial
Serial module, get information about serial state
- Counters
Counters 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
- IOS
IOS module allow to get and set status from Input and Outputs in Syrus 4 Apex OS
- Network
Network module get information about networks and events in ApexOS
- Onewire
Onewire module get information about onewire
- Serial
Serial module, get information about serial state
- System-Info
System module get information about ApexOS
- 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
- getInfo()
returns a JSON with the configured values in RF
- set(key, value)
Use this option to configure the network variable for mobile networks
- watchTrackingResolution(callback, opts)
define a tracking resolution using apx-tracking tool to receive filtered data gps
- getActiveTrackingsResolutions(prefixed)
get all the active tracking resolutions`in the apex tol apx-tracking
- setTrackingResolution(opts)
set options for a tracking_resolution for the apex tool apx-tracking
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
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 unde where unzip the app |
Start an application under /data/applications folder
Kind: inner method of Apps
Param | Description |
---|---|
app | the name of the app |
Stop an application under /data/applications folder
Kind: inner method of Apps
Param | Description |
---|---|
app | the name of the app |
Restart an application under /data/applications folder
Kind: inner method of Apps
Param | Description |
---|---|
app | the name of the app |
Enable an application for start on boot under /data/applications folder
Kind: inner method of Apps
Param | Description |
---|---|
app | the name of the app |
Disable an application for start on boot under /data/applications folder
Kind: inner method of Apps
Param | Description |
---|---|
app | the name of the app |
List all the running applications
Kind: inner method of Apps
return the state of the app
Kind: inner method of Apps
Param | Description |
---|---|
app | the name of the app |
Allows 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 |
---|---|
app | the name of the app |
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 |
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 |
Serial module, get information about serial state
get serial mode
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
monitor incoming serial messages
Kind: inner method of Serial
Counters 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 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
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
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
Onewire module get information about onewire
allow to get al lthe state of the ibuttons connected
Kind: inner method of Onewire
allow to get al lthe state of the ibuttons connected
Kind: inner method of Onewire
allow to get al lthe state of the ibuttons connected
Kind: inner method of Onewire
Serial module, get information about serial state
get serial mode
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
monitor incoming serial messages
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 |
Temperature module get information about temperature sensors
Kind: inner class of Temperature
Event published by the sdk composed of 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 Core Ccomponentss
Kind: inner method of Update
Start the update of the core packages by using the dctserver
Kind: inner method of Update
Param | Default | Description |
---|---|---|
force | false |
The same as start but without checking the network interface |
list installed packages from OS components in the distribution
Kind: inner method of Update
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
allows to recover from broken packages when a bad install or updates happens
Kind: inner method of Update
Start the update of the OS components by using the dctserver
Kind: inner method of Update
Param | Description |
---|---|
force | The same as start but without checking the network interface |
upgrade a package to the lastest version available in the dctserver
Kind: inner method of Update
Param | Description |
---|---|
package_name | the name of the package that it wants to be updated |
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 |
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 |
define a tracking resolution using apx-tracking tool to receive filtered data gps
Kind: global function
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: global function
Param | Description |
---|---|
prefixed | prefix to lookup tracking_resolution |
set options for a tracking_resolution for the apex tool apx-tracking
Kind: global function
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) |
© 2020 Digitalcomtech