dlt-daemon
dlt-daemon copied to clipboard
How to send a sync_log_storage request and wait for a response
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
Let me check in my local, sorry for late response!
Hi, have you had a chance to look at this?