def put(self, ndef_message, timeout=1.0):
        """Send an NDEF message to the server. Temporarily connects to
        the default SNEP server if the client is not yet connected.

        .. deprecated:: 0.13
           Use :meth:`put_records` or :meth:`put_octets`.

        """
        if not self.socket:
            try:
                self.connect('urn:nfc:sn:snep')
            except nfc.llcp.ConnectRefused:
                return False
            else:
                self.release_connection = True
        else:
            self.release_connection = False
        try:
            ndef_msgsize = struct.pack('>L', len(str(ndef_message)))
            snep_request = b'\x10\x02' + ndef_msgsize + str(ndef_message)
            if send_request(self.socket, snep_request, self.send_miu):
                response = recv_response(self.socket, 0, timeout)
                if response is not None:
                    if response[1] != 0x81:
                        raise SnepError(response[1])
                    return True
            return False
        finally:
            if self.release_connection:
                self.close()
def put ( self , ndef_message , timeout = 1.0 ) : if not self . socket : try : self . connect ( 'urn:nfc:sn:snep' ) except nfc . llcp . ConnectRefused : return False else : self . release_connection = True else : self . release_connection = False try : ndef_msgsize = struct . pack ( '>L' , len ( str ( ndef_message ) ) ) snep_request = b'\x10\x02' + ndef_msgsize + str ( ndef_message ) if send_request ( self . socket , snep_request , self . send_miu ) : response = recv_response ( self . socket , 0 , timeout ) if response is not None : if response [ 1 ] != 0x81 : raise SnepError ( response [ 1 ] ) return True return False finally : if self . release_connection : self . close ( )
Send an NDEF message to the server. Temporarily connects to
        the default SNEP server if the client is not yet connected.

        .. deprecated:: 0.13
           Use :meth:`put_records` or :meth:`put_octets`.