def adsbExtractBlockBits(samples, offset, isShort):
  """
  Extract an integer array of data bits for the
  packet as supplied, as well as arrays for one sample before, and 
  one sample after the normal packet. Applies to ADS-B only.

  ADS-B packets come in two flavors, short and long. Most are
  long, but short packets have the first 5 bits set to zero. This gives
  a good first indication of which one to try first, but because of errors,
  both will be tried. There is about a 10:1 ratio of long to short packets.

  Args:
    samples (nparray): Demodulated samples (int32).
    offset (int): This is the offset into ``samples`` where we consider
      the 'starting' bit to be. It is usually one, although if we don't 
      error correct with 1, 2 will be used later. 1 gets the packet that we extracted
      the sync word from. 2 will get the packet as the set of bits following
      the packet that we got the sync word for.
    isShort (bool): ``True`` if we are attempting to error correct a short ADS-B
      packet, or ``False`` if this a long packet attempt.

  Returns:
    tuple: Tuple containing:

    * Array of integers (nparray i32) representing the actual error corrected packet.
    * Array of integers (nparray i32) containing 1 bit before the first returned
      result.
    * Array of integers (nparray i32) containing 1 bit after the first returned
      result.
  """
  # Long packet is 48 bytes.
  numBytes = 48

  if isShort:
    # Short packet is 30 bytes.
    numBytes = 30
  
  # Create the samples
  bits = samples[offset:(numBytes * 16):2]
  bitsBefore = samples[offset-1:(numBytes * 16) - 1:2]
  bitsAfter = samples[offset+1:(numBytes * 16) + 1:2]
  
  return bits, bitsBefore, bitsAfter