diff options
Diffstat (limited to 'src/tests/sbus_codegen_tests_generated.c')
-rw-r--r-- | src/tests/sbus_codegen_tests_generated.c | 124 |
1 files changed, 122 insertions, 2 deletions
diff --git a/src/tests/sbus_codegen_tests_generated.c b/src/tests/sbus_codegen_tests_generated.c index ccf612996..b5ff08d9d 100644 --- a/src/tests/sbus_codegen_tests_generated.c +++ b/src/tests/sbus_codegen_tests_generated.c @@ -5,6 +5,15 @@ #include "sbus/sssd_dbus_meta.h" #include "sbus_codegen_tests_generated.h" +/* invokes a handler with a 'bu' DBus signature */ +static int invoke_bu_method(struct sbus_request *dbus_req, void *function_ptr); + +/* invokes a handler with a 's' DBus signature */ +static int invoke_s_method(struct sbus_request *dbus_req, void *function_ptr); + +/* invokes a handler with a 'u' DBus signature */ +static int invoke_u_method(struct sbus_request *dbus_req, void *function_ptr); + /* arguments for com.planetexpress.Ship.MoveUniverse */ const struct sbus_arg_meta com_planetexpress_Ship_MoveUniverse__in[] = { { "smoothly", "b" }, @@ -18,6 +27,25 @@ const struct sbus_arg_meta com_planetexpress_Ship_MoveUniverse__out[] = { { NULL, } }; +int com_planetexpress_Ship_MoveUniverse_finish(struct sbus_request *req, const char *arg_where_we_crashed) +{ + return sbus_request_return_and_finish(req, + DBUS_TYPE_STRING, &arg_where_we_crashed, + DBUS_TYPE_INVALID); +} + +/* arguments for com.planetexpress.Ship.Crash */ +const struct sbus_arg_meta com_planetexpress_Ship_crash_now__in[] = { + { "where", "s" }, + { NULL, } +}; + +int com_planetexpress_Ship_crash_now_finish(struct sbus_request *req) +{ + return sbus_request_return_and_finish(req, + DBUS_TYPE_INVALID); +} + /* methods for com.planetexpress.Ship */ const struct sbus_method_meta com_planetexpress_Ship__methods[] = { { @@ -25,12 +53,21 @@ const struct sbus_method_meta com_planetexpress_Ship__methods[] = { com_planetexpress_Ship_MoveUniverse__in, com_planetexpress_Ship_MoveUniverse__out, offsetof(struct com_planetexpress_Ship, MoveUniverse), + invoke_bu_method, }, { "Crash", /* name */ - NULL, /* no in_args */ + com_planetexpress_Ship_crash_now__in, NULL, /* no out_args */ offsetof(struct com_planetexpress_Ship, crash_now), + invoke_s_method, + }, + { + "Land", /* name */ + NULL, /* no in_args */ + NULL, /* no out_args */ + offsetof(struct com_planetexpress_Ship, Land), + NULL, /* no invoker */ }, { NULL, } }; @@ -68,6 +105,38 @@ const struct sbus_interface_meta com_planetexpress_Ship_meta = { com_planetexpress_Ship__properties }; +/* arguments for com.planetexpress.Pilot.Blink */ +const struct sbus_arg_meta test_pilot_Blink__in[] = { + { "duration", "u" }, + { NULL, } +}; + +/* arguments for com.planetexpress.Pilot.Blink */ +const struct sbus_arg_meta test_pilot_Blink__out[] = { + { "crashed", "b" }, + { NULL, } +}; + +int test_pilot_Blink_finish(struct sbus_request *req, bool arg_crashed) +{ + dbus_bool_t cast_crashed = arg_crashed; + return sbus_request_return_and_finish(req, + DBUS_TYPE_BOOLEAN, &cast_crashed, + DBUS_TYPE_INVALID); +} + +/* methods for com.planetexpress.Pilot */ +const struct sbus_method_meta test_pilot__methods[] = { + { + "Blink", /* name */ + test_pilot_Blink__in, + test_pilot_Blink__out, + offsetof(struct test_pilot, Blink), + invoke_u_method, + }, + { NULL, } +}; + /* property info for com.planetexpress.Pilot */ const struct sbus_property_meta test_pilot__properties[] = { { @@ -81,7 +150,58 @@ const struct sbus_property_meta test_pilot__properties[] = { /* interface info for com.planetexpress.Pilot */ const struct sbus_interface_meta test_pilot_meta = { "com.planetexpress.Pilot", /* name */ - NULL, /* no methods */ + test_pilot__methods, NULL, /* no signals */ test_pilot__properties }; + +/* invokes a handler with a 'bu' DBus signature */ +static int invoke_bu_method(struct sbus_request *dbus_req, void *function_ptr) +{ + dbus_bool_t arg_0; + uint32_t arg_1; + int (*handler)(struct sbus_request *, void *, bool, uint32_t) = function_ptr; + + if (!sbus_request_parse_or_finish(dbus_req, + DBUS_TYPE_BOOLEAN, &arg_0, + DBUS_TYPE_UINT32, &arg_1, + DBUS_TYPE_INVALID)) { + return EOK; /* request handled */ + } + + return (handler)(dbus_req, dbus_req->intf->instance_data, + arg_0, + arg_1); +} + +/* invokes a handler with a 's' DBus signature */ +static int invoke_s_method(struct sbus_request *dbus_req, void *function_ptr) +{ + const char * arg_0; + int (*handler)(struct sbus_request *, void *, const char *) = function_ptr; + + if (!sbus_request_parse_or_finish(dbus_req, + DBUS_TYPE_STRING, &arg_0, + DBUS_TYPE_INVALID)) { + return EOK; /* request handled */ + } + + return (handler)(dbus_req, dbus_req->intf->instance_data, + arg_0); +} + +/* invokes a handler with a 'u' DBus signature */ +static int invoke_u_method(struct sbus_request *dbus_req, void *function_ptr) +{ + uint32_t arg_0; + int (*handler)(struct sbus_request *, void *, uint32_t) = function_ptr; + + if (!sbus_request_parse_or_finish(dbus_req, + DBUS_TYPE_UINT32, &arg_0, + DBUS_TYPE_INVALID)) { + return EOK; /* request handled */ + } + + return (handler)(dbus_req, dbus_req->intf->instance_data, + arg_0); +} |