SlideShare a Scribd company logo
Android Bluetooth Introduction




               Erin Yueh
              2009/06/26




                   
Agenda
    ●   Android Bluetooth architecture
    ●   Related source code
    ●   Init Bluetooth 
    ●   Connect with other BT devices (dbus)
    ●   RFCOMM
    ●   OBEX (socket)


                               
Android architecture




                   
The diagram above offers a library-oriented
 
           view of the Bluetooth stack.
                          
     
Related source code
    ●   Bluez 3.36 (user space and kernel)
        ­ /mydroid/externel/bluez
        ­ /mydroid/kernel/drivers/bluetooth
        ­ /mydroid/kernel/net/bluetooth
    ●   Android app framework (java & c++)
        ­ /mydroid/frameworks/base/core/jni/android_bluetooth_*.cpp 
        ­ /mydroid/frameworks/base/core/java/android/bluetooth/*.java
        ­ /mydroid/frameworks/base/services/java/com/android/server/ (SystemServer)
    ●   Android UI application 
        ­ /mydroid/packages/apps/Phone/src/com/android/phone/ (Phone App)
        ­ /mydroid/packages/apps/Settings/src/com/android/settings/bluetooth/ (Settings App)

                                                  
Init Bluetooth 
    ●   /root/init.rc 

        mkdir /data/misc/hcid (store device info)
        service dbus /system/bin/dbus­daemon
        service hcid /system/bin/hcid (disabled)
        service hfag /system/bin/sdptool add ­­channel=10 HFAG (handsfree, disabled, one shot)
        service hsag /system/bin/sdptool add ­­channel=11 HSAG (headset, disabled, one shot)
    ●   /root/init.trout.rc

        service hciattach (disabled) 
    ●   system server

        decice BT power On or Off from settings value
        start related services




                                                      
ddms: dalvik debug monitor I.




                  
ddms: dalvik debug monitor II.




                   
Bluetooth headset




    Music player + Dialer 
                              
Connect with other BT devices




●
    Bluez: hcid daemon

●
    dbus-daemon: connections between hcid and system server

●
    D-Bus is a simple inter-process communication (IPC) system for software applications to communicate with one another.

●
    dbus-daemon is the D-Bus message bus daemon. D-Bus is first a library that provides one-to-one communication between
    any two applications; dbus-daemon is an application that uses this library to implement a message bus daemon. Multiple
    programs connect to the message bus daemon and can exchange messages with one another.

●
    debug utility: d-feet, dbus-monitor, dbus-send



                                                                  
BlueZ D­Bus Architecture 




                  
D­Feet: D­Bus viewer and debugger




                     
Dbus­send: send a message to a message 
bus




                    
Scan nearby BT devices in Android
    ●   Bluez utility: hcitool scan
    ●   DiscoverDevices: bluez/util/hcid/dbus­api.txt
        This method starts the device discovery procedure. This includes an inquiry 
        procedure and remote device name resolving. On start up this process will 
        generate a DiscoveryStarted signal and then return DeviceFound singals. If the 
        procedure has been finished an DiscoveryCompleted signal will be sent.
    ●   Source code: android_server_BluetoothDeviceService.cpp
        /* Compose the command */
        msg = dbus_message_new_method_call(BLUEZ_DBUS_BASE_IFC, nat­>adapter, 
        DBUS_CLASS_NAME, "DiscoverDevices");
        /* Send the command. */
        reply = dbus_connection_send_with_reply_and_block(nat­>conn, msg, ­1, &err);



                                                  
Signals




           
How to pair with a BT device? I. Register 
Passkey Agent




                       
II. Request PIN code




                        
RFCOMM (Radio Frequency 
Communication)
●
    The Bluetooth protocol RFCOMM is a simple set of 
    transport protocols.
●
    RFCOMM is sometimes called Serial Port Emulation. 
●
    The Bluetooth Serial Port Profile is based on this protocol.
●
    In the protocol stack, RFCOMM is bound to L2CAP
●
    RFCOMM provides a simple reliable data stream to the 
    user, similar to TCP. It is used directly by many telephony 
    related profiles as a carrier for AT commands




                                                                    
Send AT commands via bluetooth
    ●   Connect with Nokia N73 phone
    ●   > sdptool browse 00:18:C5:42:18:78
    ●   > sudo rfcomm connect 0 00:18:C5:42:18:78 2
    ●   minicom
    ●   > AT
    ●   > AT+CGMR
    ●   > AT+CGMI
                              
OBEX (Object EXchange)
    ●   a communications 
        protocol that 
        facilitates the 
        exchange of binary 
        objects between 
        devices.
    ●   in the protocol stack, 
        OBEX is bound to 
        RFCOMM
                                   
SOCKET 
    ●   UNIX socket 
        (AF_BLUETOOTH)
    ●   inter­process 
        communication 
    ●   like Internet socket
                                   recv()   send()
    ●   client­server



                                
Receive files via BT in Android
    ●   openobex + obexpushd  
    ●   Run an OBEX data server in Android
    ●   > obexpushd
    ●   listen RFCOMM connections
    ●   File permission




                             
Send files via BT in Android
    ●   Openobex + obexftp
    ●   Connect to a RFCOMM connection
    ●   > obex_test ­b BTADDR CHANNEL
    ●   > obexftp ­b BTADDR ­B CHANNEL ­­list




                              
Thank You!




         

More Related Content

What's hot

Embedded Android : System Development - Part IV (Android System Services)
Embedded Android : System Development - Part IV (Android System Services)Embedded Android : System Development - Part IV (Android System Services)
Embedded Android : System Development - Part IV (Android System Services)
Emertxe Information Technologies Pvt Ltd
 
Day: 1 Introduction to Mobile Application Development (in Android)
Day: 1 Introduction to Mobile Application Development (in Android)Day: 1 Introduction to Mobile Application Development (in Android)
Day: 1 Introduction to Mobile Application Development (in Android)Ahsanul Karim
 
MIPI DevCon Seoul 2018: Dual Mode C-PHY/D-PHY Use in VR Display IC
MIPI DevCon Seoul 2018: Dual Mode C-PHY/D-PHY Use in VR Display IC MIPI DevCon Seoul 2018: Dual Mode C-PHY/D-PHY Use in VR Display IC
MIPI DevCon Seoul 2018: Dual Mode C-PHY/D-PHY Use in VR Display IC
MIPI Alliance
 
Flutter Online Study jam 10-7-2019
Flutter Online Study jam 10-7-2019Flutter Online Study jam 10-7-2019
Flutter Online Study jam 10-7-2019
Ahmed Abu Eldahab
 
Accessing Hardware on Android
Accessing Hardware on AndroidAccessing Hardware on Android
Accessing Hardware on Android
Gary Bisson
 
Android media framework overview
Android media framework overviewAndroid media framework overview
Android media framework overview
Jerrin George
 
From Android NDK To AOSP
From Android NDK To AOSPFrom Android NDK To AOSP
From Android NDK To AOSP
Min-Yih Hsu
 
Native Android Userspace part of the Embedded Android Workshop at Linaro Conn...
Native Android Userspace part of the Embedded Android Workshop at Linaro Conn...Native Android Userspace part of the Embedded Android Workshop at Linaro Conn...
Native Android Userspace part of the Embedded Android Workshop at Linaro Conn...Opersys inc.
 
Embedded Android : System Development - Part IV
Embedded Android : System Development - Part IVEmbedded Android : System Development - Part IV
Embedded Android : System Development - Part IV
Emertxe Information Technologies Pvt Ltd
 
Android studio ppt
Android studio pptAndroid studio ppt
Android studio ppt
Swapanpreet Kaur
 
Q4.11: Porting Android to new Platforms
Q4.11: Porting Android to new PlatformsQ4.11: Porting Android to new Platforms
Q4.11: Porting Android to new Platforms
Linaro
 
Introduction of android treble
Introduction of android trebleIntroduction of android treble
Introduction of android treble
Bin Yang
 
The Android graphics path, in depth
The Android graphics path, in depthThe Android graphics path, in depth
The Android graphics path, in depth
Chris Simmonds
 
Android seminar ppt
Android seminar pptAndroid seminar ppt
Android seminar ppt
chakrapani tripathi
 
Embedded Android Workshop
Embedded Android WorkshopEmbedded Android Workshop
Embedded Android Workshop
Opersys inc.
 
Android+init+process
Android+init+processAndroid+init+process
Android+init+processHong Jae Kwon
 
ppt based on android technology with great animations
ppt based on android technology with great animationsppt based on android technology with great animations
ppt based on android technology with great animations
Hriday Garg
 

What's hot (20)

Embedded Android : System Development - Part IV (Android System Services)
Embedded Android : System Development - Part IV (Android System Services)Embedded Android : System Development - Part IV (Android System Services)
Embedded Android : System Development - Part IV (Android System Services)
 
Day: 1 Introduction to Mobile Application Development (in Android)
Day: 1 Introduction to Mobile Application Development (in Android)Day: 1 Introduction to Mobile Application Development (in Android)
Day: 1 Introduction to Mobile Application Development (in Android)
 
Android presentation
Android presentationAndroid presentation
Android presentation
 
MIPI DevCon Seoul 2018: Dual Mode C-PHY/D-PHY Use in VR Display IC
MIPI DevCon Seoul 2018: Dual Mode C-PHY/D-PHY Use in VR Display IC MIPI DevCon Seoul 2018: Dual Mode C-PHY/D-PHY Use in VR Display IC
MIPI DevCon Seoul 2018: Dual Mode C-PHY/D-PHY Use in VR Display IC
 
Tizen
TizenTizen
Tizen
 
Flutter Online Study jam 10-7-2019
Flutter Online Study jam 10-7-2019Flutter Online Study jam 10-7-2019
Flutter Online Study jam 10-7-2019
 
Accessing Hardware on Android
Accessing Hardware on AndroidAccessing Hardware on Android
Accessing Hardware on Android
 
Android media framework overview
Android media framework overviewAndroid media framework overview
Android media framework overview
 
From Android NDK To AOSP
From Android NDK To AOSPFrom Android NDK To AOSP
From Android NDK To AOSP
 
Native Android Userspace part of the Embedded Android Workshop at Linaro Conn...
Native Android Userspace part of the Embedded Android Workshop at Linaro Conn...Native Android Userspace part of the Embedded Android Workshop at Linaro Conn...
Native Android Userspace part of the Embedded Android Workshop at Linaro Conn...
 
Embedded Android : System Development - Part IV
Embedded Android : System Development - Part IVEmbedded Android : System Development - Part IV
Embedded Android : System Development - Part IV
 
Android studio ppt
Android studio pptAndroid studio ppt
Android studio ppt
 
Q4.11: Porting Android to new Platforms
Q4.11: Porting Android to new PlatformsQ4.11: Porting Android to new Platforms
Q4.11: Porting Android to new Platforms
 
Introduction of android treble
Introduction of android trebleIntroduction of android treble
Introduction of android treble
 
The Android graphics path, in depth
The Android graphics path, in depthThe Android graphics path, in depth
The Android graphics path, in depth
 
Android seminar ppt
Android seminar pptAndroid seminar ppt
Android seminar ppt
 
Embedded Android Workshop
Embedded Android WorkshopEmbedded Android Workshop
Embedded Android Workshop
 
Android+init+process
Android+init+processAndroid+init+process
Android+init+process
 
5 pen technology ppt
5 pen technology ppt5 pen technology ppt
5 pen technology ppt
 
ppt based on android technology with great animations
ppt based on android technology with great animationsppt based on android technology with great animations
ppt based on android technology with great animations
 

Viewers also liked

Android bluetooth
Android bluetoothAndroid bluetooth
Android bluetooth
Masahiro Hidaka
 
Bluetooth Chat
Bluetooth ChatBluetooth Chat
Bluetooth Chat
Panchhi Sahu
 
Bluetooth based-chatting-system-using-android-docx
Bluetooth based-chatting-system-using-android-docxBluetooth based-chatting-system-using-android-docx
Bluetooth based-chatting-system-using-android-docx
shanofa sanu
 
Android workShop
Android workShopAndroid workShop
Android workShop
Srinivas Devarapalli
 
My presentation on Android in my college
My presentation on Android in my collegeMy presentation on Android in my college
My presentation on Android in my college
Sneha Lata
 
A project report on chat application
A project report on chat applicationA project report on chat application
A project report on chat applicationKumar Gaurav
 
Android seminar-presentation
Android seminar-presentationAndroid seminar-presentation
Android seminar-presentationconnectshilpa
 
Android ppt
Android pptAndroid ppt
Android ppt
Ansh Singh
 
Bluetooth android application For interfacing with arduino
Bluetooth android application For interfacing with arduinoBluetooth android application For interfacing with arduino
Bluetooth android application For interfacing with arduino
sumit chakraborty
 
Connect your Android to the real world with Bluetooth Low Energy
Connect your Android to the real world with Bluetooth Low EnergyConnect your Android to the real world with Bluetooth Low Energy
Connect your Android to the real world with Bluetooth Low Energy
Gabor Paller
 
Power Management from Linux Kernel to Android
Power Management from Linux Kernel to AndroidPower Management from Linux Kernel to Android
Power Management from Linux Kernel to Android
National Cheng Kung University
 
Bluetooth
BluetoothBluetooth
Bluetooth
Kashyap Shah
 
project
projectproject
project
dnraj
 
Design and Concepts of Android Graphics
Design and Concepts of Android GraphicsDesign and Concepts of Android Graphics
Design and Concepts of Android Graphics
National Cheng Kung University
 
Software Design patterns on Android English
Software Design patterns on Android EnglishSoftware Design patterns on Android English
Software Design patterns on Android English
Pedro Vicente Gómez Sánchez
 
Android vs Others Operating System
Android vs Others Operating SystemAndroid vs Others Operating System
Android vs Others Operating System
Shemul Hossain
 
Android Development: The Basics
Android Development: The BasicsAndroid Development: The Basics
Android Development: The Basics
Mike Desjardins
 
PPT Companion to Android
PPT Companion to AndroidPPT Companion to Android
PPT Companion to Android
Dharani Kumar Madduri
 
Bluetooth technology presentation
Bluetooth technology presentationBluetooth technology presentation
Bluetooth technology presentation
Krishna Kumari
 

Viewers also liked (20)

Android bluetooth
Android bluetoothAndroid bluetooth
Android bluetooth
 
Bluetooth Chat
Bluetooth ChatBluetooth Chat
Bluetooth Chat
 
Android ppt
Android ppt Android ppt
Android ppt
 
Bluetooth based-chatting-system-using-android-docx
Bluetooth based-chatting-system-using-android-docxBluetooth based-chatting-system-using-android-docx
Bluetooth based-chatting-system-using-android-docx
 
Android workShop
Android workShopAndroid workShop
Android workShop
 
My presentation on Android in my college
My presentation on Android in my collegeMy presentation on Android in my college
My presentation on Android in my college
 
A project report on chat application
A project report on chat applicationA project report on chat application
A project report on chat application
 
Android seminar-presentation
Android seminar-presentationAndroid seminar-presentation
Android seminar-presentation
 
Android ppt
Android pptAndroid ppt
Android ppt
 
Bluetooth android application For interfacing with arduino
Bluetooth android application For interfacing with arduinoBluetooth android application For interfacing with arduino
Bluetooth android application For interfacing with arduino
 
Connect your Android to the real world with Bluetooth Low Energy
Connect your Android to the real world with Bluetooth Low EnergyConnect your Android to the real world with Bluetooth Low Energy
Connect your Android to the real world with Bluetooth Low Energy
 
Power Management from Linux Kernel to Android
Power Management from Linux Kernel to AndroidPower Management from Linux Kernel to Android
Power Management from Linux Kernel to Android
 
Bluetooth
BluetoothBluetooth
Bluetooth
 
project
projectproject
project
 
Design and Concepts of Android Graphics
Design and Concepts of Android GraphicsDesign and Concepts of Android Graphics
Design and Concepts of Android Graphics
 
Software Design patterns on Android English
Software Design patterns on Android EnglishSoftware Design patterns on Android English
Software Design patterns on Android English
 
Android vs Others Operating System
Android vs Others Operating SystemAndroid vs Others Operating System
Android vs Others Operating System
 
Android Development: The Basics
Android Development: The BasicsAndroid Development: The Basics
Android Development: The Basics
 
PPT Companion to Android
PPT Companion to AndroidPPT Companion to Android
PPT Companion to Android
 
Bluetooth technology presentation
Bluetooth technology presentationBluetooth technology presentation
Bluetooth technology presentation
 

Similar to Android Bluetooth Introduction

Tutorial mikrotik step by step
Tutorial mikrotik step by stepTutorial mikrotik step by step
Tutorial mikrotik step by step
Dewa Ketut Setiawan
 
Android debug bridge
Android debug bridgeAndroid debug bridge
Android debug bridge
Wave Digitech
 
Controlpcviabluetoothenablemobile 091028150632-phpapp01
Controlpcviabluetoothenablemobile 091028150632-phpapp01Controlpcviabluetoothenablemobile 091028150632-phpapp01
Controlpcviabluetoothenablemobile 091028150632-phpapp01nagapriyanka
 
Control Pc Via Bluetooth Enable Mobile
Control Pc Via Bluetooth Enable MobileControl Pc Via Bluetooth Enable Mobile
Control Pc Via Bluetooth Enable MobileSamiul Hoque
 
Controlpcviabluetoothenablemobile 091028150632-phpapp01
Controlpcviabluetoothenablemobile 091028150632-phpapp01Controlpcviabluetoothenablemobile 091028150632-phpapp01
Controlpcviabluetoothenablemobile 091028150632-phpapp01ramaswamireddy challa
 
Manish Chasta - Securing Android Applications
Manish Chasta - Securing Android ApplicationsManish Chasta - Securing Android Applications
Manish Chasta - Securing Android ApplicationsPositive Hack Days
 
Lab Handson: Power your Creations with Intel Edison!
Lab Handson: Power your Creations with Intel Edison!Lab Handson: Power your Creations with Intel Edison!
Lab Handson: Power your Creations with Intel Edison!
Codemotion
 
DevFest 2022 - Cloud Workstation Introduction TaiChung
DevFest 2022 - Cloud Workstation Introduction TaiChungDevFest 2022 - Cloud Workstation Introduction TaiChung
DevFest 2022 - Cloud Workstation Introduction TaiChung
KAI CHU CHUNG
 
Embedded Android
Embedded AndroidEmbedded Android
Embedded Android
晓东 杜
 
IBCAST 2021: Observations and lessons learned from the APNIC Community Honeyn...
IBCAST 2021: Observations and lessons learned from the APNIC Community Honeyn...IBCAST 2021: Observations and lessons learned from the APNIC Community Honeyn...
IBCAST 2021: Observations and lessons learned from the APNIC Community Honeyn...
APNIC
 
An Introduction To Android
An Introduction To AndroidAn Introduction To Android
An Introduction To Android
natdefreitas
 
Interacting with your app through the command line
Interacting with your app through the command lineInteracting with your app through the command line
Interacting with your app through the command line
Roman Mazur
 
Android Workshop
Android WorkshopAndroid Workshop
Android Workshop
Junda Ong
 
Cloud Computing in Mobile
Cloud Computing in MobileCloud Computing in Mobile
Cloud Computing in MobileSVWB
 
Defcon 18-dunning-breaking-bluetooth
Defcon 18-dunning-breaking-bluetoothDefcon 18-dunning-breaking-bluetooth
Defcon 18-dunning-breaking-bluetooth
Vengadanathan Srinivasan
 
Labs_BT_20221017.pptx
Labs_BT_20221017.pptxLabs_BT_20221017.pptx
Labs_BT_20221017.pptx
ssuserb4d806
 
Cold front - bridging the web and the physical world
Cold front - bridging the web and the physical worldCold front - bridging the web and the physical world
Cold front - bridging the web and the physical world
Kenneth Rohde Christiansen
 
[Webinar] QtSerialBus: Using Modbus and CAN bus with Qt
[Webinar] QtSerialBus: Using Modbus and CAN bus with Qt[Webinar] QtSerialBus: Using Modbus and CAN bus with Qt
[Webinar] QtSerialBus: Using Modbus and CAN bus with Qt
ICS
 
Getting started with Intel IoT Developer Kit
Getting started with Intel IoT Developer KitGetting started with Intel IoT Developer Kit
Getting started with Intel IoT Developer Kit
Sulamita Garcia
 
Real World Experience of Running Docker in Development and Production
Real World Experience of Running Docker in Development and ProductionReal World Experience of Running Docker in Development and Production
Real World Experience of Running Docker in Development and Production
Ben Hall
 

Similar to Android Bluetooth Introduction (20)

Tutorial mikrotik step by step
Tutorial mikrotik step by stepTutorial mikrotik step by step
Tutorial mikrotik step by step
 
Android debug bridge
Android debug bridgeAndroid debug bridge
Android debug bridge
 
Controlpcviabluetoothenablemobile 091028150632-phpapp01
Controlpcviabluetoothenablemobile 091028150632-phpapp01Controlpcviabluetoothenablemobile 091028150632-phpapp01
Controlpcviabluetoothenablemobile 091028150632-phpapp01
 
Control Pc Via Bluetooth Enable Mobile
Control Pc Via Bluetooth Enable MobileControl Pc Via Bluetooth Enable Mobile
Control Pc Via Bluetooth Enable Mobile
 
Controlpcviabluetoothenablemobile 091028150632-phpapp01
Controlpcviabluetoothenablemobile 091028150632-phpapp01Controlpcviabluetoothenablemobile 091028150632-phpapp01
Controlpcviabluetoothenablemobile 091028150632-phpapp01
 
Manish Chasta - Securing Android Applications
Manish Chasta - Securing Android ApplicationsManish Chasta - Securing Android Applications
Manish Chasta - Securing Android Applications
 
Lab Handson: Power your Creations with Intel Edison!
Lab Handson: Power your Creations with Intel Edison!Lab Handson: Power your Creations with Intel Edison!
Lab Handson: Power your Creations with Intel Edison!
 
DevFest 2022 - Cloud Workstation Introduction TaiChung
DevFest 2022 - Cloud Workstation Introduction TaiChungDevFest 2022 - Cloud Workstation Introduction TaiChung
DevFest 2022 - Cloud Workstation Introduction TaiChung
 
Embedded Android
Embedded AndroidEmbedded Android
Embedded Android
 
IBCAST 2021: Observations and lessons learned from the APNIC Community Honeyn...
IBCAST 2021: Observations and lessons learned from the APNIC Community Honeyn...IBCAST 2021: Observations and lessons learned from the APNIC Community Honeyn...
IBCAST 2021: Observations and lessons learned from the APNIC Community Honeyn...
 
An Introduction To Android
An Introduction To AndroidAn Introduction To Android
An Introduction To Android
 
Interacting with your app through the command line
Interacting with your app through the command lineInteracting with your app through the command line
Interacting with your app through the command line
 
Android Workshop
Android WorkshopAndroid Workshop
Android Workshop
 
Cloud Computing in Mobile
Cloud Computing in MobileCloud Computing in Mobile
Cloud Computing in Mobile
 
Defcon 18-dunning-breaking-bluetooth
Defcon 18-dunning-breaking-bluetoothDefcon 18-dunning-breaking-bluetooth
Defcon 18-dunning-breaking-bluetooth
 
Labs_BT_20221017.pptx
Labs_BT_20221017.pptxLabs_BT_20221017.pptx
Labs_BT_20221017.pptx
 
Cold front - bridging the web and the physical world
Cold front - bridging the web and the physical worldCold front - bridging the web and the physical world
Cold front - bridging the web and the physical world
 
[Webinar] QtSerialBus: Using Modbus and CAN bus with Qt
[Webinar] QtSerialBus: Using Modbus and CAN bus with Qt[Webinar] QtSerialBus: Using Modbus and CAN bus with Qt
[Webinar] QtSerialBus: Using Modbus and CAN bus with Qt
 
Getting started with Intel IoT Developer Kit
Getting started with Intel IoT Developer KitGetting started with Intel IoT Developer Kit
Getting started with Intel IoT Developer Kit
 
Real World Experience of Running Docker in Development and Production
Real World Experience of Running Docker in Development and ProductionReal World Experience of Running Docker in Development and Production
Real World Experience of Running Docker in Development and Production
 

Recently uploaded

The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
Cheryl Hung
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
Dorra BARTAGUIZ
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Tobias Schneck
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Product School
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
RTTS
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
KatiaHIMEUR1
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
Generating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using SmithyGenerating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using Smithy
g2nightmarescribd
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
Product School
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
Sri Ambati
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Jeffrey Haguewood
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
Paul Groth
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Inflectra
 

Recently uploaded (20)

The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
Generating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using SmithyGenerating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using Smithy
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
 

Android Bluetooth Introduction

  • 1. Android Bluetooth Introduction Erin Yueh 2009/06/26    
  • 2. Agenda ● Android Bluetooth architecture ● Related source code ● Init Bluetooth  ● Connect with other BT devices (dbus) ● RFCOMM ● OBEX (socket)    
  • 4. The diagram above offers a library-oriented   view of the Bluetooth stack.  
  • 5.    
  • 6. Related source code ● Bluez 3.36 (user space and kernel) ­ /mydroid/externel/bluez ­ /mydroid/kernel/drivers/bluetooth ­ /mydroid/kernel/net/bluetooth ● Android app framework (java & c++) ­ /mydroid/frameworks/base/core/jni/android_bluetooth_*.cpp  ­ /mydroid/frameworks/base/core/java/android/bluetooth/*.java ­ /mydroid/frameworks/base/services/java/com/android/server/ (SystemServer) ● Android UI application  ­ /mydroid/packages/apps/Phone/src/com/android/phone/ (Phone App) ­ /mydroid/packages/apps/Settings/src/com/android/settings/bluetooth/ (Settings App)    
  • 7. Init Bluetooth  ● /root/init.rc  mkdir /data/misc/hcid (store device info) service dbus /system/bin/dbus­daemon service hcid /system/bin/hcid (disabled) service hfag /system/bin/sdptool add ­­channel=10 HFAG (handsfree, disabled, one shot) service hsag /system/bin/sdptool add ­­channel=11 HSAG (headset, disabled, one shot) ● /root/init.trout.rc service hciattach (disabled)  ● system server decice BT power On or Off from settings value start related services    
  • 10. Bluetooth headset Music player + Dialer     
  • 11. Connect with other BT devices ● Bluez: hcid daemon ● dbus-daemon: connections between hcid and system server ● D-Bus is a simple inter-process communication (IPC) system for software applications to communicate with one another. ● dbus-daemon is the D-Bus message bus daemon. D-Bus is first a library that provides one-to-one communication between any two applications; dbus-daemon is an application that uses this library to implement a message bus daemon. Multiple programs connect to the message bus daemon and can exchange messages with one another. ● debug utility: d-feet, dbus-monitor, dbus-send    
  • 15. Scan nearby BT devices in Android ● Bluez utility: hcitool scan ● DiscoverDevices: bluez/util/hcid/dbus­api.txt This method starts the device discovery procedure. This includes an inquiry  procedure and remote device name resolving. On start up this process will  generate a DiscoveryStarted signal and then return DeviceFound singals. If the  procedure has been finished an DiscoveryCompleted signal will be sent. ● Source code: android_server_BluetoothDeviceService.cpp /* Compose the command */ msg = dbus_message_new_method_call(BLUEZ_DBUS_BASE_IFC, nat­>adapter,  DBUS_CLASS_NAME, "DiscoverDevices"); /* Send the command. */ reply = dbus_connection_send_with_reply_and_block(nat­>conn, msg, ­1, &err);    
  • 19. RFCOMM (Radio Frequency  Communication) ● The Bluetooth protocol RFCOMM is a simple set of  transport protocols. ● RFCOMM is sometimes called Serial Port Emulation.  ● The Bluetooth Serial Port Profile is based on this protocol. ● In the protocol stack, RFCOMM is bound to L2CAP ● RFCOMM provides a simple reliable data stream to the  user, similar to TCP. It is used directly by many telephony  related profiles as a carrier for AT commands    
  • 20. Send AT commands via bluetooth ● Connect with Nokia N73 phone ● > sdptool browse 00:18:C5:42:18:78 ● > sudo rfcomm connect 0 00:18:C5:42:18:78 2 ● minicom ● > AT ● > AT+CGMR ● > AT+CGMI    
  • 21. OBEX (Object EXchange) ● a communications  protocol that  facilitates the  exchange of binary  objects between  devices. ● in the protocol stack,  OBEX is bound to  RFCOMM    
  • 22. SOCKET  ● UNIX socket  (AF_BLUETOOTH) ● inter­process  communication  ● like Internet socket recv() send() ● client­server    
  • 23. Receive files via BT in Android ● openobex + obexpushd   ● Run an OBEX data server in Android ● > obexpushd ● listen RFCOMM connections ● File permission    
  • 24. Send files via BT in Android ● Openobex + obexftp ● Connect to a RFCOMM connection ● > obex_test ­b BTADDR CHANNEL ● > obexftp ­b BTADDR ­B CHANNEL ­­list