예제 #1
0
    def send_pkt(self, seqNr, addressInfo, payload='', eof=False):
        """
        Send the payload.

        @param seqNr: sequence number of packet
        @type seqNr: byte
        @param addressInfo: address information for packet
        @type addressInfo: string
        @param payload: data to send
        @type payload: string
        """

        if eof:
            msg = gr.message(1) # tell self.pkt_input we're not sending any more packets
        else:
            FCF = make_FCF()

            pkt = make_ieee802_15_4_packet(FCF,
                                           seqNr,
                                           addressInfo,
                                           payload,
                                           self.pad_for_usrp)
            print "pkt =", packet_utils.string_to_hex_list(pkt), len(pkt)
            msg = gr.message_from_string(pkt)
        self.pkt_input.msgq().insert_tail(msg)
예제 #2
0
    def send_tinyos_pkt_add_crc(self, payload='', eof=False):
        """
        Send the payload.

        @param payload: data to send
        @type payload: string
        """

        print "GR: ieee802_15_4_pkt: ########## SDR sending a TinyOS packet ###########"

        if eof:
            msg = gr.message(1) # tell self.pkt_input we're not sending any more packets
        else:
            pkt = make_tinyos_packet_add_crc(payload,
                                             self.pad_for_usrp)
            print "GR: ieee802_15_4_pkt: pkt =", packet_utils.string_to_hex_list(pkt), len(pkt)
            msg = gr.message_from_string(pkt)
        self.pkt_input.msgq().insert_tail(msg)

        print "GR: ieee802_15_4_pkt: ########## SDR inserted packet in message Queue ###########"
    def send_tinyos_pkt_add_crc(self, payload='', eof=False):
        """
        Send the payload.

        @param payload: data to send
        @type payload: string
        """

        print "GR: ieee802_15_4_pkt: ########## SDR sending a TinyOS packet ###########"

        if eof:
            msg = gr.message(
                1)  # tell self.pkt_input we're not sending any more packets
        else:
            pkt = make_tinyos_packet_add_crc(payload, self.pad_for_usrp)
            print "GR: ieee802_15_4_pkt: pkt =", packet_utils.string_to_hex_list(
                pkt), len(pkt)
            msg = gr.message_from_string(pkt)
        self.pkt_input.msgq().insert_tail(msg)

        print "GR: ieee802_15_4_pkt: ########## SDR inserted packet in message Queue ###########"
    def send_pkt(self, seqNr, addressInfo, payload='', eof=False):
        """
        Send the payload.

        @param seqNr: sequence number of packet
        @type seqNr: byte
        @param addressInfo: address information for packet
        @type addressInfo: string
        @param payload: data to send
        @type payload: string
        """

        if eof:
            msg = gr.message(
                1)  # tell self.pkt_input we're not sending any more packets
        else:
            FCF = make_FCF()

            pkt = make_ieee802_15_4_packet(FCF, seqNr, addressInfo, payload,
                                           self.pad_for_usrp)
            print "pkt =", packet_utils.string_to_hex_list(pkt), len(pkt)
            msg = gr.message_from_string(pkt)
        self.pkt_input.msgq().insert_tail(msg)