sgofferj wrote in Sat Apr 12, 2014 7:34 pm:Maybe not that long...
So, I got a simple test running which outputs /sim/messages/mp-plane to a serial display. I have a little issue though - it repeats the last value over and over again. Is there any way to tell the generic protocol to only send something if there actually was written something to the property and not repeat the same stuff? Otherwise, I don't see how I could implement the command output for the gauges because I would likely run in to serious timing/sync issues, when the sending of a new byte comes "too late" and simply the last byte is repeated.
sgofferj wrote in Sat Apr 12, 2014 8:06 pm:I absolutely can't understand why nobody ever thought that normal, oldfashioned fopen/fclose/etc. could be a useful thing for Nasal and implemented those...
Besides, I wonder that this repeating thing hasn't come up yet because in case of network-transmissions, that potentially creates a ton of unnecessary traffic.
At the moment, it looks more like there won't be a native integration. What I probably could do is write a bridge in C or Java which listens to FG native or some other protocol and translates this to the gauge commands. I have to think a bit about this, how to do this best.
Or maybe... Can a property value be an array of char - not a string with it's predetermined terminator and such - just an array of char?
If I understand you right, you suggest that I edit the code to implement the "pull only when there were changes" algo? I looked at the config parser and while I MIGHT be able to add this there, implementing this function would most certainly require also hacking the property tree core, the Nasal interpreter and potentially a ton of other things... THAT is way out of my league!
sgofferj wrote in Sun Apr 13, 2014 7:23 am:But, again, as GP doesn't know what Nasal is doing, this might happen:
Nasal writes byte 1
Nasal writes byte 2
Nasal writes byte 3
Nasal writes byte 4
GP pulls all 6 bytes
Nasal writes byte 5
Nasal writes byte 6
In which case the last 2 bytes would be from the old command = garbage again.
sgofferj wrote in Mon Apr 14, 2014 3:27 pm:Different question:
Where and how do I put a Nasal script so it gets executed in the main loop? Do I have to register it somewhere, put it to some config file?
Users browsing this forum: No registered users and 10 guests