Extended Bluetooth Profiles on Ccpilot Displays
Total Page:16
File Type:pdf, Size:1020Kb
UPTEC F 17017 Examensarbete 30 hp Maj 2017 Extended Bluetooth Profiles on CCpilot displays Alexander Johnson Abstract Extended Bluetooth Profiles on CCpilot displays Alexander Johnson Teknisk- naturvetenskaplig fakultet UTH-enheten Bluetooth is used in modern cars to connect smartphones to stream music, to access internet and for phone services such as phone book Besöksadress: contacts and making calls. Similar features are now requested by Ångströmlaboratoriet Lägerhyddsvägen 1 customers of maximatecc's products, e.g. display computers, for off- Hus 4, Plan 0 road vehicles. This thesis is aimed to investigate what is needed to support these features in maximatecc's Linux based displays and how Postadress: the features can be used in a Qt application. Box 536 751 21 Uppsala For instance, the connectivity features in personal cars most Telefon: commonly utilizes the Bluetooth profiles: 018 – 471 30 03 Telefax: Advanced Audio Distribution Profile (A2DP) 018 – 471 30 00 Audio/Video Remote Control Profile (AVRCP) Personal Area Network (PAN) Profile Hemsida: Hands Free Profile (HFP) http://www.teknat.uu.se/student Phone Book Access Profile (PBAP) Message Access Profile (MAP). In Linux operating system the Bluetooth stack Bluez is used in the lower level implementation. Open source software components recommended to implement the above profiles includes: Obexd (for MAP and PBAP) PulseAudio (for A2DP and HFP) oFono (for HFP) Connman (for PAN) all of which help to implement the top level profiles of the Bluetooth stack needed, easily controlled by a Qt application through DBus. Most of the external software components were not possible to add to the Linux image on the CCpilot VA display during the period of the thesis. Instead some features of the profiles have been tested, through a Qt demo and python test scripts, on a Virtual Machine in an environment similar to the CCpilot VA. All profiles tested had some functionality verified except for AVRCP, which is not supported until later versions of Bluez, not available for the Linux kernel on the CCpilot VA. However, the audio in the HFP only occasionally worked. On the CCpilot VA only PBAP was tested successfully. Handledare: Carl-Magnus Moon Ämnesgranskare: Ping Wu Examinator: Tomas Nyberg ISSN: 1401-5757, UPTEC F 17017 Popul¨arvetenskaplig sammanfattnig Bluetooth anv¨andsidag i moderna bilar f¨oratt smidigt koppla upp sin smartphone f¨oratt f˚atillg˚angtill dess funktionalitet i bilens informations- och mediaenhet(IVI). Det g¨alleridag framf¨orallt • Str¨ommamusik • F˚atillg˚angtill en internetuppkoppling • Anv¨andatelefonen f¨oratt ringa och ta emot samtal, hantera meddelanden och anv¨anda telefonboken. I vilken utstr¨ackning dessa erbjuds skiljer sig ˚atmellan biltillverkare och modell men, ˚atminstone som tillval, finns det i princip i alla nyproducerade bilar. I framtiden finns stora m¨ojligheterf¨or nya anv¨andingsomr˚adend¨arBluetooth kan nyttjas, d¨aribland • Diagnostik och annan data fr˚anbilen • Monitorering av f¨orarensh¨alsotillst˚and. M¨ojlighetenatt anv¨andaBluetooth f¨oratt uppn˚aliknande funktionalitet efterfr˚agasnu av kunder till maximateccs displayenheter till terr¨angfordon.Dessa displayenheter anv¨anderfr¨amst operativsystemet Linux i vilket ett grundst¨odf¨orBluetooth finns inbyggt genom programvaran Bluez. F¨oratt underl¨attautvecklingen av applikationer med ¨onskad funktionalitet anv¨andsofta mellanprogramvara, middleware, vilken implementerar funktioner som inte direkt ¨artillg¨angliga via operativsystemet. Genom att bland annat g˚aigenom projekt med ¨oppen k¨allkod riktat mot Linuxbaserade IVI i personbilsindustrin har har fyra mellanprogramvaror identifierats f¨oratt underl¨attaen implementering av dessa funktionaliteter. Dessa ¨ar • Obexd (f¨ormeddelandehantering och telefonbok) • PulseAudio (f¨orhantering av ljud, b˚ademusik och samtal) • oFono (f¨orsamtalshantering) • Connman (f¨orinternetaccess). Ett konceptuellt demoprogram har tagits fram d¨arvissa av dessa mellanprogramvaror anv¨ands som visar hur de praktiskt kan anv¨andasi en applikation skapad i utvecklingsverktyget Qt. Andra funktioner har testats med sm˚atestprogram, scripts, som f¨oljermed k¨allkoden. Testningen har fr¨amstutf¨ortsi en utvecklingsmilj¨osom ska efterlikna displayenheterna. 1 Abbreviations • A2DP - Advacned Audio Distribution Profile • ACL - Asynchronous Connection-Oriented (logical transport) • API - Application Programming Interface • AT - ATtention • AVCTP - Audio/Video Control Transport Protocol • AVDTP - Audio/Video Distribution Transport Protocol • AVRCP - Audio/Video Remote Control Profile • BLE - Bluetooth Low Energy • BNEP - Bluetooth Network Encapsulation Protocol • BR - Basic Rate • DUN - Dial Up Network Profile • EDR - Enhanced Data Rate • GAP - Generic Access Profile • GN - Group Ad-hoc Network • GOEP - Generic Object Exchange Profile • GUI - Graphical User Interface • HCI - Host Controller Interface • HF - Hands-Free Unit • HFP - Hands-Free Profile • HS - High Speed • HSP - Headset Profile • ICE - In-Car Entertainment • ich - incomming call history • IVI - In-Vehicle Infotainment system • L2CAP - Logical Link Control and Adaption Protocol • MAP - Message Access Profile • NAP - Network Access Point • OBEX - Object Exchange Protocol • OPP - Object Push Profile 2 • PAN - Personal Area Network Profile • PANU - Personal Area Network Profile User • pb - main phone book • PBAP - Phone Book Access Profile • RFCOMM - Radio Frequency Communication • (e)SCO - (Enhanced) Synchronous Connection Oriented • SDP - Service Discovery Protocol • USB - Universal Serial Bus • VM - Virtual Machine 3 Contents 1 Introduction 7 1.1 Background . .7 1.2 Specification . .7 1.3 Tasks and Methodology . .7 2 IVI in personal cars 8 2.1 Overview . .8 2.2 Connectivity features . .8 2.2.1 Hands Free Features . 10 2.2.2 Media Player . 10 2.2.3 Tethering . 10 2.2.4 Other technologies . 10 2.2.5 Future functionality . 10 2.2.6 Technical . 11 2.2.7 Profiles supported by mobile phones . 12 2.2.8 Compatibility check between phone model and IVI system . 12 2.3 OpenSource initiatives . 13 3 Bluetooth 14 3.1 General . 14 3.1.1 BR/EDR . 14 3.1.2 High Speed (HS) extension . 14 3.1.3 Bluetooth Low Energy . 14 3.2 The Bluetooth Stack . 15 3.2.1 Controller . 15 3.2.2 HCI . 16 3.2.3 Host . 17 3.3 Protocols . 17 3.3.1 L2CAP . 17 3.3.2 RFCOMM . 17 3.3.3 BNEP . 17 3.3.4 Obex . 18 3.3.5 SDP . 18 3.3.6 AVDTP/AVCTP . 18 3.4 Profiles . 18 3.4.1 Generic Access Profile (GAP) . 18 3.4.2 Serial Port Profile (SPP) . 18 3.4.3 Phone Book Access Profile (PBAP) . 19 3.4.4 Hands Free Profile (HFP) . 22 3.4.5 Advanced Audio Distribution Profile (A2DP) . 23 3.4.6 Audio/Video Remote Control Profile (AVRCP) . 25 3.4.7 Message Access Profile (MAP) . 25 3.4.8 Personal Area Network Profile (PAN) . 27 3.5 Security . 30 3.5.1 Bluetooth Security Model . 30 3.5.2 Legacy Pairing . 31 4 3.5.3 Secure Simple Pairing . 32 3.5.4 Secure Connection . 33 3.5.5 Detectable and Connectable only when needed . 33 4 Hardware and Development Environment 34 4.1 Tested Platforms . 34 4.1.1 CCPilot VA . 34 4.1.2 Virtual Machine . 34 4.2 Bluetooth Hardware . 34 4.3 Qt ............................................ 34 5 Software Components in Linux 36 5.1 BlueZ . 36 5.1.1 Kernel configuration . 36 5.1.2 Versions . 36 5.1.3 A2DP support . 37 5.1.4 AVRCP support . 39 5.1.5 HFP support . 39 5.1.6 PAN support . 40 5.1.7 MAP & PBAP support . 40 5.2 Obexd . 41 5.2.1 PBAP API . 41 5.2.2 MAP API . 42 5.2.3 Changes with different versions . 42 5.3 Audio . 43 5.3.1 Advanced Linux Sound Architecture - ALSA . 43 5.3.2 PulseAudio . 43 5.3.3 Audio Configuration in Bluez . 44 5.4 Telephony stack - oFono . 44 5.4.1 HFP AG plugin . 45 5.5 Network management . 45 5.6 DBus . 45 5.6.1 Service, Path and Interface . 45 5.6.2 Methods and signals . 45 5.7 Qt - Bluetooth Support . 46 5.7.1 QtBluetooth Classes . 46 5.7.2 Extending the support . 47 5.7.3 Combining the generated QDBusAbstractionInterface classes . 49 5.7.4 Pending replies . 49 6 Implementation 50 6.1 Configuration and setup . 50 6.1.1 Software versions on the tested systems . ..