     
 }
 
+/// GAP LE Role Type
 public enum GAPLERoleType: UInt8 {
     
     /// Only Peripheral Role supported

    
    public init?(data: Data) {
        
        guard data.count == type(of: self).length, let type = GAPLEBluetoothDeviceAddressType(rawValue: data[6])
            else { return nil }
        
        let address = Address(bytes: (data[0], data[1], data[2], data[3], data[4], data[5]))

    /// Peripheral and Central Role supported, Central Role preferred for connection establishment
    case bothSupportedCentralPreferred = 0x03
    
    /// Bluetooth LE Role (e.g. Central or peripheral)
    public enum Role: UInt8, BitMaskOption { // not part of BT spec
        
        case central
        case peripheral
        
        public static var all: Set<Role> = [.central, .peripheral]
    }
    
    public var supported: BitMaskOptionSet<Role> {
        
        switch self {
        case .onlyPeripheralRoleSupported:
            return [.peripheral]
        case .onlyCentralRoleSupported:
            return [.central]
        case .bothSupportedPeripheralPreferred,
            .bothSupportedCentralPreferred:
            return [.central, .peripheral]
        }
    }
    
    public var preferred: Role {
        
        switch self {
        case .onlyPeripheralRoleSupported,
            .bothSupportedPeripheralPreferred:
            return .peripheral
        case .onlyCentralRoleSupported,
             .bothSupportedCentralPreferred:
            return .central
        }
    }
}

/**
