Data structures

PJON_Endpoint

PJON_Endpoint contains the device id, bus id and MAC address of a device:

struct PJON_Endpoint {
  uint8_t id = PJON_NOT_ASSIGNED;
  uint8_t bus_id[4] = {0, 0, 0, 0};
  uint8_t mac[6] = {0, 0, 0, 0, 0, 0};
};

PJON_Endpoint contains mac if PJON_INCLUDE_MAC is defined. The conditional inclusion is present to reduce the footprint of programs where the MAC address is not used.

PJON_Packet_Info

PJON_Packet_Info contains all meta-data supported by the PJON packet format. The tx and rx data structures of type PJON_Endpoint contain the transmitter and receiver information.

struct PJON_Packet_Info {
  PJON_Endpoint tx;
  PJON_Endpoint rx;
  void *custom_pointer;
  uint8_t header = PJON_NO_HEADER;
  uint8_t hops = 0;
  uint16_t id = 0;
  uint16_t port = PJON_BROADCAST;
};

PJON_Packet_Info contains port if PJON_INCLUDE_PORT is defined and id if PJON_INCLUDE_PACKET_ID is defined. The conditional inclusion is present to reduce the footprint of programs where the port and the packet id are not used.

The custom_pointer can be used to link other classes or instances passing any sort of data structure. To understand how to use it see the ClassMemberCallback example.


This document is automatically generated from the github repository. If you have noticed an error or an inconsistency, please report it opening an issue here

The PJON software big box

The PJON 12.0 big box is a limited edition (only 500 units). It contains the PJON protocol handbook, the PJON protocol source code in CD and the stickers. This product contains everything you need to master the PJON protocol and its implementation, although it is also designed to nicely fit in your big box collection. Choosing this handy kit, you will always have PJON with you in different formats, also when not being connected to Internet. Buying PJON products you support its further development and enhancement.


BUY NOW!