flutter_blue shows mac address instead of Names - flutter

I am running flutter_blue example,it doesn't raise any error but after searching for bluetooth devices it shows mac address instead of Local Names.alse after clicking on connect it doesn't connect.
I did make sure that other devices are ble support, even I purchased Bluetooth v4.0 usb dongle to be completely sure about Bluetooth version, but nothing changed.
also, I thought it may be related to my android phone,I reset(factory) the phone and wiped cache but nothing changed.
my cellphone is Sony Xperia Z3+ with android 7.1.1;
any Idea what is wrong and why I can't get devices name in scan?

It was gattserver, couldn't broadcast properly,I changed gattServer with another app in another smartphone and now it shows the Name of GattServer.

Related

Core Bluetooth: Cannot find a BLE device in the app again if reinstalling the app without disconnecting the BLE device properly in the app

When I reinstall the app without disconnecting the BLE device, the phone keeps the connection so when I reinstall my app and scan for a BLE device, the last connection will appear in os level, but not in-app level. This causes me to not discover a BLE device if it is not disconnected on the app properly before. My tester insists that if I reinstall the app, I should not see a connection and discover the BLE device anyways.
I can retrieve a BLE device connection in the app if I know the UUID and services, but it is impossible without these as I see in the documentation. Is there any other way to resolve this problem?
This is precisely what retrieveConnectedPeripherals(withServices:) is for. That will return already connected (at the OS level) peripherals that advertise a particular list of services.
You will still need to call connect on the returned peripherals. "Connect" in this context means "to the app," not "to the device." The docs refer to these "app" connections as "local."

cordova-plugin-ble-central autoconnect function always prompting user to pair the device

I'm currently working on an ionic capacitor app that needs to connect automatically with a ble device.
I'm using the ble ionic native plugin:
https://ionicframework.com/docs/native/ble
https://github.com/don/cordova-plugin-ble-central
The goal is sending and receiving bluetooth info and commands to the ble device, which is a car alarm central that controls a few actions like lock and unlock the doors accordingly to the RSSI values on from the device.
So, I'm using the autoconnect function to auto-connect with the device as soon the device is close to range and all works perfectly in Android and iOS. The only issue is that everytime the device reachs the ble range and the ble plugin try connecting, the system prompts the user to accept pairing with the device again.
I need it to work without that pairing prompting everytime. I tried to pairing the device previous to initialize the app but it didn't worked as well. So is it a way to make this autoconnection work without prompting the pairing acceptance everytime it is disconnected?
The issue occurs on Android versions 9 and 10 and iOS.
I've changed my ble hardware interface to ask for a PIN code. I guessed the connection could be considered secure by the OS and prevent prompting the user to pair again. Didn't work as well.
Every connection started by the plugin seems like bounding and connecting as if it was the first time connecting to the device. Even connecting to a known device is prompt the user to input the PIN, which if not provided the OS forgets the device.
Any toughts? Anyone? Thank you!

HttpUrlConnection on Android Wear with connected phone

I am trying to access the network with my Android Wear 2.0 App.
The Problem:
If the smartwatch is connected with the phone then I get an connection timeout. But if the smartwatch isnĀ“t connected with the phone then the connection works fine.
I am using HttpUrlConnection.
Thanks and sorry for my bad english!
This has been answered in a different post:
Android Wear 100% packet loss
The basic idea is that you should not count on having Wi-Fi on the watch. The user may disable Wi-Fi on the watch and then your application will not work on the watch. Instead you should use your companion phone app to connect to the internet. If the phone isn't connected to your watch then use Wi-Fi.
Even if you want your app to run on an LET enabled watch the user may have turned this off or may not have a SIM card installed. At this point the user will most likely still expect your app to work.
So depending on what it is you're working on, if you want your app to work even while connected to the phone, then make a companion app for the phone. If you want your watch app to be a stand-alone app but you still want to be able to access the internet even when the watch is connected to the phone then you're basically saying that you want to drain the user's battery by using Wi-Fi/LTE instead of going via Bluetooth through the phone to access the web.

If a bluetooth device is not in the MFi program, which profiles should it support so that an IPhone app can check it MAC or name?

I would like to build an IPhone app that should check the identity of a BT device, by name or MAC.
If the device is not part of the MFI programme what profiles should the device support in order for an IPhone app to connect to it and validate its MAC or name ?
Cheers,
Ionut
I'm not sure you need to connect to something to get a MAC address or a name. My coworker's iphone seems to see all other bluetooth devices in our work area and displays the names, it just won't connect to them. And I'm sure it gets the MAC before it gets the name, but avoids displaying it to the user because names are a lot more friendly.
I do know that with android and blackberry, you actually use MAC addreses as your basic internal identifier, and only pull out the name when you want to identify your remote devices to the user.
If you really do need to make a connection from iOS to non MFi bluetooth radio, the advanced audio distribution profile (A2DP) would do what you want. There's a product out there I've seen that is a bluetooth controlled power board, and it used audio pulses being transmitted over A2DP to get around MFi requirements. Though you should reconsider this approach because it's problematic for a non audio device to advertise an audio profile. And this fake audio device will get seen by by a lot more than your application.
If you're happy to only work with iphone 4s and above, I've also heard rumours that bluetooth LE(4.0?) devices are not required to have the apple verification chip... but haven't really looked into it

Device Type identification from MAC address

Can I determine if a device is IPhone/IPad/IPod or Android from its MAC address ? MAC addresses can be used to identify the manufacturer but can I distinguish a Macbook pro from an IPhone ?
Unless Apple uses unique wifi chipset suppliers for a Macbook that would never be used for an iphone (e.g. samsung for iphone and toshiba for macbook), a mac address will only ever tell you who manufactured the particular wifi chip in use. Maybe certain ranges of mac addresses would only ever show up in one type of device, but you'd have to compile that list yourself.