- 11 Aug 2020
Sending binary data (BLOBS) via INDI
The INDI messaging protocol sends text-based messages between clients and drivers as outlined in the last section. It is possible to send binary data but this is not enabled by default.
Since the protocol is based on XML and is plain-text, special considerations must be given in order to send binary data.
First, sending binary data (BLOBS) must be enabled, and this is done by sending an ENB message from client to driver. The message is intercepted by "indiserver" and after this point when a BLOB is send from the driver it is allowed through to the client which has enabled this type of communication. If the client is restarted, this must be done once again.
BLOB data is sent by embedding it in the XML as a UUEncoded element contained in the property. Several fields should be set in order for this to work:
- "format" Set this to a hint which can be used to indicate what the format of the BLOB data is. For LBTI, this is usually set to "fits" to indicate that the data is a binary FITS file. "fits.z" indicates a compressed fits file.
- "size" This should be the size (in bytes) of the uncompressed data.
One way to receive BLOB data is to use the terminal-based program "getINDI". When a BLOB-based messages arrive, they will automatically be decompressed, un-uuencoded and saved based on the "format" field in the element. The name of the file will be the "device", "name", and "element" of the property contained in the message.
getINDI -Bmt 0 lmircam_display.display_image.file ->. lmircam_display_display_image_file.fits
The "B" option tells "getINDI" to enable the receipt of BLOB data, "m" indicates that we want to wait until a BLOB arrives, and "t 0" tells the program to never timeout.