4 * Copyright (c) 2015 Samsung Electronics Co., Ltd.
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
24 #include "dbus_util.h"
27 #define WRISTUP_CONF_SIGNAL "conf"
29 class injector_wristup_conf : public injector {
31 injector_wristup_conf(sensor_type_t sensor_type, const char *event_name);
32 virtual ~injector_wristup_conf() {}
34 bool inject(int argc, char *argv[]);
37 injector_wristup_conf::injector_wristup_conf(sensor_type_t sensor_type, const char *event_name)
38 : injector(sensor_type, event_name)
42 bool injector_wristup_conf::inject(int argc, char *argv[])
46 RETVM_IF(argc <= INJECTOR_ARGC, false, "Invalid argument\n");
48 variant = make_variant_int(argc - INJECTOR_ARGC, &argv[INJECTOR_ARGC]);
49 RETVM_IF(!variant, false, "Cannot make variant\n");
51 dbus_emit_signal(NULL,
52 (gchar *)SENSORD_OBJ_PATH,
53 (gchar *)SENSORD_INTERFACE_NAME,
54 (gchar *)WRISTUP_CONF_SIGNAL,
58 _I("Set up options to wristup:");
59 for (int i = 0; i < argc - INJECTOR_ARGC; ++i)
60 _I("option %d: %s\n", i, argv[i]);
65 REGISTER_INJECTOR(GESTURE_WRIST_UP_SENSOR, WRISTUP_CONF_SIGNAL, injector_wristup_conf)