更新串口插件

This commit is contained in:
2026-06-03 15:49:48 +08:00
parent 923b4a3292
commit f5e47f37b3
16 changed files with 1106 additions and 1871 deletions
+3 -3
View File
@@ -223,7 +223,7 @@ export default {
onLoad() {
this.RS485 = getApp().globalData.RS485
this.RS232 = getApp().globalData.RS232
// console.log('this.RS485', this.RS485.isOpen())
console.log('this.RS485', this.RS485.isOpen())
this.getDevice()
// uni.$emit('debug', { disconnect: true })
},
@@ -292,7 +292,7 @@ export default {
this.RS485.setBaudrate(this.rs485Baudrate);
this.rs485State = this.RS485.open();
if(this.rs485State){
this.RS485.startAutoReadData((res) =>{
this.RS485.onStartAutoReadData((res) =>{
console.log(this.RS485.byte2HexString(res))
this.received.unshift(this.RS485.byte2HexString(res))
})
@@ -309,7 +309,7 @@ export default {
this.RS232.setBaudrate(this.rs232Baudrate);
this.rs232State = this.RS232.open();
if(this.rs232State){
this.RS232.startAutoReadData((res) =>{
this.RS232.onStartAutoReadData((res) =>{
this.received.unshift(this.RS232.byte2HexString(res))
})
}