[IGSTK-Developers] SerialCommunicationSimulator data file format
David Gobbi
dgobbi at atamai.com
Tue Jul 19 19:58:11 EDT 2005
Hi Hee-Su,
I've taken a look at the simulator data file and it the
SerialCommunicationSimulator and it misses one of the requirements: it
isn't able to handle binary data streams.
The difference between an ASCII data stream and a binary data stream is
that the bytes in an ASCII stream only contains ASCII characters, that
is, the byte values are always in the range [1,127].
The bytes in a binary stream can have any value in the range [0,255]. A
binary stream can contain zeros, but an ASCII stream cannot.
A chunk of binary data cannot be stored in a C++ string, because a C++
string cannot contain a zero byte, except at the very end.
The reason that this is important is that virtually all tracking systems
do at least some communication using binary data, for example we cannot
support the Aurora's BX "binary transform" command unless we can
communicate with binary data, and tracking systems like the Flock of
Birds always communicate transforms with binary data.
In summary:
The Communication classes cannot store their input or data in C++
strings. The data must either be stored in a char array e.g. char
data[1024], or in a C++ vector. Or perhaps, going along with Luis'
philosophy on these things, we should define our own data container type
for this purpose.
The file format for the CommunicationSimulator data file will also have
to be adjusted, because it doesn't support binary data either. On my
wiki design page for SerialCommunicationSimulator I specified a file
format that stored the number of bytes used by every sent and received
data record, but the file format used by the simulator doesn't appear to
follow that design.
- David
More information about the IGSTK-Developers
mailing list