41 #include "PJONSimpleSwitch.h"
42 #include "strategies/Any/Any.h"
48 const uint8_t
id = PJON_NOT_ASSIGNED
53 const uint8_t
id = PJON_NOT_ASSIGNED
56 strategy.set_link(link);
61 const uint8_t bus_id[],
62 const uint8_t
id = PJON_NOT_ASSIGNED
68 strategy.set_link(link);
73 strategy.set_link(link);
85 uint8_t default_gateway = PJON_NOT_ASSIGNED
90 template<
class A,
class B>
97 PJONSwitch2(uint8_t default_gateway = PJON_NOT_ASSIGNED)
101 busA.set_link(&linkA);
102 busB.set_link(&linkB);
105 PJONAny &get_bus(
const uint8_t ix)
107 return ix == 0 ? busA : busB;
112 return linkA.strategy;
116 return linkB.strategy;
121 template<
class A,
class B,
class C>
129 PJONSwitch3(uint8_t default_gateway = PJON_NOT_ASSIGNED)
131 PJON<Any> *buses[3] = { &busA, &busB, &busC };
133 busA.set_link(&linkA);
134 busB.set_link(&linkB);
135 busC.set_link(&linkC);
138 PJONAny &get_bus(
const uint8_t ix)
140 return ix == 0 ? busA : (ix == 1 ? busB : busC);
145 return linkA.strategy;
149 return linkB.strategy;
153 return linkC.strategy;