Upload
others
View
3
Download
0
Embed Size (px)
Citation preview
New Tizen Bluetooth Framework
Agenda• Tizen Bluetooth Stack Overview
• Why we need Bluetooth Framework?
• Current Bluetooth Framework Desgin
• New Tizen Bluetooth Framework
• New Tizen Bluetooth Framework PoC 0.1 release
Some Concepts
• OSP/Native Apps
• WRT(Web Run Time) Apps
• In House/(System) Apps
• CAPI
• Tizen Service
In House Bluetooth apps
Tizen Bluetooth Stack
CAPI
Bluetooth-service
Bluetoothd
Bluetooth-UG
Web Run Time
ObexdBluetooth Framework
Kernel
Tizen BT APIs
Plugin
Native Apps
The Role of Bluetooth Framework in Tizen
• Provides Simple, Uniform, Stable CAPI interface for Apps/UI
• Integrates BlueZ into Tizen elegantly and Handles Tizen specific Bluetooth operations
– Easy to maintain, extend
– High performance, low memory consumption
• Easily to port to different verticals/branch/Platform
Bluetooth Framework and BlueZ
• Integrate BlueZ into Tizen elegantly
• Focus on Tizen specific operation
• And by no means replacing and modify any logics of BlueZ
5
Current Bluetooth Framework Design
Bluetooth Subsystem
ObexD BluetoothD
Bluetooth Driver (UART)
User space
Kernelspace
Bluetooth UI Gadget
BluetoothShare
BluetoothCore
SystemPopup
Bluetooth Share UI
Bluetooth Service
PulseAudio
Multimedia Framework
Contact, Email,MessageFramework
Music App.
ALSADriver
INPUTMouse,
Keyboard,AVRCP
BlueZ Project
Application
DBUSUI Gadget
Framework
Daemon API/Callback
IPC
System popup
System Call/Events
Call App.
BluetoothPhonebook/MAP Agent
Bluetooth HFP Agent
EFL check logic(Call System popup or Send the
event to application)
Where We Can Improve (2-1)
• Over complicated, performance issue, maintaining issue
• Bluetooth-Service daemon should not wrap entire BlueZ and proxy all the BlueZ operations and events.• That makes Bluetooth-Service daemon over complicated
• And difficult to maintain and migrate to latest version of BlueZ
• Impact performance a lot
• Apps should access BlueZ directly in most situations
• Non-UI operations should be merged into Bluetooth-Service• To reduce memory consumption
• and improve performance
• Easy to maintain
• Difficult to migrate to new version of BlueZ
• Difficult to port to other Tizen verticals or branches
• Verticals/branches may have different apps/UI, vconf, configure …
Where We Can Improve (2-2)
• No unified interface for apps/UI
• Some apps call CAPI; while others access Bluetooth-service daemon
• Apps/UI are not easy to write and maintain
• Bluetooth-Service uses Dbus-glib, which has been replaced
by GDbus lib
• Please see Tizen Telephony core code
• Also see
• https://developer.gnome.org/gio/2.30/ch29.html
• http://www.freedesktop.org/wiki/Software/DBusBindings/
New Tizen Bluetooth Framework
Obexd Bluetoothd
Bluetooth UI Gadget
Paring/OPP server UI(SystemPopup)
Bluetooth Share UI
PulseAudio
Multimedia Framework
Music App.
BlueZ Project
Application
DBUSUI Gadget
Framework
Daemon API/Callback
System Call/Events
Call App.
PBAP/MAP Agent
HFP Agent
Vertical Plugin
(Vertical specific operation
Call System popup Send the event to
application)
BlueZ Lib
OPP Relay
Bluetooth CAPI
Manager(Bluetooth Core)
SPPParing Relay
…
Lib/API
Bluetooth Service Daemon
Bluetooth Framework
New Design Philosophy (2-1)
• Unified CAPI for Apps/UI
• All Tizen specific non-UI functions are merged in Bluetooth-
service daemon
• Apps/UI access BlueZ directly
• with help functions CAPI/BlueZ-lib
• Bluetooth-Service only proxy paring and OPP operations for
BlueZ
• BlueZ-lib facilitates BlueZ services access
• Hide the DBus operation detail
• Easily to migrate to new version of BlueZ
New Design Philosophy (2-2)
• Vertical plugin• Easy to port to other vertical/platform
• Bluetooth-Service is modulated• Easy to add new feature
• Module load/unload runtime
• A2DP(Pulse Audio) uses upstream solution• Pulse Audio accesses BlueZ directly and independent from
the Bluetooth Framework
• NAP/Panu• Using ConnMan based tethering over bluetooth• ConnMan accesses BlueZ dreictly and independnt from Bl
uetooth Framwork
New Design Saves >50% Memory
1,900
2,775
2,014
3,793
5,3905,070
0
1,000
2,000
3,000
4,000
5,000
6,000
Adapter On(KBytes) OPP Send File(KBytes) Paring(KBytes)
Bluetooth Framework New Generation
Bluetooth Framwork @ Tizen 2.x
New Design Memory Consumption BreakdownAdapter ONBluetooth-service 1,170kBluetoothd 730kSum 1,900k
OPP Send FileBluetooth-service 1,499kBluetoothd 754kObexd 522kSum 2,775k
OPP Receive FileBluetooth-service 1,582kBluetoothd 956kObexd 515kSum 3,053k
ParingBluetooth-service 1,262kBluetoothd 752kSum 2,014k
Old Design Memory Consumption BreakdownAdapter ONBt-service 760kBt-core 290kBluetooth-share 1614kBluetooth-hfp-agent 1129kBluetoothd 718kSum 3,793k
OPP Send FileBt-service 774kBt-core 289kBluetooth-share 1,848kBluetooth-hfp-agent 1,129kBluetoothd 884kObexd-client 466kSum 5,390k
ParingBt-service 763kBt-core 289kBluetooth-share 1,875kBluetooth-hfp-agent 1,120kBluetoothd 1023kSum 5,070k
Operation Simplified
CAPI/BlueZ-libUG/UI
CallBack()
BlueZ
DBus Request
DBus Response
api()
UG/UI BlueZ
DBus Request
DBus Responsesignal
Bluetooth-Service
DBus Request
DBus Response
Other-Service
DBus Request
DBus Response
Bluetooth Framework NG Bluetooth Framework
2 person month~60 patches
2 person weekTouch 2 files
Upgrading BlueZ more easily
Bluetooth Framework NG Bluetooth Framework
Upgrading to BlueZ 5.x
New Tizen Bluetooth Framework PoC 0.1 Release
• We have finished 0.1 PoC release
• This release includes:
– Software framework
• Enhanced CAPI
• Refined Bluetooth service Daemon
• Bluez lib
– basic Bluetooth Profiles
• Adapter functionality
• Device functionality
• Paring
• Data share(OPP client/server)
• SDP
• HID
– New Bluetooth-UG(UI Gadget)
– New Paring/OPP apps (system popup)
– Basing on latest upstream BlueZ(5.x)
• Q/A
Backup
Bluetooth Service: Manager Module (Bluetooth Core)
• Bluetooth Service: Manager module replaces Bluetooth Core
• Manager Main Function: void EnableBluetoothService()
Starts bluetooth service daemons like Bluetoothd and Obexd Power on the default adapter.
Loads the service objects of bluetooth-servcie. After property InService changes to ture,
bluetooth service will be ready for use.
• Bluetooth Service Daemon only loads manager module on system start
up. And all the other daemon including Bluetoothd Obexd will be started
through Dbus after apps/UI call EnableBluetoothService(), So Bluetooth
subsystem will not impact system boot up time. And almost consume no
resource when Bluetooth is not used
• “Bluetooth core” system() trigged “startup script” is abandoned
• Use built in driver, not to load/unload driver runtime
• Load/unload driver runtime is dangerous
Bluetooth Service Startup
CAPIUG/UI
Obexd/Bluetoothd
Bt_adpater_enable()
Bluetooth-Service
Manager
EnableBluetoothService()
Invoke BlueZ Services
Request Power On Adapter
Adapter On signal
Load Function Modules
General Operations: Access BlueZ Service Directly
CAPI/BlueZ-libUG/UI
CallBack()
Obexd/Bluetoothd
DBus Request
DBus Response
api()
Paring: PoPup/Paring UI-> Bluetooth Service -> Bluetoothd
CAPI Bluetoothd
bt_device_create_bound()ParingRelay
paring.pare()
UG
VerticalPlugin
Paring UI/Sys Popup
Paring agent Request
InvokeParing APP/UI
Bluetooth-Service
CAPI
Paring.RegisterRelayAgent()
Relay Paring agent Operation
Paring agent Response
ParingRelay
OPP Send File: UG->Bluetooth Service->Obexd
CAPI Obexd
bt_opp_client_push_file()
OPPRelayopp.send_file()
UG
VerticalPlugin
Notification
Transfer State
Notify transfer state
Bluetooth-Service
Bluetooth Share UI/Cancel Transfer
CAPI Obexd
OPPRelay
opp.CancelTransfer ()
BT-Share-UI
Transfer State
bt_opp_transfer_state_cb()
bt_opp_transfer_cancel()
Bluetooth-Service
OPP Server: Obexd->Bluetooth Service-> Syspop/OPP UI
Obexd
OPP Relay
VerticalPlugin
CAPI
Obex agentRequest Sending file
Invoke OPP_Service APP/UI(System Popup)
Bluetooth-Service
OPP/syspopup UI
Opp.RegisterOPPAgent()
OPP relay agent operation
OPPRelay
Obex agentResponse Sending file