Engage Engine API  1.246.9086
Loading...
Searching...
No Matches
EngageConstants.h
1//
2// Copyright (c) 2019 Rally Tactical Systems, Inc.
3// All rights reserved.
4//
5
6#ifndef EngageConstants_h
7#define EngageConstants_h
8
9#include <stdint.h>
10
11#if 1
12
13#if !defined(__APPLE__)
14 #include <cstddef>
15 #include <cstdint>
16#endif
17
18#ifdef WIN32
19 #include <winsock2.h>
20 #include <windows.h>
21 #include <ws2tcpip.h>
22#else
23 #include <netinet/in.h>
24#endif
25
26static const size_t ENGAGE_MAX_CRYPTO_PASSWORD_BYTES = 256;
27
28static const int ENGAGE_INVALID_IP_ADDRESS_FAMILY = -1;
29
30static const size_t ENGAGE_MAX_RTP_OUTPUT_QUEUE_PACKETS = 100;
31
32static const size_t ENGAGE_MAX_IP_ADDR_SIZE = sizeof(struct sockaddr_in6);
33static const size_t ENGAGE_MAX_ALIAS_SIZE = 16;
34static const size_t ENGAGE_MAX_NODE_ID_SIZE = 16;
35
36static const size_t ENGAGE_BLOB_PACKET_BUFFER_ALLOCATION_EXTRA_BYTES = 512;
37
38static const int16_t ENGAGE_PCM_MIN_VALUE = -32768;
39static const int16_t ENGAGE_PCM_MAX_VALUE = 32767;
40
41static const uint16_t ENGAGE_SELECT_FUNCTION_TIMEOUT_SECS = 1;
42static const uint16_t ENGAGE_MULTICAST_REJOIN_SECS = 8;
43
44static const size_t ENGAGE_MAX_DATAGRAM_SIZE = 4096;
45static const long ENGAGE_MAX_RECONNECT_PAUSE_MS = 30000;
46static const long ENGAGE_RECONNECT_FAILURE_PAUSE_INCREMENT_MS = 1500;
47
48static const size_t ENGAGE_BASE_RTP_HEADER_SIZE = 12;
49static const uint16_t ENGAGE_ACCEPTED_RTP_VERSION = 2;
50static const size_t ENGAGE_MAX_RTP_SAMPLES_THAT_CAN_BE_DECODED = (8000 * 5);
51
52static const size_t ENGAGE_PCM_SAMPLE_COUNT_PER_MS = 8;
53static const size_t ENGAGE_PCM_10_MS_SAMPLE_COUNT = (ENGAGE_PCM_SAMPLE_COUNT_PER_MS * 10);
54
55#if defined(__APPLE__)
56 static const size_t ENGAGE_PCM_MIN_PLATFORM_SAMPLE_COUNT = (ENGAGE_PCM_SAMPLE_COUNT_PER_MS * 40);
57#elif defined(__ANDROID__)
58 static const size_t ENGAGE_PCM_MIN_PLATFORM_SAMPLE_COUNT = (ENGAGE_PCM_SAMPLE_COUNT_PER_MS * 250);
59#elif defined(__linux__)
60 static const size_t ENGAGE_PCM_MIN_PLATFORM_SAMPLE_COUNT = (ENGAGE_PCM_SAMPLE_COUNT_PER_MS * 250);
61#elif defined(WIN32)
62 static const size_t ENGAGE_PCM_MIN_PLATFORM_SAMPLE_COUNT = (ENGAGE_PCM_SAMPLE_COUNT_PER_MS * 250);
63#elif defined(__EMSCRIPTEN__)
64 static const size_t ENGAGE_PCM_MIN_PLATFORM_SAMPLE_COUNT = (ENGAGE_PCM_SAMPLE_COUNT_PER_MS * 250);
65#endif
66
67static const long ENGAGE_TLS_CONNECTION_KEY_MATERIAL_SIZE = 32;
68static const uint64_t ENGAGE_RTP_RESET_AFTER_IDLE_MS = (1000 * 30);
69
70#if defined(RTS_DEBUG_BUILD)
71static const uint64_t ENGAGE_GROUP_HEALTH_ERROR_ERROR_NOTIFICATION_INTERVAL_MS = (1000 * 10);
72#else
73static const uint64_t ENGAGE_GROUP_HEALTH_ERROR_ERROR_NOTIFICATION_INTERVAL_MS = (1000 * 30);
74#endif
75
76static const size_t ENGAGE_MAX_GROUPS_PER_BRIDGE = 128;
77#endif
78
91static const int ENGAGE_RESULT_OK = 0;
95static const int ENGAGE_RESULT_NOT_INITIALIZED = -2;
99static const int ENGAGE_RESULT_GENERAL_FAILURE = -4;
101static const int ENGAGE_RESULT_NOT_STARTED = -5;
103static const int ENGAGE_RESULT_ALREADY_STARTED = -6;
128static const int ENGAGE_LOG_LEVEL_FATAL = 0;
130static const int ENGAGE_LOG_LEVEL_ERROR = 1;
132static const int ENGAGE_LOG_LEVEL_WARNING = 2;
136static const int ENGAGE_LOG_LEVEL_DEBUG = 4;
149static const int ENGAGE_SYSLOG_ENABLE = 1;
151static const int ENGAGE_SYSLOG_DISABLE = 0;
164static const int ENGAGE_WATCHDOG_ENABLE = 1;
166static const int ENGAGE_WATCHDOG_DISABLE = 0;
179static const int ENGAGE_NOTIFICATIONS_ENABLE = 1;
181static const int ENGAGE_NOTIFICATIONS_DISABLE = 0;
196static const uint8_t ENGAGE_TXFLAG_EMERGENCY = 0x0001;
197
199static const uint8_t ENGAGE_TXFLAG_TX_END = 0x0002; // READ-ONLY!!
200
202static const uint8_t ENGAGE_TXFLAG_AUTOMATED_SYSTEM = 0x0004;
203
205static const uint8_t ENGAGE_TXFLAG_STICKY_TID = 0x0008;
206
208static const uint8_t ENGAGE_TXFLAG_TID_INVALIDATED = 0x0010; // READ-ONLY!!
209
211static const uint8_t ENGAGE_TXFLAG_MUTE_RX_FOR_SPECIALIZER = 0x0020; // READ-ONLY!!
212
214static const uint8_t ENGAGE_TXFLAG_TX_START = 0x0040; // READ-ONLY!!
223static const uint8_t ENGAGE_DEFAULT_BLOB_RTP_PAYLOAD_TYPE = 66;
226#endif // EngageConstants_h
static const uint8_t ENGAGE_DEFAULT_BLOB_RTP_PAYLOAD_TYPE
The default RTP payload type Engage uses for RTP blob messaging.
static const int ENGAGE_LOG_LEVEL_WARNING
Indicates that a condition exists that should be addressed soon.
static const int ENGAGE_LOG_LEVEL_DEBUG
Debugging, primarily geared toward development and support personnel.
static const int ENGAGE_LOG_LEVEL_ERROR
A error has occurred but operation can continue.
static const int ENGAGE_LOG_LEVEL_INFORMATIONAL
The log message is of an informational nature - no action is required.
static const int ENGAGE_LOG_LEVEL_FATAL
A fatal error has occurred - Engine operation cannot continue.
static const int ENGAGE_NOTIFICATIONS_DISABLE
Disables notifications.
static const int ENGAGE_NOTIFICATIONS_ENABLE
Enables notifications.
static const int ENGAGE_RESULT_HIGH_RES_TIMER_ALREADY_EXISTS
An application high resolution timer is already defined.
static const int ENGAGE_RESULT_OK
The request was succesful.
static const int ENGAGE_RESULT_ALREADY_INITIALIZED
The library has already been initialized.
static const int ENGAGE_RESULT_INVALID_PARAMETERS
One or more parameters are invalid.
static const int ENGAGE_RESULT_CRYPTO_MODULE_INITIALIZATION_FAILED
Initialization of the crypto module failed.
static const int ENGAGE_RESULT_INSUFFICIENT_DESTINATION_SPACE
Insufficient space in destination.
static const int ENGAGE_RESULT_NOT_INITIALIZED
The library has not yet been initialized - engageInitialize() should be called.
static const int ENGAGE_RESULT_GENERAL_FAILURE
An unspecified error has occurred.
static const int ENGAGE_RESULT_ALREADY_STARTED
The Engine has already been started.
static const int ENGAGE_RESULT_NOT_STARTED
The Engine has not yet been started - engageStart() should be called.
static const int ENGAGE_SYSLOG_ENABLE
Enables syslog output on supported systems.
static const int ENGAGE_SYSLOG_DISABLE
Disables syslog output.
static const uint8_t ENGAGE_TXFLAG_AUTOMATED_SYSTEM
Indicates that the transmission is coming from an automated system.
static const uint8_t ENGAGE_TXFLAG_EMERGENCY
Sets the EMERGENCY flag in the transmitted stream.
static const uint8_t ENGAGE_TXFLAG_TID_INVALIDATED
Indicates that the transmission ID is no longer valid.
static const uint8_t ENGAGE_TXFLAG_MUTE_RX_FOR_SPECIALIZER
Indicates that the receiver should auto-mute using the alias specializer if receiver has that special...
static const uint8_t ENGAGE_TXFLAG_STICKY_TID
Indicates a "sticky" transmission ID (if non-zero)
static const uint8_t ENGAGE_TXFLAG_TX_START
Indicates that a transmission is about to start.
static const uint8_t ENGAGE_TXFLAG_TX_END
Indicates that the transmission has concluded.
static const int ENGAGE_WATCHDOG_DISABLE
Disables the watchdog - has no effect if the watchdog is disabled in the policy configuration.
static const int ENGAGE_WATCHDOG_ENABLE
Enables the watchdog - has no effect if the watchdog is disabled in the policy configuration.