Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- char DataBuffer[2] = { 0x06 }; //Hex for ACK
- BOOL bErrorFlag = FALSE;
- uint8_t * pTmpBuf = (uint8_t *)calloc(outputReportLength, sizeof(uint8_t));
- uint8_t * pAppBuffer = (uint8_t *)calloc(outputReportLength, sizeof(uint8_t));
- DWORD nRead;
- if (pTmpBuf == NULL)
- {
- //return error(“memory allocation failed”);
- }
- //
- // copy data to be sent, reserving the 1st byte for report ID
- //
- unsigned long Written = 0;
- memcpy(pTmpBuf + 1, DataBuffer, sizeof(DataBuffer));
- bErrorFlag = WriteFile(hDevice, pTmpBuf, outputReportLength, &Written, NULL);
- free(pTmpBuf);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement