ios-bluetooth

Is possible send hexadecimal data to A2DP Bluetooth Device in swift?

北城余情 提交于 2019-12-08 09:35:22
问题 I am developing an application on iOS that connects to a Bluetooth A2DP device but I can not send instructions in hexadecimal to make it work. Somebody could help me? I can not find information. With AVAudioSession.sharedInstance().currentRoute I can see the UID and the name of the device but not send data. let route = AVAudioSession.sharedInstance().currentRoute let outPort = route.outputs.first if let outPort = outPort { print("out port name:\(outPort.portName)") } Could you help me? Thanks

Method captureOutput:(AVCaptureOutput *)captureOutput didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer fromConnection only called a few times

大兔子大兔子 提交于 2019-12-08 02:39:31
问题 I'm capturing audio from external bluetooth microphone. But I can't record anything. This method is only called one time, at the beginning of the current AvCaptureSession. - (void)captureOutput:(AVCaptureOutput *)captureOutput didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer fromConnection:(AVCaptureConnection *)connection After that I never get called this method for process the audio. For instantiate the capture session I do this: self.captureSession.usesApplicationAudioSession = true;

Subscribing for notifications from a CBCharacteristic does not work

限于喜欢 提交于 2019-12-07 01:37:14
问题 First things first: running OSX 10.10.4, iOS 4, Xcode 6.3.2, iPhone 6, Swift Short story: I have a certain Bluetooth LE device here from which I want to receive notifications when values of a Characteristic change, e.g. by user input. Trying to subscribe to it does not succeed, but rather yields an error Error Domain=CBATTErrorDomain Code=10 "The attribute could not be found." Long story: So, I have a BluetoothManager class in which I start scanning for Peripherals as soon as my

Method captureOutput:(AVCaptureOutput *)captureOutput didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer fromConnection only called a few times

为君一笑 提交于 2019-12-06 13:37:49
I'm capturing audio from external bluetooth microphone. But I can't record anything. This method is only called one time, at the beginning of the current AvCaptureSession. - (void)captureOutput:(AVCaptureOutput *)captureOutput didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer fromConnection:(AVCaptureConnection *)connection After that I never get called this method for process the audio. For instantiate the capture session I do this: self.captureSession.usesApplicationAudioSession = true; self.captureSession.automaticallyConfiguresApplicationAudioSession = true; [[AVAudioSession

BLE: Read Long Characteristics Value using Android / iOS

谁都会走 提交于 2019-12-06 11:01:18
With a normal Characteristics Read only the MTU Size (20bytes) of data will be read. My customer will offer a characteristics with a larger size (about 100bytes). I saw that BLE offers a "Long Read" feature which reads until the size of the characteristics is reached. ( https://bluegiga.zendesk.com/entries/25053373--REFERENCE-BLE-master-slave-GATT-client-server-and-data-RX-TX-basics ) attclient_read_long command - Starts a procedure where the client first sends normal read request to the server, and if the server returns an attribute value with a length equal to the BLE MTU (22 bytes), then

BLE takes too much time while sending data from iOS 7.1 to iOS 8

左心房为你撑大大i 提交于 2019-12-06 01:54:01
问题 I have a strange issue. I am developing an app in which I am sending Chunks in 20-20 bytes. . Everything is working fine. When I am sending Bytes data from iOS 8 to iOS 8 device it take around 4-5 second to transfer from one device to another, but my problem is when I am sending Bytes data from iOs 7.1 to iOs 8 or reverse, It take around 17-20 seconds to transfer the data from one device to any device. Why it's taking too much time in iOS 7.1 to iOS 8 or reverse? 回答1: Try to look at some of

iOS Detect Bluetooth connection/disconnection

帅比萌擦擦* 提交于 2019-12-05 21:35:37
问题 Is it possible to be notified when a Bluetooth Device is connected or disconnected from iOS even when my app is in background ? On Android, I use the ACTION_ACL_CONNECTED and ACTION_ACL_DISCONNECTED events. But I cannot find equivalents for iOS. I found the CBCentralManager that can be used to monitor Bluetooth events, but my functions aren't called when a bluetooth device is connected/disconnected, only when I enable/disable the bluetooth. Is it an error on my side or is it normal ? I also

Subscribing for notifications from a CBCharacteristic does not work

℡╲_俬逩灬. 提交于 2019-12-05 05:48:50
First things first: running OSX 10.10.4, iOS 4, Xcode 6.3.2, iPhone 6, Swift Short story: I have a certain Bluetooth LE device here from which I want to receive notifications when values of a Characteristic change, e.g. by user input. Trying to subscribe to it does not succeed, but rather yields an error Error Domain=CBATTErrorDomain Code=10 "The attribute could not be found." Long story: So, I have a BluetoothManager class in which I start scanning for Peripherals as soon as my $CBCentralManager.state is .PoweredOn . That's easy, I'm even a good citizen and scan specifically for those with

In CBCentralManager delegate method didDiscoverPeripheral: never called

爷,独闯天下 提交于 2019-12-04 19:17:57
I initialize the CBCenteralManager in viewdidload on main queue. First time update state method is called and start scanning for bluetooth devices but didDiscoverPeripheral: delegate method never get called. Code is : - (void)viewDidLoad { [super viewDidLoad]; self.CM = [[CBCentralManager alloc]initWithDelegate:self queue:nil]; } -(void)centralManagerDidUpdateState:(CBCentralManager *)central{ if (central.state == CBCentralManagerStatePoweredOn) { [self.CM scanForPeripheralsWithServices:nil options:nil]; } } - (void)centralManager:(CBCentralManager *)central didDiscoverPeripheral(CBPeripheral*

Bluetooth headphone music quality deteriorates when launching iOS simulator

若如初见. 提交于 2019-12-04 07:20:02
问题 The situation goes a little something like this: I am programming Xcode whilst concurrently listening to music on my bluetooth headphones... you know to block out the world. Then, I go to launch my app in the iOS simulator and BOOM all of a sudden my crystal clear music becomes garbled and super low quality like it is playing in a bathtub 2 blocks away... in the 1940s. Note: the quality deterioration does NOT occur if I am playing music on my laptop or cinema display and I launch the sim.