/*
 *
 *  kylin - Bluetooth configure for Linux
 *
 *  Copyright (C) 2023-  Kylin Corporation
 *  Copyright (C) 2023-  Dengtuo Kylin <dengtuo@kylinos.cn>
 *
 *
 */
#include <stdio.h>

#include <unistd.h>
#include <stdint.h>
#include <stdlib.h>
#include <stdbool.h>

#include <sys/time.h>
#include <sys/types.h>
#include <sys/stat.h>

#include <glib.h>
#include <fcntl.h>
#include <string.h>
#include <dbus/dbus.h>
#include <dlfcn.h>

#include "gdbus/gdbus.h"
#include "dbus-common.h"

#define FILE_CPUINFO "/proc/cpuinfo"
#define KYLINCONFIGDIR "/etc/bluetooth"
#define CTRL_PLUGIN_SO_PATH "/usr/lib/bluetooth/libbluetooth_plugin.so"

#define DEVICE_IS_NOT_CONTROLLED  0 //设备未管控
#define DEVICE_IS_CONTROLLED      1 //设备已被管控

#ifndef CTRL_BLUETOOTH
#define CTRL_BLUETOOTH
#endif
//运行环境配置
extern bool is_huawei;

typedef struct {
    unsigned int (*bluetooth_dev_control)(unsigned int dev_type,const char * dev_addr);
} PluginInterface;

void btd_kylin_init(void);
void btd_kylin_cleanup(void);

bool systemEnvironmentinfo(void);
bool init_ctrl_plugin_so_file();
void close_ctrl_plugin_so_file();
unsigned int btd_kylin_dev_type(const char * dev_type_name);
unsigned int btd_kylin_dev_ctrl(const char * dev_type_name,const char * dev_addr);
