Questions tagged [bluetooth]

1

votes
2

answer
39

Views

Encoding in 8 Bit Integer to Text in Python 3

I updating a script to Python 3 from Python 2 and having trouble with the line below, it decodes and displays the RSSI value of a BLE Beacon: rssi = struct.unpack('b', packet[packetOffset -1]) I found an alternative method to get the same result, which takes the 2 last characters in the broadcast...
tbowden
1

votes
3

answer
142

Views

How to write large amount of text to write characteristic

I am writing an Android application with Xamarin.Android, but an answer in native Android would be appreciated as well. In my Android application, I have a BLE Write Characteristic that devices can write to. It works, but I can't send more than 20 bytes, the rest gets cut off. My code to create and...
Darius
1

votes
2

answer
7.8k

Views

Multi connection via bluetooth in android

Hy , We are working on the android multiplayer game via bluetooth. It is a multiplayer LUDO game in which 4 player connect to each other and play the game. We are stuck in connection with the 3rd and 4th player connection. private OnMaxConnectionsReachedListener maxConnectionsListener = new OnMaxCon...
fahad Idrees
1

votes
1

answer
849

Views

What is the service, characteristics for step count in Bluetooth LE?

What is the service, characteristics value (UUIDs) for step count in Bluetooth Low Energy? The corresponding pages for bluetooth docs does not list any for steps. How to calculate steps count? Does steps count devices use running speed and cadence service? Thanks.
0

votes
0

answer
5

Views

Hi! I'm looking for a code for sharing files using bluetooth

I'm a newbie. At least little explaination and a link of it would be great! Tnx in advance.
1

votes
0

answer
69

Views

IOS - Connecting to bluetooth device in background periodically

I have a bluetooth device which connects to my iphone and i can perform all sorts of operations on the device. Its a tracking device and I log all sensor based data in the device. Since the device have a data limit, I want to read data from the device once every hour and dump it into a file through...
Kpatel1989
1

votes
0

answer
98

Views

IOBluetooth Mouse Battery Level

Is it possible to read battery levels from a Bluetooth mouse (Magic Mouse 2 in this case), using the IOBluetooth framework? Would this require writing a request as data through a L2CAP or RFCOMM channel? I got as far as reading the SDP service records, but am not sure how to proceed.
comfortablejohn
1

votes
0

answer
171

Views

Send continuous data via bluetooth while button pressed

I want to send data via bluetooth while a button is pressed. I am using an ontouchlistener. After the button down event happens the data transfer is started but when the button up event happens the transfer is not stopped immediately. At the bluetooth receiver side I see a lot of data incoming still...
Daniel
1

votes
1

answer
51

Views

Automated mobile testing strategy for the usecases that involves multiple phones - say bluetooth data transfer, etc

What could be the best automation test strategy for mobile uses cases that involve multiple devices: Bluetooth data transfer Push data from one phone and pull the same from other phone Hit like or share button on one phone and see the count updated on the other phone Send SMS from one phone and chec...
RaMo
1

votes
0

answer
108

Views

Using Bluez (with C) to receive BLE notifications

I'm looking for an example (without having to reverse engineering hcitool and/or gatttool) for using Bluez (C api) to pair a 'peripheral sensor', read/write characteristics, and receive notifications from the peripheral. Pointers to an example or documentation would be appreciated! Thanks!
ckt-designer
1

votes
0

answer
116

Views

Can I call CBPeripheral writeValue:forCharacteristic:type:CBCharacteristicWriteWithoutResponse multiple times?

I need to write different values to a single characteristic very quickly. I'm using [cbPeripheral writeValue:myData forCharacteristic:myCharacteristic type:CBCharacteristicWriteWithoutResponse] Since I'm using WithoutResponse, I can't utilize a callback to know when it's safe to fire off another wri...
Toasty
1

votes
0

answer
181

Views

Python and Bluetooth

I am doing my best to learn Python by writing a script for my home automation setup. I want to monitor the presence of 4 Iphone's and as things are right now I want to avoid installing any app to handle this. (Yes, this is both impractical and not 100% accurate - but why go the easy route? :)) I hav...
pittbull74
1

votes
0

answer
74

Views

Bluetooth-serial(iOS) + Rongta RPP200-B - slowly and chopped print

I use bluetooth printer Rongta RPP200-B and cordova plugin Bluetooth-serial for printing on mobile devices. On android devices are everthing ok, but on iOS devices is printing very slowly and chopped, especially images are printing very very slowly. I tried to changed native objective-c implementati...
krata
1

votes
1

answer
68

Views

Peripheral state never changes after CBPeripheralStateDisconnecting state on mac osx 10.13 CoreBluetooth framework

I have updated macOS to High sierra and Xcode to 9.2. I am working on BLE device connection / disconnection and reading data. It was was working fine in Xcode 8.2, Now there are changes in CoreBluetooth framework. A new state CBPeripheralStateDisconnecting is added in peripheral state. Now, I need...
user8154740
1

votes
2

answer
194

Views

How to not get clicked when using Bluetooth barcode scanner of alert dialog buttons?

I use Cilico CT80 2D CMOS Barcode Scanner. It uses my physical keyboard as a default. When the alert dialog shows with positive and negative buttons it automatically presses the 'left most' button after scanning a barcode. Every after scan it will virtually hit 'enter'.
Sauer Voussoir
1

votes
2

answer
36

Views

AndroidPlot, what is the biggest value we can put into plot?

I have a program on micro-controller (uC) which send data in intmax_t format (my goal is to send 19 bytes). I'm receiving on my Android app value which is send from uC (I'm sending data through Bluetooth Low Energy module). Then I'm parsing this value and putting it as Double. Here it is my code for...
chebad
1

votes
0

answer
86

Views

Connect BLE device from F#

Since F# is not (yet) supported by .net native compiler, is there another process to connect a BLE device from an F# application? As far as I can see, 32feet uses UWP, and all other examples I found are also based on UWP. And as far as I know, UWP is based on the .net native copmpiler.
Peter Siebke
1

votes
1

answer
1k

Views

Play sound in speaker while headphone is connected

How to play sound in speaker while a headphone or Bluetooth headset is connected? I have tried the code below, but still the same: AudioManager audioManager = (AudioManager)context.getSystemService(Context.AUDIO_SERVICE); audioManager.setMode(AudioManager.STREAM_MUSIC); audioManager.setSpeakerphoneO...
hiwehuvelu
1

votes
0

answer
207

Views

How to keep output on bluetooth device in AVAudioSession with PlayAndRecord when the BT-device only has a speaker?

I've created an AVAudioSession with AVAudioSessionCategoryPlayAndRecord and AVAudioSessionCategoryOptionDefaultToSpeaker | AVAudioSessionCategoryAllowBluetooth as option. As long as a device with speaker and mic is connected everything is fine. The sound comes out of the external-speaker and the inp...
MatzeLoCal
1

votes
0

answer
526

Views

Bluetooth Low Energy with Android NDK

So I am developing an app which connects to an EEG board over BLE. My app is building on Google BLE Gatt Sample and is used to receive EEG samples from the previously mentioned board. These samples are transmitted as 100 packets/s as this is the limit according to them, before major packet loss is...
LittleCatSteps
1

votes
0

answer
305

Views

Why is DeviceInformation.CreateWatcher not returning

I have a method that has started failing, but only on one of my test machines, it works fine on the others. Here's the entire method private void ScanBluetoothDevices() { deviceWatcher = DeviceInformation.CreateWatcher('(System.Devices.Aep.ProtocolId:=\'{e0cbf06c-cd8b-4647-bb8a-263b43f0f974}\')', _R...
dumbledad
1

votes
0

answer
979

Views

Unable to connect to BLE: [CoreBluetooth] XPC connection invalid error

I am using an Adafruit nRF8001 bluetooth module with an Arduino Nano micro controller. The goal is to connect the nRF8001 to an iOS application. This connection was successfully made using an Arduino Uno. However, when switching to the Arduino Nano, the connection cannot be made and the following is...
c.f.harris
1

votes
1

answer
98

Views

Stream.Read doesn't return anything if nothing has been sent

I'm trying to receive data via bluetooth in Xamarin.Android. If I have data to receive, my method work fine. But if nothing has been sent, nothing is returned from Stream.Read method (_inputStream.Read(buffer, 0, buffer.Length)). Any idea what am I doing wrong? private Stream _inputStream; public s...
perozzo
1

votes
1

answer
338

Views

Ionic BLE Connection Issues

I'm using the Ionic Native BLE plugin to scan and connect to bluetooth devices. I'm able to get the plugin to list available devices, but I'm unable to get it to show already paired devices. This is the plugin I'm using: https://ionicframework.com/docs/native/ble/ After searching through the documen...
Johnathan Brown
1

votes
1

answer
336

Views

Bluetooth serial with C# and Mono on Raspbian?

I've been trying to create a C# Windows Forms Bluetooth serial application and then run it via Mono on my Raspberry Pi 3. I tried the following: String SelectedDevice = AvailableDevicesComboBox.SelectedItem.ToString(); BSerialPort = new SerialPort(SelectedDevice, 115200, Parity.None, 8, StopBits.One...
Martin
1

votes
1

answer
269

Views

Read data from BLE in background

I have a problem with reading data from BLE device in background. Every 30 seconds I must ask my device for data and save it in database. Unfortunately Timer is not working in background so I tried to use CLLocationManager and update location every 30 second and then read value from device. It is wo...
Daloteon
1

votes
1

answer
140

Views

/dev/rfcommo not giving any data when reading OBD data in raspberry pi via bluetooth

I am trying to connect my raspberry pi to a Bluetooth OBD adapter. I have verified that the OBD device is working by connecting to it from the android phone using Torque lite app. I am following this tutorial to connect the raspberry pi to the OBD adapter. I am able to pair with the OBD adapter and...
Kiran
1

votes
0

answer
37

Views

How to hide popup alert dialog box of Bluetooth pairing while connecting with HC-05 Bluetooth module?

I want to implement an app which connects with HC-05 Bluetooth module. While connecting with HC-05 Bluetooth module an popup of alert dialog box which ask for password comes for 3-4 seconds and disappears but it connects successfully. I want to hide alert box which comes for 3-4 seconds. How to solv...
imasirt
1

votes
0

answer
118

Views

Android: connect multiple BLE devices without using third party libraries

I am working on Android BLE Devices. Right now, I am trying to keep state connected of two BLE devices(eg. two Scales devices or Activity Sensor devices). Well, I know I can do that by using multiple services where each service contains different BluetoothGatt object for different BLE devices. But I...
Aanal Mehta
1

votes
1

answer
279

Views

Android Things Bluetooth Le permissions

I am trying to debug may Android Things BLE app in Android Studio. I am trying to do a simple scan on my main activity thread but I keep getting this exception: 01-17 02:13:24.735 29032-29044/com.dv.iotitag W/Binder: Caught a RuntimeException from the binder stub implementation. java.lang.SecurityEx...
David Vescovi
1

votes
0

answer
64

Views

Turn based android app (bluetooth)

Im working on a bluetooth android app/game, this consists of two players connected via bluetooth and try to guess the other's number. This is what i have done: Connect via bluetooth two devices. Choose your number. Try to guess the other's number and get the result. Show the opponent's guess. Win, i...
Juan Manuel
1

votes
1

answer
43

Views

Select last connected audio source android

How can I automatically connect to the last connected audio source in Android? We are building a video doorbell app, now instead of giving the user option to select audio output our UI/UX team asked us to hardcode selecting to the last selected audio source. Ex: If a bluetooth is connected I have to...
Adithya.K
1

votes
1

answer
270

Views

How to disconnect a ble device in android

I am trying to disconnect a Bluetooth Low Energy (BLE) device.My code works fine in lollipop and lower versions and connecting again to the BLE device also works fine. However, when I disconnect in nougat it disconnects the BLE device, but connecting again fails and shows the error 'app is not respo...
Bichitra Pradhan
1

votes
1

answer
149

Views

Swift: Airdrop/Bluetooth sync CoreData (SQLite) between apps [closed]

I have an app that utilizes a CoreData SQLite database, and would like to be able to synchronize these databases across different devices. To accomplish this, I need help with 2 specific steps: Packaging a coredata database into some kind of store/entity (ex: store container) that can be transferred...
riceman89
1

votes
1

answer
256

Views

Getting positional location of android device respective of other android devices [duplicate]

This question already has an answer here: Is wifi/bluetooth Triangulation(not trilateration) using a mobile device possible? 2 answers I want to create a way to let users communicate with phones in front or behind them or right of them or left of them. Although this cannot be achieved with GPS, I w...
cruzhacker2020
1

votes
0

answer
932

Views

AttributeError: module 'socket' has no attribute 'AF_BLUETOOTH'

I wanted to use bluetooth in Python to comunicate with my robot, so I looked online for some tutorials. I've found some examples using socket module which I've used before. So I tried to use it, but I'm getting this error AttributeError: module 'socket' has no attribute 'AF_BLUETOOTH'. I've checked...
to_matih
1

votes
0

answer
301

Views

Kotlin, Bluetooth - intent.getParcelableExtra(Bluetooth.EXTRA_DEVICE) returns Null and crashes

var pairedDevice = mBluetoothAdapter.bondedDevices deviceAdapter = DeviceAdapter(this,pairedDevice) bluetooth_listView.adapter = deviceAdapter layoutManager = LinearLayoutManager(this) bluetooth_listView.layoutManager = layoutManager mBroadcastReceiver = object : BroadcastReceiver() { override fun o...
Lowkin
1

votes
0

answer
165

Views

Bluetooth LE Enumeration with DevicePicker issue

I am developing an application to enumerate Bluetooth LE devices, showing them in standard DevicePicker and connect to specific device. Connecting works fine in my code, but I have a problem with enumeration. To display devices, I have to enumerate them with other app, like Bluetooth LE Explorer fro...
Sha-1
1

votes
0

answer
119

Views

How to play the music in the Bluetooth speaker programmatically?

I want to play the audio of my app to Bluetooth enabled speaker in Xamarin. I tried with this code. It is not working. It throws an error like invalid cast exception for MBluetoothAdapter.GetProfileProxy. Can anyone please suggest how to do it in Xamarin.Android? private IBluetoothProfileServiceList...
ramya br
1

votes
0

answer
228

Views

Updating bluetooth device name

I have a bluetooth blueNRG device on STM32 mcu firmware to which I'm programming. I want user to be able to change the name under which device is visible over bluetooth. The app sends new name to device, device stores it and upon next start when initializing bluetooth it sets it by updating the devi...
Vit

View additional questions