# Copyright 2015 The Chromium OS Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import logging import signal import struct import time from collections import namedtuple import common import numpy from six.moves.queue import Queue from usb import core from autotest_lib.client.cros.cellular.mbim_compliance import mbim_errors USBNotificationPacket = namedtuple( 'USBNotificationPacket', ['bmRequestType', 'bNotificationCode', 'wValue', 'wIndex', 'wLength']) class MBIMChannelEndpoint(object): """ An object dedicated to interacting with the MBIM capable USB device. This object interacts with the USB devies in a forever loop, servicing command requests from |MBIMChannel| as well as surfacing any notifications from the modem. """ USB_PACKET_HEADER_FORMAT = '