6,609
edits
(Switched to {{readme file}} to remove the out of date and broken Gitorious links.) |
(Switch to {{fg root file}} and {{fgdata url}} to fix the broken Gitorious links.) |
||
| Line 147: | Line 147: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
See [[generic protocol]] for more info on the generic protocol and have a look in | See [[generic protocol]] for more info on the generic protocol and have a look in {{fg root file|Protocol}} for examples of various protocol configurations. There's also a howto tutorial available here: [[Howto: Create a generic protocol]]. | ||
We suggest you just try it, create a simple protocol with a couple properties, explore ways to send and receive those values, and so on. If your serial device is a microcontroller that your programming then you may be able to get away with sending/receiving the values directly to/from flightgear without need of any secondary 'middleware' programs at all. If not you may need a small program to handle marshalling the data between flightgear and your hardware. | We suggest you just try it, create a simple protocol with a couple properties, explore ways to send and receive those values, and so on. If your serial device is a microcontroller that your programming then you may be able to get away with sending/receiving the values directly to/from flightgear without need of any secondary 'middleware' programs at all. If not you may need a small program to handle marshalling the data between flightgear and your hardware. | ||
| Line 155: | Line 155: | ||
Using a serial device properly requires more than just 'fopen'ing it, except in the most simple of cases, and can be quite tedious and complex using straight C system calls...networking as well. Personally I recommend using a higher level language (I use Python) that will make your life so much easier and allow you to get things done quickly and easily without hassles of low level details. | Using a serial device properly requires more than just 'fopen'ing it, except in the most simple of cases, and can be quite tedious and complex using straight C system calls...networking as well. Personally I recommend using a higher level language (I use Python) that will make your life so much easier and allow you to get things done quickly and easily without hassles of low level details. | ||
For your data processing needs (formatting, conversion, marshalling, compression etc), you can use a combination of the sprintf() library function, and the | For your data processing needs (formatting, conversion, marshalling, compression etc), you can use a combination of the sprintf() library function, and the {{fg root file|Nasal/bits.nas}} file. | ||
<syntaxhighlight lang="nasal"> | <syntaxhighlight lang="nasal"> | ||
| Line 170: | Line 170: | ||
* {{readme file|protocol}} | * {{readme file|protocol}} | ||
* http://flightgear.org/forums/viewtopic.php?f=30&t=15166 | * http://flightgear.org/forums/viewtopic.php?f=30&t=15166 | ||
* | * {{fgdata source|path=Protocol|text=Protocol}} | ||
* | * {{fgdata source|path=Nasal/bits.nas|text=Nasal/bits.nas}} | ||
[[Category:Nasal howto]] | [[Category:Nasal howto]] | ||