|
From: <gt...@ma...> - 2006-02-21 20:12:42
|
> Hello Guys, > Thanks a lot Wysong, Tim and Jon for the > stimulating discussion, the ideas and the suggestions > regarding the Matlab Interface! No problem, Matlab is one of the best tools out there for engineering wor= k... > Tim, interesting to have a GaTech Aero dude in the > group :-) I must confess...this whole fascination with > UAVs and helicopters goes back atleast 7 years when I > first saw the UAV Competition website (in which GaTech > seems to always lead :-) With the Yamaha helicopter > (GTar?)) Its only now that I have gotten the > opportunity, the resources...and JSBSim to actually do > something tangible. (Well...got rejected for a PhD > from GaTech last year :-)!) I am only a second year undergrad, so don't give me too much credit... ha= ha > As for a union...thats something I hadnt thought of > :-) So...shall try to look into that option > too...thanks Wysong :-)! Only problem...in the windows > socket "recv" command...the incoming data comes in as > a character array pointer...and in the "send" > command...the outgoing data is also a "char > *"...doesnt that mean that you are restricted to send > on character arrays? As in...for the network > layer...there is only one datatype...the "char". On this issue, keep in mind that just because it says char, it doesn't me= an letters. The char datatype is 8 bits long, which means it is one byte. Yo= u could just as easily send binary data (you could even create the byte data type= to avoid confusion, but remember it's really just a char). So yes, you are l= imited to sending "character arrays," but that could be any type of data you wan= t. If you wanted to send a union of something, you would just need to allocate = a char * array that has the sizeof(your_union). Then, set it equal to the &your_= union (address of your_union) and you've got yourself the bytes that make up th= e union. Then on the receiving end, you just need to have it pull out that = char* array and reassemble it in memory as your union. You could do this for a = class, union, struct, int, whatever else you could possible imagine as a datatyp= e. Does that make sense? Tim Gallagher Georgia Institute of Technology School of Aerospace Engineering |