Yes you are right, I don't really know what I am doing. Can you explain it to me please?
At this stage I know how to write a file to the Com port. One of the commands write a ping request to the LCD screen but I don't know how to read the data back from the LCD screen?
This is the latest readFile() code that I have
Code:
void receive_packet(COMMAND_PACKET *packet)
{
int ret;
unsigned char buf[2];
unsigned long len;
ret = ReadFile(handle,
buf,
1,
&len,
NULL);
if(len > 0)
{
//if(trace == 1)
printf("read char %d\n", (int)buf[0]);
}
}
How does that look?
But when I open a hyperterminal I know that I am not reading anything?
these are the list of commands that I call in the main()
Code:
outgoing_response.command = 0; // coomand to send ping
outgoing_response.data_length = 0;
send_packet(&outgoing_response);
receive_packet(&incoming_request);
Can you tell me what I am doing wrong?
I really dont know how to intercept or catch the response from the command?