I will be using OBD2 device to get data form a car. I don't have the dongle yet, but am reading into how things should be done. As far as I understand the device should be with BLE on and should scan for peripherals with some specific service.
For example I need to get the speed of the vehicle. How should I know what is the UUID of the service I am looking for and what are the UUIDs of its characteristics and possibly some details about the data that should be received. For devices using GATT profiles for example they could be found here: https://www.bluetooth.com/specifications/gatt/services . But I don't find any such documentation for OBD2. I found this answer: here and the first one here. As far as I understand they suggest I need to look through all peripherals and all services there and try all characteristics to find the needed ones and distinguish them by the response. Is this the only way to do this? I found also this project: here where some UUID is used but I cannot understand where it comes from. Any suggestions how to get the needed UUID-s?
Related
For a project of mine I need a pairless bluetooth data transfer. I have first thought about doing it with BLE IBeacons but they can only advertise a very limited amount of data. I looked further through the Apple documentation and found this tutorial about Central/ Peripheral
BLE data transfer. I've implemented the code in my project but even though the devices were very close together they could not "see" each other. I have since looked up on the Internet and could not find a hint about whether the devices need pairing or not and what the problem of mine could be(the code is not throwing any errors nor warnings).
If it does require pairing, is there some way to do that in the background without requiring the user to perform an action, so that I could theoretically advertise some kind of pair request via. IBeacons to then transfer the data? If that's not the case, is there even a way to transfer data (mono directional, round about 512 bytes) between nearby bluetooth devices without user actions?
greets from germany!
To get started with Bluetooth Low Energy or any other protocol, it's best to learn how it works. At least basics.
Simplifying. BLE allows you to send data:
"Passive" (without conncetion) - over Advertisement Data. The size of the packages depends on the BLE version.
"Active" (requires connection with the device) - bidrirectional comunication. In this case size of the data package also depends on the BLE version.
Bonding and pairing is a separate issues.
I suggested you look at the following book:
https://www.oreilly.com/library/view/getting-started-with/9781491900550/
The websites of BLE module manufacturers also offer a lot of information about this technology. For example Nordic or TI. Very often with sample programs for various platforms.
For iOS:
https://developer.apple.com/videos/play/wwdc2017/712/
https://developer.apple.com/bluetooth/
You may also be interested in sending more data without connection using version BLE 5.0
https://www.bluetooth.com/blog/exploring-bluetooth5-whats-new-in-advertising/
Is there a way to find out what type of device it is that I have scanned?
After iOS 7?
For instance, APPLE, DELL, LENOVO, ect.
Thanks
You can check to see if the device you have connected to implements the Device Information service. If it does then you can read the Manufacturer Name characteristic.
There is no way of determining this information without actually connecting to the peripheral.
This would only be possible if the product developer included this in the advertisement data or within a GATT service.
You can observe advertisement data when CBCentralManager discovers peripherals, see documentation here.
Information like this might be found under the CBAdvertisementDataManufacturerDataKey dictionary key.
I am new to Objective c and I want to send simple strings from an iPhone to an arduino an vice versa with Bluetooth. I have read apples information about Core Bluetooth, but I am having trouble understanding it. As I said, all I need the iPhone to do is: 1) connect to the BLE device of the arduino. 2) Send instructions (in the form of strings) 3)get a response from the arduino when the instructions have been carried out, so that the next set of instructions can be sent. I would be very happy if somebody is able to help me with this project
Thanks
You should follow the wwdc presentation on core bluetooth.
You should probably start here
I suggest operate your device with YMSCoreBluetooth.
The basic step to operation bluetooth device is:
Search all nearby device by blue tooth scan, you will find all nearby device.
Stop your scan. Connect one of the devices found in response.
Discover all services on the device.
Discover all character in service found by service discover action.
Write your content into character found in 4.
You can read character value from device.
YMSCoreBluetooth let you write your logic in one code block instead of separate delegate.
I've written an app that could (as a side effect) provide information to another app (not mine) running on the same iDevice. In order to do so, I'd need to make my app a BLE Peripheral providing the BLE service that the other app looks for. If I were to do this, would the other app be able to connect to my Peripheral app, even though it's running on the same iDevice?
I've only found one passing comment on the topic, in this Stack Overflow answer. It says: "Note that you cannot connect to your own device even if it acts as a peripheral" but I'm not ready to give up on the basis of one opinion. Is there any authoritative documentation that rules this out, or is this something people know from trial and error?
I've been googling this problem, but haven't gotten the wording right.
Basically I'm looking for an API, or some seeds of guidance in how I would go about writing a program where you get push notified if someone is in the same area as you based on GPS coordinates. In short: a realtime 4square not based on checking-in but based on GPS.
Part of me feels like this is something Apple may frown upon, but if the user is notified and making the decision to run the app, perhaps not.
Thanks in advance.
You're looking for the Bluetooth Bonjour type notifications found in GameKit. This has nothing to do with GPS and is instead based of short range radio (Bluetooth) which advertises itself using a zero conf protocol. The APIs basically give you the ability to broadcast your service (eg. "MyGame") over bluetooth and listen for others potentially broadcasting the same service.
If you're talking about geographic vicinity, you'll need to set up a central server where each device can register its location, and which will provide locations of nearby devices. A service like FourSquare does exactly this kind of thing.
Another way to look at 'vicinity' is network vicinity. You could have each device advertise itself via Bonjour and look for other devices doing the same.