<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>nRF UART app (iOS) - Selecting Device</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/12837/nrf-uart-app-ios---selecting-device</link><description>Hi there, 
 I&amp;#39;m currently using the nRF UART app for iOS (v1.0.1), and I noticed it doesn&amp;#39;t work the same as the Android app (v2). The key difference is the ability to select which BLE device to connect to. On the iPhone, upon hitting &amp;#39;Connect&amp;#39;, the</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 01 Apr 2016 08:39:41 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/12837/nrf-uart-app-ios---selecting-device" /><item><title>RE: nRF UART app (iOS) - Selecting Device</title><link>https://devzone.nordicsemi.com/thread/48804?ContentTypeID=1</link><pubDate>Fri, 01 Apr 2016 08:39:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:db9423b9-500d-4cd4-913b-289983db99eb</guid><dc:creator>Anders Strand</dc:creator><description>&lt;p&gt;I do not really know iOS code myself, but i can see if I can find someone who does. You can also try iOS code forums or stack overflow for help on this. You should be able to use any BLE template or example project instead of the nrf toolbox project. In either case, i guess it requires you to learn how to program apps for iOS.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF UART app (iOS) - Selecting Device</title><link>https://devzone.nordicsemi.com/thread/48803?ContentTypeID=1</link><pubDate>Wed, 30 Mar 2016 18:32:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:810b5309-4ebc-4f56-ae8d-21529164aafe</guid><dc:creator>leehong</dc:creator><description>&lt;p&gt;Anders,&lt;/p&gt;
&lt;p&gt;Thanks for the info. I&amp;#39;m trying to design an iOS app that has the functionality of UART-BLE data transmission (connect, select from list, send uart string, disconnect). From the nRF toolbox app, what are the minimum code/modules that I would require (minus the UI) for this functionality?&lt;/p&gt;
&lt;p&gt;Best,
Lee-Hong&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF UART app (iOS) - Selecting Device</title><link>https://devzone.nordicsemi.com/thread/48802?ContentTypeID=1</link><pubDate>Tue, 29 Mar 2016 12:41:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:79ff83c9-7b5d-4ed6-9b6c-883610c46782</guid><dc:creator>Anders Strand</dc:creator><description>&lt;p&gt;Hello.
The nRF uart app for iOS is old (2013).
I recommend that you use either the &lt;a href="https://itunes.apple.com/us/app/nrf-toolbox/id820906058?mt=8"&gt;nrf toolbox&lt;/a&gt;, or the &lt;a href="https://itunes.apple.com/us/app/nrf-master-control-panel-ble/id1054362403?mt=8"&gt;nRF master control panel&lt;/a&gt;.
You can find the source for nrf toolbox &lt;a href="https://github.com/NordicSemiconductor/IOS-nRF-Toolbox"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;If you still want to modify the old uart app (I do not recommend this):&lt;/p&gt;
&lt;p&gt;In the file ViewController.m, we find the function &lt;code&gt;- (IBAction)connectButtonPressed:(id)sender&lt;/code&gt; at line 55. Inside it, we find a switch case:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;switch (self.state) {
        case IDLE:
            self.state = SCANNING;
            
            NSLog(@&amp;quot;Started scan ...&amp;quot;);
            [self.connectButton setTitle:@&amp;quot;Scanning ...&amp;quot; forState:UIControlStateNormal];
            
            [self.cm scanForPeripheralsWithServices:@[UARTPeripheral.uartServiceUUID] options:@{CBCentralManagerScanOptionAllowDuplicatesKey: [NSNumber numberWithBool:NO]}];
            break;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This tells iOS to scan for just one UUID. If you want to scan for all UUID, leave the UUID array empty. See the iOS &lt;a href="https://developer.apple.com/library/ios/documentation/CoreBluetooth/Reference/CBCentralManager_Class/#//apple_ref/occ/instm/CBCentralManager/scanForPeripheralsWithServices:options:"&gt;documentation&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The callback function on line 167&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(void) centralManager:(CBCentralManager *)central didDiscoverPeripheral:(CBPeripheral *)peripheral advertisementData:(NSDictionary *)advertisementData RSSI:(NSNumber *)RSSI
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Is called when a suitable device has been found. If you want to create a list over device, this is where you must do it.&lt;/p&gt;
&lt;p&gt;-Anders&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>