# 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 Queue import signal import struct import time import numpy from collections import namedtuple from usb import core import common 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 = '