cleanly print out ambe model and version

instead of raw printing whole ambe control packet reply, including non-printable chars, field identifiers and even parity byte...
This commit is contained in:
narspt 2022-04-02 22:13:07 +01:00 committed by GitHub
parent 60f167b339
commit 3801ffdec5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -355,7 +355,12 @@ bool CUsb3xxxInterface::ReadDeviceVersion(void)
ok = (len != 0);
//we succeed in reading a packet, print it out
std::cout << "ReadDeviceVersion : ";
for ( i = 4; i < len+4 ; i++ )
for ( i = 5; (i < len+4) && (rxpacket[i] != 0x00); i++ )
{
std::cout << (char)(rxpacket[i] & 0x00ff);
}
std::cout << " ";
for ( i = i+2; (i < len+4) && (rxpacket[i] != 0x00); i++ )
{
std::cout << (char)(rxpacket[i] & 0x00ff);
}