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 <felix.walter@d3tn.com>
This commit is contained in:
Felix Walter 2025-11-13 09:03:04 +01:00
parent b3fe52c66d
commit f684fabc5a
3 changed files with 4 additions and 3 deletions

View file

@ -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;
}

View file

@ -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)");

View file

@ -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;
};
/**