HID Hi-O iCLASS Installation Guide User Manual
Page 38
iCLASS OEM75 Integration Guide, 3141-907, Rev. B.0
Page 38 of 49
January 2014
HID GLOBAL CONFIDENTIAL AND/OR PROPRIETARY INFORMATION. This document contains confidential and/or proprietary
information, which may not be duplicated, published, disseminated or disclosed, or used for any purpose, without the written
consent of HID Global Corporation. If you are an unintended recipient of this information or are unwilling to accept the above
restrictions, please immediately return this document to HID Global Corporation, 15370 Barranca Pkwy, Irvine, CA 92618-3106.
*pNumBytes = readByte();
//
// If there is no message data available, send a stop and return.
//
if (NULL_MSG == *pNumBytes)
{
sendI2CNak();
}
else
{
//
// If this point is reached, then the slave has message data to send us.
// Ack the last byte and continue.
//
sendI2CAck();
//
// Expecting only a maximum number of bytes.
//
if (*pNumBytes > I2C_MSG_BUFSIZE)
{
*pNumBytes = 0;
}
//
// Read the remaining bytes in the message.
//
cnt = 0;
while (cnt < *pNumBytes)
{
pData[cnt + 2] = readByte();
cnt++;
//
// Don't ACK the last byte. A stop is sent instead.
//
if (cnt < *pNumBytes)
{
sendI2CAck();
}
else
{
sendI2CNak();
}
}
}
//
// Send a stop and return.
//
sendI2CStop();
}
/**********************************************************************/
/************************** Private functions *************************/
/**********************************************************************/