0
votes

When I am using CBPeripheralManager

- (BOOL) updateValue: (NSData *) value forCharacteristic: (CBMutableCharacteristic *) characteristic onSubscribedCentrals: (NSArray *) centrals; 

Can be used to send data from peripherals to the central[CentralManager] .

But how can I send data from central[CBCentralManager] to Peripherals? There is no method for that?

At last, how CBPeripheralManager receive data?

I have a question about CoreBluetooth

Here is the code https://drive.google.com/file/d/0B1trn7LauGlrWmdIQUJkcldvZzg/edit?usp=sharing

There are two projects are Central and Peripheral

When the Peripheral connections Central. There is one in the Peripheral SendData method that can send data to the Central, in Central has a method for receiving data

  • (void) peripheral: (CBPeripheral *) _peripheral didUpdateValueForCharacteristic: (CBCharacteristic *) characteristic error: (NSError *) error

The question is, how can I send data from the Central and Peripheral receives it?

2

2 Answers

1
votes

you can use CoreBluetoothPeripheral in your app

https://github.com/liquidx/CoreBluetoothPeripheral
it will allow you to send and receive data. Meanwhile you can contact for helping at skype(boygaggoo)

0
votes

Take a look at the writeValue:forCharacteristic:type method from the CBPeripheral that your CBCentralManager has discovered.

Also you will have to implement the peripheralManager:didReceiveWriteRequests: protocol method form the CBPeripheralManagerDelegate.

Here are the links for the Apple reference:

Hope it helps!