mkdir -p %{_libdir}/deviced
mv %{_libdir}/iot-headless-input-handler.so %{_libdir}/deviced/input-handler.so
mv %{_libdir}/iot-headless-battery.so %{_libdir}/deviced/battery.so
+mv %{_libdir}/iot-headless-display.so %{_libdir}/deviced/display.so
%files
%manifest %{name}.manifest
%config %{_sysconfdir}/deviced/power-profile-iot-headless.conf
%{_libdir}/iot-headless-input-handler.so
%{_libdir}/iot-headless-battery.so
+%{_libdir}/iot-headless-display.so
%{_unitdir}/rndis.service
%{_bindir}/rndis.sh
--- /dev/null
+CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
+PROJECT(iot-headless-display C)
+
+FILE(GLOB SRCS "*.c")
+
+INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/src)
+
+INCLUDE(FindPkgConfig)
+pkg_check_modules(libpkgs REQUIRED
+ libsyscommon)
+
+FOREACH(flag ${libpkgs_CFLAGS})
+ SET(EXTRA_LIB_CFLAGS "${EXTRA_LIB_CFLAGS} ${flag}")
+ENDFOREACH(flag)
+SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_LIB_CFLAGS}")
+
+ADD_LIBRARY(${PROJECT_NAME} SHARED ${SRCS})
+TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${libpkgs_LDFLAGS} deviced-common-private)
+SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES PREFIX "")
+SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES OUTPUT_NAME iot-headless-display)
+INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${LIB_INSTALL_DIR} COMPONENT RuntimeLibraries)
--- /dev/null
+/*
+ * deviced
+ *
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <shared/common.h>
+#include <shared/devices.h>
+#include <libsyscommon/libgdbus.h>
+
+static GVariant *dbus_lockstate(GDBusConnection *conn,
+ const gchar *sender, const gchar *path, const gchar *iface, const gchar *name,
+ GVariant *param, GDBusMethodInvocation *invocation, gpointer user_data)
+{
+ return g_variant_new("(i)", 0);
+}
+
+static GVariant *dbus_unlockstate(GDBusConnection *conn,
+ const gchar *sender, const gchar *path, const gchar *iface, const gchar *name,
+ GVariant *param, GDBusMethodInvocation *invocation, gpointer user_data)
+{
+ return g_variant_new("(i)", 0);
+}
+
+static const dbus_method_s dbus_methods[] = {
+ { "lockstate", "sssi", "i", dbus_lockstate },
+ { "unlockstate", "ss", "i", dbus_unlockstate },
+};
+
+static const dbus_interface_u dbus_interface = {
+ .oh = NULL,
+ .name = DEVICED_INTERFACE_DISPLAY,
+ .methods = dbus_methods,
+ .nr_methods = ARRAY_SIZE(dbus_methods),
+};
+
+static void display_init(void *data)
+{
+ gdbus_add_object(NULL, DEVICED_PATH_DISPLAY, &dbus_interface);
+}
+
+static const struct device_ops display_device_ops = {
+ .priority = DEVICE_PRIORITY_HIGH,
+ DECLARE_NAME_LEN("display"),
+ .init = display_init,
+};
+
+DEVICE_OPS_REGISTER(&display_device_ops)