ITCB_SDK_Peripheral

public class ITCB_SDK_Peripheral : ITCB_SDK, ITCB_SDK_Peripheral_Protocol
extension ITCB_SDK_Peripheral: CBPeripheralManagerDelegate

This is the Peripheral specialization of the main SDK interface.

IMPORTANT NOTE: Peripheral Mode is not supported for WatchOS or TVOS. This class is only included in the iOS and MacOS framework targets.

Instance Methods

  • This method will load or update a given Service with new or updated Characteristics.

    Declaration

    Swift

    func _setCharacteristicsForThisService(_ inMutableServiceInstance: CBMutableService)

    Parameters

    inMutableServiceInstance

    The Service that we are adding the Characteristics to.

  • This sends the “An answer was successfully sent” message to all registered observers.

    Declaration

    Swift

    func _sendSuccessInSendingAnswerToAllObservers(device inDevice: ITCB_Device_Central_Protocol, answer inAnswer: String, toQuestion inToQuestion: String)

    Parameters

    device

    The Central device

    answer

    The answer that was sent

    toQuestion

    The question that was asked

  • This sends the “A question was asked” message to all registered observers.

    Declaration

    Swift

    func _sendQuestionAskedToAllObservers(device inDevice: ITCB_Device_Central_Protocol, question inQuestion: String)

    Parameters

    device

    The Central device

    question

    The question that was asked

  • This sends a random answer to the central.

    Declaration

    Swift

    func _sendRandomAnswerToThisQuestion(_ inQuestion: String)

    Parameters

    inQuestion

    The question asked by the Central.

CBPeripheralManagerDelegate Methods

  • This method is required by the Core Bluetooth system. It informs the delegate of a state change, in the CB manager instance.

    Declaration

    Swift

    public func peripheralManagerDidUpdateState(_ inPeripheralManager: CBPeripheralManager)

    Parameters

    inPeripheralManager

    The Peripheral Manager that experienced the change.

  • This method is called when the Central changes the value of one of the Characteristics in our Service.

    Declaration

    Swift

    public func peripheralManager(_ inPeripheralManager: CBPeripheralManager, didReceiveWrite inWriteRequests: [CBATTRequest])

    Parameters

    inPeripheralManager

    The Peripheral Manager that experienced the change.

    didReceiveWrite

    The Write request objects, in an Array.

  • Declaration

    Swift

    public func peripheralManager(_ inPeripheralManager: CBPeripheralManager, central inCentral: CBCentral, didSubscribeTo inCharacteristic: CBCharacteristic)

    Parameters

    inPeripheralManager

    The Peripheral Manager that experienced the change.