From: Oliver O. <oli...@cs...> - 2009-02-08 20:57:44
|
On 09/02/2009, at 6:57 AM, Mahdi wrote: > For the problem you mentioned about the binary size mismatch of > indormation in different cpu architectures, I did a bit of > searching, and found out that Microsoft dot net framework has > introduced some types like int32, int64 and like these, which gcc > yet does not support, or may not support at all. (Please correct me > if I am assuming wrong) So another way should be found around the > problem. Anybody got any idea? I don't think that introducing a binary protocol is a good idea, and should be avoided if possible. For the sensors we're using at the moment, a text based protocol is a good solution because it's human readable. A float always uses up 4 bytes, and the text representation doesn't use much more (in some cases, it can use less). Plus you may introduce cross-platform issues that should be avoided. The work to implement and the hassle of using a binary protocol isn't worth the relatively small gain in efficiency. There are two cases where it may be necessary: For camera data and player integration. So I'd like to suggest to think about a mixed protocol instead of pure binary. S-Expressions (the syntax for the protocol we're using now) support binary data, or another solution would be a binary protocol combined with the S-Exp for the existing sensors / actuators. just my AU$0.02 cheers Oliver |