44 unsigned long ts =
millis();
45 const uint8_t numSensors = 1;
49 memcpy(&ackBits, &
ack,
sizeof(
float));
50 chunk.add_datapoint(0, ackBits);
52 std::vector<daq::SensorDataChunkCollection>
chunks;
64 Serial.print(
"REPLY: [SENSOR_DATA] ");
66 Serial.print(
" bytes -> ");
80 Serial.println(
"Multi-Board Comms Testing – SECONDARY");
81 Serial.println(
" Listens on :5006 for packets from primary");
82 Serial.println(
" Replies with SENSOR_DATA -> <primaryIP>:5005");
83 Serial.println(
"----------------------------------------");
85 ESP_ERROR_CHECK(esp_read_mac(
mac, ESP_MAC_ETH));
87 for (
int i = 0; i < 6; i++) {
116 int n =
udp.parsePacket();
123 Serial.print(
" bytes from ");
static EthernetClass Ethernet
std::vector< daq::SensorDataChunkCollection > chunks
IPAddress dns(192, 168, 2, 1)
IPAddress subnet(255, 255, 255, 0)
IPAddress staticIP(192, 168, 2, BOARD_ID_DEFAULT)
IPAddress gateway(0, 0, 0, 0)
static IPAddress subnet(255, 255, 255, 0)
static IPAddress gateway(192, 168, 2, 1)
char packetBuffer[UDP_TX_PACKET_MAX_SIZE]
IPAddress dns(192, 168, 2, 1)
IPAddress staticIP(192, 168, 2, 101)
static constexpr int ETH_CS
Ball Valve Hotfire — motorized ball valve prototype board.
static constexpr int ETH_SCLK
static constexpr int ETH_MISO
static constexpr int ETH_MOSI
uint8_t replyBuffer[MAX_PACKET_SIZE]
const int primaryListenPort
void sendReplyTo(IPAddress primaryIP)
size_t create_sensor_data_packet(const std::vector< SensorDataChunkCollection > &chunks, const uint8_t num_sensors, uint32_t timestamp_ms, uint8_t *buffer, size_t buffer_size)
Creates a complete Sensor Data packet in the provided buffer.
*brief user defined string literal for JSON values *sa std::size_t n
constexpr Layout PT_Board
Represents a single data chunk with timestamp and sensor datapoints.
static const uint8_t ack[]