<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by CV Nithi on Medium]]></title>
        <description><![CDATA[Stories by CV Nithi on Medium]]></description>
        <link>https://medium.com/@iosnithic?source=rss-35a411624cae------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*Yc3H34wC3LlNDs1x.png</url>
            <title>Stories by CV Nithi on Medium</title>
            <link>https://medium.com/@iosnithic?source=rss-35a411624cae------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 18:39:26 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@iosnithic/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Hello Everyone..!]]></title>
            <link>https://iosnithic.medium.com/hello-everyone-bd59424a6528?source=rss-35a411624cae------2</link>
            <guid isPermaLink="false">https://medium.com/p/bd59424a6528</guid>
            <dc:creator><![CDATA[CV Nithi]]></dc:creator>
            <pubDate>Sat, 20 Feb 2021 15:29:11 GMT</pubDate>
            <atom:updated>2021-03-04T05:27:24.893Z</atom:updated>
            <content:encoded><![CDATA[<p>Hello Everyone..! In the next decade, wireless communication will be the part of our day to day life. The prediction is bit straight forward, Yes.. IoT’s may be act like servant for us, or else vice verse :P. Hence, it is better to know something about Bluetooth.</p><p>Bluetooth… ohhhh.. Yes, Bluetooth. It is an effective communication medium helps to have better wireless communication (piconet). Bluetooth 4.0 came up with low power consumption (BLE). With BLE’s applications can run on small battery devices. The recent iPhone devices are shipped with BLE 5.0.</p><p>In this article, we are going to develop a sample app, that to integrate with CoreBluetooth framework. So it’s better to have the following IoT with you,</p><ol><li>Heart Rate Monitor.</li><li>Health Thermometer.</li></ol><p>Oops..! I don’t have thebugdet to purchase 😉. Hence, I have downloaded the <strong>BLE Peripheral Simulator</strong> in my android device. Simulator app is offering, the following BLE service simulations,</p><ol><li>Battery</li><li>Heart Rate Monitor.</li><li>Health Thermometer.</li></ol><p>Let’s start to begin with Xcode default project creation, and then create a <strong>BLEManager</strong> class. Prepare a <strong>BLEService</strong> protocol, declare the API’s of <strong>BLEManager. </strong>Hence, the below code is an interface for <strong>BLEManager</strong> useful to offer the required API’s and supports to build the mock. I know that is a different story of UnitTest, will see it later.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f4e1631cb0cc9fc1bd7cfbf303566c77/href">https://medium.com/media/f4e1631cb0cc9fc1bd7cfbf303566c77/href</a></iframe><p>In <strong>BLEManager</strong>, declare the <em>CBCentralManager</em> property. This central manager makes our device will act as a receiver. So it must know, the receiving content. CBCentralManager scan the peripherals with an optional services. CBUUID services help to scan the peripherals, which are offering the same services we required. Otherwise, we can get all the peripherals in our scanned result. <br>FYI, you can get the BLE standard services list here. <a href="https://github.com/Pluto-Y/Swift-LightBlue/blob/master/Source/CBUUID%2BLightBlue.swift"><em>https://github.com/Pluto-Y/Swift-LightBlue/blob/master/Source/CBUUID%2BLightBlue.swift</em></a><em>.</em></p><p>What is peripheral?. It is an IoT device or another BLE device that can offer services called measuring, sensing, and more. In our case, <em>Heart Rate Monitor, and </em>Health Thermometer<em> </em>are peripherals.</p><p><strong>BLEManager</strong> can be constructed like below,</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6d82f1381693a9fc7263f774edad8d6d/href">https://medium.com/media/6d82f1381693a9fc7263f774edad8d6d/href</a></iframe><p>Okay, we instructed the <em>CBCentralManager </em>to scan only the specified services. But before that, we need to know the state of <em>CBCentralManager, </em>if it is .<em>poweredOn</em> then start the peripheral scanning.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/aada668da0b32b804c9cb2e357d5841f/href">https://medium.com/media/aada668da0b32b804c9cb2e357d5841f/href</a></iframe><p>Discovered peripherals are captured in discover <em>delegate</em> of <em>CBCentralManager</em></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f118335001fe24363a8810ffbf0b8533/href">https://medium.com/media/f118335001fe24363a8810ffbf0b8533/href</a></iframe><p><strong><em>BLEDevice</em></strong><em> </em>is a wrapper class is helps to prepare the robust MVVM, and to have <em>CBPeripheralDelegate </em>methods. Hence peripheral related operation has been considered as a part of <strong><em>BLEDevice</em></strong><em>.</em></p><p>Peripheral is offering some services based on the assigned characteristics.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bd59424a6528" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>