Skip to content

Commit

Permalink
fix: send break before device disconnect
Browse files Browse the repository at this point in the history
  • Loading branch information
LynnL4 committed Dec 19, 2023
1 parent 4b31ea8 commit f7bbd4c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/sscma/grove_ai_we2/deviceHimax.ts
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,7 @@ class Himax extends Device {

public async disconnect(): Promise<void> {
console.log('Called when disconnected, Does serial exist?', !!this.serial);
this.break();
this.cleanLogger();
if (!this.serial) {
return;
Expand Down
1 change: 1 addition & 0 deletions src/sscma/xiao_esp32s3/EspSerialDevice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ class EspSerialDevice extends Device {
public async disconnect() {
this.cleanLogger();
try {
this.break();
this.reader?.releaseLock();
this.writer?.releaseLock();
await this.port?.close();
Expand Down

0 comments on commit f7bbd4c

Please sign in to comment.