--- /dev/null
+/*
+ * Copyright (c) 2016-2017 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.
+ */
+
+#ifndef __PERIPHERAL_BUS_H__
+#define __PERIPHERAL_BUS_H__
+
+#include <gio/gio.h>
+
+#include "peripheral_io_gdbus.h"
+#include "peripheral_bus_board.h"
+
+typedef enum {
+ PERIPHERAL_BUS_TYPE_GPIO = 0,
+ PERIPHERAL_BUS_TYPE_I2C,
+ PERIPHERAL_BUS_TYPE_PWM,
+ PERIPHERAL_BUS_TYPE_UART,
+ PERIPHERAL_BUS_TYPE_SPI,
+} peripheral_bus_type_e;
+
+typedef struct {
+ pb_board_s *board;
+ /* devices */
+ GList *gpio_list;
+ GList *i2c_list;
+ GList *pwm_list;
+ GList *uart_list;
+ GList *spi_list;
+ /* gdbus variable */
+ guint reg_id;
+ GDBusConnection *connection;
+ PeripheralIoGdbusGpio *gpio_skeleton;
+ PeripheralIoGdbusI2c *i2c_skeleton;
+ PeripheralIoGdbusPwm *pwm_skeleton;
+ PeripheralIoGdbusUart *uart_skeleton;
+ PeripheralIoGdbusSpi *spi_skeleton;
+} peripheral_bus_s;
+
+typedef struct {
+ char *id;
+ pid_t pid;
+ pid_t pgid;
+} pb_client_info_s;
+
+typedef struct {
+ int pin;
+} peripheral_bus_gpio_s;
+
+typedef struct {
+ int bus;
+ int address;
+ int fd;
+} peripheral_bus_i2c_s;
+
+typedef struct {
+ int chip;
+ int pin;
+} peripheral_bus_pwm_s;
+
+typedef struct {
+ int port;
+ int fd;
+} peripheral_bus_uart_s;
+
+typedef struct {
+ int bus;
+ int cs;
+ int fd;
+} peripheral_bus_spi_s;
+
+typedef struct {
+ peripheral_bus_type_e type;
+ uint watch_id;
+ GList **list;
+ /* client info */
+ pb_client_info_s client_info;
+ union {
+ peripheral_bus_gpio_s gpio;
+ peripheral_bus_i2c_s i2c;
+ peripheral_bus_pwm_s pwm;
+ peripheral_bus_uart_s uart;
+ peripheral_bus_spi_s spi;
+ } dev;
+} peripheral_bus_data_s;
+
+typedef peripheral_bus_data_s *pb_data_h;
+
+#endif /* __PERIPHERAL_BUS_H__ */
#include <gio/gio.h>
-#include "peripheral_bus.h"
+#include "peripheral_handle.h"
+#include "peripheral_log.h"
pb_data_h peripheral_bus_data_new(GList **plist);
int peripheral_bus_data_free(pb_data_h handle);
+++ /dev/null
-/*
- * Copyright (c) 2016-2017 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.
- */
-
-#ifndef __PERIPHERAL_BUS_H__
-#define __PERIPHERAL_BUS_H__
-
-#include <gio/gio.h>
-
-#include "peripheral_io_gdbus.h"
-#include "peripheral_bus_board.h"
-
-typedef enum {
- PERIPHERAL_BUS_TYPE_GPIO = 0,
- PERIPHERAL_BUS_TYPE_I2C,
- PERIPHERAL_BUS_TYPE_PWM,
- PERIPHERAL_BUS_TYPE_UART,
- PERIPHERAL_BUS_TYPE_SPI,
-} peripheral_bus_type_e;
-
-typedef struct {
- pb_board_s *board;
- /* devices */
- GList *gpio_list;
- GList *i2c_list;
- GList *pwm_list;
- GList *uart_list;
- GList *spi_list;
- /* gdbus variable */
- guint reg_id;
- GDBusConnection *connection;
- PeripheralIoGdbusGpio *gpio_skeleton;
- PeripheralIoGdbusI2c *i2c_skeleton;
- PeripheralIoGdbusPwm *pwm_skeleton;
- PeripheralIoGdbusUart *uart_skeleton;
- PeripheralIoGdbusSpi *spi_skeleton;
-} peripheral_bus_s;
-
-typedef struct {
- char *id;
- pid_t pid;
- pid_t pgid;
-} pb_client_info_s;
-
-typedef struct {
- int pin;
-} peripheral_bus_gpio_s;
-
-typedef struct {
- int bus;
- int address;
- int fd;
-} peripheral_bus_i2c_s;
-
-typedef struct {
- int chip;
- int pin;
-} peripheral_bus_pwm_s;
-
-typedef struct {
- int port;
- int fd;
-} peripheral_bus_uart_s;
-
-typedef struct {
- int bus;
- int cs;
- int fd;
-} peripheral_bus_spi_s;
-
-typedef struct {
- peripheral_bus_type_e type;
- uint watch_id;
- GList **list;
- /* client info */
- pb_client_info_s client_info;
- union {
- peripheral_bus_gpio_s gpio;
- peripheral_bus_i2c_s i2c;
- peripheral_bus_pwm_s pwm;
- peripheral_bus_uart_s uart;
- peripheral_bus_spi_s spi;
- } dev;
-} peripheral_bus_data_s;
-
-typedef peripheral_bus_data_s *pb_data_h;
-
-#endif /* __PERIPHERAL_BUS_H__ */
#include <gio/gunixfdlist.h>
#include "peripheral_io_gdbus.h"
-#include "peripheral_bus.h"
+#include "peripheral_handle.h"
#include "peripheral_handle_gpio.h"
#include "peripheral_log.h"
#include "peripheral_gdbus_gpio.h"
#include <peripheral_io.h>
#include "peripheral_io_gdbus.h"
-#include "peripheral_bus.h"
+#include "peripheral_handle.h"
#include "peripheral_handle_i2c.h"
#include "peripheral_log.h"
#include "peripheral_gdbus_i2c.h"
#include <peripheral_io.h>
#include "peripheral_io_gdbus.h"
-#include "peripheral_bus.h"
+#include "peripheral_handle.h"
#include "peripheral_handle_pwm.h"
#include "peripheral_log.h"
#include "peripheral_gdbus_pwm.h"
#include <peripheral_io.h>
#include "peripheral_io_gdbus.h"
-#include "peripheral_bus.h"
+#include "peripheral_handle.h"
#include "peripheral_handle_spi.h"
#include "peripheral_log.h"
#include "peripheral_gdbus_spi.h"
#include <peripheral_io.h>
#include "peripheral_io_gdbus.h"
-#include "peripheral_bus.h"
+#include "peripheral_handle.h"
#include "peripheral_handle_uart.h"
#include "peripheral_log.h"
#include "peripheral_gdbus_uart.h"
#include <stdlib.h>
#include "peripheral_handle_common.h"
-#include "peripheral_log.h"
pb_data_h peripheral_bus_data_new(GList **plist)
{
#include <peripheral_io.h>
#include "peripheral_interface_gpio.h"
-#include "peripheral_bus.h"
-#include "peripheral_log.h"
#include "peripheral_handle_common.h"
static bool peripheral_bus_gpio_is_available(int pin, peripheral_bus_s *pb_data)
#include <peripheral_io.h>
#include "peripheral_interface_i2c.h"
-#include "peripheral_bus.h"
-#include "peripheral_log.h"
#include "peripheral_handle_common.h"
#define INITIAL_BUFFER_SIZE 128
#include <peripheral_io.h>
#include "peripheral_interface_pwm.h"
-#include "peripheral_bus.h"
-#include "peripheral_log.h"
#include "peripheral_handle_common.h"
static bool peripheral_bus_pwm_is_available(int chip, int pin, peripheral_bus_s *pb_data)
#include <peripheral_io.h>
#include "peripheral_interface_spi.h"
-#include "peripheral_bus.h"
-#include "peripheral_log.h"
#include "peripheral_handle_common.h"
static bool __peripheral_bus_spi_is_available(int bus, int cs, peripheral_bus_s *pb_data)
#include <peripheral_io.h>
#include "peripheral_interface_uart.h"
-#include "peripheral_io_gdbus.h"
-#include "peripheral_bus.h"
-#include "peripheral_log.h"
#include "peripheral_handle_common.h"
#define INITIAL_BUFFER_SIZE 128
#include <peripheral_io.h>
#include "peripheral_io_gdbus.h"
-#include "peripheral_bus.h"
+#include "peripheral_handle.h"
#include "peripheral_log.h"
#include "peripheral_gdbus_gpio.h"
#include "peripheral_gdbus_i2c.h"