|
STAR
Cal STAR — firmware, DAQ server, and engine design
|
#include <Ethernet.h>#include <EthernetUdp.h>#include <SPI.h>#include <daq-protocol.h>#include <cstring>Go to the source code of this file.
Macros | |
| #define | ETH_CLK_PIN 39 |
| #define | ETH_MISO_PIN 41 |
| #define | ETH_MOSI_PIN 40 |
| #define | ETH_CS_PIN 38 |
Functions | |
| void | setup () |
| void | printBoardInfo () |
| Prints all board networking information to Serial. | |
| void | sendExampleMessage () |
| Sends an example message in the old format (string-based) This is the original implementation for testing basic UDP communication. | |
| bool | sendHeartbeatPacket () |
| Creates and sends a Board Heartbeat packet using DiabloComms library This uses the proper packet encoding format defined in the DAQv2-Comms library. | |
| void | startHeartbeatLoop () |
| Continuously sends heartbeat packets until user cancels Checks for Serial input to allow cancellation. | |
| void | printMenu () |
| Prints the CLI menu options. | |
| void | processCLI () |
| Processes CLI commands from Serial input. | |
| void | loop () |
Variables | |
| IPAddress | staticIP (192, 168, 2, 100) |
| IPAddress | gateway (192, 168, 2, 1) |
| IPAddress | subnet (255, 255, 255, 0) |
| IPAddress | dns (192, 168, 2, 1) |
| IPAddress | receiverIP (192, 168, 2, 20) |
| const int | receiverPort = 5006 |
| EthernetUDP | udp |
| byte | mac [] = {0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED} |
| void loop | ( | ) |
Definition at line 258 of file main.cpp.
References delay(), and processCLI().
| void printBoardInfo | ( | ) |
| void printMenu | ( | ) |
Prints the CLI menu options.
Definition at line 219 of file main.cpp.
References Serial.
Referenced by processCLI(), and setup().
| void processCLI | ( | ) |
Processes CLI commands from Serial input.
Definition at line 231 of file main.cpp.
References printBoardInfo(), printMenu(), Serial, and startHeartbeatLoop().
Referenced by loop().
| void sendExampleMessage | ( | ) |
Sends an example message in the old format (string-based) This is the original implementation for testing basic UDP communication.
Definition at line 114 of file main.cpp.
References millis(), receiverIP, receiverPort, Serial, and udp.
| bool sendHeartbeatPacket | ( | ) |
Creates and sends a Board Heartbeat packet using DiabloComms library This uses the proper packet encoding format defined in the DAQv2-Comms library.
Definition at line 140 of file main.cpp.
References daq::ACTIVE, daq::create_board_heartbeat_packet(), MAX_PACKET_SIZE, millis(), packetBuffer, receiverIP, receiverPort, daq::SAFE, Serial, and udp.
Referenced by startHeartbeatLoop().
| void setup | ( | void | ) |
Definition at line 27 of file main.cpp.
References delay(), dns, ETH_CLK_PIN, ETH_CS_PIN, ETH_MISO_PIN, ETH_MOSI_PIN, Ethernet, gateway, mac, printBoardInfo(), printMenu(), Serial, staticIP, subnet, and udp.
| void startHeartbeatLoop | ( | ) |
Continuously sends heartbeat packets until user cancels Checks for Serial input to allow cancellation.
Definition at line 179 of file main.cpp.
References delay(), millis(), sendHeartbeatPacket(), and Serial.
Referenced by processCLI().
| IPAddress dns(192, 168, 2, 1) | ( | 192 | , |
| 168 | , | ||
| 2 | , | ||
| 1 | ) |
| IPAddress gateway(192, 168, 2, 1) | ( | 192 | , |
| 168 | , | ||
| 2 | , | ||
| 1 | ) |
| IPAddress receiverIP(192, 168, 2, 20) | ( | 192 | , |
| 168 | , | ||
| 2 | , | ||
| 20 | ) |
| IPAddress staticIP(192, 168, 2, 100) | ( | 192 | , |
| 168 | , | ||
| 2 | , | ||
| 100 | ) |
| IPAddress subnet(255, 255, 255, 0) | ( | 255 | , |
| 255 | , | ||
| 255 | , | ||
| 0 | ) |