README
eva-utils
collection of hw management APIs
Installation
npm i @novavisionspa/eva-utils
API
Serial
returns a callback with the CPU serial as a string parameter
ERR000
for all platforms excepts the raspberrypi[serial]
of the CPU for raspberrypi platform
var device = require('@novavisionspa/eva-utils');
device.serial(function(serial){
console.log(serial); // -> string
});
readDateTime
returns a callback with a date as a string parameter
Mon May 2 09:35:11 UTC 2016
output format example
var device = require('@novavisionspa/eva-utils');
device.readDateTime(function(error,dateTime){
if (error) {
console.log(error);
} else {
console.log(dateTime); // -> string
}
});
setDateTime
returns a callback with a date as a string parameter (for ACK)
2 OCT 2006 18:00:00
input format example
var device = require('@novavisionspa/eva-utils');
device.setDateTime(`2 OCT 2006 18:00:00`,function(error,dateTime){
if (error) {
console.log(error);
} else {
console.log(dateTime); // -> string
}
});
readRtc
returns a callback with a date as a string parameter
Mon 02 May 2016 11:13:38 AM UTC -0.244577 seconds
output format example
var device = require('@novavisionspa/eva-utils');
device.readRtc(function(error,dateTime){
if (error) {
console.log(error);
} else {
console.log(dateTime); // -> string
}
});
writeRtc
writes the current date to RTC. Returns a callback with an error object
var device = require('@novavisionspa/eva-utils');
device.writeRtc(function(error){
if (error) {
console.log(error);
} else {
console.log('success'); // -> string
}
});
buzz
var evautils = require('@novavisionspa/eva-utils');
evautils.buzz(100); // accepts milliseconds, returns error obj
alert
var evautils = require('@novavisionspa/eva-utils');
evautils.alert(); // returns error obj
rts (yellow LED)
var evautils = require('@novavisionspa/eva-utils');
evautils.rts(); // returns error obj
error (red LED)
var evautils = require('@novavisionspa/eva-utils');
evautils.error(); // returns error obj