Skip to content

Instantly share code, notes, and snippets.

@scalone
Created July 10, 2013 16:16
Show Gist options
  • Save scalone/5967682 to your computer and use it in GitHub Desktop.
Save scalone/5967682 to your computer and use it in GitHub Desktop.
unsigned char * SReader_ReadCard(int *size)
{
int cmdbuf[] = { 0x1b, 0x41, 0x00, 0x00, 0x2f, 0x75 };
// clear buffer;
int tmpsize = 0;
unsigned char *tmpbuf = get_DataBuffer(&tmpsize);
if (tmpbuf)
free(tmpbuf);
clearDataStatus();
write_command(cmdbuf, 6);
m_comStatus = COM_READCARD;
*size = -1;
_WAITTING_RESPONSE_(10000)
int datasize = 0;
unsigned char * buffer = processDataResult(&datasize);
*size = datasize;
return buffer;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment