Read a message from kvaser device and return whether filtering has taken place.

def _recv_internal(self, timeout=None):
        """
        Read a message from kvaser device and return whether filtering has taken place.
        """
        arb_id = ctypes.c_long(0)
        data = ctypes.create_string_buffer(64)
        dlc = ctypes.c_uint(0)
        flags = ctypes.c_uint(0)
        timestamp = ctypes.c_ulong(0)

        if timeout is None:
            # Set infinite timeout
            # http://www.kvaser.com/canlib-webhelp/group___c_a_n.html#ga2edd785a87cc16b49ece8969cad71e5b
            timeout = 0xFFFFFFFF
        else:
            timeout = int(timeout * 1000)

        #log.log(9, 'Reading for %d ms on handle: %s' % (timeout, self._read_handle))
        status = canReadWait(
            self._read_handle,
            ctypes.byref(arb_id),
            ctypes.byref(data),
            ctypes.byref(dlc),
            ctypes.byref(flags),
            ctypes.byref(timestamp),
            timeout  # This is an X ms blocking read
        )

        if status == canstat.canOK:
            #log.debug('read complete -> status OK')
            data_array = data.raw
            flags = flags.value
            is_extended = bool(flags & canstat.canMSG_EXT)
            is_remote_frame = bool(flags & canstat.canMSG_RTR)
            is_error_frame = bool(flags & canstat.canMSG_ERROR_FRAME)
            is_fd = bool(flags & canstat.canFDMSG_FDF)
            bitrate_switch = bool(flags & canstat.canFDMSG_BRS)
            error_state_indicator = bool(flags & canstat.canFDMSG_ESI)
            msg_timestamp = timestamp.value * TIMESTAMP_FACTOR
            rx_msg = Message(arbitration_id=arb_id.value,
                             data=data_array[:dlc.value],
                             dlc=dlc.value,
                             is_extended_id=is_extended,
                             is_error_frame=is_error_frame,
                             is_remote_frame=is_remote_frame,
                             is_fd=is_fd,
                             bitrate_switch=bitrate_switch,
                             error_state_indicator=error_state_indicator,
                             channel=self.channel,
                             timestamp=msg_timestamp + self._timestamp_offset)
            #log.debug('Got message: %s' % rx_msg)
            return rx_msg, self._is_filtered
        else:
            #log.debug('read complete -> status not okay')
            return None, self._is_filtered