-40
(3) Read Tag
Click “Read” button to read tag. When it passive mode, reader will read tag once, when it is active mode, reader will start to read tag
continuously.
The “Read” button executes the following code.
void CWinceDEMODlg::OnBnClickedButtonRead()
{
//
TODO:
在此加入控制項告知處理常式程式碼
CString
sTemp,sTemp2;
BYTE
byTemp=0;
SUNLITRFID_TAGID
TagID;
ButtonRead.EnableWindow(false);
SUNLITRFID_Pause();
byTemp=SUNLITRFID_ScanTag(&TagID);
DrawEnvironment.ClearPicture();
switch(byTemp)
{
case HANDLE_SUCCESS://Only in Active Mode
ListMsg.InsertString(0,CString("(A)Read~~~"));
break;
case HANDLE_ERR_TAG_PASSIVE://Read Tag in Passive Mode
if(SDB.IsExists(&TagID)==-1)
{
if(ButtonMute.GetCheck()==BST_UNCHECKED)
MessageBeep(MB_ICONASTERISK);
AddNewTagToDB(&TagID);//Add
New
Tag
Dialog
}
else if(ButtonMute.GetCheck()==BST_UNCHECKED)
MessageBeep(MB_OK);
ShowTagInfo(&TagID,true);
break;
case HANDLE_ERR_TAG_NOT_FOUND://Did't Read Tag in Passive Mode
ListMsg.InsertString(0,CString("(P)Not
Found
Tag..."));
break;
case
HANDLE_ERR_COMPORT:
ListMsg.InsertString(0,CString("Comport
Error..."));