Bluetooth LE Connection Termination with device

I am having difficulty finding a clean method in XE7 to terminate a BluetoothLE connection to a device.  

In iOS (objective-C), a command would be something like:

{code}
[myCentralManager cancelPeripheralConnection:peripheral];
{code}

Or in Android:

{code}
bluetoothGatt.disconnect();
{code}

Specifically I am looking for a method to send a LL_Terminate_Ind Packet from the central device (Android or iOS).  



I have noticed that in the example code built in the webinar, the device stays connected once BluetoothLE1->DiscoverServices() is executed.  I have seen this issue in all of the C++ example BLE code provided (HeartRateMonitor and ExploreDevicesLE).  In the example code built in the webinar, a disconnection is only achieved when BluetoothLE1->DiscoverDevices() is executed.  I have been able to duplicate this situation on several BLE devices including:

Nordic  nRF51-DK
TI Key FOB
Wonder Workshop Dash and Dot Robots

Is there a way to disconnect a BLE device using C++ without performing another {DiscoverServices()}?  I design wearable medical devices that require the host to periodically (usually daily) download data from the wearable device, then disconnect to save power.  I have  gone through the Wiki documentation for TBluetoothLE and haven’t come across anything that seems to work.   Hopefully I am simply missing an obvious method.

Marty
0
Martin
1/12/2015 3:18:42 PM
embarcadero.delphi.firemonkey 4901 articles. 4 followers. Follow

2 Replies
5108 Views

Similar Articles

[PageSpeed] 1
Get it on Google Play
Get it on Apple App Store

Update:

I received an email from Diego Navarro about this issue.  Apparently the ability to disconnect will be in XE8.

He also made a suggestion to free the devices, but that didn't cause a disconnect (I may be doing it incorrectly).

For now I am putting some logic in the onDiscoveredDevices callback so I can use that function for disconnecting...

{quote:title=Martin Bruner wrote:}{quote}
> I am having difficulty finding a clean method in XE7 to terminate a BluetoothLE connection to a device.  
> 
> In iOS (objective-C), a command would be something like:
> 
> {code}
> [myCentralManager cancelPeripheralConnection:peripheral];
> {code}
> 
> Or in Android:
> 
> {code}
> bluetoothGatt.disconnect();
> {code}
> 
> Specifically I am looking for a method to send a LL_Terminate_Ind Packet from the central device (Android or iOS).  
> 
> 
> 
> I have noticed that in the example code built in the webinar, the device stays connected once BluetoothLE1->DiscoverServices() is executed.  I have seen this issue in all of the C++ example BLE code provided (HeartRateMonitor and ExploreDevicesLE).  In the example code built in the webinar, a disconnection is only achieved when BluetoothLE1->DiscoverDevices() is executed.  I have been able to duplicate this situation on several BLE devices including:
> 
> Nordic  nRF51-DK
> TI Key FOB
> Wonder Workshop Dash and Dot Robots
> 
> Is there a way to disconnect a BLE device using C++ without performing another {DiscoverServices()}?  I design wearable medical devices that require the host to periodically (usually daily) download data from the wearable device, then disconnect to save power.  I have  gone through the Wiki documentation for TBluetoothLE and haven’t come across anything that seems to work.   Hopefully I am simply missing an obvious method.
> 
> Marty
0
Martin
1/12/2015 6:25:01 PM
Sorry for the continued updates, but Diego send me some code that appears to work well.

If you wish to disconnect from a device you can call:
{code}
BluetoothLE1->DiscoveredDevices->Items[i]->DisposeOf();
{code}

where

+BluetoothLE1->DiscoveredDevices->Items[i]+ is the device you are connected to.

Marty



> {quote:title=Martin Bruner wrote:}{quote}
> Update:
> 
> I received an email from Diego Navarro about this issue.  Apparently the ability to disconnect will be in XE8.
> 
> He also made a suggestion to free the devices, but that didn't cause a disconnect (I may be doing it incorrectly).
> 
> For now I am putting some logic in the onDiscoveredDevices callback so I can use that function for disconnecting...
> 
> {quote:title=Martin Bruner wrote:}{quote}
> > I am having difficulty finding a clean method in XE7 to terminate a BluetoothLE connection to a device.  
> > 
> > In iOS (objective-C), a command would be something like:
> > 
> > {code}
> > [myCentralManager cancelPeripheralConnection:peripheral];
> > {code}
> > 
> > Or in Android:
> > 
> > {code}
> > bluetoothGatt.disconnect();
> > {code}
> > 
> > Specifically I am looking for a method to send a LL_Terminate_Ind Packet from the central device (Android or iOS).  
> > 
> > 
> > 
> > I have noticed that in the example code built in the webinar, the device stays connected once BluetoothLE1->DiscoverServices() is executed.  I have seen this issue in all of the C++ example BLE code provided (HeartRateMonitor and ExploreDevicesLE).  In the example code built in the webinar, a disconnection is only achieved when BluetoothLE1->DiscoverDevices() is executed.  I have been able to duplicate this situation on several BLE devices including:
> > 
> > Nordic  nRF51-DK
> > TI Key FOB
> > Wonder Workshop Dash and Dot Robots
> > 
> > Is there a way to disconnect a BLE device using C++ without performing another {DiscoverServices()}?  I design wearable medical devices that require the host to periodically (usually daily) download data from the wearable device, then disconnect to save power.  I have  gone through the Wiki documentation for TBluetoothLE and haven’t come across anything that seems to work.   Hopefully I am simply missing an obvious method.
> > 
> > Marty
0
Martin
1/12/2015 8:21:43 PM
Reply:

Similar Artilces:

Delphi XE5/XE6 Mobile App Terminated When Bluetooth Device Activated
I created a firemonkey mobile app that contains a single edit box, in XE5. I have a symbol bluetooth barcode scanner paired with my mobile device. The scanner is turned off until it's ready to be used. When I run the application on my phone and touch the edit box, the onscreen keyboard appears. At this point I enable the scanner (it has a button on it for this purpose). When the scanner connects to the phone, my application closes. To see what's going on, I added an application event handler to the program to see what events were occurring: function TForm13.AppEvent(AApp...

connecting two bluetooth devices
Hi, I like to connect two bluetooth devices (RFID Reader, GPS receiver) using bluetooth to my PDA (MDA III). After installing the devices I can connect one device at a time from the bluetooth manager. If I connect using my PK application it does'nt differenciate which device I need. The application connects to the last connected device regardless which one I like to use. Because it is to complicated for a user to use the bluetooth manager every time he wants to change the needed device I'm looking for a solution to choose the device programmatically. Any hints? TIA Ch...

Connecting a Bluetooth Device to Lan
I have a solar pv inverter (Sunny Boy) which has a built in bluetooth transmitter to enable monitoring using a laptop or similar bluetooth enabled device. Sadly the inverter is in the loft and out of range. There is however a lan switch near the inverter so I am asking if there is a device like a bluetooth access point or bridge device or similar which would enable me to connect from the lan. Would such a device be transparent or need dedicated software? Alternatively on the inverter there is an RS 485 interface. Is there a device that will convert this to lan TCP/IP? Th...

Bluetooth LE device advertisment and RSSI data
Hi all, I'm using TBluetoothLE XE7 component on android platform. I have no problem with DiscoverDevice and DiscoverServices functions, and I succeffully collect data (using Characteristics) from BTLE device once I'm connected with. The worry is that I can't find a way to access the advertisment data and the RSSI that it carries. I've read this thread https://forums.embarcadero.com/thread.jspa?threadID=110196 but it's about IOS. The only way I found to read the RSSI it's by using OnReaddRSSI, but I MUST be connected to set ReadRemoteRSSI to true. So my quest...

Minefield uses 100%CPU when Bluetooth device is connected!
Name: Kosala Email: kmack07atgmaildotcom Product: Minefield Summary: Minefield uses 100%CPU when Bluetooth device is connected! Comments: When ever I connect the bluetooth adapter to my laptop while mine field is running the laptop sudenly goes to 100% CPU. Same problem was there in firefox after standby or hybridization. but minfield doesnot get stuk on hybridization. just wantedto let you know. K Browser Details: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a9pre) Gecko/2007092305 Minefield/3.0a9pre ...

How can I read Bluetooth LE device advertisment data? [Edit]
How can I read Bluetooth LE device advertisment data using TBluetoothLEManager? Advertisment data - data packet, which broadcasts Bluetooth LE device. Edited by: Serge P on Nov 14, 2014 12:37 PM Does this cover what you need? http://community.embarcadero.com/index.php/blogs/entry/bluetooth-le-support-in-rad-studio-xe7 > {quote:title=Eli M wrote:}{quote} > Does this cover what you need? > > http://community.embarcadero.com/index.php/blogs/entry/bluetooth-le-support-in-rad-studio-xe7 Thanks. As I understood, iOS dont provides raw advertisement - http://stackove...

How can I delete a USB device from Windows' device list without connecting the device?
When a printer is redetected by Windows XP (and other versions), it'll be list as, say, "Over-priced Printer #2" - status Online, and it will be listed next to "Over-priced Printer" - status Offline. What's nice here, is that the unconnected printer(s) is/are still be listed in Printers and Faxes. This allows you to delete all instances of "Over-priced Printer #n" and then to force Windows to redetect the printer, restoring its instance as "Over-priced Printer". However, this only works for printers and faxes. I'm supporting ...

TBitmap gets smaller on rotation in delphi xe8 firemonkey multi device proj
I have an TImage compontent with a bitmap. The image component size properties are singles and TBitmap size properties are integers. The bitmap needs to be the same size as the component and i've made a resize method that gets called everytime the screen rotates. So i've tried to trunc the component size in order to set the size and tried to round it, but every time the bitmap gets smaller. I also tried to cast the sizes of the image component to integer so it doesn't have to round the size for the bitmap. But this has no effect. *Is there a solution for this problem?* I...

How to terminate TIDPop3.Connect / TIdIMAP4.Connect
Hi folks, I'm using both of TIDPop3.Connect / TIdIMAP4.Connect to retrieve email. Is that possible to cancel the Connect operation that already started ?, I've tried using Disconnect when Connect operation still being executed, but it doesn't work. <eldi munggaran> wrote in message news:40005@forums.codegear.com... > Is that possible to cancel the Connect operation that already started ? You have to call Disconnect() from another thread. > I've tried using Disconnect when Connect operation still being executed, > but it doesn't work. Works...

Prevent connection terminate on wireless connection?
Why is it that ASA frequently terminates on a slow-wireless connection? Can this be resolved by increasing the connection timeout? Or it will really terminate when a network-disconnected occured, which is untolerable on wireless network. thanks. First off, you probably need to determine if the socket is being dropped or if it is a database controled timeout.If it database controlled, increase the liveness timeout. /ck "jayvee" <jayvee@cats.edu.ph> wrote in message news:3EDB933A.2266FC68@cats.edu.ph... > Why is it that ASA frequently terminates on a slow-w...

Trying to connect to a bluetooth device to read data (serial port profile). Webapi and documentation
Hi everybody After some very hard days trying to find documentation....I have to surrend= er.. That's why I'm asking for help... Here is the the goal of our test: We need to read information from a device (a BT GPS, for this proof of conc= ept). This gadget expose the serialized info through a serial port...or at = least is what we see when we test it in win/lin environments... What I've done: Webapi bluetooth 1st...search for info...not much though... only pages like "https://wiki.mo= zilla.org/WebAPI/WebBluetooth"..although it says at the beginning...

Connect from CE device to ASA on CE device?
Hello: I'm using Adaptive Server Anywhere on a Windows CE device (Clio VADEM, MIPS). It appears at first glance to work fine. I can start it with TCP/IP, connect to it from the desktop using Interactive SQL, etc. I compiled a simple JDBC program in pure Java and ran it on the desktop, connecting back to the ASA database via jConnect. This worked fine, allowing me to select, use statements, etc. I then took the exact same Java program and ran it using PersonalJava (both the commercial CrEme VM and Sun's PersonalJava for CE VM). When I do this, I get the following:...

bluetooth devices
How can I access a bluetooth device in OS X? My understanding (which could be wrong) is that /dev/blueThing1 won't work, because Apple wants us to use IOKit instead. I'm trying to getting data from 4 barcode scanners which are HID devices so normally they are treated like a keyboard. I've heard of a solution which uses AppleScript (which I don't know), something about reading Apple Events. But, this doesn't seem like the best solution to me... Ryan On Tue, Nov 20, 2007 at 06:16:56AM -0600, namotco wrote: > I've heard of a solution whic...

Web resources about - Bluetooth LE Connection Termination with device - embarcadero.delphi.firemonkey

Electrical termination - Wikipedia, the free encyclopedia
Electrical termination of a signal involves providing a terminator at the end of a wire or cable to prevent an RF signal from being reflected ...

Facebook Denies Involvement in Termination of Coffee Shop’s Lease in NYC HQ Building
Facebook denied any involvement in the decision by Vornado Realty Trust to terminate its lease with a family-run coffee shop and newsstand in ...

YouTube - SENKO FIBER OPTIC TERMINATION KIT - SC CONNECTOR
Hochgeladen am 16.09.2009 SENKO's Fiber Optic Termination Kits are complete solutions to on the job terminations and/or repairs. Designed specifically ...

Abbott's GP co-payments aren't dead: it's a tweak not a termination
Tony Abbott has cut the size of the co-payment and he has excluded children and Australians on benefits, but he is still insisting on a co-payment, ...

Perth shock jock Howard Sattler to sue station for termination over Julia Gillard interview
Disgraced shock jock Howard Sattler is suing his former employer Radio 6PR for at least half a million dollars.

InvoCare withdraws CEO termination package
... after taking into account concerns by some larger shareholders. Funeral homes and cemeteries operator InvoCare has withdrawn a proposed termination ...

Suspected cyber attack forces termination of crucial Qantas pilot vote
A suspected cyber attack has forced the termination of a crucial vote on a new wage deal by Qantas' long-haul pilots.

Sky surprised by 'premature' tender termination
Sky News slams the Federal Government's decision to cancel the tender process for the $223 million Australia Network contract.

Teacher who gave zeros threatened with termination
The Edmonton teacher who was suspended for giving students zeros in defiance of school policy is one step closer to losing his job.

Mobilicity announces termination of Acquisition Agreement by TELUS
TORONTO , June 10, 2013 /CNW/ - Data & Audio-Visual Enterprises Holdings Inc. and its affiliates (collectively, Mobilicity ) today announced ...

Resources last updated: 12/23/2015 7:55:04 PM