Skip to content

Commit

Permalink
Merge pull request #737 from entrylabs/develop-hw
Browse files Browse the repository at this point in the history
하드웨어 1.9.54 버전업
  • Loading branch information
Tnks2U authored May 23, 2024
2 parents 1f24bb2 + d21f989 commit b9e4768
Show file tree
Hide file tree
Showing 5 changed files with 80 additions and 42 deletions.
Binary file modified app/firmwares/codewiz.bin
Binary file not shown.
76 changes: 39 additions & 37 deletions app/modules/codewiz.json
Original file line number Diff line number Diff line change
@@ -1,42 +1,44 @@
{
"id": "011201",
"name": {
"en": "CodeWiz",
"ko": "코드위즈"
},
"category": "board",
"platform": ["win32"],
"icon" : "codewiz.png",
"module": "codewiz.js",
"url": "https://www.codable.co.kr",
"email": "[email protected]",
"video": "https://youtu.be/79gc4e6p3i0",
"driver": {
"id": "011201",
"name": {
"en": "CodeWiz",
"ko": "코드위즈"
},
"category": "board",
"platform": ["win32"],
"icon": "codewiz.png",
"module": "codewiz.js",
"url": "https://www.codable.co.kr",
"email": "[email protected]",
"video": "https://youtu.be/79gc4e6p3i0",
"driver": {
"win32-ia32": "CH34x_Install_Windows_v3_4/CH34x_Install_Windows_v3_4.EXE",
"win32-x64": "CH34x_Install_Windows_v3_4/CH34x_Install_Windows_v3_4.EXE"
},
"reconnect" : true,
"selectPort": true,
"firmware": [{
"type": "esp32",
"offset": "0x10000",
"name": "codewiz",
"translate" : "코드위즈 펌웨어(E_1.0)"
},
{
"type": "esp32",
"offset": "0x10000",
"name": "codewizTooth",
"translate" : "동글 코드위즈 펌웨어"
}],
"firmwareBaudRate": 921600,
"hardware": {
"type": "serial",
"control": "slave",
"duration": 32,
"vendor": ["wch.cn"],
"baudRate": 115200,
"firmwarecheck" : false,
"advertise": 2000
}
"reconnect": true,
"selectPort": true,
"firmware": [
{
"type": "esp32",
"offset": "0x10000",
"name": "codewiz",
"translate": "코드위즈 펌웨어(E_1.1)"
},
{
"type": "esp32",
"offset": "0x10000",
"name": "codewizTooth",
"translate": "동글 코드위즈 펌웨어"
}
],
"firmwareBaudRate": 921600,
"hardware": {
"type": "serial",
"control": "slave",
"duration": 32,
"vendor": ["wch.cn"],
"baudRate": 115200,
"firmwarecheck": false,
"advertise": 2000
}
}
42 changes: 39 additions & 3 deletions app/modules/hexaboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,13 @@ class hexaboard extends BaseModule {
DISPLAY_OLED: 0x10, // OLED 값 정의
DISPLAY_INIT_OLED: 0x12, // OLED 값 정의
UPDATE_ALL_NEOPIXEL: 0x11, //모든 네오픽셀 켜기
CLEAR_DISPLAY_OLED: 0x25, // OLED값 리셋
CONNECT_WIFI: 0x21, //WIFI 연결
CONNECT_BLYNK: 0x21, //BLYNK서버 연결
BLYNK_VIRTUAL_WRITE: 0x22, //BLYNK 가상의 핀 데이터 전송
BLYNK_WRITE: 0x23, //BLYNK 상태값 바뀌었을때
CONNECTED_BLYNK: 0x24, //BLYNK 연결 상태 확인
HEXA_INIT: 0x30,
};
// 자이로 센서에 대한 추가적인 세부 명령 정의
this.gyro_sensor = {
Expand Down Expand Up @@ -160,7 +162,7 @@ class hexaboard extends BaseModule {
// 에러 처리 또는 데이터 분할 필요
throw new Error('Data length exceeds buffer limit');
}

// console.log(`딜레이 : ${duration}`);
buffer = new Buffer([
255,
85,
Expand Down Expand Up @@ -374,6 +376,7 @@ class hexaboard extends BaseModule {
data : value,
}),
]);
// console.log(`pin : ${port}, value : ${value}`);
if (buffer.length) {
//이곳에서 데이터를 SendBuffer에 저장하기
this.sendBuffers.push(buffer);
Expand Down Expand Up @@ -414,6 +417,7 @@ class hexaboard extends BaseModule {
]);
if (buffer.length) {
//이곳에서 데이터를 SendBuffer에 저장하기
console.log(`duration : ${duration}`);
this.sendBuffers.push(buffer);
}
break;
Expand Down Expand Up @@ -525,6 +529,19 @@ class hexaboard extends BaseModule {
this.sendBuffers.push(buffer);
}
break;
case this.sensorTypes.CLEAR_DISPLAY_OLED:
// console.log('DISPLAY_INIT_OLED');
buffer = Buffer.concat(
[buffer,
this.makeOutputBuffer({
command : this.command.WRITE,
sensorType : this.sensorTypes.CLEAR_DISPLAY_OLED,
}),
]);
if (buffer.length) {
this.sendBuffers.push(buffer);
}
break;
case this.sensorTypes.CONNECT_WIFI:
// console.log('CONNECT_WIFI');
ssid = readData.data.ssid;
Expand Down Expand Up @@ -595,6 +612,19 @@ class hexaboard extends BaseModule {
this.sendBuffers.push(buffer);
}
break;
case this.sensorTypes.HEXA_INIT:
buffer = Buffer.concat(
[buffer,
this.makeOutputBuffer({
command : this.command.WRITE,
sensorType : this.sensorTypes.HEXA_INIT,
}),
]);
if (buffer.length) {
//이곳에서 데이터를 SendBuffer에 저장하기
this.sendBuffers.push(buffer);
}
break;
}
}

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

connect() {}
connect() {
// console.log("connected");
}

disconnect(connect) {
if (this.isConnect) {
Expand All @@ -720,7 +754,9 @@ class hexaboard extends BaseModule {
}
}

reset() {}
reset() {
// console.log("reset");
}
}

module.exports = new hexaboard();
2 changes: 1 addition & 1 deletion build/entry-hw.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
!define PRODUCT_NAME "Entry_HW"
!define PROTOCOL_NAME "entryhw"
!define APP_NAME "Entry_HW.exe"
!define PRODUCT_VERSION "1.9.53"
!define PRODUCT_VERSION "1.9.54"
!define PRODUCT_PUBLISHER "EntryLabs"
!define PRODUCT_WEB_SITE "https://www.playentry.org/"

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "entry-hw",
"version": "1.9.53",
"version": "1.9.54",
"description": "엔트리 하드웨어 연결 프로그램",
"author": "EntryLabs",
"main": "./app/src/index.bundle.js",
Expand Down

0 comments on commit b9e4768

Please sign in to comment.