|
From: D W. <hdw...@gm...> - 2006-02-21 01:22:19
|
$0.02 from the peanut gallery: > ...driving is happening tomorrow heh heh. I got passed on the autobahn whilst going ~150 kph in the rain... by a lady in a MINIVAN!!! :-) Theory that kept me alive in Germany: -- red+yellow means you're about to get passed (... when the light turns g= reen) -- flashing headlights means you're about to get passed by a lady in a min= ivan -- honking at someone that passes you is like flipping them the bird with both hands... :-) > To avoid the endian issue, I'd still probably do the > data transfer using character strings, unless that's a really bad idea > for some reason I'm not yet aware of. **Bronx cheer** Careful use of a union and htons/ntohs (or the 'long' functions if preferred) will also avoid any endian problems... and it'll be easier to parse. However, use of a union (structure) complicates the idea of providing a generic XML definition for the socket datastream. Perhaps you can predefine a generic union with... I dunno... 30 values in it and then fill that up according to a non-generic XML spec? > I totally agree with you on this...I had considered > sending it as a delimited character string...because > that way...as you said...no worries about precision, > and also, it can be done using one send operation. If your data are packed in a union, you can send the buffer pointer in one shot. I'll post a simple client/server that demos the idea if necessary. > I was thinking more in terms of something like the > first value in the character string sent out from > Simulink being a time value which would correspond to > the simulation time in Simulink...that way...JSBSim > would run at any step size specified by Simulink, and > will also always be in sync. If your Simulink app is running in lock-step with the JSBSim (i.e. - you use a blocking socket read) then you get the sync for free... right? Every packet lands on the Simulink side of the fence at 1/120 of a second intervals. Is more than that required? Good work, Philippose! I look forward to reading the article. ;-) D |