Skip to content

Commit df7661d

Browse files
committed
2019/05 배포를 이전 프로세스에서 하기 위한 임시 모듈이전
1 parent b4db4f2 commit df7661d

8 files changed

+852
-653
lines changed

app/custom_modules/flasher/thinkboard.hex

+628-623
Large diffs are not rendered by default.

app/modules/neobot.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"pnpId" : "PID",
2525
"type": "bluetooth",
2626
"control": "master",
27-
"vendor": ["neobot", "Silicon Laps", "Microsoft"],
27+
"vendor": ["neobot", "Silicon Labs", "Microsoft"],
2828
"baudRate": 115200
2929
}
3030
}

app/modules/neobot_new.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"pnpId" : "PID",
2424
"type": "serial",
2525
"control": "master",
26-
"vendor": "Silicon Laps",
26+
"vendor": "Silicon Labs",
2727
"duration": 32,
2828
"baudRate": 115200
2929
}

app/modules/neobot_robot_theme.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@
1919
{
2020
"win32-ia32": "NEOBOT/VCP_V1.5.0_Setup_W8_x64_32bits.exe",
2121
"win32-x64": "NEOBOT/VCP_V1.5.0_Setup_W8_x64_64bits.exe",
22-
"translate": "Win8용 드라이버"
22+
"translate": "Windows 8 Driver"
2323
},
2424
{
2525
"win32-ia32": "NEOBOT/VCP_V1.5.0_Setup_W7_x86_32bits.exe",
2626
"win32-x64": "NEOBOT/VCP_V1.5.0_Setup_W7_x64_64bits.exe",
27-
"translate": "Win7용 드라이버"
27+
"translate": "Windows 7 Driver"
2828
}
2929
],
3030
"hardware": {
+123
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
function Module() {
2+
this.localBuffer = new Array(8);
3+
this.remoteBuffer = new Array(5);
4+
5+
this.LOCAL_MAP = [
6+
'IN1',
7+
'IN2',
8+
'IN3',
9+
'IR',
10+
'IN4'
11+
];
12+
13+
this.REMOTE_MAP = [
14+
'OUT1',
15+
'OUT2',
16+
'OUT3',
17+
'DCL',
18+
'DCR',
19+
'SND',
20+
'LED',
21+
'OPT'
22+
];
23+
}
24+
25+
Module.prototype.init = function(handler, config) {
26+
};
27+
28+
Module.prototype.requestInitialData = function() {
29+
return null;
30+
};
31+
32+
Module.prototype.checkInitialData = function(data, config) {
33+
return true;
34+
};
35+
36+
Module.prototype.validateLocalData = function(data) {
37+
var state = false;
38+
39+
for(var i = 0; i < data.length - 1; i++) {
40+
if(data[i] === 171 && data[i + 1] === 205 ) {
41+
var dataSet = data.slice(i, i + 8);
42+
var dataSum = dataSet.reduce(function (result, value, idx) {
43+
if(idx < 2 || idx >= dataSet.length-1) {
44+
return result;
45+
}
46+
return result + value;
47+
}, 0);
48+
if((dataSum & 255) === dataSet[dataSet.length-1]) {
49+
state = true;
50+
}
51+
break;
52+
}
53+
}
54+
55+
return state;
56+
};
57+
58+
//로컬 데이터 처리
59+
// data: Native Buffer
60+
Module.prototype.handleLocalData = function(data) {
61+
var buffer = this.remoteBuffer;
62+
for(var i = 0; i < data.length - 1; i++) {
63+
if(data[i] === 171 && data[i + 1] === 205 ) {
64+
var dataSet = data.slice(i + 2, i + 7);
65+
66+
dataSet.forEach(function (value, idx) {
67+
buffer[idx] = value;
68+
});
69+
70+
break;
71+
}
72+
}
73+
};
74+
75+
//리모트 데이터 전송
76+
Module.prototype.requestRemoteData = function(handler) {
77+
var buffer = this.remoteBuffer;
78+
for(var i = 0; i < 5; i++) {
79+
handler.write(this.LOCAL_MAP[i], buffer[i]);
80+
}
81+
};
82+
83+
//리모트 데이처 처리
84+
Module.prototype.handleRemoteData = function(handler) {
85+
var buffer = this.localBuffer;
86+
87+
this.REMOTE_MAP.forEach(function (key, idx) {
88+
buffer[idx] = handler.read(key);
89+
});
90+
};
91+
92+
//로컬 데이터 전송
93+
Module.prototype.requestLocalData = function() {
94+
var requestData = [];
95+
var buffer = this.localBuffer;
96+
97+
// 시작 바이트
98+
requestData.push(0xCD); // TODO change to EF
99+
requestData.push(0xAB);
100+
101+
var checksum = 0;
102+
var isLed = false; // for adding option bit 181013
103+
buffer.forEach(function (value, idx) {
104+
if(idx === 6 && value > 0) {
105+
isLed = true;
106+
} else if(idx === 7 && isLed) {
107+
value = value | 8;
108+
}
109+
requestData.push(value);
110+
checksum += value;
111+
});
112+
113+
checksum = checksum & 255;
114+
//체크썸
115+
requestData.push(checksum);
116+
117+
return requestData;
118+
};
119+
120+
Module.prototype.reset = function() {
121+
};
122+
123+
module.exports = new Module();
+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
"id": "050302",
3+
"name": {
4+
"en": "NEOBOT Robot Theme-NEW",
5+
"ko": "네오봇 로봇 테마(무선형)"
6+
},
7+
"category": "module",
8+
"platform": ["win32", "darwin"],
9+
"icon" : "neobot_robot_theme.png",
10+
"module": "neobot_robot_theme_dongle.js",
11+
"url": "http://neobot.co.kr/",
12+
"email": "[email protected]",
13+
"video": "https://goo.gl/hAXFZT",
14+
"driver": {
15+
"win32-ia32": "CP210x_VCP_Windows/CP210xVCPInstaller_x86.exe",
16+
"win32-x64": "CP210x_VCP_Windows/CP210xVCPInstaller_x64.exe",
17+
"darwin-x64": "Mac_OSX_VCP_Driver/SiLabsUSBDriverDisk.dmg"
18+
},
19+
"reconnect" : true,
20+
"entry": {
21+
"protocol": "json"
22+
},
23+
"hardware": {
24+
"pnpId" : "PID",
25+
"type": "serial",
26+
"control": "master",
27+
"vendor": "Silicon Labs",
28+
"duration": 32,
29+
"baudRate": 115200
30+
}
31+
}

app/modules/neobot_sensor_theme.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"id": "050201",
33
"name": {
4-
"en": "NEOBOT Senosor Theme",
4+
"en": "NEOBOT Sensor Theme",
55
"ko": "네오봇 센서 테마"
66
},
77
"category": "module",
@@ -19,12 +19,12 @@
1919
{
2020
"win32-ia32": "NEOBOT/VCP_V1.5.0_Setup_W8_x64_32bits.exe",
2121
"win32-x64": "NEOBOT/VCP_V1.5.0_Setup_W8_x64_64bits.exe",
22-
"translate": "Win8용 드라이버"
22+
"translate": "Windows 8 Driver"
2323
},
2424
{
2525
"win32-ia32": "NEOBOT/VCP_V1.5.0_Setup_W7_x86_32bits.exe",
2626
"win32-x64": "NEOBOT/VCP_V1.5.0_Setup_W7_x64_64bits.exe",
27-
"translate": "Win7용 드라이버"
27+
"translate": "Windows 7 Driver"
2828
}
2929
],
3030
"hardware": {

0 commit comments

Comments
 (0)