MinneBar 8: Bluetooth LE, Core Bluetooth, and a Glimpse into your Near Future

so I think we’re gonna get started can everybody hear me okay all right cool I’m Sam we’re going to be talking about bluetooth low energy and core Bluetooth Gore bluetooth is Apple’s framework for building Bluetooth Low are apps that work with bluetooth low energy devices you can find me on Twitter as Eskridge Meyer and I’m part of the team at live front a live front we build mobile apps for iPhone and Android I’m primarily an iOS developer there although I do lots of different kinds of software development stuff recently I’ve had an opportunity to work on a couple of projects with bluetooth low energy and kind of blew my mind it’s like super awesome so I’m excited to get a chance to kind of share my experience with it and do a couple demos that’s part of my plan so this is going to be a technical talk i’m sure a lot of you know that if you’re familiar with core Bluetooth or Bluetooth Low Energy the first half or so we’re going to just kind of talk about what bluetooth low energy is what it’s good for hopefully I can convince you that it’s awesome you won’t need much convincing because it’s pretty awesome and then the last tap we’re going to dive into Xcode and music or Bluetooth and do a couple cool demos so if your if your eyes glaze over the thought of source code or at the site of source code try to hang in there hopefully we’ll have we’ll have some hopefully cool demos we’ll see so what is Bluetooth Low Energy and what makes it so awesome before we talk about that it’s important to understand that the Bluetooth that we all already know is different and I’m going to refer to that actually as Bluetooth classic for this talk so mu tooth classic you know we all either have a headset that syncs with our phone or we you know pair your phone with your car so you can with some music in the car so we’ve got kind of this it’s like the standard wireless technology that we use for all our peripherals so why do we need another wireless technology why why do we need Bluetooth low-energy Bluetooth Low Energy is designed from the ground up to maximize battery life and we’re talking about ultra low power peripherals so these are things that run on a coin cell battery and that battery might last for months or a year or even more and so it’s a different architecture it’s not backwards compatible and we’re talking about a whole new class of peripherals so it’s important I think just to make that distinction between Bluetooth classic and Bluetooth Low Energy we’re talking about two different things so part of the way that works and we’ll get into a little more detail on this but part of the way that works is it’s designed to send small bits of data very quickly in short bursts just to maximize battery life so with Bluetooth classic you know you can do streaming like audio streaming to listen to music but that sort of thing doesn’t work with Bluetooth Low Energy it just doesn’t have the capability to do to send that much data so a little more history on Bluetooth will kind of blow through this but it was adapted from standard Bluetooth in 2001 started by a nokia they kind of sadhus need for a kind of a new new kind of group of peripherals that bluetooth didn’t really work for they made quite a bit of progress on it marketed it as something completely different initially and then as a bluetooth four points officially rolled back into the specification so it’s an official part of Bluetooth and the iphone 4s was the first commercial peripheral tattoo a Bluetooth low-energy support in October 2011 and it’s awesome so thinking about kind of a typical Bluetooth classic peripheral I think the kind of wireless headset is a good example of that this is a kind of a typical Bluetooth low-energy peripheral it’s a wristwatch citizen you can sync this with your iPhone and they can communicate with each other there a couple things that are really interesting about this particular watch I think this is powered by eco drive which is like basically magic I think it’s not mad it’s science it’s totally science but it’s like a solar-powered faceplate for the watch so that you don’t actually have to change the battery in this watch it just it’s solar powered and it’s a wireless peripheral awesome there are other things that are cool about it if I you can’t really see this if I fade out the watch it’s kind of hard to see but around the face play

it I’m not sure if you can read those up there there are little indicators kind of on the very edge and there’s like mail and call and so what happens is if you miss a call on your phone your phone can tell the watch that you missed a call and in the second hand actually spins around and just points like at call so then when you look at your watch you can see oh yeah I missed a call because my second dad isn’t spinning around like it normally does this is kind of an interesting user interface I like this kind of idea of an analog it’s like it’s like this digital device that’s analog but kind of interesting so there are three three things I find really interesting about bluetooth low energy that i want to touch on today it’s ubiquitous number two it’s inexpensive and number three it’s hackable this is a good kind of a cabal and two and three really distinguished bluetooth low energy from bluetooth classic so how is it ubiquitous it actually isn’t quite ubiquitous yet but it will be soon and that has a lot to do with the fact that it’s part of the Bluetooth specification this means that the industry that’s creating these peripherals and creating these radios has already endorsed it and it’s it’s not going anywhere it’s also important because it means the bluetooth low energy can kind of piggyback on the success of Bluetooth the Bluetooth special interest group predicts that two-thirds of all cell phones will have Bluetooth Low Energy radios in them this year and by 2060 and that will be a hundred percent and really this one hundred percent number means that anywhere any peripheral where you see a Bluetooth radio right now by 2016 that will either be a Bluetooth low-energy radio or it’ll be a dual mode radio that supports Bluetooth classic and Bluetooth Low Energy so this isn’t the whole picture from a software developers perspective this is great that we have a lot of coverage with bluetooth but in order to write apps that interface with these peripherals we need a software stack as well so even if we have Bluetooth Low Energy radios everywhere it doesn’t do us much good without software so this is a chart that shows kind of the current state of mobile platforms and their support for Bluetooth Low Energy and so we have a lot of check marks in the yes column which is good one in the know they’re for windows phone and then Android gets its own column it’s complicated it bluetooth low energy there are actually a lot of Android phones that have Bluetooth Low Energy radios but it’s not officially supported by the Android SDK yet so manufacturers have kind of gone off on their own and not waiting for Google they’ve built their own Bluetooth Low Energy libraries but those are not compatible with each other their specific to the hardware for that manufacturers device so from software developers perspective that kind of sucks because then if you want to support the maximum number of devices you have to build kind of an interface teach one of those libraries and it’s a big mess the good news is that there’s kind of anecdotal evidence at least online from google engineers saying that this is a priority internally and they’re working on it and you know no ETA for when it’s going to be supported but this will eventually make it into the android sdk and a similar story with Windows Phone just you know Microsoft engineers have commented online but not other than any official capacity it’s also inexpensive and this this this really just means inexpensive compared to developing software and hardware with Bluetooth classic it’s an inexpensive in a couple of different ways one thing that this is I really think this is a huge deal and makes Bluetooth Low Energy really fun to experiment with is that may drive phone is not required does anyone have experience with made for iphone made for iphone program Adam you do do you have any comments on the other two thoughts on in any I could to summarize the experience okay expensive and time-consuming yeah yep yeah so good that’s good to hear that disk expensive yeah me so this is this is Apple’s program if you if you develop a peripheral for like an iPhone or an iPad and you use the 30-pin dock connector Apple makes you go through this process they make you sign up you actually have to apply to the program and they can just reject you and not let you in or if they accept you like Adam said it gets expensive because they require you to pay a third party to do testing for your peripheral to make sure it doesn’t interfere with things and it’s well behaved and all that stuff there’s also potentially licensing fees involved you know as well so it’s it’s and that that goes not only for peripherals that you connect with a dock connector but also Bluetooth classic peripherals as well if you want to write software that interfaces with a peripheral so it bluetooth low energy gets around this primarily because of the way it maximizes battery life it’s less of a less of an issue to just have an app on your phone that uses Bluetooth Low Energy we’ll talk a little bit more about that it’s also less expensive because bluetooth low energy is a simpler software stack it’s a completely different architecture than Bluetooth

classic so bluetooth low energy is generally since it’s simpler it’s cheaper to implement in hardware it’s easier cheaper it’s also smaller because batteries can be smaller so enclosures can be smaller so manufacturing costs can be lower and this is actually the fun one I think it’s also very hackable which is kind of awesome and this may be the only time you ever see an Apple technology on the same slide as the word hackable but this is really true core Bluetooth goes a long way to making kind of exposing a lot of the features of bluetooth low energy without a lot of limitations and you can even do stuff in the background which is if you’re an iOS developer you know what kind of how much what the right word is but just how how much Apple really locks down what you can do in the background what you can so it’s nice that this gives you the opportunity to do it kind of do some things in the background because it’s it saves battery life that the interaction with Bluetooth Low Energy peripherals in the iOS and an iOS is very different than the interaction with Bluetooth classic peripherals in iOS in that you know when you pair like a headset or something you have to go through settings and then you see a list of all your Bluetooth devices the OS kind of gets in the it’s like it wants to control all of those interactions with Bluetooth Low Energy all of that’s left up to you as a software developer and your app you’re responsible for scanning for devices connecting to them remembering which ones you’ve connected to disconnecting all of that stuff so that gives you a huge amount of flexibility and just lets you it’s great for experimentation and then again just to read here at this there’s no made for iphone required so you can write your own app and you can put it in the app store and as long as you pass the standard apple approval process you don’t have to do any more than that to write an app that’s interacting with wireless peripherals there’s also lots of cool hardware available so this is a this is a experimenting kit kind of like a development kit from Texas Instruments it’s a comes with a key fob and a USB adapter and these are both programmable so for a hundred bucks and a macbook you can start hacking away on your own custom wireless peripheral to make it do whatever you want this is a similar kit from Lou Giga those works basically the same way is a little bit more expensive and Arduino actually we’re going to be using an Arduino for the demos so I’ve got this Arduino up here we’ll hook that up later if you’re not familiar with Arduino it’s it’s a really inexpensive like microprocessor that you can program via USB I’m sure a lot of you have hard we knows and have experimented with them it’s cheap to get a bluetooth adapter for your Arduino about 30 bucks and that’s what I’m using here this is also a cool peripheral I’m using one of these as well this lets you use bluetooth low energy from the iOS simulator so if you’re an iOS developer you can do all of your development in the simulator you don’t have to load the app on your phone and test from your phone so this is cool and cheap so just to recap ubiquitous inexpensive and hackable and awesome life work number four so there’s there are products out there quite a few products some of them are really basic like heart rate monitors things you’d kind of expect like things that you can kind of picture and think of it might be operated by coin cell battery heart rate monitor thermometer or thermostat we’re going to look at a couple of the more interesting examples that I’ve just kind of found online before we do that I just want to mention Bluetooth smart and Bluetooth smart ready these are the terms that the Bluetooth special interest group uses to market bluetooth low energy so you don’t actually see bluetooth low energy on product packaging you’ll see Bluetooth smart and Bluetooth smart ready Smart is just like the peripheral and smart ready is like a computer or device that you’d connect multiple peripherals to Fitbit uses ble the latest version uses it to sink in the background does anyone have a Fitbit few people okay so for those of you they don’t know what this is it’s like a pedometer basically you wear it all day and it tells you how many calories you burned because you walked a thousand miles or something and it can sink what wirelessly in the background without any intervention on your part with your phone which is kind of cool hip key this is like a key fob that you put on your keychain and then if your phone and your keychain get separated too far it’ll leave at you you could also put it on your child or something you’re really good I think stick and find is similar this is like a little sticker this actually is a good example that disc right there this is a good example of kind of a size of peripheral we’re talking about it’s this includes the battery enclosure the radio everything and an LED light this is this is something you’d like stick on something you want to lose and then when you lose that thing you can kind of use their app to find out where it is go find it and it can beat that you and stuff both stick and find an hiep key have this concept of proximity which is kind of an important part of Bluetooth Low Energy there are some features of it that make detecting proximity like how far away the devices from you pretty easy to do so it’s kind of an

interesting thing you can do with Bluetooth Low Energy this is another smart watch this is similar to the citizen except this one actually has a digital display this is a Kickstarter you know thing that came to fruition recently so it can show you unread email or alert you if you miss a call or social media updates I’m particularly fascinated by this and I’ve already had two examples of this the citizen watch in this one this kind of remote display concept is really cool because you can build a peripheral like this with a battery that lasts for months or a year like a normal wristwatch and you don’t have to build in a web server or like connect to Wi-Fi or anything on the peripheral you don’t have to like have code in there to connect to Twitter and you know monitor tweets and stuff like that you can do all that on the phone where we all have experience doing that a software developers kind of harness that power of the phone and keep the device simple and have a you know really low power radio in it so yeah it’s I think the maximum range is like 160 feet like the theoretical maximum when conditions are perfect and you’re in an open field or yeah in testing with devices it’s pretty good as usually like 30 to 50 feet so it’s a very reasonable and usable it’s the we’ll talk about I’ll touch on that I have a slide for that kind of ranges it’s about half of the theoretical range of Bluetooth class bluetooth plastic which is about 300 feet but it also depends on which version of Bluetooth classic you’re talking about it’s gone through several iterations since the 90s when it was introduced so it’s not quite not quite as far as Bluetooth classic so talked about how awesome I know I’ve totally convinced you guys how awesome bluetooth low energy is right yes maybe I don’t know but there there are limitations the primary limitation is that it’s slow and it’s not just slow it’s really slow here’s a chart taller bars taller bars are better on this chart yeah so we’re in terms of speed of transmission weird nowhere near the Wi-Fi ballpark we’re more in the carrier pigeon ballpark down here so this chart really doesn’t do anything other than to say we’re you know you’re not going to use bluetooth low energy to be streaming video or something it’s meant for small bursts of small amounts of information so here’s a these are kind of observed transfer rates the theoretical ones are a lot higher but we’re talking about 50 kilobits per second bluetooth classic is about 1.2 megs like if it’s but it’s important to to keep in mind that when when we say it’s slow like Bluetooth Low Energy is slow that’s strictly data rate there it’s optimized for being fast in other ways like communicating really quickly wake up time is a good indicator of that two to six milliseconds to go from sleep state to fully awake in transmitting data versus Bluetooth classic which is like super slow and any time you sync your device or you have a mouse and you’re trying to wake up your computer or something you know like there’s a lot of lag time with Bluetooth classic so Bluetooth Low Energy peripherals feel a lot more responsive and you’ll see that when we do the demos when you scan for a device it shows up right away and then this is just we already talked about that but a range comparison for a distance so bluetooth low energy is about half the range of Bluetooth classic ok before we go into demos any questions so we’re going to do three things going to scan for device and connect to it discover services once we once we connect then we can figure out how to discover services and read data and then update a remote display so before we do those demos to learn some kind of terminology and dive into core Bluetooth a little bit core Bluetooth really mimics the bluetooth low energy standard for its terminology so it introduces a couple new concepts this is good if you’re kind of if you’re familiar with Bluetooth but if you’re new to bluetooth then these aren’t going to make any sense like central Central you can kind of think of as like a central hub this is the thing that’s like responsible for connecting to peripherals and then we have a peripheral here so the way this works is the central has to scan and the peripheral advertises itself and you can’t create an account connection without this step advertising is essential so the peripheral must advertise itself and in order for these two things to become aware of each other that has to happen at the right time so the central has to scan and the peripheral has to advertise and once they see each other then they can establish a connection and start transmitting data so in core Bluetooth primarily we’re going to be using CB central manager and if you’ve done core location or pretty much any other Apple framework you’re familiar kind of this concept we have to to kind of things we need to use an instance of the

central manager and then we tell the OS we want to start scanning for devices and then we get callbacks on our delegate so a call looks like this we can say I want to scan for peripherals and then when the OS discovers peripherals we just basically wait for these messages to come in and discover some peripherals that will let us know and then it’s up to us to do something with those peripherals so once we discover a peripheral we have a reference to it and we can try to establish a connection and as a similar situation there we say connect peripheral and if it’s successful we get a call back did connect peripheral so I know I already mentioned this but just to reiterate this is really cool because you can do this stuff in the background you can start a scan in your app and you can completely shut down your app and the OS will continue to monitor for you on your behalf even if your phone is in sleep mode if it detects your peripheral it will let your app know you’ll have a chance to do something with it there are limitations associated with that we don’t have a lot of enough time to kind of go into those limitations but we can certainly talk about it later okay so scanning and connecting so this is the app we’re going to build pretty simple we just have like an on/off button we can start a scan and then it’ll list the devices that gets can’t that get discovered and then we can try to establish a connection by tapping on the one that gets discovered so in order for this to work basically we have this Arduino here i’m going to plug this in but i’m just plugging it in for power purposes no monkey business this is actually wireless promise so there’s not much to see at this point this is just going to light up a little light up a little bit but really initially we just want to establish a connection to it and I want to kind of preface this by saying I’m not going to go we’re using like view controllers and table views and stuff so if you’re not an iOS developer don’t worry about that too much I’m just going to kind of assume you know the the basic structure of the app and all of this code is available and it’s annotated online so if you want to look at the code later it’s out there and available so kind of the first step happens when we instantiate are controller we create a reference to our central manager and we send in our self as a delegate right here so that just sets the sets us up to start receiving these notifications when devices are discovered and a couple other basic things we’re just going to keep an array of peripherals that we discover and then we just have a boolean telling us whether we’re standing or not we can kind of just use that to update the UI so when the user toggles the scan switch to on we’re actually going to initiate a scan and the first step in doing that is checking the state of the central manager we can only scan if power is if it’s powered on there are maybe five or seven different states that this could be in maybe there’s not even a Bluetooth Low Energy radio on this device so in the demo app we’re just going to look for powered on and if it’s not powered on we’re just going to ascend a generic alert to the user but in a production app obviously you can check the state and then take the appropriate action based on what the current state is then we just start a scan and bypassing nil in for services will talk about services and stuff in a minute but by passing an ill we can just scan for any bluetooth low energy device and if the OS discovers one it’ll send us a call back notification so now we just wait we started to scan and we wait eventually the iphone will discover a peripheral and when it does it invokes this method automatically for us gives us a reference to the peripheral and advertisement in data and RSSI these two things just give us more information about this connection some bluetooth low energy devices like a thermostat you might not ever actually connect to maybe you just read its advertisement data so you can actually encode a little bit of information very small amount in the advertisement data from your peripheral so you don’t actually ever have to establish a connection in that case you can just do a scan get the temperature from the thermostat and then you’re done in our case we actually do want to establish a connection one more note RSSI this is a signal strength so this is kind of related to proximity you can tell based on how strong the signal you’re reading is and you can actually you could configure your peripheral to send its transmitted signal strength and then read the received signal strength on the phone and do lots of complicated crazy math to figure out oh we know it transmitted that this strong and we’re receiving that the strong and this is about how far away did it how far away it is so we’ve we’ve received a notification that there’s a peripheral we check to see if it’s in our array or the reason we do this is because we could get multiple notifications for the same peripheral might come in three or four times so we check to see if we’ve had if we have it if we don’t have it yet then we add it to our array and we update the table view so at this point it shows up in the table view and the user can tap on it so now we wait for user interaction the next step is when the user selects that row we call this method connect

peripheral then we wait again and if that connection succeeds then the OS will invoke this method forests did connect peripheral and at this point we just show our detail view controller so let’s try it out come on okay and there’s also lots of log information that’s going to be printed out if you do download the code and kind of experiment with it this can be useful it’s probably not going to be super helpful for these demos so you can see that the scan pretty quickly picked up the bluetooth peripheral and this name just comes from the way the peripheral is designed when we tap on that cell will try to connect and it’s not going to work okay sometimes this is a one of the quirks with this Bluetooth Low Energy USB thing sometimes you have to like claim it with the simulator so if you put your computer to sleep or something sometimes you have to come in and do this so I hope this is what it is we’ll try it one more time okay there we go so now when you have a connection alright so that’s the first demo so now we have a connection we can start to try to do fun things with this peripheral we want to find out what kind of services this peripheral offers us and then read data from it so we’re going to add a little bit of information to our detail view here which is a message the Arduino is programmed to create a random message and just updated every three seconds so we’re going to just read that random string from the Arduino just as a demo before we do that I just want to introduce Bluetooth profiles profile is just a container for the services that your Bluetooth Low Energy peripheral provides you made up of one more services and services are made up of one or more characteristics and characteristics have a descriptor so a concrete example of this is a thermometer thermometer service has three characteristics in this case measurement location and interval measurement being the third the temperature location is where the thermometer is and then interval is how often that values updated so the concept here is you can you can create your own profiles and in fact the the creator of this bluetooth adapter for our bluetooth low energy shield for arduino created this really simple profile so this is what we’re going to interact with profile profile basically has an RX characteristic and a TX characteristic and we can read these characteristics to read from the RX characteristic and then if we want to send data back to the arduino we can write to the TX characteristic and each one of these has a uuid value associated with it this again is defined by the author so this is you can create your own profiles you can assign your own you IDs and then publish this information so in our case for the demo apps we looked up the details online for this peripheral and now we know what the uuid czar and we can connect them and do things with the characteristics so just a quick overview of sebi peripheral now that we have a reference to this peripheral and we have a connection to it we can call discover services and again the OS takes care of all the hard work for us just sends us back an array of services and we do similar thing with characteristics we just read characteristics or discover characteristics and then get back an array of all the characteristics for a particular service one interesting thing what we’re going to do for the demo app is we could we know that this message is getting updated on the Arduino so we could keep reading that characteristic over and over and over and just polling for a new value but we don’t know necessarily if that value was updated when we pull for it so i might get the same value back which is a waste of power we can set we can tell the peripheral we can call set notify value and we can tell the peripheral to notify us every time that that value changes on the peripheral so when it does then it sends us back a call back did update value for characteristics so this is much easier we don’t have to pull pull for that information we can just tell the peripheral let us know when you have any value so we are going to read from the RX characteristic and update this message on the detail page let’s look at the code for that okay so first up we’re going to call discover services on this peripheral right when the detailed page is displayed and remember this is going to let the OS do all the hard work for us and it’s just going to send us a call back with an array of services so we call that we sit back and wait and we’ll

get back an array of services so here’s to discover services for each service that we get back from this call will loop through and call discover characteristics so we’re looking for that RX characteristic so now we wait again eventually we’ll get another call back this is this one’s a little bit more involved so once we get the characteristics back we need to kind of sift through these characteristics and hook up to the one that we want the one that we want we know the UID for so we’ve got the uuid defined right here and this is from the documentation that the creator of this peripheral provided we need to turn these is just kind of a thing we need to do but we need to take these strings and turn them into CD uuid values we can compare those CD uuid values with the values we get back from the callbacks from core bluetooth so we check for the service to make sure that it’s the one that we’re interested in and then for each characteristic that comes back we loop through those and we compare the characteristic uuid with the one that we know is the one we want in this case it’s the RX characteristic and we can call set notify value yes for characteristic so we don’t actually read anything at this point we just tell the peripheral we want to get updates let us know when this value changes if it’s the TX characteristic we’re just going to keep a reference to that for now and we’ll use that in the third demo so we’ll get back to that yep it’s up to the is defined in a profile so the profile can say yes this is a characteristic that supports updates or no it doesn’t so this isn’t available for everything and for some things like I don’t know what a good example is maybe like on and the thermostat like the frequency of updates it was one of the characteristic that’s never going to change it’s just like a unknown value you just want to read that from the peripheral so it doesn’t really make sense in every case I’m not sure I understand exactly what you’re asking it does it does yes yeah once the connection is established they know about each other and they take on different roles depending on how they’re connected it’s Bluetooth core Bluetooth makes that very simple from a software developer standpoint there’s a lot of craziness going on in the Bluetooth spec that handles all that like the roles of the devices but they do know about each other yet so we’ll keep a reference to the TX characteristic and we’re going to just sit back and wait for notifications for the RX characteristic and eventually when the peripheral lets us know we get this callback in our in our code and in our case we know that the Arduino is sending us a ski data so we grab that characteristic and just turn it into a string just translate it from NS data to an ASCII string and update the label in our table view so let’s run that demo so we just wait eventually we should get updates maybe there is it should change every few seconds okay is this such the session is over at eleven is that right anybody now okay thank you okay so that’s demo number two number three we’re going to try to remote update a remote display you know what a fan of this concept i am so we’re going to try to kind of make a very simple version of this with this Arduino it’s got an LED display on the front so what we’re going to do is I have some software in the iOS app that monitors Twitter for a hashtag and I’m going to need your assistance hopefully some of you can help me out here if you tweet with a hashtag then the iOS app will monitor that account basically of tweets with that hashtag and then send an update to the peripheral to just kind of increment the number on the display here’s the hashtag don’t tweet it yet though we can actually tweet it until we make a connection to the peripheral so hold your horses okay so one last demo just look at that take a quick look at the code here this is just a constant for the hashtag that we’re going to search for and there’s lots of other code that makes a connection to Twitter streaming connection just counts the updates when those tweets come in we check to see if we have a reference to that TX characteristic and we create an NS data object and then call peripheral right value or characteristic and that just sends the data over bluetooth low energy to the peripheral so the Arduino is programmed to receive that and then update the LED display so I’ll hold this up here hopefully hopefully we can make

this happen try to connect as many like fragile pieces together as possible with this demo we’ve got like Wi-Fi Twitter bluetooth okay so if you tweet should start see that seeing that increment there’s one and they’ll show up in the log down here as well aight sweet yeah you guys awesome cool and this isn’t happening over USB I know there’s a cable here but it’s all wireless so cool all right okay so just to recap introduction to Bluetooth Low Energy convinced you it’s awesome hopefully I think it’s awesome and did some cool demo so hope you enjoyed it thanks we’ve still a couple minutes so if anybody has questions yep yeah Bluetooth Low Energy supports very similar pairing and kind of security encryption and stuff options as Bluetooth classic does in order to initiate that in software you basically on the peripheral side this is all documented by Apple but on the peripheral side you just reject a connection so in our iOS app we click on the road to establish a connection with the peripheral if the peripheral rejects that initial connection then the OS will automatically try to pair with that device and establish a different kind of connection so it does support that yeah yeah yep I think it’s like 37 bytes or something like that so yeah the payload for bluetooth is very small just to maximize battery life but yeah I don’t know the exact number but it’s it’s in the tens of bytes you