gnuradio.digital: Packet Utilities

gnuradio.digital.packet_utils.conv_1_0_string_to_packed_binary_string(s)

‘10101111’ -> (‘¯’, False)

Basically the inverse of conv_packed_binary_string_to_1_0_string, but also returns a flag indicating if we had to pad with leading zeros to get to a multiple of 8.

gnuradio.digital.packet_utils.conv_packed_binary_string_to_1_0_string(s)

‘¯’ –> ‘10101111’

gnuradio.digital.packet_utils.default_access_code
gnuradio.digital.packet_utils.dewhiten(s, o)
gnuradio.digital.packet_utils.is_1_0_string(s)
gnuradio.digital.packet_utils.make_header(payload_len, whitener_offset=0)
gnuradio.digital.packet_utils.make_packet(payload, samples_per_symbol, bits_per_symbol, preamble='1010010011110010', access_code='1010110011011101101001001110001011110010100011000010000011111100', pad_for_usrp=True, whitener_offset=0, whitening=True)

Build a packet, given access code, payload, and whitener offset

Parameters:
  • payload – packet payload, len [0, 4096]
  • samples_per_symbol – samples per symbol (needed for padding calculation) (int)
  • bits_per_symbol – (needed for padding calculation) (int)
  • preamble – string of ascii 0’s and 1’s
  • access_code – string of ascii 0’s and 1’s
  • whitener_offset – offset into whitener string to use [0-16)

Packet will have access code at the beginning, followed by length, payload and finally CRC-32.

gnuradio.digital.packet_utils.preamble
gnuradio.digital.packet_utils.random_mask_tuple() → empty tuple

tuple(iterable) -> tuple initialized from iterable’s items

If the argument is a tuple, the return value is the same object.

gnuradio.digital.packet_utils.random_mask_vec8()
gnuradio.digital.packet_utils.string_to_hex_list(s)
gnuradio.digital.packet_utils.unmake_packet(whitened_payload_with_crc, whitener_offset=0, dewhitening=True)

Return (ok, payload)

Parameters:whitened_payload_with_crc – string
gnuradio.digital.packet_utils.whiten(s, o)
gnuradio.digital.crc.check_crc32(s)
gnuradio.digital.crc.gen_and_append_crc32(s)

Previous topic

gnuradio.digital: OFDM Packet Utilities

Next topic

gnuradio.digital: Modulation Utilities

This Page