|
STAR
Cal STAR — firmware, DAQ server, and engine design
|
#include <Arduino.h>#include <Ethernet.h>#include <EthernetUdp.h>#include <SPI.h>#include <daq-protocol.h>#include <esp_mac.h>#include <cstring>#include <vector>#include "sense_board_pins.h"Go to the source code of this file.
Functions | |
| void | sendReplyTo (IPAddress primaryIP) |
| void | setup () |
| void | loop () |
Variables | |
| byte | mac [6] |
| Multi-Board Comms Testing - SECONDARY. | |
| IPAddress | staticIP (192, 168, 2, 101) |
| IPAddress | gateway (192, 168, 2, 1) |
| IPAddress | subnet (255, 255, 255, 0) |
| IPAddress | dns (192, 168, 2, 1) |
| const int | localPort = 5006 |
| const int | primaryListenPort = 5005 |
| EthernetUDP | udp |
| uint8_t | packetBuffer [MAX_PACKET_SIZE] |
| uint8_t | replyBuffer [MAX_PACKET_SIZE] |
| void loop | ( | ) |
Definition at line 115 of file main.cpp.
References delay(), packetBuffer, sendReplyTo(), Serial, and udp.
| void sendReplyTo | ( | IPAddress | primaryIP | ) |
Definition at line 43 of file main.cpp.
References ack, chunk, chunks, daq::create_sensor_data_packet(), millis(), primaryListenPort, replyBuffer, Serial, and udp.
Referenced by loop().
| void setup | ( | void | ) |
| IPAddress dns(192, 168, 2, 1) | ( | 192 | , |
| 168 | , | ||
| 2 | , | ||
| 1 | ) |
| IPAddress gateway(192, 168, 2, 1) | ( | 192 | , |
| 168 | , | ||
| 2 | , | ||
| 1 | ) |
| byte mac[6] |
Multi-Board Comms Testing - SECONDARY.
Listens on port 5006 for SENSOR_DATA (or any) packets from the primary. On receive: sends a reply SENSOR_DATA packet back to the primary at remoteIP():5005.
Uses: Arduino Ethernet, EthernetUDP, DAQv2-Comms (sensor packet format).
| uint8_t packetBuffer[MAX_PACKET_SIZE] |
| const int primaryListenPort = 5005 |
Definition at line 34 of file main.cpp.
Referenced by sendReplyTo().
| uint8_t replyBuffer[MAX_PACKET_SIZE] |
Definition at line 38 of file main.cpp.
Referenced by sendReplyTo().
| IPAddress staticIP(192, 168, 2, 101) | ( | 192 | , |
| 168 | , | ||
| 2 | , | ||
| 101 | ) |
| IPAddress subnet(255, 255, 255, 0) | ( | 255 | , |
| 255 | , | ||
| 255 | , | ||
| 0 | ) |