         
         localAddress.l2_family = sa_family_t(AF_BLUETOOTH)
         localAddress.l2_bdaddr = address
-        localAddress.l2_psm = port.littleEndian
+        localAddress.l2_psm = protocolServiceMultiplexer.littleEndian
         localAddress.l2_cid = channelIdentifier.littleEndian
         localAddress.l2_bdaddr_type = addressType.rawValue
 

                address = Address()
                self.internalSocket = 0
                self.internalAddress = sockaddr_l2()

                throw error
            }
            


    // MARK: - Properties

    /// Bluetooth address
    public lazy var address: Address = self.internalAddress.l2_bdaddr
    
    public lazy var addressType: AddressType = AddressType(rawValue: self.internalAddress.l2_bdaddr_type)!
    
    /// Protocol/Service Multiplexer (PSM)
    public lazy var protocolServiceMultiplexer: UInt16 = self.internalAddress.l2_psm.currentEndian

    /// Channel Identifier (CID)
    /// 
    /// L2CAP channel endpoints are identified to their clients by a Channel Identifier (CID). 
    /// This is assigned by L2CAP, and each L2CAP channel endpoint on any device has a different CID.
    public lazy var channelIdentifier: UInt16 = self.internalAddress.l2_cid.currentEndian

    // MARK: - Internal Properties
    
    /// Internal socket file descriptor
    internal let internalSocket: CInt
    
    /// Internal L2CAP Socket address
    internal let internalAddress: sockaddr_l2
    
    // MARK: - Initialization

    deinit {
