MCHPHIDClass::HIDWriteReport Method

HID Class DLL

HID Class DLL
MCHPHIDClass::HIDWriteReport Method
C
static bool HIDWriteReport(
    unsigned char buffer[], 
    unsigned int nBytes
);
Description

Transfers a buffer to the end device. Returns true if successful, false if the transfer fails.

Preconditions

The DLL should be initialized via a call to HIDClassInit or variant.

Parameters
Parameters 
Description 
buffer 
up to 64 byte array 
nBytes 
unsigned int. Number of valid bytes in the buffer. 
Returns

true if the transfer is successful, false if not. A failure to transfer usually means the device has been disconnected.

Remarks

The full buffer size is always transfered, regardless of how many are valid

Example
ToSendBuffer [0] = 'H';
ToSendBuffer [1] = 'i';
ToSendBuffer [2] = ' ';
ToSendBuffer [3] = 'M';
ToSendBuffer [4] = 'o';
ToSendBuffer [5] = 'm';
ToSendBuffer [6] = '!';
MCHPHIDCLASS::HIDWriteReport (ToSendBuffer, 7);
Microchip HID Class DLL 1.10 - [15 April 2010]
Copyright © 2009, 2010 Microchip Technology, Inc.  All rights reserved.