hi everyone,
i have a code to write and read a RFID through COM port. i able to read and write to/from RFID with tag on the field. i'd like to detect when the tag is out of field. im using TAG SEARCH command, if the tag is out of field a message AAH FFH 00H 08H FFH FFH will be read. so, the below is part of my code:
Purpose:
chartx_buf[6];
char rx_buf[6];
---output command codes to RFID---
---below is echo's part ---
---i've ignored certain code ---
//read echoes from RFID byte by byte
for (i = 0; i < 6; i++)
{
port.ReadByte(rx_buf);
}
//check first byte and second byte only
if (rx_buf[0] == 0xAA && rx_buf[1] == 0xFF)
{
m_ed1 = 99;
}
else
{
m_ed1 = 98;
}
is it correct? i always get 98 but not 99. as u know, cimplicity comm. driver is very difficult for debugging, u can't trace line by line.. (right?) is anyone can tell me wat's the best way to do debugging. currently i'm using dcrp_log_status to trace my results. everytime i hv to run and stop projects, very troublesome.
im trying to trace by display rx_buf[0] only, it surpose to display 1 character only, but i always get more than 1 character. why?
regards,
glen
i have a code to write and read a RFID through COM port. i able to read and write to/from RFID with tag on the field. i'd like to detect when the tag is out of field. im using TAG SEARCH command, if the tag is out of field a message AAH FFH 00H 08H FFH FFH will be read. so, the below is part of my code:
Purpose:
chartx_buf[6];
char rx_buf[6];
---output command codes to RFID---
---below is echo's part ---
---i've ignored certain code ---
//read echoes from RFID byte by byte
for (i = 0; i < 6; i++)
{
port.ReadByte(rx_buf);
}
//check first byte and second byte only
if (rx_buf[0] == 0xAA && rx_buf[1] == 0xFF)
{
m_ed1 = 99;
}
else
{
m_ed1 = 98;
}
is it correct? i always get 98 but not 99. as u know, cimplicity comm. driver is very difficult for debugging, u can't trace line by line.. (right?) is anyone can tell me wat's the best way to do debugging. currently i'm using dcrp_log_status to trace my results. everytime i hv to run and stop projects, very troublesome.
im trying to trace by display rx_buf[0] only, it surpose to display 1 character only, but i always get more than 1 character. why?
regards,
glen