STAR
Cal STAR — firmware, DAQ server, and engine design
Loading...
Searching...
No Matches
register-vtables-helper.cpp
Go to the documentation of this file.
1// Quick helper to register VTables with Elodin DB
2// Uses existing FSW DatabaseConfig code
3
4#include <iostream>
5#include <string>
6
9
10int main(int argc, char* argv[]) {
11 if (argc < 3) {
12 std::cerr << "Usage: " << argv[0] << " <host> <port>" << std::endl;
13 return 1;
14 }
15
16 std::string host = argv[1];
17 int port = std::stoi(argv[2]);
18
19 std::cout << "Connecting to Elodin DB at " << host << ":" << port << "..." << std::endl;
20
22 if (!client.connect(host, port)) {
23 std::cerr << "❌ Failed to connect to Elodin DB" << std::endl;
24 return 1;
25 }
26
27 std::cout << "✅ Connected to Elodin DB" << std::endl;
28 std::cout << "Registering VTables..." << std::endl;
29
31 std::cerr << "❌ VTable registration failed" << std::endl;
32 return 1;
33 }
34
35 std::cout << "✅ VTables registered successfully" << std::endl;
36 std::cout << "Elodin DB should now stream data to all connected clients" << std::endl;
37
38 // Keep connection alive briefly
39 std::this_thread::sleep_for(std::chrono::milliseconds(100));
40
41 return 0;
42}
static bool register_tables(ElodinClient &client, const std::vector< BoardChannels > &pt_boards, const std::vector< BoardChannels > &act_boards, const std::vector< BoardChannels > &tc_boards, const std::vector< BoardChannels > &rtd_boards, const std::vector< BoardChannels > &lc_boards, const std::vector< BoardChannels > &enc_boards)
Register RAW sensor / actuator VTables.
Standalone Elodin database client.
static const emmc_port_t port
Definition emmc_stm32.c:210
int main()