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, calc_crc=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
  • pad_for_usrp – If true, packets are padded such that they end up a multiple of 128 samples(512 bytes)
  • whitener_offset – offset into whitener string to use [0-16)
  • whitening – Whether to turn on data whitening(scrambling) (boolean)
  • calc_crc – Whether to calculate CRC32 or not (boolean)

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, check_crc=True)

Return (ok, payload)

Parameters:
  • whitened_payload_with_crc – string
  • whitener_offset – integer offset into whitener table
  • dewhitening – True if we should run this through the dewhitener
  • check_crc – True if we should check the CRC of the packet
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