Esempio n. 1
0
    def send_pkt(self, payload='', eof=False):
        """
        Send the payload.

        @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:
            # print "original_payload =", string_to_hex_list(payload)
            pkt = packet_utils.make_packet(payload,
                                           self._modulator.samples_per_symbol(),
                                           self._modulator.bits_per_symbol(),
                                           self._access_code,
                                           self._pad_for_usrp,
                                           self._whitener_offset,
                                           True,
                                           self.coder)
            #print "pkt =", string_to_hex_list(pkt)
            msg = gr.message_from_string(pkt)
            if self._use_whitener_offset is True:
                self._whitener_offset = (self._whitener_offset + 1) % 16
                
        self._pkt_input.msgq().insert_tail(msg)
Esempio n. 2
0
    def send_pkt(self, payload):
        """
        Wrap the payload in a packet and push onto the message queue.

        Args:
            payload: string, data to send
        """
        packet = packet_utils.make_packet(
            payload,
            self._samples_per_symbol,
            self._bits_per_symbol,
            self._preamble,
            self._access_code,
            self._pad_for_usrp,
            repeat=self._repeat,
            interleave=self._interleave,
            debug=self._debug,
        )
        msg = gr.message_from_string(packet)
        self._msgq_out.insert_tail(msg)
Esempio n. 3
0
    def send_pkt(self, payload='', eof=False):
        """
        Send the payload.

        Args:
            payload: data to send (string)
        """
        if eof:
            msg = gr.message(
                1)  # tell self._pkt_input we're not sending any more packets
        else:
            # print "original_payload =", string_to_hex_list(payload)
            pkt = packet_utils.make_packet(
                payload, self._modulator.samples_per_symbol(),
                self._modulator.bits_per_symbol(), self._preamble,
                self._access_code, self._pad_for_usrp, self._whitener_offset)
            #print "pkt =", string_to_hex_list(pkt)
            msg = gr.message_from_string(pkt)
            if self._use_whitener_offset is True:
                self._whitener_offset = (self._whitener_offset + 1) % 16

        self._pkt_input.msgq().insert_tail(msg)
Esempio n. 4
0
    def send_pkt(self, payload='', timetag=None, eof=False):
        """
        Send the payload.

        @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:
        
            # Digital Only Packet
                
            # TODO
            pkt = packet_utils.make_packet(payload,self._samples_per_symbol,2,self._access_code,self._pad_for_usrp)
            msg = gr.message_from_string(pkt)

            if timetag != None:                    

                timetag_int = int(math.floor(timetag))
                timetag_frac = timetag - float(timetag_int)

                samples = len(pkt)*8*self._samples_per_symbol
                
                #print '[TransmitPath] Digital Packet Length =',len(pkt)
                #print '[TransmitPath] Digital Packet Sample Length=',samples
                
                #self.timetag_inserter.put_timestamp(int(timetag_int), samples)
                #self.delay.set_delay (timetag_frac, samples)

            else:
                samples = len(pkt)*8*self._samples_per_symbol

                #print '[TransmitPath] Digital Packet Length =',len(pkt)
                #print '[TransmitPath] Digital Packet Sample Length=',samples

               
            self._pkt_input.msgq().insert_tail( msg )