Skip to content

Commit

Permalink
Documentation correction
Browse files Browse the repository at this point in the history
Jansson is required not only for pretty-printing OHMA messages, but
actually to decode them.
  • Loading branch information
szpajder committed Aug 26, 2023
1 parent 200de04 commit 4ee04d8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ apt install zlib1g-dev
apt install libxml2-dev
```

- OHMA messages contain JSON-encoded data. libacars may optionally pretty-print
these messages. This feature requires Jansson library:
- OHMA messages contain JSON-encoded data. Decoding these messages requires
libacars to be built with Jansson library:

```
apt install libjansson-dev
Expand Down
11 changes: 5 additions & 6 deletions doc/API_REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -888,7 +888,7 @@ Uplink messages have the following syntax:

The payload after the `OHMA` or `RYKO` string is a BASE64-encoded,
zlib-compressed JSON string. Therefore libacars must be compiled with zlib
support in order to decode these messages.
and Jansson support in order to decode these messages.

Large OHMA messages may be split across multiple ACARS blocks. In case this is
not enough, OHMA has its own message fragmentation mechanism, which uses
Expand Down Expand Up @@ -990,11 +990,10 @@ Serializes a decoded OHMA message pointed to by `data` into a human-readable
text indented by `indent` spaces and appends the result to `vstr` (which must be
non-NULL).

If libacars has been built with Jansson library support and `prettify_json`
configuration variable is set to `true`, then the function attempts to parse the
message text as a JSON document. If parsing succeeds (meaning the message indeed
contains JSON), the text is pretty-printed (reformatted into multi-line output
with proper indentation).
If `prettify_json` configuration variable is set to `true`, then the function
attempts to parse the message text as a JSON document. If parsing succeeds
(meaning the message indeed contains JSON), the text is pretty-printed
(reformatted into multi-line output with proper indentation).

### la_ohma_format_json()

Expand Down

0 comments on commit 4ee04d8

Please sign in to comment.