     /// Attempt to get L2CAP socket options.
     public func getSocketOptions() throws -> L2CAPSocketOption.Options {
         return try fileDescriptor.getSocketOption(L2CAPSocketOption.Options.self)
+    }
+}
+
+public extension L2CAPSocket {
+    
+    /// The socket's security level.
+    @available(*, deprecated, message: "Use throwing 'securityLevel()'")
+    var securityLevel: SecurityLevel {
+        return (try? _securityLevel()) ?? .sdp
     }
 }
 

import SystemPackage

/// L2CAP Bluetooth socket
public final class L2CAPSocket {
    
    // MARK: - Properties
    
    /// Internal socket file descriptor
    internal let fileDescriptor: FileDescriptor
    
    /// L2CAP Socket address

        try fileDescriptor.setSocketOption(socketOption)
    }
    
    internal func _securityLevel() throws -> SecurityLevel {
        let socketOption = try fileDescriptor.getSocketOption(BluetoothSocketOption.Security.self)
        return socketOption.level
    }
