Any

Medium Pins used Inclusion
Any NA #include <PJONAny.h>

The Any strategy includes virtual inheritance and let PJON objects change from a strategy to another after instantiation or a collection of PJON objects with different strategies to be treated agnostically.

How to use Any

Define a StrategyLink template class passing the desired strategy, then pass the type Any as PJON template parameter to instantiate a PJON object ready to communicate using this strategy.

StrategyLink<SoftwareBitBang> link;
PJON<Any> bus;

Call the set_link method passing the StrategyLink instance:

#include <PJONAny.h>

StrategyLink<SoftwareBitBang> link;
PJONAny bus;

void setup() {
  Serial.begin(9600);
  bus.strategy.set_link(&link);
}

See MultiStrategyLink and StrategyLinkNetworkAnalysis examples.

All the other necessary information is present in the general Documentation.


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
Updated on 06 November 2020 at 17:07:06

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!