- Initialize structure main_opts, set its pagable and connectable, also set its default name;
- Parse the command line options;
- Check if single instance, otherwise exit;
- Create and bind HCI socket server;
- Load main.conf options;
- Call g_io_add_watch to add io channels;
- Get D-Bus system path;
- Register to the D-Bus system bus;
- Start SDP server;
- initialize SDP server;
Register the public browse group root;
Register SDP server’s service record;
Creating L2CAP socket server l2cap_sock;
Create local unix socket unix_sock; - Register device id;
- Add watch io_accept_event to l2cap_sock;
- Add watch io_accept_event to unix_sock;
- initialize SDP server;
- set_service_classes_callback(update_service_classes);
- Load plugins;
- Add watch io_stack_event to the handle of main_opts.sock;
- Initialze already connected services;
- Enter message loops{…};
- Unregister D-bus;
- Clean up plugins;
- Stop SDP server;
- Release other resources;
BlueZ源代码阅读:Bluetoothd启动分析
最新推荐文章于 2024-08-12 14:59:09 发布