1
0
mirror of https://github.com/tdaede/td-io.git synced 2024-11-28 00:20:51 +01:00

Implement (dummy) analog read command

This commit is contained in:
Thomas Daede 2023-09-08 10:09:58 -07:00
parent 58cc496a3d
commit dbfdb38a8f

View File

@ -483,6 +483,22 @@ int main() {
} }
o += 2; o += 2;
} }
} else if ((msg_length - i) >= 2 && message[i] == 0x22) {
int channels = message[i+1];
i += 2;
if (o + channels*2 >= JVS_MAX_LEN) {
printf("JVS response overflow!\n");
status = JVS_STATUS_OVERFLOW;
break;
}
msg_send[o] = JVS_REPORT_GOOD;
o++;
for (int channel = 0; channel < channels; channel++) {
// analog input currently not supported
msg_send[o] = 0x80;
msg_send[o+1] = 0x00;
o += 2;
}
} else if ((msg_length - i) >= 1 && message[i] == 0x2f) { } else if ((msg_length - i) >= 1 && message[i] == 0x2f) {
printf("JVS re-transmit request!\n"); printf("JVS re-transmit request!\n");
send_message(prev_status, prev_msg_send, prev_msg_size); send_message(prev_status, prev_msg_send, prev_msg_size);