feat: add cookie-related API to Message (#491)

Add `Message::getCookie()` and `MethodReply::getReplyCookie()` functions, based on underlying sd-bus cookie functions. They can be useful when pairing method call messages and method call reply messages.

---------

Co-authored-by: Dylan Howey <dylan.howey@evgo.com>
Co-authored-by: Stanislav Angelovič <stanislav.angelovic@protonmail.com>
This commit is contained in:
Dylan Howey
2025-05-05 08:04:20 +02:00
committed by GitHub
co-authored by Dylan Howey Stanislav Angelovič
parent 4389ea39bf
commit 6212b12159
6 changed files with 40 additions and 0 deletions
+10
View File
@@ -113,6 +113,16 @@ uint32_t TestProxy::doOperationWithTimeout(const std::chrono::microseconds &time
return result;
}
MethodReply TestProxy::doOperationOnBasicAPILevel(uint32_t param)
{
auto methodCall = getProxy().createMethodCall(test::INTERFACE_NAME, MethodName{"doOperation"});
methodCall << param;
m_methodCallMsg = std::make_unique<MethodCall>(methodCall);
return getProxy().callMethod(methodCall);
}
sdbus::PendingAsyncCall TestProxy::doOperationClientSideAsync(uint32_t param)
{
return getProxy().callMethodAsync("doOperation")