code: def _parse_samples_header(self, io_bytes):
          
          header_size = 3
  
          # number of samples (always 1?) is the first byte
          sample_count = byteToInt(io_bytes[0])
  
          # part of byte 1 and byte 2 are the DIO mask ( 9 bits )
          dio_mask = (byteToInt(io_bytes[1]) << 8 | byteToInt(io_bytes[2])) \
              & 0x01FF
  
          # upper 7 bits of byte 1 is the AIO mask
          aio_mask = (byteToInt(io_bytes[1]) & 0xFE) >> 1
  
          # sorted lists of enabled channels; value is position of bit in mask
          dio_chans = []
          aio_chans = []
  
          for i in range(0, 9):
              if dio_mask & (1 << i):
                  dio_chans.append(i)
  
          dio_chans.sort()
  
          for i in range(0, 7):
              if aio_mask & (1 << i):
                  aio_chans.append(i)
  
          aio_chans.sort()
  
          return (sample_count, dio_chans, aio_chans, dio_mask, header_size)
docs: _parse_samples_header: binary data in XBee IO data format ->
                          (int, [int ...], [int ...], int, int)
  
          _parse_samples_header will read the first three bytes of the
          binary data given and will return the number of samples which
          follow, a list of enabled digital inputs, a list of enabled
          analog inputs, the dio_mask, and the size of the header in bytes