At this point, the Peripheral is getting the question. Time to answer it.

The user of the Peripheral Mode device now has a question that was asked by the Central Mode device displayed. They select an answer, or simply hit the “SEND A RANDOM ANSWER” button. This will initiate the process illustrated in the timeline above.
Here’s what is happening:
- The app uses the SDK’s “
sendAnswer(_:)” method of theITCB_SDK_Device_Centralinstance that was sent with the question, to send the answer (as a String). - The
ITCB_SDK_Device_Centralinstance calls the Core BluetoothCBPeripheralManager.updateValue(-:, for:, onSubscribedCentrals:)method to send the new value of the answer Characteristic to the Central. - The Peripheral gets a confirmation callback, using the observer
answerSentToDevice(_:, answer:, toQuestion:)method, that the answer was sent. - On the Central end of things, the CBPeripheral that was associated with the Peripheral device is notified that a Characteristic value has a proposed update, and uses the
CBPeripheralDelegate.peripheral(_:, didUpdateValueFor:, error:)method of theITCB_SDK_Device_Peripheralinstance that the Central had assigned to the Peripheral. - The device instance will then use the
ITCB_SDK_Centralinstance to send thequestionAnsweredByDevice(_:)observer callback to the app.
In the next entry, we’ll walk through the code that implements this.