mirror of
https://github.com/joBr99/nspanel-lovelace-ui.git
synced 2025-12-22 15:34:26 +01:00
Update nextion2text.yml (add nextion2text)
This commit is contained in:
committed by
github-actions[bot]
parent
9cbe40cb6d
commit
9c57c96647
@@ -234,154 +234,6 @@
|
||||
│ crcputs sys0,2
|
||||
│ crcputs tSend.txt,0
|
||||
│ //send cmd
|
||||
├── pageTest.txt
|
||||
│ @@ -9,45 +9,15 @@
|
||||
│ Swide down page ID : disabled
|
||||
│ Swide left page ID : disabled
|
||||
│ Swide right page ID : disabled
|
||||
│
|
||||
│ Events
|
||||
│ Preinitialize Event
|
||||
│ vis p0,0
|
||||
│ - recmod=1
|
||||
│ - bauds=115200
|
||||
│
|
||||
│ -Variable (string) tInstruction
|
||||
│ - Attributes
|
||||
│ - Scope : local
|
||||
│ - Text :
|
||||
│ - Max. Text Size: 30
|
||||
│ -
|
||||
│ -Variable (string) strCommand
|
||||
│ - Attributes
|
||||
│ - Scope : local
|
||||
│ - Text :
|
||||
│ - Max. Text Size: 20
|
||||
│ -
|
||||
│ -Variable (string) tSend
|
||||
│ - Attributes
|
||||
│ - Scope : local
|
||||
│ - Text :
|
||||
│ - Max. Text Size: 40
|
||||
│ -
|
||||
│ -Text tBench
|
||||
│ - Attributes
|
||||
│ - Scope : local
|
||||
│ - Dragging : 0
|
||||
│ - Disable release event after dragging: 0
|
||||
│ - Send Component ID : disabled
|
||||
│ - Associated Keyboard : none
|
||||
│ - Text :
|
||||
│ - Max. Text Size : 20
|
||||
│ -
|
||||
│ Picture p0
|
||||
│ Attributes
|
||||
│ Scope : local
|
||||
│ Dragging : 0
|
||||
│ Disable release event after dragging: 0
|
||||
│ Send Component ID : disabled
|
||||
│
|
||||
│ @@ -216,100 +186,7 @@
|
||||
│ Text : qr
|
||||
│ Max. Text Size : 10
|
||||
│
|
||||
│ Events
|
||||
│ Touch Press Event
|
||||
│ page cardQR
|
||||
│
|
||||
│ -Button b12
|
||||
│ - Attributes
|
||||
│ - Scope : local
|
||||
│ - Dragging : 0
|
||||
│ - Disable release event after dragging: 0
|
||||
│ - Send Component ID : disabled
|
||||
│ - State : unpressed
|
||||
│ - Text : power
|
||||
│ - Max. Text Size : 10
|
||||
│ -
|
||||
│ - Events
|
||||
│ - Touch Press Event
|
||||
│ - page cardPower
|
||||
│ -
|
||||
│ -Timer tmSerial
|
||||
│ - Attributes
|
||||
│ - Scope : local
|
||||
│ - Period (ms): 50
|
||||
│ - Enabled : yes
|
||||
│ -
|
||||
│ - Events
|
||||
│ - Timer Event
|
||||
│ - // data available
|
||||
│ - if(usize>1)
|
||||
│ - {
|
||||
│ - bufferPos=0
|
||||
│ - while(bufferPos<usize)
|
||||
│ - {
|
||||
│ - // check for 0x55 0xBB - Command Init Secuence
|
||||
│ - if(u[bufferPos]==187&&u[bufferPos-1]==85)
|
||||
│ - {
|
||||
│ - //remove garbage at the start of the buffer if there's any to free buffer for command
|
||||
│ - if(u[bufferPos]!=1)
|
||||
│ - {
|
||||
│ - udelete bufferPos-1
|
||||
│ - }
|
||||
│ - //instruction is now aligned with buffer, because we deleted garbage before instrcution
|
||||
│ - //get length after init sequence (check if there are more than to bytes in buffer)
|
||||
│ - if(3<usize)
|
||||
│ - {
|
||||
│ - // check if serial buffer has reached the announced length
|
||||
│ - ucopy payloadLength,2,2,0
|
||||
│ - // we are only checking payload length so we have to skip first 3 bytes (init+payload length) (-1 because of < instead of <=)
|
||||
│ - payloadLength+=3
|
||||
│ - // payload length does also not contain crc, so we are adding another 2 bytes for crc
|
||||
│ - payloadLength+=2
|
||||
│ - if(payloadLength<usize)
|
||||
│ - {
|
||||
│ - // calculate crc
|
||||
│ - crcrest 1,0xFFFF
|
||||
│ - // u[2] contains payload legth at 3rd pos in buffer, we are calculating crc from 3rd pos with number of bytes from payload length
|
||||
│ - //crcputu 3,u[2]
|
||||
│ - // u[2] cotnains payload length, we are calculating a crc over the whole message, so we have to add 3 to the length from u[2]
|
||||
│ - crcputu 0,payloadLength-1
|
||||
│ - // get recived crc to be able to compare it
|
||||
│ - ucopy recvCrc,payloadLength-1,2,0
|
||||
│ - // compare crc with recived value
|
||||
│ - if(crcval==recvCrc)
|
||||
│ - {
|
||||
│ - // crc is okay
|
||||
│ - // here is the location where acual code should be
|
||||
│ - // write command to variable strCommand
|
||||
│ - ucopy strCommand.txt,4,payloadLength-5,0
|
||||
│ - // write instruction to tInstuction (debug output, but used as variable here, ui elements will be disabled by default)
|
||||
│ - spstr strCommand.txt,tInstruction.txt,"~",0
|
||||
│ - if(tInstruction.txt=="ping")
|
||||
│ - {
|
||||
│ - spstr strCommand.txt,tBench.txt,"~",1
|
||||
│ - tSend.txt="pong,"+tBench.txt
|
||||
│ - //send calc crc
|
||||
│ - btlen tSend.txt,sys0
|
||||
│ - crcrest 1,0xffff // reset CRC
|
||||
│ - crcputh 55 bb
|
||||
│ - crcputs sys0,2
|
||||
│ - crcputs tSend.txt,0
|
||||
│ - //send cmd
|
||||
│ - printh 55 bb
|
||||
│ - prints sys0,2
|
||||
│ - prints tSend.txt,0
|
||||
│ - prints crcval,2
|
||||
│ - }
|
||||
│ - // end of user code
|
||||
│ - udelete payloadLength-1
|
||||
│ - bufferPos=0
|
||||
│ - }
|
||||
│ - }
|
||||
│ - }
|
||||
│ - }
|
||||
│ - // next character
|
||||
│ - bufferPos++
|
||||
│ - }
|
||||
│ - }
|
||||
│ -
|
||||
├── popupFan.txt
|
||||
│ @@ -623,18 +623,14 @@
|
||||
│ {
|
||||
|
||||
@@ -720,154 +720,6 @@
|
||||
│ crcputs sys0,2
|
||||
│ crcputs tSend.txt,0
|
||||
│ //send cmd
|
||||
├── pageTest.txt
|
||||
│ @@ -9,45 +9,15 @@
|
||||
│ Swide down page ID : disabled
|
||||
│ Swide left page ID : disabled
|
||||
│ Swide right page ID : disabled
|
||||
│
|
||||
│ Events
|
||||
│ Preinitialize Event
|
||||
│ vis p0,0
|
||||
│ - recmod=1
|
||||
│ - bauds=115200
|
||||
│
|
||||
│ -Variable (string) tInstruction
|
||||
│ - Attributes
|
||||
│ - Scope : local
|
||||
│ - Text :
|
||||
│ - Max. Text Size: 30
|
||||
│ -
|
||||
│ -Variable (string) strCommand
|
||||
│ - Attributes
|
||||
│ - Scope : local
|
||||
│ - Text :
|
||||
│ - Max. Text Size: 20
|
||||
│ -
|
||||
│ -Variable (string) tSend
|
||||
│ - Attributes
|
||||
│ - Scope : local
|
||||
│ - Text :
|
||||
│ - Max. Text Size: 40
|
||||
│ -
|
||||
│ -Text tBench
|
||||
│ - Attributes
|
||||
│ - Scope : local
|
||||
│ - Dragging : 0
|
||||
│ - Disable release event after dragging: 0
|
||||
│ - Send Component ID : disabled
|
||||
│ - Associated Keyboard : none
|
||||
│ - Text :
|
||||
│ - Max. Text Size : 20
|
||||
│ -
|
||||
│ Picture p0
|
||||
│ Attributes
|
||||
│ Scope : local
|
||||
│ Dragging : 0
|
||||
│ Disable release event after dragging: 0
|
||||
│ Send Component ID : disabled
|
||||
│
|
||||
│ @@ -216,100 +186,7 @@
|
||||
│ Text : qr
|
||||
│ Max. Text Size : 10
|
||||
│
|
||||
│ Events
|
||||
│ Touch Press Event
|
||||
│ page cardQR
|
||||
│
|
||||
│ -Button b12
|
||||
│ - Attributes
|
||||
│ - Scope : local
|
||||
│ - Dragging : 0
|
||||
│ - Disable release event after dragging: 0
|
||||
│ - Send Component ID : disabled
|
||||
│ - State : unpressed
|
||||
│ - Text : power
|
||||
│ - Max. Text Size : 10
|
||||
│ -
|
||||
│ - Events
|
||||
│ - Touch Press Event
|
||||
│ - page cardPower
|
||||
│ -
|
||||
│ -Timer tmSerial
|
||||
│ - Attributes
|
||||
│ - Scope : local
|
||||
│ - Period (ms): 50
|
||||
│ - Enabled : yes
|
||||
│ -
|
||||
│ - Events
|
||||
│ - Timer Event
|
||||
│ - // data available
|
||||
│ - if(usize>1)
|
||||
│ - {
|
||||
│ - bufferPos=0
|
||||
│ - while(bufferPos<usize)
|
||||
│ - {
|
||||
│ - // check for 0x55 0xBB - Command Init Secuence
|
||||
│ - if(u[bufferPos]==187&&u[bufferPos-1]==85)
|
||||
│ - {
|
||||
│ - //remove garbage at the start of the buffer if there's any to free buffer for command
|
||||
│ - if(u[bufferPos]!=1)
|
||||
│ - {
|
||||
│ - udelete bufferPos-1
|
||||
│ - }
|
||||
│ - //instruction is now aligned with buffer, because we deleted garbage before instrcution
|
||||
│ - //get length after init sequence (check if there are more than to bytes in buffer)
|
||||
│ - if(3<usize)
|
||||
│ - {
|
||||
│ - // check if serial buffer has reached the announced length
|
||||
│ - ucopy payloadLength,2,2,0
|
||||
│ - // we are only checking payload length so we have to skip first 3 bytes (init+payload length) (-1 because of < instead of <=)
|
||||
│ - payloadLength+=3
|
||||
│ - // payload length does also not contain crc, so we are adding another 2 bytes for crc
|
||||
│ - payloadLength+=2
|
||||
│ - if(payloadLength<usize)
|
||||
│ - {
|
||||
│ - // calculate crc
|
||||
│ - crcrest 1,0xFFFF
|
||||
│ - // u[2] contains payload legth at 3rd pos in buffer, we are calculating crc from 3rd pos with number of bytes from payload length
|
||||
│ - //crcputu 3,u[2]
|
||||
│ - // u[2] cotnains payload length, we are calculating a crc over the whole message, so we have to add 3 to the length from u[2]
|
||||
│ - crcputu 0,payloadLength-1
|
||||
│ - // get recived crc to be able to compare it
|
||||
│ - ucopy recvCrc,payloadLength-1,2,0
|
||||
│ - // compare crc with recived value
|
||||
│ - if(crcval==recvCrc)
|
||||
│ - {
|
||||
│ - // crc is okay
|
||||
│ - // here is the location where acual code should be
|
||||
│ - // write command to variable strCommand
|
||||
│ - ucopy strCommand.txt,4,payloadLength-5,0
|
||||
│ - // write instruction to tInstuction (debug output, but used as variable here, ui elements will be disabled by default)
|
||||
│ - spstr strCommand.txt,tInstruction.txt,"~",0
|
||||
│ - if(tInstruction.txt=="ping")
|
||||
│ - {
|
||||
│ - spstr strCommand.txt,tBench.txt,"~",1
|
||||
│ - tSend.txt="pong,"+tBench.txt
|
||||
│ - //send calc crc
|
||||
│ - btlen tSend.txt,sys0
|
||||
│ - crcrest 1,0xffff // reset CRC
|
||||
│ - crcputh 55 bb
|
||||
│ - crcputs sys0,2
|
||||
│ - crcputs tSend.txt,0
|
||||
│ - //send cmd
|
||||
│ - printh 55 bb
|
||||
│ - prints sys0,2
|
||||
│ - prints tSend.txt,0
|
||||
│ - prints crcval,2
|
||||
│ - }
|
||||
│ - // end of user code
|
||||
│ - udelete payloadLength-1
|
||||
│ - bufferPos=0
|
||||
│ - }
|
||||
│ - }
|
||||
│ - }
|
||||
│ - }
|
||||
│ - // next character
|
||||
│ - bufferPos++
|
||||
│ - }
|
||||
│ - }
|
||||
│ -
|
||||
├── popupFan.txt
|
||||
│ @@ -78,31 +78,31 @@
|
||||
│ Value: 1
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
+++ /dev/fd/62 2022-10-08 21:13:32.539567089 +0000
|
||||
+++ /dev/fd/62 2022-10-08 21:22:56.668959488 +0000
|
||||
+rdAlarm.txt
|
||||
+18 +833,14 @@
|
||||
+ {
|
||||
@@ -152,154 +152,6 @@
|
||||
+ Scope : global
|
||||
+ Dragging : 0
|
||||
+ Disable release event after dragging: 0
|
||||
+geTest.txt
|
||||
+ +9,15 @@
|
||||
+ Swide down page ID : disabled
|
||||
+ Swide left page ID : disabled
|
||||
+ Swide right page ID : disabled
|
||||
+
|
||||
+nts
|
||||
+ Preinitialize Event
|
||||
+ vis p0,0
|
||||
+ recmod=1
|
||||
+ bauds=115200
|
||||
+
|
||||
+e (string) tInstruction
|
||||
+ributes
|
||||
+ Scope : local
|
||||
+ Text :
|
||||
+ Max. Text Size: 30
|
||||
+
|
||||
+e (string) strCommand
|
||||
+ributes
|
||||
+ Scope : local
|
||||
+ Text :
|
||||
+ Max. Text Size: 20
|
||||
+
|
||||
+e (string) tSend
|
||||
+ributes
|
||||
+ Scope : local
|
||||
+ Text :
|
||||
+ Max. Text Size: 40
|
||||
+
|
||||
+ench
|
||||
+ributes
|
||||
+ Scope : local
|
||||
+ Dragging : 0
|
||||
+ Disable release event after dragging: 0
|
||||
+ Send Component ID : disabled
|
||||
+ Associated Keyboard : none
|
||||
+ Text :
|
||||
+ Max. Text Size : 20
|
||||
+
|
||||
+ p0
|
||||
+ributes
|
||||
+ Scope : local
|
||||
+ Dragging : 0
|
||||
+ Disable release event after dragging: 0
|
||||
+ Send Component ID : disabled
|
||||
+
|
||||
+100 +186,7 @@
|
||||
+ Text : qr
|
||||
+ Max. Text Size : 10
|
||||
+
|
||||
+nts
|
||||
+ Touch Press Event
|
||||
+ page cardQR
|
||||
+
|
||||
+b12
|
||||
+ributes
|
||||
+ Scope : local
|
||||
+ Dragging : 0
|
||||
+ Disable release event after dragging: 0
|
||||
+ Send Component ID : disabled
|
||||
+ State : unpressed
|
||||
+ Text : power
|
||||
+ Max. Text Size : 10
|
||||
+
|
||||
+nts
|
||||
+ Touch Press Event
|
||||
+ page cardPower
|
||||
+
|
||||
+mSerial
|
||||
+ributes
|
||||
+ Scope : local
|
||||
+ Period (ms): 50
|
||||
+ Enabled : yes
|
||||
+
|
||||
+nts
|
||||
+ Timer Event
|
||||
+ // data available
|
||||
+ if(usize>1)
|
||||
+ {
|
||||
+ bufferPos=0
|
||||
+ while(bufferPos<usize)
|
||||
+ {
|
||||
+ // check for 0x55 0xBB - Command Init Secuence
|
||||
+ if(u[bufferPos]==187&&u[bufferPos-1]==85)
|
||||
+ {
|
||||
+ //remove garbage at the start of the buffer if there's any to free buffer for command
|
||||
+ if(u[bufferPos]!=1)
|
||||
+ {
|
||||
+ udelete bufferPos-1
|
||||
+ }
|
||||
+ //instruction is now aligned with buffer, because we deleted garbage before instrcution
|
||||
+ //get length after init sequence (check if there are more than to bytes in buffer)
|
||||
+ if(3<usize)
|
||||
+ {
|
||||
+ // check if serial buffer has reached the announced length
|
||||
+ ucopy payloadLength,2,2,0
|
||||
+ // we are only checking payload length so we have to skip first 3 bytes (init+payload length) (-1 because of < instead of <=)
|
||||
+ payloadLength+=3
|
||||
+ // payload length does also not contain crc, so we are adding another 2 bytes for crc
|
||||
+ payloadLength+=2
|
||||
+ if(payloadLength<usize)
|
||||
+ {
|
||||
+ // calculate crc
|
||||
+ crcrest 1,0xFFFF
|
||||
+ // u[2] contains payload legth at 3rd pos in buffer, we are calculating crc from 3rd pos with number of bytes from payload length
|
||||
+ //crcputu 3,u[2]
|
||||
+ // u[2] cotnains payload length, we are calculating a crc over the whole message, so we have to add 3 to the length from u[2]
|
||||
+ crcputu 0,payloadLength-1
|
||||
+ // get recived crc to be able to compare it
|
||||
+ ucopy recvCrc,payloadLength-1,2,0
|
||||
+ // compare crc with recived value
|
||||
+ if(crcval==recvCrc)
|
||||
+ {
|
||||
+ // crc is okay
|
||||
+ // here is the location where acual code should be
|
||||
+ // write command to variable strCommand
|
||||
+ ucopy strCommand.txt,4,payloadLength-5,0
|
||||
+ // write instruction to tInstuction (debug output, but used as variable here, ui elements will be disabled by default)
|
||||
+ spstr strCommand.txt,tInstruction.txt,"~",0
|
||||
+ if(tInstruction.txt=="ping")
|
||||
+ {
|
||||
+ spstr strCommand.txt,tBench.txt,"~",1
|
||||
+ tSend.txt="pong,"+tBench.txt
|
||||
+ //send calc crc
|
||||
+ btlen tSend.txt,sys0
|
||||
+ crcrest 1,0xffff // reset CRC
|
||||
+ crcputh 55 bb
|
||||
+ crcputs sys0,2
|
||||
+ crcputs tSend.txt,0
|
||||
+ //send cmd
|
||||
+ printh 55 bb
|
||||
+ prints sys0,2
|
||||
+ prints tSend.txt,0
|
||||
+ prints crcval,2
|
||||
+ }
|
||||
+ // end of user code
|
||||
+ udelete payloadLength-1
|
||||
+ bufferPos=0
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ // next character
|
||||
+ bufferPos++
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+18 +623,14 @@
|
||||
+ {
|
||||
+ page cardAlarm
|
||||
|
||||
Reference in New Issue
Block a user