func read()

in Sources/RxCBCentral/RxPeripheral.swift [48:86]


    func read(service: CBUUID, characteristic: CBUUID) -> Single<Data?>
    
    /// Perform a GATT write operation upon subscription. Supports reactive Retry operators.
    /// Immediately returns an error if disconnected.
    ///
    /// - parameter service: the CoreBluetooth UUID of the GATT Service containing the desired Characteristic.
    /// - parameter characteristic: the CoreBluetooth UUID of the GATT Characteristic to write to.
    /// - parameter data: raw Data to write to the Characteristic.
    /// - returns: Completable of the operation success, or else an error. Expect `GattError` for
    ///     errors that may be retried.
    func write(service: CBUUID, characteristic: CBUUID, data: Data) -> Completable
    
    /// Register for GATT notifications for a particular service and characteristic.
    ///
    /// GATT notifications are a mechanism for a peripheral to alert its central that values have changed.
    ///
    /// - parameter service: the CoreBluetooth UUID of the GATT Service containing the desired Characteristic.
    /// - parameter characteristic: the CoreBluetooth UUID of the GATT Characteristic to receive updates about.
    /// - parameter preprocessor: a data aggregator that can perform demarcation. Will process the notification data received
    ///   to return data in the required format.
    ///   Ex: collecting notification data until a complete message is formed, and then performing a COBS decode operation on the data.
    /// - returns: Completable, indicating that we are done registering to receive notification updates for this characteristic.
    /// - note: The preprocessor, if non-nil, will be used only for notifications for the specified `characteristic`.
    /// - seeAlso: [Consistent Overhead Byte Stuffing - COBS](https://en.wikipedia.org/wiki/Consistent_Overhead_Byte_Stuffing)
    func registerForNotification(service: CBUUID, characteristic: CBUUID, preprocessor: Preprocessor?) -> Completable
    
    /// Receive notification data for a specific GATT Characteristic.
    ///
    /// - parameter characteristic: the CoreBluetooth UUID of the GATT Characteristic you want to receive data for.
    /// - returns: A sequence of `Data`.
    ///
    /// - important:
    /// The data returned will be processed by the `Preprocessor` given when registering
    /// for notifications for this `characteristic`, if one was provided.
    func notificationData(for characteristic: CBUUID) -> Observable<Data>
}

/// Aggregates Data for the purpose of demarcation.
public protocol Preprocessor {