From f684fabc5a53a9e28799d8a00d3f40d4e6961376 Mon Sep 17 00:00:00 2001 From: Felix Walter Date: Thu, 13 Nov 2025 09:03:04 +0100 Subject: [PATCH] aap2_client: Make type of keepalive timeout consistent with AAP2 AAP2 uses uint32, so we do, too. This moves the check for a negative value to the UAPI backend implementation. Signed-off-by: Felix Walter --- components/aap2/aap2_client.c | 4 ++-- components/aap2/aap2_unified_api_backend.c | 1 + include/aap2/aap2_client.h | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/components/aap2/aap2_client.c b/components/aap2/aap2_client.c index 8d920a5..6c3c2a8 100644 --- a/components/aap2/aap2_client.c +++ b/components/aap2/aap2_client.c @@ -36,7 +36,7 @@ struct aap2_client { char *ud3tn_node_id; char *registered_eid; - int keepalive_timeout_s; + uint32_t keepalive_timeout_s; }; void aap2_client_close(struct aap2_client *client) @@ -207,7 +207,7 @@ enum aap2_client_error aap2_client_register(struct aap2_client *client, const char *secret = client_spec.secret; bool is_subscriber = client_spec.is_subscriber; - if (!eid || client_spec.keepalive_timeout_s < 0) { + if (!eid) { LOG_WARN("AAP2Client: Invalid argument to register function!"); return AAP2_CLIENT_EARGUMENT; } diff --git a/components/aap2/aap2_unified_api_backend.c b/components/aap2/aap2_unified_api_backend.c index 11cb97c..cd0e12d 100644 --- a/components/aap2/aap2_unified_api_backend.c +++ b/components/aap2/aap2_unified_api_backend.c @@ -173,6 +173,7 @@ ud3tn_error_t ud3tn_register(ud3tn_handle_t handle, ud3tn_reg_info_t *const reg_ { // Params check if (!handle->input_client || !handle->output_client || !reg_info || + reg_info->keepalive_seconds < 0 || aap2_client_is_configured(handle->input_client) || aap2_client_is_configured(handle->output_client)) { LOG_WARN("Invalid input param(s)"); diff --git a/include/aap2/aap2_client.h b/include/aap2/aap2_client.h index e1fe0ea..6f13aa6 100644 --- a/include/aap2/aap2_client.h +++ b/include/aap2/aap2_client.h @@ -107,7 +107,7 @@ struct aap2_client_spec { * Keepalive messages, but will require the caller to retry reception. * A value of 0 (default) means that the keepalive mechanism is turned off. */ - int keepalive_timeout_s; + uint32_t keepalive_timeout_s; }; /**