TUIO tcp proxy |
|
|
|
|
Joined 2007-10-23
Total Posts: 87
New Member
|
Hmm. So it’s something at the flash end. I’ll keep working
|
|
|
|
|
|
|
|
Joined 2008-03-02
Total Posts: 107
Member
|
Wait as I’m posting in a short time new version (I’ve found some minor issues that could cause data loss)
eh It seems that I overrated myself .. right now I can’t see on my eyes,and I’m doing more damage than
some progress.. for now I do have set working (server - client) but I lost the path and types (as they must
be sent as fixed number of chars)
It’s not that easy as I must take care of endianess, cross platform compatibility .. and who knows what else
but I believe I’ll finish everything tomorrow, as now I’m really pissed off..
btw. It could be that set nums are broken because of how the struct is packaged.. so don’t loose your mind
|
|
|
|
|
|
|
|
Joined 2007-10-23
Total Posts: 87
New Member
|
OK. I’ll wait until the next release before I carry on with the flash implementation, but so far eveything is going great, the data seams to be transferring and processed very quickly! I look forward to completing it (hopefully tomorrow )
|
|
|
|
|
|
|
|
Joined 2008-03-02
Total Posts: 107
Member
|
Here is something to play with (set/fseq are working well) Still have to find the proper and compatible way for sending dynamic struct.
I had it working but just under linux, so when I saw that exe has problems I had to go back and rewrite everything again 8!
Anyway this is how the set/fseq will be sent, so you can see how it’s working with flash. Attached is tuio proxy and dump stream app
to debug msgs. Below are updated structs:
typedef struct
{
char path[12];
char name[6];
char types[9];
int sessionID;
float x,y,X,Y,m,w,h;
} set;
typedef struct
{
char path[12];
char name[6];
char types[4];
int framenum;
} fseq;
|
|
|
|
|
|
|
|
Joined 2007-10-23
Total Posts: 87
New Member
|
Thats great they are coming through properly now and I have successfully pulled out all the required information in flash. How are the alive structs coming?
|
|
|
|
|
|
|
|
Joined 2008-03-02
Total Posts: 107
Member
|
Well to be honest I’m not sure, I think I wrote it right this time, but I’m having headache with linux version (it’s skipping some messages when I send alive), while when I run exe, it seems all right.
I didn’t have time to test it as I’m trying to resolve the linux version bug. But here is the version with alive packets as well, so you can try and see if it’s working ( I don’t promise nothing as I didn’t
wrote dump debugging yet) I have a bunch of things here that are conflicting and It will pass some time before I align all of the differences (developing crossplatform on linux, using mingw to compile exe,
debug exe with wine .. just to number some)
This is the struct I use to send it dynamically (name is 8 wide because of byte aligning)
struct _alive {
char path[12];
char name[8];
char types[blobnum+1]; +1 is for s tring = name
int blobs[blobnum];
};
And here is the windows binary (I’m really curious if it’s working)
|
|
|
|
|
|
|
|
Joined 2007-10-23
Total Posts: 87
New Member
|
Hey I havn’t had much time to test it but it seams that some messages aren’t being sent with the exe as well, I’m just attempting to pull out the alive id’s at the moment. I’ve gotta say that your doing a great job! You’ve put alot of effort and time into this already and I and probably alot of other people are and will be very grateful.
|
|
|
|
|
|
|
|
Joined 2008-03-02
Total Posts: 107
Member
|
Hmm that’s strange, here I’m attaching sdump, I adjusted it to catch the data (for now I’m getting just the types - number of data .. and having difficulties with finding right
alignment of int array) this way you can try and see if some message is dropped or are all passed.
|
|
|
|
|
|
|
|
Joined 2007-10-23
Total Posts: 87
New Member
|
Hmmm actually it looks alright, I think it was just my testing in flash that was throwing things off for me. You say you are having problems with the alignment of the int array...would it be easier for you to just omit the types array, and perhaps just end the int array with a zero byte?? Just an idea, tell me what you think
|
|
|
|
|
|
|
|
Joined 2008-03-02
Total Posts: 107
Member
|
well I was thinking on putting the int32 after the name to signalize int array length .. but that would break compability with tuio format .. so I’ll try tomorrow and see if I come up with some idea..
I really hope tomorrow I can finish this. About zero byte, well I think int arrays can’t have zero byte as ending, and It would be easier to come up with some algorithm to find byte alignment
than loop and regenerate array based on ending. (anyway I almost had it, but then I changed the way .. so I guess tomorrow I’m going one step back)
|
|
|
|
|
|
|
|
Joined 2007-10-23
Total Posts: 87
New Member
|
OK sure, well I can work around any approach you take, so yes...tomorrow Speak soon
|
|
|
|
|
|
|
|
Joined 2008-03-02
Total Posts: 107
Member
|
Hmm I was thinking, types aren’t really helpful, I should get rid of them, and add initial int32 to alive just to signalize the size of array. This way it would be done in a matter of hour.
Ok I finished the code, pulled out the types as they aren’t specified in tuio specs. (unnecessary evil) :D
So here it is tuio_socket.exe and tuio_sdump.exe (I’ve renamed them to toxy.exe and toxy_dump.exe, Tuio sOcket proXY)
Ps. Ive also added -d for debug output to toxy
(it’s kinda stupid as it works just when invoked without any port parameters,its using the default 3333 - 3000 like : toxy.exe -d )
I’m too lazy to implement getops.
struct _alive {
char path[12];
char name[8];
int blobs[argc];
};
first blob[0] is actually number of blobs in the array.
[EDIT]
I’ve also uploaded the code to google, so who wants can download it etc. (link is on the first page of this thread)
|
|
|
|
|
|
|
|
Joined 2007-10-23
Total Posts: 87
New Member
|
Hey everything works great however would it be possible to send through alive events even when there are no blobs? It would just make it easier implementing the flash end as I need to know when there are no blobs in order to remove those that were present before all of the blobs were removed...if that makes any sense
|
|
|
|
|
|
|
|
Joined 2008-03-02
Total Posts: 107
Member
|
Ok I’ll see to change that, I forgot that touchlib can send that (I was adjusting some unnecessary tuio simulator data which is sent who knows why)
here it is .. updated toxy and dump
[Edit]
Ive updated the zip with pthread.dll (it’s needed for windows)
|
|
|
|
|
|
|
|
Joined 2007-10-23
Total Posts: 87
New Member
|
Cool after I’ve done this little bit I’ll sent through a test application, then I’ll look to optimize the code and release it (fingers crossed)
|
|
|
|
|