Skip to content

Commit b9e4768

Browse files
authored
Merge pull request #737 from entrylabs/develop-hw
하드웨어 1.9.54 버전업
2 parents 1f24bb2 + d21f989 commit b9e4768

File tree

5 files changed

+80
-42
lines changed

5 files changed

+80
-42
lines changed

app/firmwares/codewiz.bin

384 Bytes
Binary file not shown.

app/modules/codewiz.json

+39-37
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,44 @@
11
{
2-
"id": "011201",
3-
"name": {
4-
"en": "CodeWiz",
5-
"ko": "코드위즈"
6-
},
7-
"category": "board",
8-
"platform": ["win32"],
9-
"icon" : "codewiz.png",
10-
"module": "codewiz.js",
11-
"url": "https://www.codable.co.kr",
12-
"email": "[email protected]",
13-
"video": "https://youtu.be/79gc4e6p3i0",
14-
"driver": {
2+
"id": "011201",
3+
"name": {
4+
"en": "CodeWiz",
5+
"ko": "코드위즈"
6+
},
7+
"category": "board",
8+
"platform": ["win32"],
9+
"icon": "codewiz.png",
10+
"module": "codewiz.js",
11+
"url": "https://www.codable.co.kr",
12+
"email": "[email protected]",
13+
"video": "https://youtu.be/79gc4e6p3i0",
14+
"driver": {
1515
"win32-ia32": "CH34x_Install_Windows_v3_4/CH34x_Install_Windows_v3_4.EXE",
1616
"win32-x64": "CH34x_Install_Windows_v3_4/CH34x_Install_Windows_v3_4.EXE"
1717
},
18-
"reconnect" : true,
19-
"selectPort": true,
20-
"firmware": [{
21-
"type": "esp32",
22-
"offset": "0x10000",
23-
"name": "codewiz",
24-
"translate" : "코드위즈 펌웨어(E_1.0)"
25-
},
26-
{
27-
"type": "esp32",
28-
"offset": "0x10000",
29-
"name": "codewizTooth",
30-
"translate" : "동글 코드위즈 펌웨어"
31-
}],
32-
"firmwareBaudRate": 921600,
33-
"hardware": {
34-
"type": "serial",
35-
"control": "slave",
36-
"duration": 32,
37-
"vendor": ["wch.cn"],
38-
"baudRate": 115200,
39-
"firmwarecheck" : false,
40-
"advertise": 2000
41-
}
18+
"reconnect": true,
19+
"selectPort": true,
20+
"firmware": [
21+
{
22+
"type": "esp32",
23+
"offset": "0x10000",
24+
"name": "codewiz",
25+
"translate": "코드위즈 펌웨어(E_1.1)"
26+
},
27+
{
28+
"type": "esp32",
29+
"offset": "0x10000",
30+
"name": "codewizTooth",
31+
"translate": "동글 코드위즈 펌웨어"
32+
}
33+
],
34+
"firmwareBaudRate": 921600,
35+
"hardware": {
36+
"type": "serial",
37+
"control": "slave",
38+
"duration": 32,
39+
"vendor": ["wch.cn"],
40+
"baudRate": 115200,
41+
"firmwarecheck": false,
42+
"advertise": 2000
43+
}
4244
}

app/modules/hexaboard.js

+39-3
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,13 @@ class hexaboard extends BaseModule {
8484
DISPLAY_OLED: 0x10, // OLED 값 정의
8585
DISPLAY_INIT_OLED: 0x12, // OLED 값 정의
8686
UPDATE_ALL_NEOPIXEL: 0x11, //모든 네오픽셀 켜기
87+
CLEAR_DISPLAY_OLED: 0x25, // OLED값 리셋
8788
CONNECT_WIFI: 0x21, //WIFI 연결
8889
CONNECT_BLYNK: 0x21, //BLYNK서버 연결
8990
BLYNK_VIRTUAL_WRITE: 0x22, //BLYNK 가상의 핀 데이터 전송
9091
BLYNK_WRITE: 0x23, //BLYNK 상태값 바뀌었을때
9192
CONNECTED_BLYNK: 0x24, //BLYNK 연결 상태 확인
93+
HEXA_INIT: 0x30,
9294
};
9395
// 자이로 센서에 대한 추가적인 세부 명령 정의
9496
this.gyro_sensor = {
@@ -160,7 +162,7 @@ class hexaboard extends BaseModule {
160162
// 에러 처리 또는 데이터 분할 필요
161163
throw new Error('Data length exceeds buffer limit');
162164
}
163-
165+
// console.log(`딜레이 : ${duration}`);
164166
buffer = new Buffer([
165167
255,
166168
85,
@@ -374,6 +376,7 @@ class hexaboard extends BaseModule {
374376
data : value,
375377
}),
376378
]);
379+
// console.log(`pin : ${port}, value : ${value}`);
377380
if (buffer.length) {
378381
//이곳에서 데이터를 SendBuffer에 저장하기
379382
this.sendBuffers.push(buffer);
@@ -414,6 +417,7 @@ class hexaboard extends BaseModule {
414417
]);
415418
if (buffer.length) {
416419
//이곳에서 데이터를 SendBuffer에 저장하기
420+
console.log(`duration : ${duration}`);
417421
this.sendBuffers.push(buffer);
418422
}
419423
break;
@@ -525,6 +529,19 @@ class hexaboard extends BaseModule {
525529
this.sendBuffers.push(buffer);
526530
}
527531
break;
532+
case this.sensorTypes.CLEAR_DISPLAY_OLED:
533+
// console.log('DISPLAY_INIT_OLED');
534+
buffer = Buffer.concat(
535+
[buffer,
536+
this.makeOutputBuffer({
537+
command : this.command.WRITE,
538+
sensorType : this.sensorTypes.CLEAR_DISPLAY_OLED,
539+
}),
540+
]);
541+
if (buffer.length) {
542+
this.sendBuffers.push(buffer);
543+
}
544+
break;
528545
case this.sensorTypes.CONNECT_WIFI:
529546
// console.log('CONNECT_WIFI');
530547
ssid = readData.data.ssid;
@@ -595,6 +612,19 @@ class hexaboard extends BaseModule {
595612
this.sendBuffers.push(buffer);
596613
}
597614
break;
615+
case this.sensorTypes.HEXA_INIT:
616+
buffer = Buffer.concat(
617+
[buffer,
618+
this.makeOutputBuffer({
619+
command : this.command.WRITE,
620+
sensorType : this.sensorTypes.HEXA_INIT,
621+
}),
622+
]);
623+
if (buffer.length) {
624+
//이곳에서 데이터를 SendBuffer에 저장하기
625+
this.sendBuffers.push(buffer);
626+
}
627+
break;
598628
}
599629
}
600630

@@ -617,6 +647,7 @@ class hexaboard extends BaseModule {
617647
}),
618648
]);
619649
if (buffer.length) {
650+
// console.log(`pin : ${port}, value : ${value}`);
620651
this.sendBuffers.push(buffer);
621652
}
622653
break;
@@ -691,6 +722,7 @@ class hexaboard extends BaseModule {
691722
// 디바이스로 데이터를 보내는 로직. control: slave 인 경우 duration 주기에 맞춰 디바이스에 데이터를 보낸다.
692723
// return 값으로 버퍼를 반환하면 디바이스로 데이터를 보내나, 아두이노의 경우 레거시 코드를 따르고 있다.
693724
if (this.sendBuffers.length > 0) {
725+
// console.log(this.sendBuffers);
694726
this.sp.write(this.sendBuffers.shift(), () => {
695727
if (this.sp) {
696728
this.sp.drain(() => {
@@ -703,7 +735,9 @@ class hexaboard extends BaseModule {
703735
return null;
704736
}
705737

706-
connect() {}
738+
connect() {
739+
// console.log("connected");
740+
}
707741

708742
disconnect(connect) {
709743
if (this.isConnect) {
@@ -720,7 +754,9 @@ class hexaboard extends BaseModule {
720754
}
721755
}
722756

723-
reset() {}
757+
reset() {
758+
// console.log("reset");
759+
}
724760
}
725761

726762
module.exports = new hexaboard();

build/entry-hw.nsi

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
!define PRODUCT_NAME "Entry_HW"
1515
!define PROTOCOL_NAME "entryhw"
1616
!define APP_NAME "Entry_HW.exe"
17-
!define PRODUCT_VERSION "1.9.53"
17+
!define PRODUCT_VERSION "1.9.54"
1818
!define PRODUCT_PUBLISHER "EntryLabs"
1919
!define PRODUCT_WEB_SITE "https://www.playentry.org/"
2020

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "entry-hw",
3-
"version": "1.9.53",
3+
"version": "1.9.54",
44
"description": "엔트리 하드웨어 연결 프로그램",
55
"author": "EntryLabs",
66
"main": "./app/src/index.bundle.js",

0 commit comments

Comments
 (0)