[psas-software] CanMessage byte-order

Jamey Sharp jamey at minilop.net
Sat Jun 14 19:45:43 PDT 2003


On 06/14 07:06PM, Ian Osgood wrote:
> On Friday, June 13, 2003, at 11:19 PM, Jamey Sharp wrote:
> >CanMessage is currently a 9am-after-14-hours-of-work hack to get things
> >to work for Usenix.
> 
> Speaking of which, any word from Texas?

Not that I've heard. Though I don't expect to hear much from Bart: his
office box/mail server seems to be down.

> Sounds good.  I was worried that not swapping before putting it into 
> the socket was a design decision (avoid unnecessary processing in the 
> 133MHz FC computer).  I'll make that change to the net_common code and 
> other C net testers.

Nah, we're nowhere near our limit of processing power right now.
Speaking of which, if anyone puts much effort into optimizing for
performance, I'll hit them.

> On a related note, we are using bit fields on the C side to combine
> CAN id, RTR flag, and data length into one 16-bit word, but using
> shift/and in Java. ... We have been lucky with the particular
> implementation of bit fields in gcc.

We were actually almost perfectly unlucky. Both the byte order and the
order of the elements of the bitfield were wrong, and that was probably
a good hour of that Tuesday morning. (Why did it take me that long to
identify the right ordering? In my defense, I was pretty tired by that
point.) Please do fix the marshalling too. (Policy: *never* write C
structures off-host unless you really know what you're doing, and even
then...)

> I prefer using native libraries for such things, ...

Um... The latest Dr. Dobbs Journal has an article titled "Calling C
Library Routines from Java" that you could read, but I still suspect
it's easier to maintain two copies of the code. (!)

> You got it.  I'm similarly expanding test_net.c to accept command line 
> parameters to test both TCP and UDP, client and server, and to 
> configure addresses and ports.

Cool.
-- 
Jamey Sharp <jamey at minilop.net> - http://minilop.net/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.psas.pdx.edu/pipermail/psas-avionics/attachments/20030614/78198691/attachment.pgp>


More information about the psas-avionics mailing list