I need to broadcast custom ble advertisement data from an ios/android device to many custom BLE Devices. My goal is to set the bytes of the ble adv package to broadcast it to ble devices nearby.
As far as is i know i need to set the payload of the advertise package of my ios / android device.
In my case it isn’t possible to simply connect to every ble device and write characteristics values, because i need to broadcast data to many devices.
Is there any way to solve this problem with flutter / flutter blue?
Advertisement is not meant to connect to devices, just advertising data.
If a device is advertising, it is up to the receiver to make a connection and exchange data.
This is only possible if the application on the receiver is made for the advertising device, or has some pre-defined protocol to interact with advertising devices that have the same protocol.
In the advertising packet there is a flag that states if the advertiser is connectable or not.
Related
How to connect BLE multiple devices at the same time in Swift
I'm working on iOS application project using BLE to transfer some data between them. The concept is one device is the main device that broadcast the data to other devices, then device that get data from bluetooth send data back to the main device.
How to connect multiple devices at the same time using core bluetooth? (1-to-many topology)
Is that possible to send and receive data in the same time?
There are two different roles: peripheral and central.
A peripheral typically has data that is needed by other devices. A central typically uses the information served up by a peripheral to accomplish some task.
The central can discover and connect to multiple peripherals.
See Core Bluetooth Programming Guide for details. Even it is archived, it has the good overview of the feature.
I'm using an app that uses Bluetooth low energy to scan and detect devices however it does not detects other phones
is there a specific way on flutter to make it detect other mobile phones
You can only detect BLE devices that are advertising their services. A mobile phone often does not do that on its own. There are two solutions:
Use an already available app on the other device to advertise some service. One of the possible apps I personally use is nRF Connect, another one would be BLE Peripheral.
This might not be sufficient depending on your project and goal this might not be sufficient. If you need some specific service or characteristic that can't be generated by pre-existing apps you have to develop your own app for advertising. This would be possible with flutter_ble_peripheral (limited functionality on iOS)
The issue is when my flutter app is in bluetooth scanning mode it is detecting all the devices so i need only smartphone to detect using my app and other devices like smarTv,smartwatch and bands and headphones i need to reject them in my flutter app
Unfortunately there isn't a way to conclusively detect only smartphones and display them. When advertising with BLE, many devices use the "GAP Appearance" flag to specify their type (e.g. phone, computer, tag, clock, etc), but not all devices follow this convention, and many devices don't use this tag, so you are bound to display devices that are not smartphones.
For more information, have a look at the following links:-
How Bluetooth Low Energy Works: Advertisement
BLE Specification Generic Access Profile
BLE Specification GAP Appearance
I hope this helps.
We can make iOS devices act as a iBeacon transmitter and We can locate nearby iBeacons if we know their Proximity UUID.
With Google's Proximity Beacon API, It's possible to configure and register real Beacon hardware, and we can locate them with Nearby Messaging API.
But is it possible to make iOS devices to broadcast as Eddystone Beacons ? And it needs to be discoverable by apps that scan Eddystone beacons.
Thanks in advance.
Unfortunately, this is not possible. While iOS devices can advertise Bluetooth LE service advertisements(which are the advertisement type used by Eddystone) using CoreBluetooth APIs, you cannot attach the necessary data. This is because the CBAdvertisementDataServiceDataKey that associates service data to an advertisement is read-only on iOS. You can't set the data.
So while you want to make the iOS device advertise something like this to transmit Eddystone-UID:
0201060303aafe1516aafe00e72f234454f4911ba9ffa6000000000001
You end up advertising something like this:
0201060303aafe0316aafe
This leaves off the Eddystone-UID type code (00), the calibrated power (e7), the namespace identifier (2f234454f4911ba9ffa6) and the instance identifier (000000000001). As a result, it won't be recognized as an Eddystone-UID frame.
The Bluetooth v2.1 specifies the so called "Secure Simple Pairings" methods - one of those methods is called Out of band (OOB) and according to Wikipedia This method uses an external means of communication, such as Near Field Communication (NFC) to exchange some information used in the pairing process.
Whatever is the "external means of communication" of getting the PIN, the handsfree device id, etc. - is it possible on iPhone to initiate the hands-free connection from the code? I.e. if i have all necessary information in my application can I say iPhone to connect to the handsfree using given information?
If it is not part of the public API, has Apple some process to allow some companies to get access to some additional non-public features?
If you want to connect a Bluetooth 2.1 device to your iOS device, you must do it through the Settings->General->Bluetooth screen.
However, for the iPhone4S and the New iPad, you can detect and connect Bluetooth devices that Low-Energy devices.
The Bluetooth Low-Energy specification is part of the (some-what) new Bluetooth 4.0 protocol and only these two Apple devices have the necessary components to connect with low energy devices.