 
 import UIKit
 import CoreBluetooth
+import VerticonsToolbox
 
 extension CentralManager {
 
-    public struct Identifier {
+    public struct Identifier : Encodable  {
         public let uuid: CBUUID
         public let name: String?
         

        return lhs.uuid == rhs.uuid
    }
}

            self.id = id
            self.discoverDescriptors = discoverDescriptors
        }

        public init?(_ properties: Encodable.Properties?) {
            guard let properties = properties else { return nil }

            if  let id = Identifier(properties["id"] as? Encodable.Properties),
                let discover = properties["discover"] as? Bool {
                self.id = id
                self.discoverDescriptors = discover
            } else {
                return nil
            }
        }
        
        public func encode() -> Encodable.Properties {
            return ["id": id.encode(), "discover": discoverDescriptors]
        }
    }

    public struct ServiceSubscription : Encodable {
        public let id: Identifier
        public var characteristics: [CharacteristicSubscription] // If empty then all of the service's characteristics and descriptors will be discovered
        
        public init(id: Identifier, characteristics: [CharacteristicSubscription] = []) {
            self.id = id
            self.characteristics = characteristics
        }

        public init?(_ properties: Encodable.Properties?) {
            guard let properties = properties else { return nil }

            if  let id = Identifier(properties["id"] as? Encodable.Properties),
                let characteristics = properties["characteristics"] as? [Encodable.Properties] {
                self.id = id
                self.characteristics = characteristics.decode(type: CharacteristicSubscription.self)
            } else {
                return nil
            }
        }
        
        public func encode() -> Encodable.Properties {
            return ["id": id.encode(), "characteristics": characteristics.encode()]
        }

        subscript(characteristicId: CBUUID) -> CharacteristicSubscription? {
