Commit d66af2ab authored by Andrew Jeffery's avatar Andrew Jeffery
Browse files

transport: dbus: Implement flush


Change-Id: If34f2f6cac002fae417d99baec8c08f675cdb974
Signed-off-by: Andrew Jeffery's avatarAndrew Jeffery <andrew@aj.id.au>
parent 40ef67be
......@@ -341,6 +341,32 @@ static int transport_dbus_mark_dirty(sd_bus_message *m, void *userdata,
return sd_bus_send(NULL, n, NULL);
}
static int transport_dbus_write_flush(sd_bus_message *m, void *userdata,
sd_bus_error *ret_error)
{
struct mbox_context *context = userdata;
sd_bus_message *n;
int rc;
if (!context) {
MSG_ERR("DBUS Internal Error\n");
return -EINVAL;
}
rc = context->protocol->flush(context, NULL /* No args in v2 */);
if (rc < 0) {
return rc;
}
rc = sd_bus_message_new_method_return(m, &n);
if (rc < 0) {
MSG_ERR("sd_bus_message_new_method_return failed: %d\n", rc);
return rc;
}
return sd_bus_send(NULL, n, NULL);
}
static int transport_dbus_ack(sd_bus_message *m, void *userdata,
sd_bus_error *ret_error)
{
......@@ -430,6 +456,8 @@ static const sd_bus_vtable protocol_v2_vtable[] = {
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD("MarkDirty", "qq", NULL, &transport_dbus_mark_dirty,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD("Flush", NULL, NULL, &transport_dbus_write_flush,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD("Ack", "y", NULL, &transport_dbus_ack,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_PROPERTY("FlashControlLost", "b", transport_dbus_get_property,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment