(self, data)
Simulate a write to an HID device.

        Given data will be writen to :attr:`bytes`, prefixed with the
        :data:`HID_REPORT_TYPE_OUTPUT` byte.

        :param bytes data: The data to send to the device.

        >>> from rivalcfg.usbhid import FakeDevice
        >>> dev = FakeDevice()
        >>> dev.write(b"\\x00\\xAA\\xBB\\xCC")
        >>> dev.bytes.seek(0)
        0
        >>> dev.bytes.read()
        b'\\x02\\x00\\xaa\\xbb\\xcc'
Simulate a write to an HID device.
Simulate a write to an HID device .
def write(self, data):
        """Simulate a write to an HID device.

        Given data will be writen to :attr:`bytes`, prefixed with the
        :data:`HID_REPORT_TYPE_OUTPUT` byte.

        :param bytes data: The data to send to the device.

        >>> from rivalcfg.usbhid import FakeDevice
        >>> dev = FakeDevice()
        >>> dev.write(b"\\x00\\xAA\\xBB\\xCC")
        >>> dev.bytes.seek(0)
        0
        >>> dev.bytes.read()
        b'\\x02\\x00\\xaa\\xbb\\xcc'
        """
        self.bytes.write(struct.pack("B", HID_REPORT_TYPE_OUTPUT))
        self.bytes.write(data)
def write ( self , data ) : self . bytes . write ( struct . pack ( "B" , HID_REPORT_TYPE_OUTPUT ) ) self . bytes . write ( data )