sketchbook
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions | Variables
BlinkingSwitch.ino File Reference

Switch/Tunnel for LocalUDP-SoftwareBitBang. More...

#include <PJONInteractiveRouter.h>

Macros

#define PJON_MAX_PACKETS   3
 

Functions

PJONInteractiveRouter
< PJONVirtualBusRouter
< PJONSwitch > > 
router (2,(PJONAny *[2]){&bus1,&bus2})
 
void setup ()
 
void loop ()
 
void sendnotification_function (const uint8_t *const payload, const uint16_t length, const uint8_t receiver_bus, const uint8_t sender_bus, const PJON_Packet_Info &packet_info)
 

Variables

byte mac [] = {0xDE, 0x34, 0x4E, 0xEF, 0xFE, 0xE1}
 
StrategyLink< SoftwareBitBang > link1
 
StrategyLink< LocalUDP > link2
 

Detailed Description

Switch/Tunnel for LocalUDP-SoftwareBitBang.

Author
drtrigon
Date
2018-08-08
Version
1.1
  • added missing default to switch cases
1.0
  • first version derived from PJON 11.0 examples examples/ARDUINO/Local/SoftwareBitBang/Tunneler/BlinkingRGBSwitch/BlinkingRGBSwitch.ino
Tunnel packets through another medium using one switch on each end. For example, two SoftwareBitBang buses that are far from each other can be joined transparently through a LAN using the LocalUDP strategy, or through a WAN or Internet using the EthernetTCP strategy. Features additionally a blinking led indicating packets forwarded with on and off for each direction respectively.
See Also
https://github.com/gioblu/PJON/blob/master/examples/ARDUINO/Local/SoftwareBitBang/Tunneler/BlinkingRGBSwitch/BlinkingRGBSwitch.ino
* OneWire PJON Generic "OWPG" scheme:
*   @ref OWPJON/LINUX/Local/LocalUDP/RemoteWorker/DeviceGeneric/DeviceGeneric.cpp
*
* Compatible with: atmega328 (Uno, Nano), atmega32u4 (Yun)
*
* Pinout:
*   1wire PJON data bus (OWPJON SWBB):
*        1WIRE DATA    -> Arduino Pin D7
*        GND black     -> Arduino GND
*   ETH Shield W5100 based
*   1wire Sniffer/Master/Client Shield
*
* Test on Ubuntu or Raspberry Pi Server (owpshell) confer the docu of
* following files:
*   - @ref OWPJON/LINUX/Local/LocalUDP/RemoteWorker/DeviceGeneric/DeviceGeneric.cpp
*   - @ref OWPJON/LINUX/Local/ThroughSerial/RemoteWorker/DeviceGeneric/DeviceGeneric.cpp
*
* Thanks to:
* gioblu - PJON 11.0 and support
*          @see https://www.pjon.org/
*          @see https://github.com/gioblu/PJON
* fredilarsen - support
* 

Macro Definition Documentation

#define PJON_MAX_PACKETS   3

Function Documentation

void loop ( void  )

OneWirePJON device status update function.

Returns
(void)
PJONInteractiveRouter<PJONVirtualBusRouter<PJONSwitch> > router ( ,
(PJONAny *[2]){&bus1,&bus2}   
)
void sendnotification_function ( const uint8_t *const  payload,
const uint16_t  length,
const uint8_t  receiver_bus,
const uint8_t  sender_bus,
const PJON_Packet_Info &  packet_info 
)
void setup ( void  )

Arduino IDE: put your setup code here, to run once.

Variable Documentation

PJONAny bus1 & link1
PJONAny bus2 & link2
byte mac[] = {0xDE, 0x34, 0x4E, 0xEF, 0xFE, 0xE1}