<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Julian Steenbakker</title>
    <description>The latest articles on DEV Community by Julian Steenbakker (@juliansteenbakker).</description>
    <link>https://dev.to/juliansteenbakker</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F390281%2F4ec9dfe3-ff5b-4959-be38-e049b153fd98.jpeg</url>
      <title>DEV Community: Julian Steenbakker</title>
      <link>https://dev.to/juliansteenbakker</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/juliansteenbakker"/>
    <language>en</language>
    <item>
      <title>Advertising Custom Data over Bluetooth Low Energy on iOS &amp; Android: Github Graduation</title>
      <dc:creator>Julian Steenbakker</dc:creator>
      <pubDate>Wed, 20 May 2020 08:53:00 +0000</pubDate>
      <link>https://dev.to/juliansteenbakker/advertising-custom-data-over-bluetooth-low-energy-github-graduation-2em4</link>
      <guid>https://dev.to/juliansteenbakker/advertising-custom-data-over-bluetooth-low-energy-github-graduation-2em4</guid>
      <description>&lt;h2&gt;
  
  
  My Final Project
&lt;/h2&gt;

&lt;p&gt;During my internship at Bever Innovations, a Dutch company that manufactures smart LED-light solutions for gas stations and other companies, I developed a Flutter application that communicates via Bluetooth Low Energy (BLE) with the different LED devices. The idea was to communicate without making a connection, in order to save time and increase the usage speed when there are many products in one area. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--508Muj_g--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/hg2tn7ohw67kyt441e37.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--508Muj_g--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/hg2tn7ohw67kyt441e37.png" alt="Picture showing different LED devices communicating with smartphone"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In order to get this to work, I needed to turn the device where the application was running on into a Bluetooth Low Energy Peripheral, which means it can advertise custom manufacturer data without specifying a receiver. Because there wasn't any package available on &lt;a href="https://www.pub.dev"&gt;pub.dev&lt;/a&gt; that would allow me to do that, I decided to create my own and share it by making it open source.&lt;/p&gt;

&lt;h2&gt;
  
  
  flutter_ble_peripheral
&lt;/h2&gt;

&lt;p&gt;By enabling a mobile device to broadcast custom manufacturer data, we were able to communicate without much delay with the different products, regardless of how many products were in the area. You can find the repository at the bottom of this post.&lt;/p&gt;

&lt;h4&gt;
  
  
  An Apple a day keeps BLE away?
&lt;/h4&gt;

&lt;p&gt;One of the advantages of Flutter is that you can run your application on multiple platforms with the same codebase. However, there are some drawbacks on using BLE on iOS. Using Android, it's no problem to advertise custom manufacturer data at all, but on iOS Apple restricts the possibility to broadcast custom data. In order to get around this problem, I’ve developed a way to broadcast custom data using the UUID field of the Core Bluetooth API. Using this way, we can still broadcast non directed data over the air via BLE on an iOS device!&lt;/p&gt;

&lt;h2&gt;
  
  
  How I built it
&lt;/h2&gt;

&lt;p&gt;I've used Flutter as cross-platform framework because it compiles to native code and allows for really great performance. GitHub Actions allowed me to automate tests, which was great. Thanks for the free GitHub Pro included in the student pack @GitHub! For receiving BLE data I’ve used flutter_blue. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Flutter&lt;/li&gt;
&lt;li&gt;Github Actions&lt;/li&gt;
&lt;li&gt;flutter_blue&lt;/li&gt;
&lt;li&gt;flutter_ble_peripheral&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Link to Code
&lt;/h2&gt;

&lt;p&gt;&lt;em&gt;Keep in mind that flutter_ble_peripheral is still under development and your mileage may vary. Feel free to contribute and make it even greater!&lt;/em&gt;&lt;/p&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--vWogaON8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://practicaldev-herokuapp-com.freetls.fastly.net/assets/github-logo-28d89282e0daa1e2496205e2f218a44c755b0dd6536bbadf5ed5a44a7ca54716.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/juliansteenbakker"&gt;
        juliansteenbakker
      &lt;/a&gt; / &lt;a href="https://github.com/juliansteenbakker/flutter_ble_peripheral"&gt;
        flutter_ble_peripheral
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      A Flutter package for advertising BLE data in peripheral mode
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;p&gt;&lt;a href="https://pub.dartlang.org/packages/flutter_ble_peripheral" rel="nofollow"&gt;&lt;img src="https://camo.githubusercontent.com/3ac66c1ac1f42269b25a908dddff1410fa2fae34/68747470733a2f2f696d672e736869656c64732e696f2f7075622f762f666c75747465725f626c655f7065726970686572616c3f696e636c7564655f70726572656c6561736573" alt="pub package"&gt;&lt;/a&gt;
&lt;a href="https://gitter.im/flutter_ble_peripheral/community" rel="nofollow"&gt;&lt;img src="https://camo.githubusercontent.com/da2edb525cde1455a622c58c0effc3a90b9a181c/68747470733a2f2f6261646765732e6769747465722e696d2f4a6f696e253230436861742e737667" alt="Join the chat"&gt;&lt;/a&gt;
Dev: &lt;a href="https://github.com/juliansteenbakker/flutter_ble_peripheral/actions"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--sULIpdqs--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://github.com/juliansteenbakker/flutter_ble_peripheral/workflows/Build%2520Flutter/badge.svg%3Fbranch%3Ddevelop" alt="Workflow"&gt;&lt;/a&gt;
Master: &lt;a href="https://github.com/juliansteenbakker/flutter_ble_peripheral/actions"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--8C7HDwdZ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://github.com/juliansteenbakker/flutter_ble_peripheral/workflows/Build%2520Flutter/badge.svg%3Fbranch%3Dmaster" alt="Workflow"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h1&gt;
FlutterBlePeripheral&lt;/h1&gt;
&lt;p&gt;This Flutter plugin allows a device to be used in Peripheral mode, and advertise data over BLE to central devices.&lt;/p&gt;
&lt;h2&gt;
Help develop this plugin!&lt;/h2&gt;
&lt;p&gt;If you want to contribute to this plugin, feel free to make issues and pull-requests.&lt;/p&gt;
&lt;h3&gt;
Not stable&lt;/h3&gt;
&lt;p&gt;Since this plugin is currently being developed, limited functionality will be available. Check the release page for the most recent release.&lt;/p&gt;
&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Functionality&lt;/th&gt;
&lt;th&gt;Android&lt;/th&gt;
&lt;th&gt;iOS&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Advertise UUID&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;Set and advertise a custom uuid.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Advertise custom service&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;

&lt;td&gt;Advertise a custom service.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Advertise custom characteristic&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;

&lt;td&gt;Advertise a custom characteristic with any of the following specifications.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Read characteristic&lt;/td&gt;


&lt;td&gt;Enable the possibility to read a value.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Write characteristic&lt;/td&gt;


&lt;td&gt;Enable the possibility to write a value.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Notify characteristic&lt;/td&gt;


&lt;td&gt;Enable the possibility to subscribe and notify a value.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;
&lt;/div&gt;



&lt;/div&gt;
&lt;br&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/juliansteenbakker/flutter_ble_peripheral"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;br&gt;
&lt;/div&gt;
&lt;br&gt;



&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--vWogaON8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://practicaldev-herokuapp-com.freetls.fastly.net/assets/github-logo-28d89282e0daa1e2496205e2f218a44c755b0dd6536bbadf5ed5a44a7ca54716.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/pauldemarco"&gt;
        pauldemarco
      &lt;/a&gt; / &lt;a href="https://github.com/pauldemarco/flutter_blue"&gt;
        flutter_blue
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      Bluetooth plugin for Flutter
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;p&gt;&lt;a href="https://pub.dartlang.org/packages/flutter_blue" rel="nofollow"&gt;&lt;img src="https://camo.githubusercontent.com/f2aed3a17efe9a8db838d958439be36726f5e6f9/68747470733a2f2f696d672e736869656c64732e696f2f7075622f762f666c75747465725f626c75652e737667" alt="pub package"&gt;&lt;/a&gt;
&lt;a href="https://discord.gg/Yk5Efra" rel="nofollow"&gt;&lt;img src="https://camo.githubusercontent.com/09765330815efe4315add99dbc605c2de51ab973/68747470733a2f2f696d672e736869656c64732e696f2f646973636f72642f3633343835333239353136303033333330312e7376673f7374796c653d666c61742d73717561726526636f6c6f72423d373538454433" alt="Chat"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;br&gt;
&lt;p&gt;
&lt;a rel="noopener noreferrer" href="https://github.com/pauldemarco/flutter_blue/blob/master/site/flutterblue.png?raw=true"&gt;&lt;img alt="FlutterBlue" src="https://res.cloudinary.com/practicaldev/image/fetch/s--ifpjLrNy--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://github.com/pauldemarco/flutter_blue/raw/master/site/flutterblue.png%3Fraw%3Dtrue"&gt;&lt;/a&gt;
&lt;/p&gt;



&lt;h2&gt;
Introduction&lt;/h2&gt;

&lt;p&gt;FlutterBlue is a bluetooth plugin for &lt;a href="http://www.flutter.io" rel="nofollow"&gt;Flutter&lt;/a&gt;, a new mobile SDK to help developers build modern apps for iOS and Android.&lt;/p&gt;

&lt;h2&gt;
Alpha version&lt;/h2&gt;

&lt;p&gt;This library is actively developed alongside production apps, and the API will evolve as we continue our way to version 1.0.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Please be fully prepared to deal with breaking changes.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Having trouble adapting to the latest API?   I'd love to hear your use-case, please contact me.&lt;/p&gt;

&lt;h2&gt;
Cross-Platform Bluetooth LE&lt;/h2&gt;

&lt;p&gt;FlutterBlue aims to offer the most from both platforms (iOS and Android).&lt;/p&gt;

&lt;p&gt;Using the FlutterBlue instance, you can scan for and connect to nearby devices (&lt;a href="https://raw.githubusercontent.com/pauldemarco/flutter_blue/master/#bluetoothdevice-api"&gt;BluetoothDevice&lt;/a&gt;)
Once connected to a device, the BluetoothDevice object can discover services (&lt;a href="https://raw.githubusercontent.com/pauldemarco/flutter_blue/master/lib/src/bluetooth_service.dart"&gt;BluetoothService&lt;/a&gt;), characteristics (&lt;a href="https://raw.githubusercontent.com/pauldemarco/flutter_blue/master/lib/src/bluetooth_characteristic.dart"&gt;BluetoothCharacteristic&lt;/a&gt;), and descriptors (&lt;a href="https://raw.githubusercontent.com/pauldemarco/flutter_blue/master/lib/src/bluetooth_descriptor.dart"&gt;BluetoothDescriptor&lt;/a&gt;)
The BluetoothDevice object is then used to directly interact with characteristics and descriptors.&lt;/p&gt;
&lt;h2&gt;
Usage&lt;/h2&gt;
&lt;h3&gt;
Obtain an instance&lt;/h3&gt;
&lt;div class="highlight highlight-source-dart"&gt;&lt;pre&gt;&lt;span class="pl-c1"&gt;FlutterBlue&lt;/span&gt; flutterBlue &lt;span class="pl-k"&gt;=&lt;/span&gt; &lt;span class="pl-c1"&gt;FlutterBlue&lt;/span&gt;.instance;&lt;/pre&gt;&lt;/div&gt;
&lt;h3&gt;
Scan for devices&lt;/h3&gt;
&lt;div class="highlight highlight-source-dart"&gt;…&lt;/div&gt;
&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/pauldemarco/flutter_blue"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;


</description>
      <category>githubsdp</category>
      <category>flutter</category>
      <category>devgrad2020</category>
      <category>octograd2020</category>
    </item>
  </channel>
</rss>
