In this example, a data block with a length of 1024 bytes is compressed. For the compression of the text message (Lorem_ipsum_1024) the Gzip algorithm from the library “compress_j2me” available in the Internet is used. This library was originally developed for mobile phones with Java ME. This library can also be used for the PreonVM on the Preon32 radio module. Compression of data always makes sense when communication may take place in a short time or with minimal resources.

In this example, the text message is reduced to 396 bytes. If an IEEE 802.15.4 radio message has an assumed payload of 103 bytes, then only 4 instead of 10 messages have to be sent by compression. Decompression takes place in the receiver, which has been combined in a program for the example.

Copy to Clipboard