|
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 | printRawPacketData (const uint8_t *buffer, size_t size) |
| Prints raw packet data in hex format for debugging. | |
| void | printPacketHeader (const daq::PacketHeader &header) |
| Prints packet header information. | |
| void | printBoardHeartbeat (const daq::PacketHeader &header, const daq::BoardHeartbeatPacket &data) |
| Prints Board Heartbeat packet information. | |
| void | printServerHeartbeat (const daq::PacketHeader &header, const daq::ServerHeartbeatPacket &data) |
| Prints Server Heartbeat packet information. | |
| void | decodeAndPrintPacket (const uint8_t *buffer, size_t size) |
| Attempts to decode and print packet information. | |
| void | loop () |
Variables | |
| IPAddress | staticIP (192, 168, 2, 101) |
| IPAddress | gateway (192, 168, 2, 1) |
| IPAddress | subnet (255, 255, 255, 0) |
| IPAddress | dns (192, 168, 2, 1) |
| unsigned int | localPort = 5006 |
| uint8_t | packetBuffer [MAX_PACKET_SIZE] |
| EthernetUDP | udp |
| byte | mac [] = {0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xEE} |
| void decodeAndPrintPacket | ( | const uint8_t * | buffer, |
| size_t | size ) |
Attempts to decode and print packet information.
| buffer | The packet buffer |
| size | The size of the packet |
Definition at line 297 of file main.cpp.
References daq::ABORT, daq::ABORT_DONE, daq::ACTUATOR_COMMAND, daq::ACTUATOR_CONFIG, daq::BOARD_HEARTBEAT, daq::CLEAR_ABORT, daq::parse_board_heartbeat_packet(), daq::parse_server_heartbeat_packet(), printBoardHeartbeat(), printPacketHeader(), printRawPacketData(), printServerHeartbeat(), daq::SENSOR_CONFIG, daq::SENSOR_DATA, Serial, and daq::SERVER_HEARTBEAT.
Referenced by loop().
| void loop | ( | ) |
Definition at line 460 of file main.cpp.
References decodeAndPrintPacket(), delay(), MAX_PACKET_SIZE, packetBuffer, Serial, and udp.
| void printBoardHeartbeat | ( | const daq::PacketHeader & | header, |
| const daq::BoardHeartbeatPacket & | data ) |
Prints Board Heartbeat packet information.
Definition at line 177 of file main.cpp.
References daq::ABORT_FINISHED, daq::ACTIVE, daq::CONNECTION_LOSS_DETECTED, daq::FIRING, daq::LOX_FILL, daq::NO_CONN_ABORT_FOLLOWER, daq::NO_CONNECTION_ABORT, daq::NO_PT_ABORT, daq::POST_FIRE, daq::PRESSURIZING, printPacketHeader(), daq::PT_ABORT, daq::SAFE, daq::SELF_TEST, Serial, daq::SETUP, and daq::STANDALONE_ABORT.
Referenced by decodeAndPrintPacket().
| void printBoardInfo | ( | ) |
| void printPacketHeader | ( | const daq::PacketHeader & | header | ) |
Prints packet header information.
Definition at line 127 of file main.cpp.
References daq::ABORT, daq::ABORT_DONE, daq::ACTUATOR_COMMAND, daq::ACTUATOR_CONFIG, daq::BOARD_HEARTBEAT, daq::CLEAR_ABORT, daq::SENSOR_CONFIG, daq::SENSOR_DATA, Serial, and daq::SERVER_HEARTBEAT.
Referenced by decodeAndPrintPacket(), printBoardHeartbeat(), and printServerHeartbeat().
| void printRawPacketData | ( | const uint8_t * | buffer, |
| size_t | size ) |
Prints raw packet data in hex format for debugging.
Definition at line 110 of file main.cpp.
Referenced by decodeAndPrintPacket().
| void printServerHeartbeat | ( | const daq::PacketHeader & | header, |
| const daq::ServerHeartbeatPacket & | data ) |
Prints Server Heartbeat packet information.
Definition at line 259 of file main.cpp.
References daq::FIRING, daq::LOX_FILL, daq::POST_FIRE, daq::PRESSURIZING, printPacketHeader(), daq::SAFE, and Serial.
Referenced by decodeAndPrintPacket().
| void setup | ( | void | ) |
Definition at line 29 of file main.cpp.
References delay(), dns, ETH_CLK_PIN, ETH_CS_PIN, ETH_MISO_PIN, ETH_MOSI_PIN, Ethernet, gateway, localPort, mac, printBoardInfo(), Serial, staticIP, subnet, and udp.
| IPAddress dns(192, 168, 2, 1) | ( | 192 | , |
| 168 | , | ||
| 2 | , | ||
| 1 | ) |
| IPAddress gateway(192, 168, 2, 1) | ( | 192 | , |
| 168 | , | ||
| 2 | , | ||
| 1 | ) |
| uint8_t packetBuffer[MAX_PACKET_SIZE] |
| IPAddress staticIP(192, 168, 2, 101) | ( | 192 | , |
| 168 | , | ||
| 2 | , | ||
| 101 | ) |
| IPAddress subnet(255, 255, 255, 0) | ( | 255 | , |
| 255 | , | ||
| 255 | , | ||
| 0 | ) |