68 Commits

Author SHA1 Message Date
Richard Holme
b4d73bb56b 2025-12-05 v10.0.12: New API functions, enhanced CLI add command, fixed race hazards
Added
- 'obuspa -c add' CLI command now supports setting child parameters
- SIGTERM signal handler to cleanly shutdown
- USP_SIGNAL_Reboot API function to initiate shutting down, then
rebooting the device
- USP_LOG_GetLogLevel and USP_LOG_SetLogLevel API functions to
atomically access the log level at runtime

Fixed
- Compilation failure when #include'ing only usp_api.h
(enable_callstack_debug should be declared in usp_api.h)
- Race hazard preventing graceful shutdown. Occurs if re-initiating
shutdown whilst in the process of shutting down
- Race hazard causing USP Broker to reject all messages from a USP
Service. Occurs when USP Service disconnects, then immediately
reconnects over UDS MTP, whilst USP Broker is waiting for a synchronous
USP response
2025-12-05 19:32:42 +00:00
Richard Holme
cd71ce1fe3 2025-11-05 v10.0.11: Updated to latest release of protobuf-c
Updated
- Code has been updated to use the latest v1.5.2 release of protobuf-c

Fixed
- A certificate file in the MUTABLE_CERT_DIR that did not contain Alias
could be left open. Note: This cannot occur if the certificate was added
using Device.LocalAgent.AddCertificate().
2025-11-05 10:45:12 +00:00
Richard Holme
a45ac35902 2025-10-10 v10.0.10: Device.LocalAgent.AddCertificate() support
Added
- Device.LocalAgent.AddCertificate() support. See QUICK_START_GUIDE.md
for how to use this feature.
- can_mtp_connect vendor hook should also control Bulk Data Collection
report generation

Fixed
- Compilation failure with recent USP_PROCESS_DoWorkSync changes when
REMOVE_USP_BROKER is defined
- Removed Clang static analyzer false positives
2025-10-10 17:04:08 +01:00
Richard Holme
dcc380b3ee 2025-09-30 v10.0.9: REMOVE_DEVICE_SECURITY_CERTIFICATE define
Added
- Device.Security.Certificate may be removed from OBUSPA's data model
using the define REMOVE_DEVICE_SECURITY_CERTIFICATE in vendor_defs.h.
This does not affect  Device.LocalAgent.Certificate, which still reports
the trust store certificates.
- Configure options to enable address sanitizer (--enable-asan) and
thread sanitizer builds (--enable-tsan) have been added. These options
are disabled by default.
- To support compilation of OBUSPA data model plug-ins, the build
process now installs header files to $(includedir)/obuspa

Fixed
- USP Command and Event arguments should not be allowed to be registered
more than once

Modified
- 'obuspa -c' output has been made cleaner, containing only logs from
the data model thread
- The m4-extra directory and AX_CHECK_XXX autotools macros (added in
v10.0.8) have been removed, as they filter rather than stop the build if
unsupported compiler options are used.
2025-09-30 21:46:04 +01:00
Richard Holme
8de4d34cb3 2025-09-15 v10.0.8: Synchronous functions to access the data model from vendor threads
Added
- Functions to access the data model from vendor threads
(USP_PROCESS_DoWorkSync, USP_PROCESS_DM_GetParameterValue,
USP_PROCESS_DM_SetParameterValue)
- Configure option (--enable-hardening) to enable compiler hardening
flags (disabled by default)

Fixed
- Concurrent CLI invocations can get stuck

Modified
- Maximum allowed MTP frame size received has been increased to 5MB
(from 64K)
2025-09-15 11:45:55 +01:00
Richard Holme
9a09b1e91c 2025-08-18 v10.0.7: Bug fixes
Fixed
- Suppress annoying warnings when using OBUSPA CLI commands
- MQTT client should not disconnect if no Response Topic
- R-GET.0 not applied for partial paths
- USP Services should not reuse group_ids registered by internal data
model providers
- Crash if object creation notification contains too many keys
2025-08-18 11:42:36 +01:00
Richard Holme
f816643763 2025-08-04 v10.0.6: Bug fixes
Fixed
- Wildcarded delete response with allow_partial=true incorrect if one
instance not permitted to be deleted
- MQTT connection not retried if TLS handshake fails and libmoquitto
version<2.0.13
- MQTT Send message queue gets stuck if packet too large
2025-08-04 14:07:22 +01:00
Richard Holme
d41800dc7d 2025-07-22 v10.0.5: Search Expression based permissions
Added
- Support for permission Targets containing search expressions
(configured by ALLOWED_PARAMS_FOR_SE_BASED_PERMS in vendor_defs.h)

Fixed
- MQTT client should disconnect if no Response Topic
- Changing LocalAgent.MTP.Enable should not assert when Protocol is UDS
- LocalAgent.MTP.{i}.Status is not working for UDS MTP
- Async Operation max concurrency limit regression (broken in v10.0.0)
2025-07-22 10:55:00 +01:00
Richard Holme
f05221d342 2025-06-24 v10.0.4: Bug Fixes
Fixed
- ControllerTrust Permission Order uniqueness should be enforced when
Add request with allow_partial=false adds multiple permissions with the
same Order
- GSDM response should not contain unique keys for child objects when
first_level_only=true
2025-06-24 15:41:19 +01:00
Richard Holme
42720a5862 2025-06-06 v10.0.3: Bug fixes
Fixed
- First object creation notification after bootup may be missed
- CLI initiated event arguments do not support JSON formatted data
- Provide better documentation for OBUSPA CLI -c commands
- Removed .gitattributes file, as this causes problems when building
OBUSPA for OpenWRT
2025-06-06 16:30:08 +01:00
Richard Holme
9a68032280 2025-05-27 v10.0.2: Bug fixes
Fixed
- Code should compile with --disable-bulkdata (regression introduced in
v10.0.1)
- Wrong error code returned in USP conformance test 1.100
- Crash occurs if USP Service registers a DM element, but does not
provide it in the GSDM response
2025-05-27 10:24:23 +01:00
Richard Holme
7c292f96a2 2025-05-02 v10.0.1: Added Device.BulkData.Profile.{i}.Controller
Added
- Support for Device.BulkData.Profile.{i}.Controller parameter
2025-05-02 18:28:21 +01:00
Richard Holme
8fb0942ea0 2025-04-07: v10.0.0 (Jackdaw)
Changes from v9.0.9
Added
- Instance based permissions
- Reason and Cause arguments have been added to Device.Reboot(),
Device.FactoryReset() and Device.Boot!
- Get response only contains the names of objects that also have Obj
read permissions (in addition to Param read permissions) (USPv1.4)

Fixed
- Potential memory leak in DEVICE_SECURITY_SetALPN
v10.0.0-master
2025-04-07 16:16:27 +01:00
Richard Holme
cdcfd9f736 2025-03-25 v9.0.9: USP 1.4 GSDM updates
Added
- USP 1.4: GSDM should contain unique keys
- USP 1.4: GSDM should support request of non-objects

Fixed
- Periodic! notifications should be sent after the Boot! event
- Empty string should not be interpreted as 0 by parameter value
conversion functions
2025-03-25 12:30:53 +00:00
Richard Holme
5d4a191d88 2025-03-07 v9.0.8: USP Broker Optimizations
Added
- USP Broker: Optimize Get requests spanning multiple USP Services
- USP Broker: Search Expressions optimizations (pass through of requests
and subscriptions containing search expressions to USP Services)

Fixed
- Compilation failures when INCLUDE_PROGRAMMATIC_FACTORY_RESET is
defined (GitHub PR#122)
2025-03-07 15:35:42 +00:00
Richard Holme
7428fabc2e 2025-02-24: v9.0.7: Bug fixes
Added
- HardwareVersion can also be specified by an environment variable
(USP_BOARD_HW_VERSION)

Fixed
- Crash that could occur once at startup if the controller trust
permissions table contained invalid data
2025-02-24 09:18:06 +00:00
Richard Holme
c057d745db 2025-02-10: v9.0.6: Example vendor layer plug-in
Added
- Example vendor layer plug-in and documentation (in quick start guide)
2025-02-10 08:51:20 +00:00
Richard Holme
7ca52b3a5d 2025-01-13: v9.0.5: Bug Fixes
Fixed
- Compilation failure when building for pure USP Service
- Subscription ID should be immutable
- OpenSSL should be initialized only once
2025-01-13 11:47:26 +00:00
Richard Holme
1235ce6281 2024-12-09: v9.0.4: Registration of non-objects, BDC over MQTT
Added
- USP Broker support for registration of parameters, events and USP
commands (USP 1.4)
- Bulk Data Collection over MQTT

Fixed
- Event and OperationComplete subscriptions to 'Device.' on a USP Broker
now set subscriptions on each USP Service containing only the DM
elements that were registered
- USP Conformance test 11.11 failure: MQTT PUBLISH frames should not be
sent until SUBACK frame indicates successfully subscribed
2024-12-09 12:54:35 +00:00
Richard Holme
56236d1615 2024-11-11: v9.0.3: New CLI command
Added
- New CLI command for interacting directly with USP Services, when
obuspa runs as a USP Broker:
`obuspa -c service [endpoint] [command] [path-expr] [optional: value or
notify type]`
2024-11-11 16:00:37 +00:00
Richard Holme
8bb8f64350 2024-10-29: v9.0.2: Bug fixes
Fixed
- OpenSSL deprecated functions should not be used
2024-10-29 17:09:53 +00:00
Richard Holme
6417f26692 2024-09-27: v9.0.1: Bug fixes
Fixed:
- UDS MTP should be accessible by USP Services running as non root
- 'obuspa -c' should not crash with long command arguments
2024-09-27 16:21:04 +01:00
Richard Holme
c254a1530c Making release 9.0.0 (Ibis) v9.0.0-master 2024-09-17 14:39:34 +01:00
Richard Holme
5f3358d864 2024-08-30: v8.0.9: ALPN support for MQTT
Added
- Application Layer Protocol Negotiation (ALPN) support for MQTT over
TLS
- Code maintenance improvements to MQTT MTP
2024-08-30 16:50:21 +01:00
Richard Holme
21f6a542e3 2024-08-19: v8.0.8: Dockerfile bug fixes
Fixed
- Dockerfile rewritten to use debian:stable and build libwebsockets [GH
2024-08-19 17:30:05 +01:00
Richard Holme
0fa8b0c162 2024-08-05: v8.0.7: Improved MQTT MTP debug
Added
- Improved MQTT MTP debug

Fixed
- USP Service acting as pure Controller does not accept responses unless
Broker is in the USP Service's Controller table
2024-08-05 14:00:06 +01:00
Richard Holme
389a9fdc34 2024-07-29: v8.0.6: MQTT bug fixes
Fixed
- Get requests with max_depth >= 0x80000000 should return full sub-tree
- USP Connect record not always sent immediately after connection on
MQTT

Removed
- Unmaintained MQTT tests
2024-07-29 09:49:47 +01:00
Richard Holme
c5554313d5 2024-07-08: v8.0.5: MQTT bug fixes
Fixed
- MQTT keep alive can now be completely disabled (if required) when
linking with libmosquitto v2.0.x
- OBUSPA should subscribe to all topics indicated by the subscribe-topic
user properties in the CONNACK [R-MQTT.15]
- OBUSPA should delete pending USP notifications (on MQTT MTP) if
notification has expired whilst waiting to be sent
- MQTT connection blocks for too long if server is unresponsive. To
workaround the underlying issue in libmosquitto, OBUSPA tests for server
responsiveness by transiently connecting, before proceeding with the
libmosquitto connect (if responsive).
- OBUSPA should disconnect if unable to subscribe to anything
[R-MQTT.17]
- Device.MQTT.Client.{i}.Name should be auto-assigned by the agent, if
not given at creation time, and immutable thereafter
- Device.MQTT.Client.{i}.RequestResponseInfo should control whether
response information is requested in the CONNECT frame. Previously it
was always requested, regardless of the value of the parameter
- Removed unimplemented parameter:
Device.MQTT.Client.{i}.RequestProblemInfo
- Modifying MQTT KeepAliveTime should not force a reconnect
- MQTTv5 Assigned Client Identifier is not being saved in
Device.MQTT.Client.{i}.ClientID
- MQTT ConnectRetryTime parameter modifications should apply at the next
retry [GH #109]
- MQTT CleanSession and CleanStart parameter modifications should apply
at the next retry
- STOMP ServerRetryMaxInterval parameter modifications should apply at
the next retry

Added
- Device.LocalAgent.X_VANTIVA-COM_PreConnectTimeout controls how long to
wait for the can_mtp_connect vendor hook to allow connection, before
connecting anyway
- USP_REGISTER_Object_UniqueKey() validates that the unique key
parameters have not already been registered
2024-07-08 12:13:03 +01:00
Richard Holme
77317d77fc 2024-06-10: v8.0.4: Bug fixes
Fixed
- Compiling without UDS fails [GH#110]
- WebSocket client does not send Boot! event (regression introduced in
v8.0)
- WebSocket client not started after MTP dynamically added to controller
table (regression introduced in v8.0)
2024-06-10 15:09:05 +01:00
Richard Holme
8355c200af 2024-05-13: v8.0.3: USP Broker feature additions
Added
- USP Broker: CLI initiated gets have been optimized to pass through the
path to the USP Service, when possible
- USP Broker: Support a USP Service registering Device.DNS.SD before
Device.DNS (in separate register messages)
- USP Broker: Workaround for USP Services which have limitations on the
number of parameters requested in a get
- USP Broker: Support additional DM elements registered directly under
Device.

Fixed
- Get instances failures during path resolution should be gracefully
ignored
- An unused variable warning seen during cmake based builds has been
addressed
2024-05-13 11:04:04 +01:00
Richard Holme
7a4d29b831 2024-04-29: v8.0.2: Bug fixes
Added
- VALUE_CHANGE_WILL_IGNORE flag support

Fixed
- Prevent accidental CLI socket stealing
2024-04-29 12:23:39 +01:00
Richard Holme
e276712269 2024-04-15: v8.0.1: Bug Fixes
Fixed
- USP Broker should not assume hierarchically ordered fields in GSDM and
get instances responses
- STOMP connects shouldn't block the data model thread
2024-04-15 09:39:25 +01:00
Richard Holme
7b29243133 Making release 8.0.0 (Heron) v8.0.0-master 2024-04-08 15:32:10 +01:00
Richard Holme
bccadb28bf 2024-01-08: v7.0.6: Bug Fixes
Fixed
- The default value for Device.LocalAgent.MTP.{i}.Protocol now takes
into account which MTPs are present
2024-01-08 17:49:02 +00:00
Richard Holme
f968aefef2 2023-11-15: v7.0.5: Bug fixes
Fixed
- WebSockets ping failure count is not reset after reconnect (GH#97)
2023-11-15 15:07:04 +00:00
Richard Holme
e8350c6892 2023-09-08: v7.0.4: New API functions
Added
- A new core vendor hook has been added (modify_firmware_updated_cb_t),
which allows the FirmwareUpdated argument of the Boot! event to be
modified from the default determined by OBUSPA.
- New function: USP_PROCESS_DoWork() performs work (via a callback) in
the context of the data model thread (GH#93). Example usage: Initiating
the setting of parameters from a non-data model thread.

Fixed
- E2E session context SessionId fields are printed incorrectly in logs
on 32-bit devices
2023-09-08 16:14:00 +01:00
Richard Holme
d18bdd6875 2023-05-09: v7.0.3: Bug fixes
Fixed
- Prevent a parent object's parameters being spread across more than one
resolved_path_result in the GetResponse, if it has many child object
instances
- Example mqtt factory reset database should not contain wildcard in
ResponseTopicConfigured (GH#78)
2023-05-09 09:14:02 +01:00
Richard Holme
d363c50a35 2023-03-13: v7.0.2: Bug fixes
Fixed
- USP Agent should attempt to restart all async operations, even if one
restart fails
- Object creation notifications should not be sent at start up, if the
object has a refresh instances vendor hook
- Instance cache should not expire during the phases of processing a USP
request
- libjson modified to replace non-UTF8 characters with the Unicode
replacement character (U+FFFD) instead of asserting

Added
- New function: USP_REGISTER_AsyncOperation_MaxConcurrency() to register
whether a USP command allows another invocation whilst running
2023-03-13 12:18:27 +00:00
Richard Holme
d52e4727ff 2023-02-02: CMake support
Added
- CMake support (GH#69)
- Development environment within Docker container

Modified
- Memory allocation wrapper functions refactored to avoid erroneous
warnings when compiling with -Wuse-after-free
2023-02-02 09:36:38 +00:00
Richard Holme
ec35b35bd4 Making release 7.0.0 (Goldeneye) v7.0.0-master 2023-01-06 10:18:37 +00:00
Richard Holme
912d2fefc2 2023-01-05: Bug fixes
Fixed
- Updated Dockerfile to use Ubuntu Kinetic which includes the required
versions of libmosquitto and libwebsockets
- If 'obuspa -c get' truncates the printing of a parameter value, this
is now indicated
- Added note that start transaction vendor hook must never return a
failure, as it is not possible for OBUSPA to handle the failure in all
cases
2023-01-05 16:24:59 +00:00
Richard Holme
dcb7ae7fff 2022-10-28: Bug fixes
Fixed
- OnBoardRequest notification should be retried, if corresponding
NotifyResponse not received
- Adding a Controller MTP object fails, if Protocol is not specified and
CoAP is disabled ('configure --disable-coap')
2022-10-28 17:10:25 +01:00
Richard Holme
6a6357a51c 2022-10-04: Bug fixes
Fixed
- GH#30: MQTT publish QoS cannot be configured (stuck at 0)
- GH#64: Crash if PeriodicNotifInterval is set to 0
- GH#55: Ubuntu 22 (latest) contains earlier version of libwebsockets
than Ubuntu 20
- Requirement for libwebsockets version >= 4.1.0 made explicit in
configure.ac
- GetResponse optimized for large numbers of object instances
- USP Record should be ignored if the protobuf cannot be unpacked
- Default value for RebootCause would be better as "FactoryReset"
- MQTT exponential backoff reconnect time was 1 second too long
- Alias should be registered as a unique key for LocalAgent.Certificate

Modified
- MQTT Content Type property changed to usp.msg (changed R-MQTT.27)
- A USP Set referencing zero instances returns an empty success (changed
TP-469 conformance test 1.23)
2022-10-04 09:39:23 +01:00
Richard Holme
21536f58f3 2022-09-02: Bug fixes for MQTT
Fixed
- For MQTTv3.x MTP, Agent should subscribe to wildcarded agent topic and
publish to topic containing '/reply-to='
- libmosquitto subscribe/unsubscribe functions were being called
unnecessarily (and failing)
- MQTT_DeleteSubscription() was being called unnecessarily (and failing)
- Memory leak when unescaping a received MQTT response topic
- MQTT subscription topic must be unique
- MQTT subscription topic must be non empty string
- When changing a subscription’s topic, The agent was unsubscribing from
the new topic (not the old topic)
- For MQTTv5 MTP, Agent should subscribe to topic from CONNACK, if
available
- Missing mutex protection in some MQTT functions
2022-09-02 18:01:42 +01:00
Richard Holme
02ac0b270b 2022-07-25: Bug fixes for MQTT and protobuf parsing error handling
Fixed
- When disabling the agent's MQTT client, the MQTT DISCONNECT frame is
not sent and socket stays open
- Errors in received USP packets should be handled according to
requirements in R-MTP.5
2022-07-25 10:09:09 +01:00
Richard Holme
45c68cc0a7 2022-07-11: Bug fixes for Agent's WebSocket server and GetSupportedDM
Fixed
- Agent's websocket server is not restarted after IP address change or
initial failure
- GetSupportedDM response should indicate that parameters registered
with USP_REGISTER_DBParam_SecureWithType() are readable
2022-07-11 09:31:36 +01:00
Richard Holme
a113b2fec3 Making release 6.0.0 (Falcon) v6.0.0-master 2022-06-28 10:09:22 +01:00
Richard Holme
e13b8eb48d 2022-06-13: Added USP 1.2 Connect and Disconnect record support
Added
- USP 1.2 Connect and Disconnect record support
- WebSockets example factory reset file

Fixed
- 64 bit signed and unsigned integer parameter values are now
represented with full precision in JSON encoded data (for Bulk Data
Collection reports and Boot! event). To enable the old behavior (which
represented them as floating point doubles) comment out the
REPRESENT_JSON_NUMBERS_WITH_FULL_PRECISION define in vendor_defs.h
- Bulk Data Collection Protocol parameter is validating against old
value, not new value
- Empty Subscription ID should not be allowed

Modified
- MQTT function header comments
2022-06-13 10:13:44 +01:00
Richard Holme
5c69b9a730 2022-05-20: USP 1.2 updates to Get and GetSupportedDM
Added
- Get request and response upgraded to USP 1.2 spec (max_depth field)
- GetSupportedDM response upgraded to USP 1.2 spec (value_type,
value_change and command_type fields)
- Added extra parameter types: DM_BASE_64, DM_DECIMAL, DM_LONG and
DM_HEX_BINARY
2022-05-20 14:51:55 +01:00
Richard Holme
f3b076224f 2022-04-29: Additions and bug fixes
Added
- Basic End-to-End session context support (mainly segmentation and
reassembly aspects). Disabled by default. To enable, uncomment
E2ESESSION_EXPERIMENTAL_USP_V_1_2 in vendor_defs.h
- Device.DeviceInfo.UpTime parameter

Fixed
- Compile error if MQTT and STOMP are disabled
- getopt_long options structure was wrong for authcert option
- Password in STOMP header should be escaped
- Set Message obj_path is not required to contain an instance number

Modified
- Removed GET_RESPONSE_SIMPLE_FORMAT from vendor_defs.h. In USP 1.2 it
was clarified that only the simple format must be used.
2022-05-04 18:13:32 +01:00