Commit 28ec2941 authored by Giacomo Lavermicocca's avatar Giacomo Lavermicocca

package.json add modified ass

parent 0590385c
node_modules*
......@@ -226,6 +226,28 @@ void WriteAllFrames(const FunctionCallbackInfo<Value>& args) {
args.GetReturnValue().Set(String::NewFromUtf8(isolate, "end of 'WRITE ALL FRAMES' job"));
}
void WriteSingleLine(const FunctionCallbackInfo<Value>& args) {
Isolate* isolate = args.GetIsolate();
if (!args[0]->IsNumber() || !args[1]->IsNumber() || !args[2]->IsNumber() || !args[3]->IsNumber()) {
isolate->ThrowException(Exception::TypeError(String::NewFromUtf8(isolate, "Wrong type of arguments")));
return;
}
int _i2cbus = args[0]->ToInteger()->Value();
int _address = args[1]->ToInteger()->Value();
int line = args[2]->ToInteger()->Value();
int linePos = args[3]->ToInteger()->Value();
SetFile(_i2cbus, _address); //Devo settare /dev/i2c... tutte le volte
i2c_smbus_write_byte_data(file, linePos, line);
close(file);
args.GetReturnValue().Set(String::NewFromUtf8(isolate, "ok line"));
}
void Begin(const FunctionCallbackInfo<Value>& args) {
Isolate* isolate = args.GetIsolate();
......@@ -257,6 +279,7 @@ void Exit(const FunctionCallbackInfo<Value>& args) {
void Init(Local<Object> exports) {
NODE_SET_METHOD(exports, "WriteAllFrames", WriteAllFrames);
NODE_SET_METHOD(exports, "WriteSingleLine", WriteSingleLine);
NODE_SET_METHOD(exports, "Begin", Begin);
NODE_SET_METHOD(exports, "Exit", Exit);
}
......
......@@ -308,8 +308,8 @@ ifeq ($(strip $(foreach prefix,$(NO_LOAD),\
endif
quiet_cmd_regen_makefile = ACTION Regenerating $@
cmd_regen_makefile = cd $(srcdir); /usr/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py -fmake --ignore-environment "--toplevel-dir=." -I/root/matrix8x8_bicolor/AddOn/build/config.gypi -I/usr/lib/node_modules/npm/node_modules/node-gyp/addon.gypi -I/root/.node-gyp/8.6.0/include/node/common.gypi "--depth=." "-Goutput_dir=." "--generator-output=build" "-Dlibrary=shared_library" "-Dvisibility=default" "-Dnode_root_dir=/root/.node-gyp/8.6.0" "-Dnode_gyp_dir=/usr/lib/node_modules/npm/node_modules/node-gyp" "-Dnode_lib_file=/root/.node-gyp/8.6.0/<(target_arch)/node.lib" "-Dmodule_root_dir=/root/matrix8x8_bicolor/AddOn" "-Dnode_engine=v8" binding.gyp
Makefile: $(srcdir)/../../.node-gyp/8.6.0/include/node/common.gypi $(srcdir)/build/config.gypi $(srcdir)/binding.gyp $(srcdir)/../../../usr/lib/node_modules/npm/node_modules/node-gyp/addon.gypi
cmd_regen_makefile = cd $(srcdir); /usr/local/lib/node_modules/node-gyp/gyp/gyp_main.py -fmake --ignore-environment "--toplevel-dir=." -I/root/matrix8x8_bicolor/AddOn/build/config.gypi -I/usr/local/lib/node_modules/node-gyp/addon.gypi -I/root/.node-gyp/9.2.1/include/node/common.gypi "--depth=." "-Goutput_dir=." "--generator-output=build" "-Dlibrary=shared_library" "-Dvisibility=default" "-Dnode_root_dir=/root/.node-gyp/9.2.1" "-Dnode_gyp_dir=/usr/local/lib/node_modules/node-gyp" "-Dnode_lib_file=/root/.node-gyp/9.2.1/<(target_arch)/node.lib" "-Dmodule_root_dir=/root/matrix8x8_bicolor/AddOn" "-Dnode_engine=v8" binding.gyp
Makefile: $(srcdir)/../../.node-gyp/9.2.1/include/node/common.gypi $(srcdir)/../../../usr/local/lib/node_modules/node-gyp/addon.gypi $(srcdir)/build/config.gypi $(srcdir)/binding.gyp
$(call do_cmd,regen_makefile)
# "all" is a concatenation of the "all" targets from all the included
......
cmd_Release/obj.target/addon/addon.o := g++ '-DNODE_GYP_MODULE_NAME=addon' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DBUILDING_NODE_EXTENSION' -I/root/.node-gyp/8.6.0/include/node -I/root/.node-gyp/8.6.0/src -I/root/.node-gyp/8.6.0/deps/uv/include -I/root/.node-gyp/8.6.0/deps/v8/include -fPIC -pthread -Wall -Wextra -Wno-unused-parameter -O3 -fno-omit-frame-pointer -fno-rtti -fno-exceptions -std=gnu++0x -MMD -MF ./Release/.deps/Release/obj.target/addon/addon.o.d.raw -c -o Release/obj.target/addon/addon.o ../addon.cc
cmd_Release/obj.target/addon/addon.o := g++ '-DNODE_GYP_MODULE_NAME=addon' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DBUILDING_NODE_EXTENSION' -I/root/.node-gyp/9.2.1/include/node -I/root/.node-gyp/9.2.1/src -I/root/.node-gyp/9.2.1/deps/uv/include -I/root/.node-gyp/9.2.1/deps/v8/include -fPIC -pthread -Wall -Wextra -Wno-unused-parameter -O3 -fno-omit-frame-pointer -fno-rtti -fno-exceptions -std=gnu++0x -MMD -MF ./Release/.deps/Release/obj.target/addon/addon.o.d.raw -c -o Release/obj.target/addon/addon.o ../addon.cc
Release/obj.target/addon/addon.o: ../addon.cc \
/root/.node-gyp/8.6.0/include/node/node.h \
/root/.node-gyp/8.6.0/include/node/v8.h \
/root/.node-gyp/8.6.0/include/node/v8-version.h \
/root/.node-gyp/8.6.0/include/node/v8config.h \
/root/.node-gyp/8.6.0/include/node/node_version.h ../i2c-dev.h \
/root/.node-gyp/9.2.1/include/node/node.h \
/root/.node-gyp/9.2.1/include/node/v8.h \
/root/.node-gyp/9.2.1/include/node/v8-version.h \
/root/.node-gyp/9.2.1/include/node/v8config.h \
/root/.node-gyp/9.2.1/include/node/node_version.h ../i2c-dev.h \
../8x8font.h
../addon.cc:
/root/.node-gyp/8.6.0/include/node/node.h:
/root/.node-gyp/8.6.0/include/node/v8.h:
/root/.node-gyp/8.6.0/include/node/v8-version.h:
/root/.node-gyp/8.6.0/include/node/v8config.h:
/root/.node-gyp/8.6.0/include/node/node_version.h:
/root/.node-gyp/9.2.1/include/node/node.h:
/root/.node-gyp/9.2.1/include/node/v8.h:
/root/.node-gyp/9.2.1/include/node/v8-version.h:
/root/.node-gyp/9.2.1/include/node/v8config.h:
/root/.node-gyp/9.2.1/include/node/node_version.h:
../i2c-dev.h:
../8x8font.h:
......@@ -34,10 +34,10 @@ CFLAGS_CC_Debug := \
-std=gnu++0x
INCS_Debug := \
-I/root/.node-gyp/8.6.0/include/node \
-I/root/.node-gyp/8.6.0/src \
-I/root/.node-gyp/8.6.0/deps/uv/include \
-I/root/.node-gyp/8.6.0/deps/v8/include
-I/root/.node-gyp/9.2.1/include/node \
-I/root/.node-gyp/9.2.1/src \
-I/root/.node-gyp/9.2.1/deps/uv/include \
-I/root/.node-gyp/9.2.1/deps/v8/include
DEFS_Release := \
'-DNODE_GYP_MODULE_NAME=addon' \
......@@ -68,10 +68,10 @@ CFLAGS_CC_Release := \
-std=gnu++0x
INCS_Release := \
-I/root/.node-gyp/8.6.0/include/node \
-I/root/.node-gyp/8.6.0/src \
-I/root/.node-gyp/8.6.0/deps/uv/include \
-I/root/.node-gyp/8.6.0/deps/v8/include
-I/root/.node-gyp/9.2.1/include/node \
-I/root/.node-gyp/9.2.1/src \
-I/root/.node-gyp/9.2.1/deps/uv/include \
-I/root/.node-gyp/9.2.1/deps/v8/include
OBJS := \
$(obj).target/$(TARGET)/addon.o
......
......@@ -18,23 +18,30 @@
"debug_http2": "false",
"debug_nghttp2": "false",
"force_dynamic_crt": 0,
"gas_version": "2.24",
"host_arch": "arm",
"icu_gyp_path": "tools/icu/icu-system.gyp",
"icu_small": "false",
"icu_data_file": "icudt60l.dat",
"icu_data_in": "../../deps/icu-small/source/data/in/icudt60l.dat",
"icu_endianness": "l",
"icu_gyp_path": "tools/icu/icu-generic.gyp",
"icu_locales": "en,root",
"icu_path": "deps/icu-small",
"icu_small": "true",
"icu_ver_major": "60",
"node_byteorder": "little",
"node_enable_d8": "false",
"node_enable_v8_vtunejit": "false",
"node_install_npm": "false",
"node_module_version": 57,
"node_install_npm": "true",
"node_module_version": 59,
"node_no_browser_globals": "false",
"node_prefix": "/usr",
"node_release_urlbase": "",
"node_prefix": "/",
"node_release_urlbase": "https://nodejs.org/download/release/",
"node_shared": "false",
"node_shared_cares": "true",
"node_shared_http_parser": "true",
"node_shared_libuv": "true",
"node_shared_openssl": "true",
"node_shared_zlib": "true",
"node_shared_cares": "false",
"node_shared_http_parser": "false",
"node_shared_libuv": "false",
"node_shared_openssl": "false",
"node_shared_zlib": "false",
"node_tag": "",
"node_use_bundled_v8": "true",
"node_use_dtrace": "false",
......@@ -46,7 +53,7 @@
"node_without_node_options": "false",
"openssl_fips": "",
"openssl_no_asm": 0,
"shlib_suffix": "so.57",
"shlib_suffix": "so.59",
"target_arch": "arm",
"uv_parent_path": "/deps/uv/",
"uv_use_dtrace": "false",
......@@ -58,9 +65,9 @@
"v8_promise_internal_field_count": 1,
"v8_random_seed": 0,
"v8_trace_maps": 0,
"v8_use_snapshot": "false",
"v8_use_snapshot": "true",
"want_separate_host_toolset": 0,
"nodedir": "/root/.node-gyp/8.6.0",
"nodedir": "/root/.node-gyp/9.2.1",
"standalone_static_library": 1
}
}
var http = require('http');
//var bind = require('bind');
//var dispatcher = require('httpdispatcher');
var networkInterfaces = require('os').networkInterfaces();
var addon = require('./AddOn/build/Release/addon'); // ./ pesco l'AddOn dalla directory corrente
var addon1 = require('./AddOn/build/Release/addon'); // ./ pesco l'AddOn dalla directory corrente
var addon2 = require('./AddOn/build/Release/addon');
var addon3 = require('./AddOn/build/Release/addon');
var addon4 = require('./AddOn/build/Release/addon');
var addon5 = require('./AddOn/build/Release/addon');
var isBegin = false; //server per capire se ho gi fatto l'inizializzazione
var isBegin = true; //server per capire se ho gia fatto l'inizializzazione
var server = http.createServer(function (req, res) {
//dispatcher.dispatch(req, res);
......@@ -20,51 +22,112 @@ var matrixFrames = [];
var currentframeIndex;
//setup i2cbus
var _i2cbus = 1;
var _address = 112;
var _address1 = 112; //70=112 71=113 72=114 73=115 74=116
var _address2 = 113; //70=112 71=113 72=114 73=115 74=116
var _address3 = 114; //70=112 71=113 72=114 73=115 74=116
var _address4 = 115; //70=112 71=113 72=114 73=115 74=116
var _address5 = 116; //70=112 71=113 72=114 73=115 74=116
var page = [ ];
function Green()
{
var a = 255;// getRandomInt(0, 255);
var col = getRandomInt(0, 255) % 16;
for(i = 0; i < 16; i+=2)
{
addon1.WriteSingleLine(_i2cbus, _address1, a, i);
}
}
function Red()
{
var a = 255;// getRandomInt(0, 255);
var col = getRandomInt(0, 255) % 16;
for(i = 1; i < 16; i+=2)
{
addon1.WriteSingleLine(_i2cbus, _address1, a, i);
}
}
function clearDisplay(matrix) {
for (var i = 0; i < 16; i++) {
addon.Write(i, matrix[i], _i2cbus, _address);
addon1.WriteSingleLine(_i2cbus, _address1, parseInt(matrix[i]), i);
addon2.WriteSingleLine(_i2cbus, _address2, parseInt(matrix[i]), i);
addon3.WriteSingleLine(_i2cbus, _address3, parseInt(matrix[i]), i);
addon4.WriteSingleLine(_i2cbus, _address4, parseInt(matrix[i]), i);
addon5.WriteSingleLine(_i2cbus, _address5, parseInt(matrix[i]), i);
}
}
function inizializzoDisplay()
{
if (isBegin == false) {
if (isBegin == true) {
//inizializzo il display
addon.Begin(_i2cbus, _address);
isBegin = true;
addon1.Begin(_i2cbus, _address1);
addon2.Begin(_i2cbus, _address2);
addon3.Begin(_i2cbus, _address3);
addon4.Begin(_i2cbus, _address4);
addon5.Begin(_i2cbus, _address5);
console.log("isBegin : ", "Ok");
console.log("no need others begin");
}
isBegin = false;
}
server.listen(8082, function () {
//setto colori e intensit del display
//setto colori e intensit del display
inizializzoDisplay();
//matrixFrames.push([255, 0, 255, 0, 255, 0, 255, 0,
// 255, 0, 255, 0, 255, 0, 255, 0]);
//clearDisplay(matrixFrames[0]);
matrixFrames.push([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]);
clearDisplay(matrixFrames);
//RED & GREEN
var page = [
128, 0, 64, 0, 32, 0, 16, 0, 8, 0, 4, 0, 2, 0, 1, 0,
0, 1, 0, 2, 0, 4, 0, 8, 0, 16, 0, 32, 0, 64, 0, 128,
255, 0, 129, 0, 129, 0, 129, 0, 129, 0, 129, 0, 129, 0, 255, 0,
];
do {
var p = [];
for (i = 0; i < 16; i++)
{
var a = getRandomInt(0, 255);
p.push(a);
}
addon.WriteAllFrames(p, _i2cbus, _address, 200);
}
while (true);
Green();
Red();
// do {
// var a = 255;//getRandomInt(0, 255);
// var col = getRandomInt(0, 255) % 16;
// addon1.WriteSingleLine(_i2cbus, _address1, a, col);
// addon2.WriteSingleLine(_i2cbus, _address2, a, col);
// addon3.WriteSingleLine(_i2cbus, _address3, a, col);
// addon4.WriteSingleLine(_i2cbus, _address4, a, col);
// addon5.WriteSingleLine(_i2cbus, _address5, a, col);
// }
// while (true);
// var page = [
// 255, 255, 129, 0, 129, 0, 129, 0, 129, 0, 129, 0, 129, 0, 255, 0,
// ];
// addon1.WriteAllFrames(page, _i2cbus, _address1, 0);
// do {
// var p = [];
// for (i = 0; i < 16; i++)
// {
// var a;
// if (i % 2) {
// a = getRandomInt(0, 255);
// }
// else {
// a = 0;
// }
// p.push(a);
// }
// addon1.WriteAllFrames(p, _i2cbus, _address1, 0);
// addon2.WriteAllFrames(p, _i2cbus, _address2, 0);
// addon3.WriteAllFrames(p, _i2cbus, _address3, 0);
// addon4.WriteAllFrames(p, _i2cbus, _address4, 0);
// addon5.WriteAllFrames(p, _i2cbus, _address5, 0);
// }
// while (true);
console.log("Write : ", "End of program");
});
......@@ -78,4 +141,4 @@ function getRandomInt(min, max) {
}
//console.log("Your server is on 8082 port visit http://127.0.0.1/HomePage to start");
console.log(networkInterfaces.eth0[0].address);
\ No newline at end of file
console.log(networkInterfaces.wlan0[0].address);
......@@ -18,23 +18,30 @@
"debug_http2": "false",
"debug_nghttp2": "false",
"force_dynamic_crt": 0,
"gas_version": "2.24",
"host_arch": "arm",
"icu_gyp_path": "tools/icu/icu-system.gyp",
"icu_small": "false",
"icu_data_file": "icudt60l.dat",
"icu_data_in": "../../deps/icu-small/source/data/in/icudt60l.dat",
"icu_endianness": "l",
"icu_gyp_path": "tools/icu/icu-generic.gyp",
"icu_locales": "en,root",
"icu_path": "deps/icu-small",
"icu_small": "true",
"icu_ver_major": "60",
"node_byteorder": "little",
"node_enable_d8": "false",
"node_enable_v8_vtunejit": "false",
"node_install_npm": "false",
"node_module_version": 57,
"node_install_npm": "true",
"node_module_version": 59,
"node_no_browser_globals": "false",
"node_prefix": "/usr",
"node_release_urlbase": "",
"node_prefix": "/",
"node_release_urlbase": "https://nodejs.org/download/release/",
"node_shared": "false",
"node_shared_cares": "true",
"node_shared_http_parser": "true",
"node_shared_libuv": "true",
"node_shared_openssl": "true",
"node_shared_zlib": "true",
"node_shared_cares": "false",
"node_shared_http_parser": "false",
"node_shared_libuv": "false",
"node_shared_openssl": "false",
"node_shared_zlib": "false",
"node_tag": "",
"node_use_bundled_v8": "true",
"node_use_dtrace": "false",
......@@ -46,7 +53,7 @@
"node_without_node_options": "false",
"openssl_fips": "",
"openssl_no_asm": 0,
"shlib_suffix": "so.57",
"shlib_suffix": "so.59",
"target_arch": "arm",
"uv_parent_path": "/deps/uv/",
"uv_use_dtrace": "false",
......@@ -58,9 +65,9 @@
"v8_promise_internal_field_count": 1,
"v8_random_seed": 0,
"v8_trace_maps": 0,
"v8_use_snapshot": "false",
"v8_use_snapshot": "true",
"want_separate_host_toolset": 0,
"nodedir": "/root/.node-gyp/8.6.0",
"nodedir": "/root/.node-gyp/9.2.1",
"standalone_static_library": 1
}
}
192.168.1.10
writing: 0x21
writing: 0x81
Full brightness writing: 0xef
Start writing to address 0 writing: 0x00
writing: 0x21
writing: 0x81
Full brightness writing: 0xef
Start writing to address 0 writing: 0x00
writing: 0x21
writing: 0x81
Full brightness writing: 0xef
Start writing to address 0 writing: 0x00
writing: 0x21
writing: 0x81
Full brightness writing: 0xef
Start writing to address 0 writing: 0x00
writing: 0x21
writing: 0x81
Full brightness writing: 0xef
Start writing to address 0 writing: 0x00
isBegin : Ok
no need others begin
{
"name": "matrix8x8_bicolor",
"version": "1.0.0",
"description": "Web page for manage display 8x8 and animation (5 displais)",
"main": "ServerFreeForm.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git@git-ssh.mittelab.org:glavermi/matrix8x8_bicolor.git"
},
"dependencies": {
"socket.io": "2.0.4"
},
"author": "Giacomo Lavermicocca",
"license": "ISC"
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment