Chapter 6. Extending bufdump

This document describes how to extend bufdump. When you have completed this chapter you will know how to:

6.1. Preparing packet definition files

Packet definition files extend the set of packet ids that are recognized by the bufdump program. When bufdump encounters a recognized packet id, it can do some elementary formatting that identifies the packet contents.

You need to supply a packet definition file if your program uses packet ids that are not in the registered packet id set, and you either have not used the production readout skeleton, or you have, but have not used the CDocumentedPacket class to manage your packets.

A packet definition file is just a text file. By convention, packet definition files have the .def extension. Each line of the text file defines a packet id, and consists of the following fields separated by whitespace:

The text below shows an annotated line, from a packet definition file.


            s800 (1) 0x5800 (2) {S800 Spectrograph} (3) 1.0 (4)
        
(1)
s800 is the packet short name, This line is the actual definition of the S800 packet from the bufdump default packet definition file
(2)
0x5800 is the id of the packet. The leading 0x indicates that this id is expressed as a hexadecimal value.
(3)
The text quoted by curly brackets to the left of this callout is the packet long name.
(4)
1.0 Is the packet version. When a packet maintainer changes the internal structure of a packet, they are expected to change the version number as well.