Skip to content

Commit 95020df

Browse files
authored
Merge pull request #642 from entrylabs/develop-hw
[1.9.43] 버전업 PR
2 parents ed9097e + d35b302 commit 95020df

File tree

14 files changed

+2437
-71
lines changed

14 files changed

+2437
-71
lines changed

.github/workflows/build.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ jobs:
1111
steps:
1212
- name: Checkout repository
1313
uses: actions/checkout@v2
14-
- name: Setup Node version 10.x
15-
uses: actions/setup-node@v1
14+
- name: Setup Node version 16.19.0
15+
uses: actions/setup-node@v3
1616
with:
17-
node-version: '10.x'
17+
node-version: '16.19.0'
1818
check-latest: true
1919
- name: Yarn install, webpacking
2020
run: |

app/firmwares/dalgona.hex

Lines changed: 1119 additions & 34 deletions
Large diffs are not rendered by default.

app/modules/KKMOO.js

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ class KKMOO extends BaseModule {
77
super();
88

99
this.sendToEntry = "";
10-
this.receiveData = "";
10+
this.receiveData;
1111
this.isReceived = false;
1212
this.isPlaying = false;
1313
this.isPlaying_old = false;
1414
this.cmdProc = "";
1515
this.sendBuffer = [];
16-
this.test;
16+
this.test = 0;
1717
// ...
1818
}
1919
/*
@@ -36,14 +36,15 @@ class KKMOO extends BaseModule {
3636
이 두 함수가 정의되어있어야 로직이 동작합니다. 필요없으면 작성하지 않아도 됩니다.
3737
*/
3838
requestInitialData(sp) {
39-
this.isConnect = true;
40-
if (!this.sp) {
41-
this.sp = sp;
39+
if (!this.isConnect) {
40+
this.isConnect = true;
41+
if (!this.sp) {
42+
this.sp = sp;
43+
}
44+
const initTX = Buffer.from("^ET");
45+
sp.write(initTX);
4246
}
43-
const initTX = Buffer.from("^ET");
44-
sp.write(initTX);
4547
return null;
46-
4748
}
4849

4950

@@ -63,12 +64,11 @@ class KKMOO extends BaseModule {
6364
}
6465
}
6566
requestRemoteData(handler) {
66-
if(this.isPlaying != this.isPlaying_old){
67+
handler.write("data",this.isPlaying);
68+
/*if(this.isPlaying != this.isPlaying_old){
6769
this.isPlaying_old = this.isPlaying;
68-
handler.write("data",this.isPlaying);
69-
//console.log(this.isPlaying);
70-
71-
}
70+
handler.write("data",this.isPlaying);
71+
}*/
7272
}
7373

7474
// 엔트리에서 받은 데이터에 대한 처리
@@ -79,7 +79,6 @@ class KKMOO extends BaseModule {
7979
else{
8080
this.receiveData = null;
8181
}
82-
//console.log(handler);
8382
}
8483

8584
requestLocalData(){
@@ -101,7 +100,8 @@ class KKMOO extends BaseModule {
101100

102101
var cmd = "^AN"+msg;
103102
this.sp.write(Buffer.from(cmd));
104-
//console.log(cmd);
103+
this.sp.flush()
104+
console.log(cmd);
105105

106106
break;
107107
case "IR":
@@ -144,7 +144,7 @@ class KKMOO extends BaseModule {
144144
break;
145145
}
146146
}
147-
147+
this.receiveData = null;
148148

149149
}
150150
disconnect(connect){
@@ -153,6 +153,7 @@ class KKMOO extends BaseModule {
153153
setTimeout(()=>{
154154
connect.close();
155155
},500);
156+
this.isConnect = false;
156157
}
157158
lostController() { }
158159

0 commit comments

Comments
 (0)