|
STAR
Cal STAR — firmware, DAQ server, and engine design
|
Namespaces | |
| namespace | anonymous_namespace{DatabaseConfig.cpp} |
Classes | |
| struct | BoardChannels |
| Per-board channel info for board-namespaced entity registration. More... | |
| class | DatabaseConfig |
| Register sensor table schemas with Elodin database. More... | |
| class | ElodinClient |
| Standalone Elodin database client. More... | |
| struct | PacketHeader |
| class | SubscriptionTracker |
Enumerations | |
| enum class | PacketType : uint8_t { MSG = 0 , TABLE = 1 , TIME_SERIES = 2 } |
Functions | |
| std::vector< std::pair< uint8_t, uint8_t > > | raw_sensor_tables (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) |
| Elodin table ids (hi, lo) for the RAW sensor VTables the given boards publish. | |
| std::vector< std::pair< uint8_t, uint8_t > > | calibrated_sensor_tables (const std::vector< BoardChannels > &pt_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, const std::vector< BoardChannels > &act_boards) |
| Elodin table ids for the CALIBRATED VTables, matching register_calibrated_tables() (same encoding as above with a +0x10 channel offset, and ACT at 0x31 rather than 0x30). | |
| std::vector< std::pair< uint8_t, uint8_t > > | ball_valve_raw_tables (const std::vector< BoardChannels > &bv_boards) |
| std::vector< std::pair< uint8_t, uint8_t > > | ball_valve_calibrated_tables (const std::vector< BoardChannels > &bv_boards) |
| std::vector< std::pair< uint8_t, uint8_t > > | ball_valve_cmd_tables (const std::vector< BoardChannels > &bv_boards) |
| std::array< uint8_t, 2 > | message_id_to_packet_id (uint16_t message_id) |
| uint32_t | fnv1a_hash_32 (std::string_view str) |
| uint64_t | fnv1a_hash_64 (std::string_view str) |
| uint16_t | fnv1a_hash_16_xor (std::string_view str) |
| std::array< uint8_t, 2 > | msg_id (std::string_view str) |
| uint64_t | component_id (std::string_view str) |
| bool | is_error_response (const uint8_t *pkt, size_t len) |
| ErrorResponse: header len(4) | ty(1) | msg id [0xE0, 0x1D] | request id(1). | |
| template<typename T> | |
| static bool | send_msg (ElodinClient &client, T msg) |
| static bool | register_raw_sensor_vtable (ElodinClient &client, uint8_t type_hi, uint8_t channel_id, uint64_t entity_id, const std::string &entity_name, const std::string &adc_field_name) |
| static bool | register_calibrated_vtable (ElodinClient &client, uint8_t type_hi, uint8_t pkt_lo, uint64_t entity_id, const std::string &entity_name, const std::string &cal_field_name, const std::string &raw_field_name) |
| static bool | register_actuator_state_vtable (ElodinClient &client, uint8_t type_hi, uint8_t channel_id, uint64_t entity_id, const std::string &entity_name) |
| static bool | register_self_test_vtable (ElodinClient &client, uint8_t board_id, uint8_t sensor_id) |
| static bool | register_sequencer_vtable (ElodinClient &client) |
| static bool | register_calibration_command_vtable (ElodinClient &client) |
Variables | |
| constexpr uint8_t | kBallValveRawHi = 0x33 |
| Ball valve boards (BALL_VALVE) have their own type_hi bytes, so a valve never shares a key with an ACTUATOR board on the same board_id % 10 slot (board 71 and actuator board 11 are both slot 1): 0x33 raw position counts BV<n>.CH<m> raw_adc_counts 0x34 calibrated position BV<n>_Cal.CH<m> position_pct, raw_adc, cal_status 0x35 commanded state BV_CMD.B<n>.CH<m> actuator_state (0 closed, 1 open) Low bytes follow the other boards: raw/cmd (n-1)*0x20 + m, calibrated (n-1)*0x20 + 0x10 + m. | |
| constexpr uint8_t | kBallValveCalHi = 0x34 |
| constexpr uint8_t | kBallValveCmdHi = 0x35 |
| constexpr std::pair< uint8_t, uint8_t > | kTableSequencerState {0x50, 0x00} |
| Non-sensor tables, named rather than spelled as literals at each use site. | |
| constexpr std::pair< uint8_t, uint8_t > | kTableControllerState {0x43, 0x00} |
| constexpr std::pair< uint8_t, uint8_t > | kTableCalibrationCommand {0x46, 0x00} |
| static constexpr uint8_t | SELF_TEST_HIGH_BASE = 0x60 |
| static constexpr uint8_t | SELF_TEST_MAX_SENSOR = 15 |
|
strong |
| Enumerator | |
|---|---|
| MSG | |
| TABLE | |
| TIME_SERIES | |
Definition at line 14 of file ElodinProtocol.hpp.
| std::vector< std::pair< uint8_t, uint8_t > > fsw::elodin::ball_valve_calibrated_tables | ( | const std::vector< BoardChannels > & | bv_boards | ) |
Definition at line 606 of file DatabaseConfig.cpp.
References kBallValveCalHi.
Referenced by main().
| std::vector< std::pair< uint8_t, uint8_t > > fsw::elodin::ball_valve_cmd_tables | ( | const std::vector< BoardChannels > & | bv_boards | ) |
Definition at line 613 of file DatabaseConfig.cpp.
References kBallValveCmdHi.
Referenced by main().
| std::vector< std::pair< uint8_t, uint8_t > > fsw::elodin::ball_valve_raw_tables | ( | const std::vector< BoardChannels > & | bv_boards | ) |
Definition at line 599 of file DatabaseConfig.cpp.
References kBallValveRawHi.
| std::vector< std::pair< uint8_t, uint8_t > > fsw::elodin::calibrated_sensor_tables | ( | const std::vector< BoardChannels > & | pt_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, | ||
| const std::vector< BoardChannels > & | act_boards ) |
Elodin table ids for the CALIBRATED VTables, matching register_calibrated_tables() (same encoding as above with a +0x10 channel offset, and ACT at 0x31 rather than 0x30).
Definition at line 188 of file DatabaseConfig.cpp.
Referenced by main().
|
inline |
Definition at line 61 of file ElodinProtocol.hpp.
References fnv1a_hash_64().
|
inline |
Definition at line 49 of file ElodinProtocol.hpp.
References fnv1a_hash_32().
Referenced by msg_id().
|
inline |
Definition at line 25 of file ElodinProtocol.hpp.
Referenced by fnv1a_hash_16_xor().
|
inline |
Definition at line 37 of file ElodinProtocol.hpp.
Referenced by component_id().
|
inline |
ErrorResponse: header len(4) | ty(1) | msg id [0xE0, 0x1D] | request id(1).
Definition at line 32 of file SubscriptionTracker.hpp.
Referenced by main(), and test_error_response_is_recognised().
|
inline |
Definition at line 205 of file ElodinClient.hpp.
Referenced by fsw::elodin::ElodinClient::serialize_msg().
|
inline |
Definition at line 56 of file ElodinProtocol.hpp.
References fnv1a_hash_16_xor().
Referenced by fsw::elodin::ElodinClient::publish().
| std::vector< std::pair< uint8_t, uint8_t > > fsw::elodin::raw_sensor_tables | ( | 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 ) |
Elodin table ids (hi, lo) for the RAW sensor VTables the given boards publish.
The (type_hi, (board_number-1)*0x20 + channel) encoding is defined by DatabaseConfig::register_tables(), so it lives here beside it rather than being re-derived by every subscriber. Built from the boards actually in config — the version this replaced guessed boards 1-8 x channels 1-10 and subscribed to 480 tables whether they existed or not.
Definition at line 174 of file DatabaseConfig.cpp.
|
static |
Definition at line 134 of file DatabaseConfig.cpp.
References send_msg().
Referenced by fsw::elodin::DatabaseConfig::register_ball_valve_cmd_tables(), and fsw::elodin::DatabaseConfig::register_non_sensor_tables().
|
static |
Definition at line 98 of file DatabaseConfig.cpp.
References send_msg().
Referenced by fsw::elodin::DatabaseConfig::register_ball_valve_calibrated_tables(), and fsw::elodin::DatabaseConfig::register_calibrated_tables().
|
static |
Definition at line 571 of file DatabaseConfig.cpp.
References send_msg().
Referenced by fsw::elodin::DatabaseConfig::register_non_sensor_tables().
|
static |
Definition at line 57 of file DatabaseConfig.cpp.
References send_msg().
Referenced by fsw::elodin::DatabaseConfig::register_ball_valve_tables(), and fsw::elodin::DatabaseConfig::register_tables().
|
static |
Definition at line 497 of file DatabaseConfig.cpp.
References board_id, SELF_TEST_HIGH_BASE, and send_msg().
Referenced by fsw::elodin::DatabaseConfig::register_self_test_tables().
|
static |
Definition at line 536 of file DatabaseConfig.cpp.
References send_msg().
Referenced by fsw::elodin::DatabaseConfig::register_non_sensor_tables().
|
static |
Definition at line 17 of file DatabaseConfig.cpp.
Referenced by register_actuator_state_vtable(), register_calibrated_vtable(), register_calibration_command_vtable(), fsw::elodin::DatabaseConfig::register_environmental_tables(), fsw::elodin::DatabaseConfig::register_heartbeat_tables(), register_raw_sensor_vtable(), register_self_test_vtable(), register_sequencer_vtable(), and fsw::elodin::anonymous_namespace{DatabaseConfig.cpp}::register_t7_vtable().
|
constexpr |
Definition at line 58 of file DatabaseConfig.hpp.
Referenced by ball_valve_calibrated_tables(), main(), and fsw::elodin::DatabaseConfig::register_ball_valve_calibrated_tables().
|
constexpr |
Definition at line 59 of file DatabaseConfig.hpp.
Referenced by ball_valve_cmd_tables(), sequencer::ActuatorCommander::load(), and fsw::elodin::DatabaseConfig::register_ball_valve_cmd_tables().
|
constexpr |
Ball valve boards (BALL_VALVE) have their own type_hi bytes, so a valve never shares a key with an ACTUATOR board on the same board_id % 10 slot (board 71 and actuator board 11 are both slot 1): 0x33 raw position counts BV<n>.CH<m> raw_adc_counts 0x34 calibrated position BV<n>_Cal.CH<m> position_pct, raw_adc, cal_status 0x35 commanded state BV_CMD.B<n>.CH<m> actuator_state (0 closed, 1 open) Low bytes follow the other boards: raw/cmd (n-1)*0x20 + m, calibrated (n-1)*0x20 + 0x10 + m.
Definition at line 57 of file DatabaseConfig.hpp.
Referenced by ball_valve_raw_tables(), main(), and fsw::elodin::DatabaseConfig::register_ball_valve_tables().
|
constexpr |
Definition at line 71 of file DatabaseConfig.hpp.
Referenced by main().
|
constexpr |
Definition at line 70 of file DatabaseConfig.hpp.
|
constexpr |
Non-sensor tables, named rather than spelled as literals at each use site.
Definition at line 69 of file DatabaseConfig.hpp.
Referenced by anonymous_namespace{heartbeat_service_main.cpp}::elodinThread(), and anonymous_namespace{stacklight_service_main.cpp}::elodinThread().
|
staticconstexpr |
Definition at line 494 of file DatabaseConfig.cpp.
Referenced by register_self_test_vtable().
|
staticconstexpr |
Definition at line 495 of file DatabaseConfig.cpp.
Referenced by fsw::elodin::DatabaseConfig::register_self_test_tables().