X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=docs-mini%2FREADME.protocol;h=ef9c39a2e1d8bd39a7a64e2f5d2cfde4826511a2;hb=10e6cc016bcfe39332dce2f360eaa90ff8366cf2;hp=60b4f3ef6767fa9d81465c45880905e269f57614;hpb=d4d14ba5ba47b86dd272b8906f1d686f3c44b9c7;p=flightgear.git diff --git a/docs-mini/README.protocol b/docs-mini/README.protocol index 60b4f3ef6..ef9c39a2e 100644 --- a/docs-mini/README.protocol +++ b/docs-mini/README.protocol @@ -56,12 +56,14 @@ and data sets, as well as a list of s. Each defines a property that should be written (and how), or a variable and which property it should be written to. +--- ASCII protocol parameters --- + output only: - BOOL default: false (= ASCII mode) STRING default: "" file header put on top of the file STRING default: "" file footer put at the end of the file input & output: + BOOL default: false (= ASCII mode) STRING default: "" field separator STRING default: "" separator between data sets @@ -90,6 +92,7 @@ or \r\n +--- Binary protocol parameters --- To enable binary mode, simply include a true tag in your XML file. The format of the binary output is tightly packed, with 1 byte @@ -115,23 +118,22 @@ each of which describes the properties of on variable to write/read. the property tree node which provides the data the value type (needed for formatting) one of string, float, bool, int (default: int) - defines the actual piece of text which should be sent. + (ASCII protocol only, not used or needed in binary mode) + defines the actual piece of text which should be sent. it can include "printf" style formatting options like: %s string %d integer (default) %f float - (not used or needed in binary mode) an optional multiplication factor which can be used for unit conversion. (for example, radians to degrees). an optional offset which can be used for unit conversion. - (for example, degrees to radians). + (for example, degrees Celcius to degrees Fahrenheit). Chunks can also consist of a single constant , like in: - - + Data Section == examples =================================================================== @@ -225,3 +227,24 @@ used as $ fgfs --generic=file,out,1,/tmp/data.xml,xmltest +-- Analyzing the resulting binary packet format ------------------------------- + +A utility called generic-protocol-analyse can be found under +FlightGear/utils/xmlgrep which can be used to analyze the resulting +data packet for the binary protocol. + +The output would be something like: + +bintest.xml +Generic binary output protocol packet description: + + pos | size | type | factor | description +-----|------|--------|------------|------------------------ + 0 | 4 | int | | indicated speed (kt) + 4 | 4 | float | | pitch att (deg) + 8 | 4 | float | | magnetic heading (deg) + 12 | 4 | int | | outside air temperarure (degF) + 16 | 1 | bool | | autocoord + +total package size: 17 bytes +