bluetooth-lowenergy

BlueZ: How to set up a GATT server from the command line

ⅰ亾dé卋堺 提交于 2019-12-28 05:45:08
问题 I would like to know if there is a way to set up a gatt server from the Linux command line. I know that the BlueZ gatttool command allows you to act as a gatt client and interrogate a remote gatt server, however, I do not think that this tool can be used to set up a server. What I want to achieve is a gatt server, created from the command line , and can be interrogated by any central device (e.g. iOS or Android device) to connect to the GATT server, discover the services and characteristics,

How to get the battery level after connect to the BLE device?

非 Y 不嫁゛ 提交于 2019-12-28 03:38:10
问题 I am developing an application where I have to connect to Bluetooth device on Android 4.3. And I want to get the battery level by using Battery_Service and Battery_Level . public class BluetoothLeService extends Service { private static final UUID Battery_Service_UUID = UUID.fromString("0000180F-0000-1000-8000-00805f9b34fb"); private static final UUID Battery_Level_UUID = UUID.fromString("00002a19-0000-1000-8000-00805f9b34fb"); public void getbattery() { BluetoothGattService batteryService =

Which correct flag of autoConnect in connectGatt of BLE?

谁说胖子不能爱 提交于 2019-12-27 17:34:10
问题 my goal is making an auto connection between Bluetooth Low Energy device and phone. I followed the sample code and I found the line // We want to directly connect to the device, so we are setting the autoConnect parameter to false. mBluetoothGatt = device.connectGatt(this, false, mGattCallback); The above code means that false uses to autoconnection. However, I found the API at here, it said that BluetoothGatt connectGatt(Context context, boolean autoConnect, BluetoothGattCallback callback,

how to add small circle connecting pop up menu when i click on item

 ̄綄美尐妖づ 提交于 2019-12-25 11:45:59
问题 how to add small circle like pop up menu(like it rolls and display text connecting )when after moving to that particular item it should display connected/disconnected(when connected)successfully.now following is my devicescan activity.in this i will get list of all ble devices. here is my devicescanactivity public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); getActionBar().setTitle("BLE Devices"); UUIDS=new UUID[]{(UUID.fromString("0000180f-0000-1000-8000

how to add small circle connecting pop up menu when i click on item

≯℡__Kan透↙ 提交于 2019-12-25 11:45:32
问题 how to add small circle like pop up menu(like it rolls and display text connecting )when after moving to that particular item it should display connected/disconnected(when connected)successfully.now following is my devicescan activity.in this i will get list of all ble devices. here is my devicescanactivity public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); getActionBar().setTitle("BLE Devices"); UUIDS=new UUID[]{(UUID.fromString("0000180f-0000-1000-8000

Why doesn't it find my beacons?

六眼飞鱼酱① 提交于 2019-12-25 08:58:27
问题 I am writing both Android and iOS apps which need to find BLE beacons around the device. When I run my code from Android, it finds several beacons in the room I am in. I have 8 beacons. When I run the beacon code from iPhone, it returns a list of exactly 0 beacons. Here is my code: - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view. self.locationManager = [[CLLocationManager alloc] init]; self.locationManager.delegate = self; [self initRegion]; [self

How do you read/write to the handle returned by hci_le_create_conn?

♀尐吖头ヾ 提交于 2019-12-25 08:37:42
问题 Using BlueZ-5.43, Nordic nRF52832 and Raspberry Pi Raspbian. I can create an l2cap socket and perform service discovery and attribute read and write operations on characteristics. However, this solution by-passes creating a connection via the HCI and subsequently uses defaults for parameters such as supervision timeout and slave latency. Going through hci.c using hci_le_create_conn allows me to override these defaults, but I get a handle number 64 with no obvious means to use this handle for

Android - BLE connection parameter and Storing BLE sensor data in SQLite Database

孤街浪徒 提交于 2019-12-25 08:30:22
问题 I am developing an Android app that receives data from a BLE sensor at a rate of about 8000 bytes per second. The connection logic in my app is based upon Google's BluetoothLeGatt sample. It works. I haven't changed anything and don't explicitly set any connection parameters like interval between connection events (I don't think the Android 4.4 APIs support that). I am testing on two Android phones, both using Android version 4.4.2 and am using the TI BLE sniffer to monitor BLE traffic. One

Android BLE write byte[] including unsigned values

本小妞迷上赌 提交于 2019-12-25 07:52:31
问题 this question started life here here but this appears to be a red herring! So, the issue is, I have a byte array of values that need to be written to a BLE device. byte bytes[] = {0x04,0x08,0x0F,0x66,(byte)0x99,0x41,0x52,0x43,0x55,(byte)0xAA}; ch.setValue(bytes); If I log the output of this array I get (note the negative values): [4, 8, 15, 102, -103, 65, 82, 67, 85, -86] But in theory this should only be java's representation of the values and shouldn't affect the perceived values when they

Can BLE peripheral mode trigger the disconnection or refuse to connect?

北战南征 提交于 2019-12-25 06:05:28
问题 Here's our situation. We have a machine vending machine run in peripheral mode and mobile runs in central mode. When the mobile is close to the vending machine, it triggers the connection and start to communicate. But as far as I know, the peripheral mode can only connect to one device at a time just considering bluetooh 4.0, so if there's someone who wants to make a trick stands around our vending machine and connects to it all the time, no one else can connect the vending machine. Am I