How to clone BLE device (configurations,charcterstics etc)and share it with other - ios

I am working on an app that gets data from the BLE device, I am able to code to get the app to connect with the BLE device. But further characteristics read is an issue as I don't physically have the device
i came across an app named nRF Connect for Mobile . It has the functionality to clone BLE if paired. the video for a BLE clone is shown here but export and import is not avaible
Is there any way I can get the BLE cloned say some configuration file, which then imported in certain app create then same BLE device .i can use to read all the characteristics and other properties

Why don't you just connect to the device in for example nRF Connect, write down the services, characteristics and descriptors you see (usually isn't that many). Then just set up a local GATT server with the same content.

If I understood your question and your video correctly, you would like to copy the advertisement data of a BLE peripheral and use it to advertise on an iOS device yourself.
Maybe CBPeripheralManager can help you do that.
You can call startAdvertising([String:Any]?) and advertise a BLE peripheral.
But iOS limits on a system level which keys you can advertise.
From a short look in the documentation, it seems only the keys
CBAdvertisementDataLocalNameKey
CBAdvertisementDataServiceUUIDsKey
are supported.
But if you'd want to include more information about your peripheral, you could still create an own CBMutableService "deviceInfo" and send information within a characteristic after having established a connection.

Related

How to retrive the information of BLEs which are connected to a BLE

I'm new to Core Bluetooth. Using custom GATT my BLE device will exchange the information with other BLE devices, What I have to do is collect the information that my BLE device got and need to send it to cloud and after that need to clear that data.
I mostly saw Central Manager(Phone) and Peripheral(BLE device) examples but not sure how to get the connected BLE devices information. Do I need to use CBPeripheralManager? Please suggest the approach to handle it. Thanks.

How to match EAAccessory and CBPeripheral with MFi device?

I have MFi device which uses BLE for control and Classic Bluetooth for audio streaming.
In the App, i use coreBluetooth framework to scan BLE and EAAccessory framework to scan Classic Bluetooth.
I don't want the BLE of target device to be connected if its Classic Bluetooth is not yet connected. So i need to know which EAAccessory is corresponding to target CBPeripheral.
I am familiar with coreBluetooth, there is UUID string to identify the CBPeripheral. But it looks not exist in EAAccessory.
I have an idea but not sure: maybe firmware side can config EAAccessory's serial number and CBPeripheral's manufacture data in advertisement data with the same
serial number, so that App side can check if they are the same.
Dose anyone knows the general way to implement this in App side and firmware side?
I really do not think there is s relationship between the 2. BT and BTLE are managed by different chip at peripheral side and phone side.
Usually in BT you use the MAC address to identify the peripheral on BTLE side the MAC address is not used anymore since iOS at the first connection give its own identifier to the peripheral.
What you can do is probably at firmware side, by exposing a service with a characteristic that somehow relate the 2.
UPDATE AFTER COMMENT
I see, as far as I know there a best practice doesn't exist.The worst part is that you have to handle connections differently, mostly due to how connection are made on iOS side. While on the BLE you can choose a not encrypted connection that would not require paring or bonding, on BT side I guess that bonding is required.
Probably the most simple flow would be, user bond the BT device. Once you are in the app and detect the connected BT device, use a scan method for detect BLE companion device by filtering for a specific service id that your device exposes, once you do that you can also filter discoveries using BLE name without still making a connection.
Adv packet are restricted in size (29 usable byte) but you can also use the scan response (31 byte), that exposes some additional properties such as manufacturer data that will be exposed in a dictionary (kCBAdvDataManufacturerData).
Once you know that is the correct device you can start a connection, that does not require pair or bond but is NOT encrypted (Pair and Bond will require the user to accept the connection inside your app).

Sending data from computer to iOS using Core Bluetooth

Is it possible to send data from any computer the supports BLE (Windows or Mac) to an iOS app's CBCentralManager?
The data I want to send is purely text based. I'm searching for it but I am not being able to find if it is possible or a tutorial of how to do it.
Any help would be greatly appreciated.
Yes, normally you can do that. What you have to do is:
From the peripheral device (transmitter), advertise an CBService
(iOS) with a CBCharacteristic that support write value.
From the receiver, you create a CBCentralManager to search for the service created by the transmitter, then discover the right CBCharacteristic. Once the CBCharacteristic discovered, you can try to write value to that characteristic.
The processus look simple, but you have to do step by step on the receiver's side:
first, look for device
if device found, try to connect
then once connected to that device, try to discover the service
then once the service discovered, try to discover the characteristic
then once the characteristic is discovered, try to send
then you will receive the result of sending (ok or failed)
Take a look at my project in github, it's not complete but it show you how to exchange data between 2 BLE devices. The application is for iOS, but I'm pretty sure that you have the same code in Mac OS. I don't know how it works on PC.

iOS Bluetooth Device in pheripheral mode send request to one central device

iOS Bluetooth Smart.
We have few central devices and one pheripheral devices. How to send from pheripheral device request to one of centrals?
iOS support something like "direct advertising"?
Bluetooth peripherals are supposed to be used as advertisers that the Centrals can find and connect to. Not the other way around. Basically you need to set up your peripheral with service/s that the Central is scanning for. After the central discovers the peripheral, it can then choose to connect, and then exchange additional data between the devices.
Check out the Bluetooth Developer Site for more information.

BLE Shield used for ANCS iPhone

I have a http://redbearlab.com/bleshield/.
I successfully tested the Chat example and i have sent a message from iPhone to Arduino.
Now i want to test the ANCS functionality. From what i heard, the iPhone must be the Peripheral and BLE Shield must connect to ANCS service and then it will receive notifications.
Is it possible to discover and connect to bluetooth devices using BLE Shield? How?
Thank you!
Is it possible to discover and connect to bluetooth devices using BLE Shield?
yes it is possible! I'm currently writing an article and I'm also about to publish a library that handles ANCS notifications. It's way more complicated than only running the Chat example, though.
How?
To access the ANCS, here are the key things to do:
open nRFGoStudio
add the ANCS services into the pipe definition
force bonding to access the services
and generate the new services.h
in your code
when bonding is done shutdown and restart the BLE radio
wait until the ANCS pipes are opened
when they all are opened, subscribe to the ANCS Notification Source
to get more details, and a working library, please have a look at the following article I wrote:
http://i.got.nothing.to/code/on/avr-for-ble-and-ios
and the library:
https://github.com/guyzmo/avr_nrf_ancs_library
HTH

Resources