DeterministicESPAsyncWebServer v6.28.0
Zero-allocation, bounded-execution async HTTP server for ESP32
Loading...
Searching...
No Matches
ntcip.h
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.h
6 * @brief NTCIP transportation-device object identifiers (DETWS_ENABLE_NTCIP).
7 *
8 * NTCIP (National Transportation Communications for ITS Protocol) rides SNMP: an NTCIP device is an SNMP
9 * agent whose MIB carries the NTCIP object definitions. Since this library already ships an SNMP agent
10 * (services/snmp), NTCIP is the object layer - the OID roots + the object arcs for the common device
11 * classes:
12 *
13 * - **NTCIP 1202** Actuated Signal Controllers: phase timing + live signal-group states.
14 * - **NTCIP 1203** Dynamic Message Signs: pushing / reading a message to a variable message board.
15 *
16 * All NTCIP objects live under `1.3.6.1.4.1.1206.4.2` (nema.tsxx). This provides those OID arc arrays and
17 * a helper to build a full object OID (root + instance index), so an app registers them on the SNMP
18 * agent with snmp_agent_add_integer / _add_string / _add_dynamic. Pure OID data, zero heap, host-testable.
19 */
20
21#ifndef DETERMINISTICESPASYNCWEBSERVER_NTCIP_H
22#define DETERMINISTICESPASYNCWEBSERVER_NTCIP_H
23
24#include "ServerConfig.h"
25#include <stddef.h>
26#include <stdint.h>
27
28#if DETWS_ENABLE_NTCIP
29
30/**
31 * @brief NTCIP object roots under 1.3.6.1.4.1.1206.4.2 (private.enterprises.nema.transportation.devices).
32 *
33 * Each is the OID prefix of a scalar/column; the leaf/instance index is appended by
34 * detws_ntcip_oid() (a scalar takes .0; a table column takes the row index).
35 */
36extern const uint32_t NTCIP_1202_MAX_PHASES[]; ///< maxPhases (1202): number of phases. len via _len.
37extern const size_t NTCIP_1202_MAX_PHASES_LEN;
38extern const uint32_t NTCIP_1202_PHASE_MIN_GREEN[]; ///< phaseMinimumGreen column (1202).
39extern const size_t NTCIP_1202_PHASE_MIN_GREEN_LEN;
40extern const uint32_t NTCIP_1202_PHASE_STATUS[]; ///< phaseStatusGroupGreens (1202): live green states.
41extern const size_t NTCIP_1202_PHASE_STATUS_LEN;
42extern const uint32_t NTCIP_1203_DMS_MAX_LENGTH[]; ///< dmsMaxMultiStringLength (1203).
43extern const size_t NTCIP_1203_DMS_MAX_LENGTH_LEN;
44extern const uint32_t NTCIP_1203_DMS_MESSAGE_MULTI[]; ///< dmsMessageMultiString column (1203): the MULTI text.
45extern const size_t NTCIP_1203_DMS_MESSAGE_MULTI_LEN;
46
47/**
48 * @brief Build a full object OID by appending an instance index to a root.
49 * @param root the NTCIP object root arcs.
50 * @param root_len its length.
51 * @param index the instance/row index to append (use 0 for a scalar).
52 * @param out output arc buffer.
53 * @param out_cap its capacity (in arcs).
54 * @return the total number of arcs written (root_len + 1), or 0 if it will not fit.
55 */
56size_t detws_ntcip_oid(const uint32_t *root, size_t root_len, uint32_t index, uint32_t *out, size_t out_cap);
57
58#endif // DETWS_ENABLE_NTCIP
59#endif // DETERMINISTICESPASYNCWEBSERVER_NTCIP_H
User-facing configuration for DeterministicESPAsyncWebServer.