You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// process simple <ack> responses (06H) as these come back for all successsful Control commands
115
-
this.cmdPipeNext()
116
-
pipeline=''
117
-
}else{
118
-
// partial response pipeline processing as TCP Serial module can return partial responses in stream.
119
-
if(pipeline.includes(';')){
120
-
// got at least one command terminated with ';'
121
-
// multiple rapid Query strings can result in async multiple responses so split response into individual messages
122
-
letallresponses=pipeline.split(';')
123
-
// last element will either be a partial response an <ack> (processed next timer tick) or an empty string from split where a complete pipeline ends with ';'
124
-
pipeline=allresponses.pop()
125
-
for(letresponseofallresponses){
126
-
// Chance of leading <ack> responses from key commands or prior Query
127
-
while(response.charAt[0]=='\u0006'){
128
-
response=response.slice(1)
129
-
this.cmdPipeNext()
130
-
}
131
-
if(response.length>0){
132
-
this.processResponse(response)
133
-
}
128
+
129
+
// ACKs are sent at the end of the stream result, we should have 1 command to 1 ack
130
+
if(pipeline.includes(this.CONTROL_ACK)){
131
+
this.lastReturnedCommand=this.cmdPipeNext()
132
+
if(pipeline.length==1)pipeline=''
133
+
}
134
+
135
+
// Every command ends with ; and an ACK or an ACK if nothing needed; `VER` is the only command that won't return an ACK, which we do not use
136
+
if(pipeline.includes(';')){
137
+
// multiple rapid Query strings can result in async multiple responses so split response into individual messages
138
+
// however, the documentation for the V-60 says NOT to send more than 1 command before receiving the ACK from the last one,
139
+
// so we should always have one at a time
140
+
letallresponses=pipeline.split(';')
141
+
// last element will either be a partial response, an <ack> (processed next timer tick), or an empty string from split where a complete pipeline ends with ';'
0 commit comments