SRS-control 0.1.4
 
Loading...
Searching...
No Matches
CommonDefitions.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <chrono>
4#include <cstdint>
5
6namespace srs::common
7{
11
12 // General
13 constexpr auto BYTE_BIT_LENGTH = 8;
14
15 // Connections:
16 constexpr auto DEFAULT_SRS_IP = std::string_view{ "10.0.0.2" };
17 constexpr auto DEFAULT_TIMEOUT_SECONDS = 2;
18 constexpr auto WRITE_COMMAND_BITS = uint8_t{ 0xaa };
19 constexpr auto DEFAULT_TYPE_BITS = uint8_t{ 0xaa };
20 constexpr auto DEFAULT_CHANNEL_ADDRE = uint16_t{ 0xff };
21 constexpr auto COMMAND_LENGTH_BITS = uint16_t{ 0xffff };
22 constexpr auto ZERO_UINT16_PADDING = uint16_t{};
23 constexpr auto SMALL_READ_MSG_BUFFER_SIZE = 100;
24 constexpr auto LARGE_READ_MSG_BUFFER_SIZE = 10000;
25
26 constexpr auto DEFAULT_CMD_LENGTH = uint16_t{ 0xffff };
27 constexpr auto CMD_TYPE = uint8_t{ 0xaa };
28 constexpr auto WRITE_CMD = uint8_t{ 0xaa };
29 constexpr auto READ_CMD = uint8_t{ 0xbb };
30 constexpr auto I2C_ADDRESS = uint16_t{ 0x0042 }; /* device address = 0x21 */
31 constexpr auto NULL_ADDRESS = uint16_t{ 0x000f }; /* device address = 0x21 */
32
33 constexpr auto INIT_COUNT_VALUE = uint32_t{ 0x80000000 };
34 constexpr auto DEFAULT_STATUS_WAITING_TIME_SECONDS = std::chrono::seconds{ 5 };
35
36 // port numbers:
37 constexpr auto DEFAULT_SRS_CONTROL_PORT = 6600;
38 constexpr auto FEC_DAQ_RECEIVE_PORT = 6006;
39 static constexpr int FEC_CONTROL_LOCAL_PORT = 6007;
40
41 // Data processor:
42 constexpr auto DEFAULT_DISPLAY_PERIOD = std::chrono::milliseconds{ 200 };
43 constexpr auto DEFAULT_ROOT_HTTP_SERVER_PERIOD = std::chrono::milliseconds{ 1000 };
44 constexpr auto FEC_ID_BIT_LENGTH = 8;
45 constexpr auto HIT_DATA_BIT_LENGTH = 48;
46 constexpr auto SRS_TIMESTAMP_HIGH_BIT_LENGTH = 32;
47 constexpr auto SRS_TIMESTAMP_LOW_BIT_LENGTH = 10;
48 constexpr auto FLAG_BIT_POSITION = 15; // zero based
50 constexpr auto PROTOBUF_ENABLE_GZIP = true;
51
59
60 using RawDelimSizeType = uint32_t;
61
63} // namespace srs
constexpr auto FLAG_BIT_POSITION
constexpr auto FEC_ID_BIT_LENGTH
constexpr auto WRITE_COMMAND_BITS
constexpr auto I2C_ADDRESS
static constexpr int FEC_CONTROL_LOCAL_PORT
constexpr auto DEFAULT_CHANNEL_ADDRE
constexpr auto GZIP_DEFAULT_COMPRESSION_LEVEL
constexpr auto SRS_TIMESTAMP_LOW_BIT_LENGTH
constexpr auto DEFAULT_ROOT_HTTP_SERVER_PERIOD
constexpr auto DEFAULT_DISPLAY_PERIOD
uint32_t RawDelimSizeType
constexpr auto INIT_COUNT_VALUE
constexpr auto DEFAULT_TYPE_BITS
constexpr auto DEFAULT_STATUS_WAITING_TIME_SECONDS
constexpr auto ZERO_UINT16_PADDING
constexpr auto PROTOBUF_ENABLE_GZIP
constexpr auto BYTE_BIT_LENGTH
constexpr auto NULL_ADDRESS
constexpr auto DEFAULT_SRS_IP
constexpr auto HIT_DATA_BIT_LENGTH
constexpr auto SRS_TIMESTAMP_HIGH_BIT_LENGTH
constexpr auto COMMAND_LENGTH_BITS
constexpr auto LARGE_READ_MSG_BUFFER_SIZE
size of the data array for reading a UDP package
constexpr auto WRITE_CMD
constexpr auto FEC_DAQ_RECEIVE_PORT
constexpr auto CMD_TYPE
constexpr auto DEFAULT_CMD_LENGTH
constexpr auto SMALL_READ_MSG_BUFFER_SIZE
constexpr auto DEFAULT_TIMEOUT_SECONDS
constexpr auto READ_CMD
constexpr auto DEFAULT_SRS_CONTROL_PORT