COVESA / COVESA/dlt-daemon

How to send a sync_log_storage request and wait for a response

Open
#608 2 comments 1 reaction 1 assignee Claimed by @minminlittleshrimp View on GitHub
question
Dominant language
C
Stars
459
Forks
340
Avg merge
4d 21h
Merged PRs (30d)
2

Description

Hi,

I've been trying to use the DLT control interface to request that the DLT daemon sync its logs (using `dlt_client_send_ctrl_msg()` with a `DltServiceOfflineLogstorage` payload), but I recently noticed that this function returns as soon as the request is sent, not when it receives confirmation that the logs have finished syncing.

Looking through DLT Daemon's source code, it seems that a message with a `DltServiceResponse` payload it sent.

How can I wait until it has been received?

libdlt's dlt_client.h has a `dlt_client_main_loop()`, which, when combined with `dlt_client_register_message_callback()` and `dlt_client_register_fetch_next_message_callback()` would give me access to any messages that get received, and gives me a way to terminate the loop.

Is this the best way to wait until a response is received, and is there a good way to make this time out if the DLT daemon stops responding?

Thanks,

Jonathan

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.