bluez plugins
来源:互联网 发布:童装淘宝店铺简介 编辑:程序博客网 时间:2024/06/07 22:19
When Bluetoothd initializing, it will load plugins in /usr/lib/bluetooth/plugins by default. Actually, most of bluetooth profiles are implemented as plugins in BlueZ.
In plugin.h, it defines:
struct bluetooth_plugin_desc {
const char *name;
int (*init) (void);
void (*exit) (void);
};#define BLUETOOTH_PLUGIN_DEFINE(name,init,exit) \
struct bluetooth_plugin_desc bluetooth_plugin_desc = { \
name, init, exit \
};
It means that if you want to implement a plugin, just try to implement to callback functions: init and exit. All other communctions should be communicated with socket or IO channel.
Search macro BLUETOOTH_PLUGIN_DEFINE, you will find:
- BLUETOOTH_PLUGIN_DEFINE(“audio”, audio_init, audio_exit)
- BLUETOOTH_PLUGIN_DEFINE(“input”, input_init, input_exit)
- BLUETOOTH_PLUGIN_DEFINE(“network”, network_init, network_exit)
- BLUETOOTH_PLUGIN_DEFINE(“echo”, echo_init, echo_exit)
- BLUETOOTH_PLUGIN_DEFINE(“storage”, storage_init, storage_exit) //no implementation actually
- BLUETOOTH_PLUGIN_DEFINE(“serial”, serial_init, serial_exit)
Implement on serial plugin
- Connect to dbus system bus;
- btd_register_adapter_driver(&serial_proxy_driver);
- btd_register_device_driver(&serial_port_driver);
- communicate others with socket and dbus;
Implement on echo
- Communicate RFCOMM with socket;
- Use IO channel for internal event;
Implement on audio
- Connect to Dbus system bus;
- Load audio.conf;
- According to settings, start headset, audio gateway, sink, source, control service;
- Register device drivers;
Implement on input
It is similar with audio.
- bluez plugins
- Bluez
- plugins
- Plugins
- BlueZ介绍:
- android bluez
- 编译BlueZ
- android bluez
- bluez & profiles
- BlueZ移植
- BlueZ介绍
- 安装bluez
- bluez architecture
- BlueZ介绍
- 蓝牙 Bluez
- Bluez D-Bus Architecture
- Moblin 内核 -- BLUEZ集成
- YC2440-F移植blueZ
- LA4670 AC自动机模版题
- Running your own CloudFoundry based on your IaaS. Part 2
- 程序员的十层楼,看看你在哪一层
- HtmlUnit实现ajax网络爬虫
- 由一个论坛帖子, 解决udp 服务器无法返回数据给第一个客户端的问题
- bluez plugins
- asd
- 强大的sublim-text2/3 注册方法 (for Windows x64)
- 和为指定值的连续序列
- js常用函数
- PCI 总线 协议 基础 详解
- JavaScript实用功能代码片段整理二
- Android基于Cling开发DLNA应用
- ubuntu 开机黑屏 (设置android编译环境时导致该问题)