BProtocol

BProtocol — definiton of the Blinkenlights Network Protocol

Synopsis




#define     MAGIC_MCU_SETUP
#define     MAGIC_MCU_FRAME
#define     MAGIC_MCU_DEVCTRL
#define     MAGIC_BLFRAME
#define     MAGIC_BLFRAME_256
#define     MAGIC_HEARTBEAT
#define     MCU_LISTENER_PORT
#define     MCU_ID_ANY
#define     MCU_DEVCTRL_OFF
#define     MCU_DEVCTRL_ON
#define     B_HEARTBEAT_PORT
#define     B_HEARTBEAT_INTERVAL

Description

The bprotocol.h header file defines the Blinkenlights Network Protocol. It contains structure definitions for the different network packets as well as defines for magic numbers.

This header file doesn't use any GLib types to make it possible to include it from applications that can not or don't want to use BLib. As a user of BLib you don't need to care about the details of the protocol described here. Use the BSender and BReceiver instead.

Details

MAGIC_MCU_SETUP

#define MAGIC_MCU_SETUP     0x2342FEED  /* MCU Configuration packet              */

The magic number that identifies a setup packet.


MAGIC_MCU_FRAME

#define MAGIC_MCU_FRAME     0x23542666  /* MCU Frame packet                      */

The magic number that identifies a frame packet.


MAGIC_MCU_DEVCTRL

#define MAGIC_MCU_DEVCTRL   0x23542667  /* MCU Device Control packet             */

The magic number that identifies a device control packet.


MAGIC_BLFRAME

#define MAGIC_BLFRAME       0xDEADBEEF  /* Original BL Frame Packet              */

The magic number that identifies a frame packet in the old Blinkenlights protocol. BLib doesn't support this old version.


MAGIC_BLFRAME_256

#define MAGIC_BLFRAME_256   0xFEEDBEEF  /* Extendend BL Frame Packet (Greyscale) */

The magic number that identifies a frame packet in an extension to the old Blinkenlights protocol. BLib doesn't support this old version.


MAGIC_HEARTBEAT

#define MAGIC_HEARTBEAT     0x42424242  /* Heartbeat packet                      */

The magic number that identifies a heartbeat package as used with the BlinkenProxy protocol.


MCU_LISTENER_PORT

#define MCU_LISTENER_PORT    2323

The default port a matrox control unit listens too.


MCU_ID_ANY

#define MCU_ID_ANY           -1

Use this value in a setup packet to address all listening matrix control units.


MCU_DEVCTRL_OFF

#define MCU_DEVCTRL_OFF  0    /* switch device off */

Use this value in a device control packet to switch a device off.


MCU_DEVCTRL_ON

#define MCU_DEVCTRL_ON   1    /* switch device on  */

Use this value in a device control packet to switch a device on.


B_HEARTBEAT_PORT

#define B_HEARTBEAT_PORT       4242

The default port number for BlinkenProxy heartbeat packets.


B_HEARTBEAT_INTERVAL

#define B_HEARTBEAT_INTERVAL   5000     /* Heartbeat interval in ms    */

The default timeout in milliseconds between BlinkenProxy heartbeat packets.

See Also

BPacket, BSender, BReceiver