What’s New in Core Bluetooth – WWDC19 – Videos – Apple Developer

Download

Thank you for joining the school term. My identify is Duy Phan. I ‘m here with Yilok and Meghna to talk to you about what ‘s new in Core Bluetooth. I ‘ll start with an introduction. then LE 2 Mbps and advertise annex. then provide an overview for Core Bluetooth for BR/EDR devices. then Core Bluetooth for dual-mode, user privacy, developer tools, then wrap up with a drumhead. Let ‘s start with the initiation. For those in the hearing that ‘s newly to Core Bluetooth, the Core Bluetooth framework is our abstraction of the Bluetooth low energy specification and hardware. We provide our developers an easy and robust way to develop applications that can interact with Bluetooth humble energy devices, and since the presentation of the framework, we ‘ve seen an amazing number of accessories and applications. We ‘ve seen everything from health and seaworthiness devices to indoor locationing and detail finding to creative tools, toys and accessories for kids, things for the home, appliances, and even everyday items like Bluetooth controlled body of water bottles and mugs. Our developers ‘ creativity and arduous workplace have very made the Bluetooth gloomy everything ecosystem a very vibrant and advanced quad, thank you.

But there ‘s more. There exists an entire class of Bluetooth devices that are besides thriving and growing, but we much do n’t talk about them here because they do n’t support the Core Bluetooth model. These are Bluetooth BR/EDR devices, and they include accessories like your favorite sound recording cyclosis devices, in-car entertainment systems with hands-free calling and diverse accessories like mouse and keyboards and game pads. What ‘s been missing is a way for our Core Bluetooth developers to develop applications that can interact with these devices. Until nowadays. This year we are adding Core Bluetooth support for BR/EDR devices. Thank you. This means that Core Bluetooth can immediately reach out and interact with all of your favorite Bluetooth devices careless of what transportation they run. In addition, we added diverse dual-mode features, so the two transport works even better when they ‘re together. We hope that our developers will take advantage of these features, and we look forward to seeing all of the modern accessories and applications you build. then, this year we very have three major driving themes. The first is, as always, to improve our core engineering but besides to protect our user privacy and enable our developers with better tools. Let ‘s get started with improvements to our core engineering and LE 2 megabits. LE 2 Mbps is a new feature in Bluetooth 5.0. The physical layer rate or radio pace can increase now from 1 to 2 Mbps between compatible devices. This means that with the same amount of airtime, Core Bluetooth can now transmit twice the number of bits, so your connections are not only faster, they ‘re besides more ability effective. This is better however crystalline to the application. We will handle all of the associate layer negotiations for you based on the platform you ‘re on. But remember, if you ‘re developing an accessory, your accessory must besides support LE 2 Mbps for this to work. This is available now starting with iPhone 8, 8 Plus, iPhone X, Apple television receiver 4K, and the Apple Watch Series 4. And here I have an illustration of Bluetooth 1 Mbps in versatile modes. And I ‘ve added LE 2 Mbps to show the, thank you, to show the jump forward in operation. besides newly for this class we ‘ve added advertising extension. advertise extension is a Bluetooth 5.0 feature. It basically improves upon three independent points for advertise. The first base is it eases the congestion on the three advertise distribution channel by sending a smaller cargo on the ad channel, then jumping to the more broad data channel to transmit a much larger warhead. up now from 31 to 255 bytes, and the transmission rate itself can now be in LE 2 Mbps. Core Bluetooth will support gallop scan this year. This means that we can scan now for the extend advertisements that I ‘ve good mentioned, but we will only scan for our unfold advertisements that are transmitted in LE 2 Mbps. indeed, if you ‘re developing an accessory, your accessory must besides support extended ad with LE 2 Mbps. We now support extended ad payloads up to 124 bytes. This is four times the come of ad data that an accessory can send us today. This is again guileless to your application. You can use the same scan API, scan filters. We would scan for both bequest and gallop advertisements. There ‘s a new API for you to programmatically question for platform support, and this is immediately supported on iPhone adam and the new iPad Pro. besides fresh for this year we ‘re going to support prolong connections. This means that we can make connections to connectable, extensive advertisements. Extended connections improve upon the existing association substitution protocol, and I ‘ll explain how. today with Legacy Connections, the advertiser would advertise a connectable ad. The scanner would send a connection identification if it wants to connect. There ‘s no ACK for this. The scanner assumes that the connection reading reaches the advertiser. It then wakes up the horde processor to tell it there ‘s a new connection. But the connection indication may actually not reach the advertiser because the RF characteristic of the scanner and advertiser can differ, and the RF environment is identical moral force. so, because of this, throughout your day, your whole processor can be unnecessarily woken up, training your call ‘s battery more while you ‘re using, your user is using your application or accessary. But extended connections improve upon this. With extend connections, the advertiser would advertise a connectable extensive ad. The scanner would send a connection request. The advertiser would send an explicit connection response, and only when the scanner receives this connection reception it will wake the master of ceremonies processor to tell it there ‘s the new connection. In accession, your connection can besides start in LE 2 Mbps, skipping some of the link level negotiation. And because of this, extend connection is more robust and baron efficient. It is again diaphanous to your application if you can call the lapp connect API. It will connect to both Legacy and Extended Advertisements. But remember if you ‘re developing an accessory, your accessory must besides support connectable extend advertisements. There ‘s a new API for you to programmatically question for platform support. This is besides available immediately with iPhone x and the raw iPad Pro. I ‘d like to now hand it off to Yilok to talk about Core Bluetooth support for BR/EDR. Thank you. Thanks, Duy. Hi everyone. I ‘m Yilok, and I ‘m here to introduce you to you the fresh things we ‘ve added to Core Bluetooth for BR/EDR devices. When we first introduced Core Bluetooth back in 2012, we wanted to create an abstraction layer for you to use what ‘s called GATT. nowadays GATT is a Bluetooth SIG protocol that is hierarchy-based, and it consists if services and characteristics, and it makes it identical easy to read, write, and be notified of changes on these characteristics. You ‘ve shown us that it ‘s exceptionally easy to make great products such as heart pace monitors, toys, and a bunch of accessories in the earth. And it ‘s been fantastic seeing what you ‘ve been able to do with the Core Bluetooth apps that you build to interface with these accessories. immediately, this year, as Duy has mentioned, we ‘re adding support for Core Bluetooth over BR/EDR devices or authoritative devices. now these devices range from things such as cable car head units, speakers, and headphones. sol, how do we do this ? Well, our smokestack from last year consisted of two different transports. basically, we were running the system profiles or things such as audio, A2DP, HFP, and remote-control profiles in the system. On the other side, for low energy, we were running Core Bluetooth over GATT, and that was the framework that you were using to interface with your accessories. This year, we ‘ve merged the two layers together, and now, you have transparent entree to both BR/EDR and low department of energy without doing anything. nowadays, what this means for you is without much changes in the API, you can immediately work with both the classic devices and the low department of energy devices. so let ‘s go and look into the details of Core Bluetooth for BR/EDR. This now will allow diaphanous use of GATT with the BR/EDR devices. It ‘s still running the accurate lapp Bluetooth SIG protocol. There ‘s no changes to that, and sol you can look at this specification on-line on the Bluetooth SIG web site. To your application and to the developer, the CBPeripheral APIs are precisely the same. You can still do the like servicing discovery and be notified of changes to characteristics. There is a new change in the CBCentralManager. We ‘ve added a way for you to be notified when a device is connected with a service IUD or a know peripheral UID. And I ‘ll go more into detail about that late. Core Bluetooth for BR/EDR is available with io 13, the watchOS, and tvOS that we released this week. And last, because GATT is a software layer protocol, you can add confirm to your accessory without the need for newfangled hardware. This means alone a software or firmware update. now let ‘s expect at the newly API. To register for connection events, you ‘ll register by either a know service or a know peripheral UID. This would be akin to something like the heart rate service. You ‘ll call registerForConnectionEvents, and you ‘ll pass to the CBCentralManager a character for either a military service UID or a peripheral UID. When we find a match option, we ‘ll send you a delegate recall, and this delegate recall will include the CB peripheral and the type of connection consequence. It ‘s pretty simpleton. so, what does the incoming connection count like from your app ‘s bespeak of watch ? Your app will have instantiated a CBCentralManager, passed us a acknowledge avail UID, and in the font of a BR/EDR or classical device, your exploiter will go to the Bluetooth settings and research for the device, in this case let ‘s say it ‘s a headset running heart rate. They ‘ll discover the device, find it, and undertake to connect. Pairing will be triggered, and then afterwards when we ‘re connected, we ‘ll run a military service discovery of the GATT services. If we find a overhaul that you want, then you ‘ll get the delegate recall. And this will now look highly similar to those who have already used Core Bluetooth. With your delegate recall, you ‘ll then handle the connection event, and so you might call connect on that given peripheral. then, all this code looks like so. You ‘ll do low-level formatting first gear, file for your connection consequence with the CBCentralManager, and last handle the delegate recall. If you ‘re concern in the device, call plug in, and then you can clear the adjustment for filters. now, what about outgoing connections. Let ‘s say you have a known peripheral already and you ‘re paired to it and you want to connect. You can now connect out to a BR/EDR device. To do so, you ‘ll do the same thing, instantiate your CBCentralManager and call connect. This is not a new API. This has existed in CBCentralManager for a while now. And so if you ‘re calling connect on a BR/EDR device, if your app is in foreground, then we ‘ll try to make a connection out to that device for you. We ‘ll page the device, and if it ‘s connected, then you ‘ll get a delegate recall. It ‘s that simple. so, now that we ‘ve gone through the fresh APIs for BR/EDR devices, let ‘s continue on to the other improvements we ‘ve made for Core Bluetooth dual-mode. This means when you ‘re using gloomy energy and BR/EDR together. One common matter we ‘ve seen with dual-mode devices, as you ‘ve developed more and more accessories and apps on top of it, is that by and large when users use your device, they see two entries in the Bluetooth settings. There ‘s a low energy one, and there ‘s a BR/EDR or classical one. And it ‘s sometimes confuse to users. therefore, we worked truly hard this year to alleviate this confusion. then, this year we ‘re introducing adoption of what ‘s called Cross Transport Key Derivation. This is a Bluetooth 4.2 SIG stipulation, and basically what this means is through a single coupling we will derive radio link keys for the other tape drive. To you, it means that the device will now have a single CBPeripheral identifier, so you do n’t need to care about the transport of the device. This is completely guileless to your application, and now that we have the single coupling for two devices, it means your app can seamlessly use both gloomy energy and BR/EDR together. so before when users of your device or application, if they were seeing two devices, now they ‘ll just see one, which is merged. Thank you. And we can foster take advantage of Cross Transport Key Derivation, or CTKD, to improve the pair summons. So let ‘s say you want to control the entire discovery and pairing experience for your user. rather of having the drug user go into Bluetooth settings and do an inquiry scan, which leaves your app have, you can nowadays look for low energy advertisements from your accessary. If you find the device, you can then Call Connect and connect over LE and access the protective feature. once you ‘re paired, because of CTKD, we ‘ll take the LE key, and we ‘ll besides derive the BR/EDR key. And this means you can now make a BR/EDR connection without having to trigger more pair to confuse the exploiter, and it stays in the app for the entire experience. Great. now that we ‘ve talked about improving match, let ‘s talk about how we improve dual-mode connections. Let ‘s consider a fresh product that you want to plan, and it ‘s a home plate sound recording device. And it would be capital if your exploiter could be using your app and have it trigger some kind of connection to use media, such as music or podcast when the exploiter becomes in proximity of the device. therefore, you ‘d want the user to bring up something like music or podcasts, which this would mean that io would have to bring up what ‘s called a BR/EDR channels for you. We ‘ve done so this year by introducing a modern concept called bridge. Bridging works by taking advantage of low energy proximity to bring up BR/EDR profiles such as A2DP, HFP, AVRCP. This will work on all devices that support CTKD and to take advantage of it in your application, it ‘s extremely easy. You ‘ll use a new key in the CBManagerConnect, and it ‘s called the TransportBridgingKey. You add it in the option dictionary. And so when you pass that to us, we ‘ll try to connect over low energy to your device. If we find it, then we ‘ll immediately page out over BR/EDR and connect as many profiles as we can.

The result is that your drug user can now seamlessly use all the multimedia profiles without having to do anything. Great. So, now we ‘ve covered all the core engineering improvements we ‘ve made this class. I ‘d like to now hand it over to Meghna to talk at Core Bluetooth privacy. Thank you, Yilok. In the last year alone, there have been an increasing number of instances where applications made the news or we ‘re pulled from the App Store for not respecting exploiter privacy. I ‘m here nowadays to help you avoid that situation for your Core Bluetooth applications. Hello everyone. My mention is Meghna Lav, and over the adjacent few minutes, I ‘d like to talk you through the privacy update for Core Bluetooth APIs. privacy matters, and it is more important today than ever before. Our users are more aware of it today than ever before. At Apple, we believe that privacy is a fundamental human right, and as Tim Cook has mentioned, it is our collective duty to safeguard and protect the fundamental homo right to privacy. As developers in the Apple ecosystem, you all have a profound affect on drug user ‘s lives every day. As such, users trust you with their data, and together with us, you shoulder the responsibility to uphold that trust. This class, we ‘ve made enhancements to two major areas for Core Bluetooth privacy, drug user authorization, and accessory notifications. Let ‘s start by talking about user authority and how it presently works. In io 12, if your application instantiated a CBPeripheralManager and wanted to advertise when in the background, we required that you obtain drug user mandate. New for this year, if your lotion uses any Core Bluetooth APIs, we ‘ll require you to obtain drug user mandate. It is significant to note that this applies to applications that are built on older SDKs as well. And when a drug user makes this decision, they can modify it in the settings app either in the Bluetooth privacy paneling or even in your application specific settings. And this is required on io, watchOS, and tvOS. so what does exploiter authorization bastardly on watchOS. If your lotion runs as an propagation on watchOS, then the license is shared between io and watchOS, and the user only has to grant this license once. This of path is not true for stand-alone watchOS applications. so, how would you adopt drug user authorizations in your application ? The beginning thing to do is to open the info.plist of your app and add this raw use description string. There are three reasons why you should add this use description string. first base, you can use this to convey to users why your application requires access to Bluetooth. second it is a mandatary string and failure to adopt it would lead to a crash upon establish for your application. And you see an error like this in console table. And third, the app recapitulation process reviews all usage description strings to ensure that they are nonempty and meaningful. So get ‘s take a look at some code nowadays. We ‘ve created a modern property this class that is the authorization place, and this will tell you whether a user has allowed or denied access to your lotion and whether you check for this authorization place. In rate to under that, let ‘s take a spirit the hang of a Core Bluetooth application. In your Core Bluetooth application, the first thing you probably do is instantiate a CBCentralManager or a CBPeripheralManager. And so the first gear delegate callbacks that you will receive from Bluetooth will be the ManagerDidUpdateState recall. In this, you can look at the value of state to see if the director is quick to be used. now if the value of state of matter is CBManagerstate.unauthorized, then you can look at a new authority property to see if the drug user has denied access to your application. thus if your code looks like this today, where you alone look at one or two values of director country, I urge you to please take ten minutes aside today and update your code so it looks a little more like this where you look at all the potential values of coach state of matter, and this besides give you a truly smooth path to start adopting user mandate in your lotion. All of this code will be available in the sample project, details of which will be provided in the more information school term, section, deplorable. Let ‘s now move onto accessary notifications. Apple implements ANCS, or Apple Notification Center Service, which is a GATT server service that allows your accessories to get system and app notifications from the io Notification Center. If you want to learn more about ANCS, then the detailed documentation is available on developer.apple.com. The privacy update for ANCS is that drug user authority will nowadays be required in order to plowshare notifications with accessories. And therefore if a exploiter updates to iOS 13, when your accessory connects in and registers for notifications, we ‘ll show this permission prompt to users. once users make this decisiveness, they can modify it under the device-specific settings in Bluetooth settings. now, we know that this stream could be a draw better for users if the license prompt was shown at a time when it was more contextually relevant and in your lotion. And so we ‘ve created modern ANCS privacy APIs to help you enable this experience. From your CBCentralManager, if you know that the peripheral that you are connecting to supports ANCS, you can use this newfangled CBConnect choice. If you do this, then upon successful connection and coupling, we ‘ll show the license alarm to the exploiter while the exploiter is in your application, and when they respond to this license alert, your application will receive a delegate recall that tells you that ANCS mandate has changed. And you can fetch the value of that using the getter ancsAuthorized. then, we spoke about exploiter authority and accessary notifications. But apart from this, there ‘s a batch more that your lotion can do to be a dependable custodian of exploiter privacy. then let ‘s take a expect at some best practices for your Core Bluetooth applications. first base and first, invoke Core Bluetooth APIs entirely when required and at a time that it is contextually relevant to users. future, scan and advertise for a limited duration only. When your application is advertising, it is basically sharing information from the exploiter ‘s phone and limiting the duration for which you do this helps foster user trust. Keep your scan filters arsenic specific as possible and look only for the UUIDs that your application is invested in. And last, be crystalline with users about why your application requires access to Core Bluetooth. If you do this, then users are more likely to make the right decision. If you want to learn more about designing your applications for privacy, I invite you all to look at the record sessions for the privacy talks from this year ‘s and previous years ‘ WWDC sessions. So let ‘s all be proactive in thinking about and safeguarding drug user privacy as we design and follow through our Core Bluetooth applications. I ‘d now like to hand it over to Duy to walk you through developer tools. Thank you. Thanks. I ‘d like to talk to you a little bite about a newly feature of speech we ‘ve added to the Core Bluetooth PacketLogger. For those that ‘s not familiar with the Core Bluetooth PacketLogger, this is our Bluetooth package psychoanalysis application built for Apple developers. today, when you install a login profile on your io device and trigger sys diagnose, this is the application that can open up the belittled PacketLogger file that ‘s inwardly. The application can decode all protocols defined by the Bluetooth SIG and by Apple. And because it can understand all of these protocols, it will besides highlight errors to warn you of potential problems. It has rich percolate options. You can filter by trust connections or protocol. You can search by text or regex, gossip and flag individual packets, and even export raw datum for late analysis. This is what the peak charge looks like in dark manner, and in this case, I have filtered entirely for the ACI and ATT protocols. But you can besides click down, click on each of the packets and drill down to view the entire protocol hierarchy and examine each of the protocols individually down to the lowest layer in raw bytes. And newfangled for this class, we ‘ve added a feature which we think you ‘re actually going to like. It ‘s called live capture. This means that you can now install a login profile on your io device, connect it to your Mac, plunge PacketLogger, and capture live Bluetooth dealings from your io device to an accessary. Thank you. You can besides connect multiple io devices and capture know dealings. We hope that this will give you more context when you debug. It will make your debug more interactional and hopefully help you resolve your problems more cursorily. And now that you ‘re excited, how do you set up exist capture ? You can install the io 13 developer beta on your io device, install the developer logging profile, launch PacketLogger, connect your io device to your Mac, select file New io Trace on your PacketLogger application, and that ‘s it. You ‘re populate appropriate. Thank you. There ‘s besides an indicator in your io device to tell that live capture is in progress. And how do you get PacketLogger ? You can download PacketLogger inside the extra tools for Xcode package. The connect will be provided in the more data page. PacketLogger is inside the hardware folder of this package. For best performance, run with MacOS Catalina.

Let ‘s wrap up now with a summary. When developing your accessory use the chipset with the latest Bluetooth stand to take advantage of all of the modern performance and might optimizations like LE 2 Mbps and Advertising Extension. You can now build Core Bluetooth apps for Bluetooth BR/EDR devices. We look ahead to seeing all of the newly applications and accessories you build. And constantly protect your drug user privacy and protect their hope in your brand and product. And take advantage of the developer beta. Download the beta and test today. IOS has identical dependable adoption rates. You do n’t want your users to run into problems when they upgrade. We normally have a small window to help. so if you discover a problem early adequate, you can work with us to resolve the issues. And refer to the accessory design guidelines for Apple devices. We have a capital determined of guidelines there to tell you how to develop the best accessory. And last, Apple is here to help. Use the feedback app, reach out to us so we can work together in your accessories and applications. And if you have more questions, come to the Core Bluetooth lab at 4. Thank you. [ Applause ]

reference : https://coinselected.com
Category : crypto topics

Leave a Reply

Your email address will not be published.