更新串口插件
This commit is contained in:
@@ -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))
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user