//=========================================================== // StreamTest // Tests for OpenLCB Stream support // // Bob Jacobsen 2010 //=========================================================== #include #include #include #include "logging.h" int inputRead() { return 1; } // demo I/O pins #define INPUT_PIN 9 #define OUTPUT_PIN 14 int producer_pin_record; // OpenLCB definitions #include "OpenLcbCanInterface.h" #include "OpenLcbCanBuffer.h" #include "NodeID.h" #include "EventID.h" // specific OpenLCB implementations #include "LinkControl.h" #include "OlcbStream.h" OpenLcbCanBuffer rxBuffer; // CAN receive buffer OpenLcbCanBuffer txBuffer; // CAN send buffer OpenLcbCanBuffer* ptxCAN; NodeID nodeid(2,3,4,5,6,7); // This node's ID LinkControl link(&txBuffer, &nodeid); unsigned int resultcode; unsigned int rcvCallback(uint8_t *rbuf, unsigned int length){ // invoked when a stream frame arrives printf("consume frame of length %d: ",length); for (int i = 0; i