DeterministicESPAsyncWebServer v6.28.0
Zero-allocation, bounded-execution async HTTP server for ESP32
Loading...
Searching...
No Matches
ntcip.cpp
Go to the documentation of this file.
1// Copyright (C) 2026 Douglas Quigg (dstroy0) <dquigg123@gmail.com>
2// SPDX-License-Identifier: AGPL-3.0-or-later
3
4/**
5 * @file ntcip.cpp
6 * @brief NTCIP object identifiers (see ntcip.h).
7 */
8
10
11#if DETWS_ENABLE_NTCIP
12
13// Everything hangs under 1.3.6.1.4.1.1206.4.2 = iso.org.dod.internet.private.enterprises.nema(1206)
14// .transportation(4).devices(2). Under devices: .1 = protocols, .3 = global, and each device class has
15// its own subtree - 1202 signals under .devices with the ASC objects, 1203 DMS likewise. The arc values
16// below follow the published NTCIP object trees.
17
18// --- NTCIP 1202 Actuated Signal Controller ---
19// asc(1206.4.2.1) phase(1) ...
20const uint32_t NTCIP_1202_MAX_PHASES[] = {1, 3, 6, 1, 4, 1, 1206, 4, 2, 1, 1, 1};
21const size_t NTCIP_1202_MAX_PHASES_LEN = sizeof(NTCIP_1202_MAX_PHASES) / sizeof(NTCIP_1202_MAX_PHASES[0]);
22
23// phaseMinimumGreen: phaseTable(2) entry(1) col(4)
24const uint32_t NTCIP_1202_PHASE_MIN_GREEN[] = {1, 3, 6, 1, 4, 1, 1206, 4, 2, 1, 2, 1, 4};
25const size_t NTCIP_1202_PHASE_MIN_GREEN_LEN =
26 sizeof(NTCIP_1202_PHASE_MIN_GREEN) / sizeof(NTCIP_1202_PHASE_MIN_GREEN[0]);
27
28// phaseStatusGroupGreens: phaseStatusGroup(5) table(2) entry(1) col(4)
29const uint32_t NTCIP_1202_PHASE_STATUS[] = {1, 3, 6, 1, 4, 1, 1206, 4, 2, 1, 5, 2, 1, 4};
30const size_t NTCIP_1202_PHASE_STATUS_LEN = sizeof(NTCIP_1202_PHASE_STATUS) / sizeof(NTCIP_1202_PHASE_STATUS[0]);
31
32// --- NTCIP 1203 Dynamic Message Sign ---
33// dms(1206.4.2.3) dmsSignCfg(1) dmsMaxMultiStringLength(9)
34const uint32_t NTCIP_1203_DMS_MAX_LENGTH[] = {1, 3, 6, 1, 4, 1, 1206, 4, 2, 3, 1, 9};
35const size_t NTCIP_1203_DMS_MAX_LENGTH_LEN = sizeof(NTCIP_1203_DMS_MAX_LENGTH) / sizeof(NTCIP_1203_DMS_MAX_LENGTH[0]);
36
37// dmsMessageMultiString: dmsMessage(5) table(8) entry(1) col(3)
38const uint32_t NTCIP_1203_DMS_MESSAGE_MULTI[] = {1, 3, 6, 1, 4, 1, 1206, 4, 2, 3, 5, 8, 1, 3};
39const size_t NTCIP_1203_DMS_MESSAGE_MULTI_LEN =
40 sizeof(NTCIP_1203_DMS_MESSAGE_MULTI) / sizeof(NTCIP_1203_DMS_MESSAGE_MULTI[0]);
41
42size_t detws_ntcip_oid(const uint32_t *root, size_t root_len, uint32_t index, uint32_t *out, size_t out_cap)
43{
44 if (!root || !out || root_len == 0 || root_len + 1 > out_cap)
45 return 0;
46 for (size_t i = 0; i < root_len; i++)
47 out[i] = root[i];
48 out[root_len] = index;
49 return root_len + 1;
50}
51
52#endif // DETWS_ENABLE_NTCIP
NTCIP transportation-device object identifiers (DETWS_ENABLE_NTCIP).