I am trying to run the SerialAccel.cpp in Windows and the readFile doesnt read values from the serial port.
Please find the code below.
// Check for the ready prompt to ensure data is available.
if (ReadFile(hCOM,prompt,samples,&bytes_read,&overlap)==TRUE){
if (GetOverlappedResult(hCOM,&overlap,&bytes_read,TRUE) == 0){
cout<<"\nERROR reading COM Port!";
cout<< "\nERROR: " << GetLastError();
}
else cout<<"\nChecking for SERIAL DONGLE in BINARY MODE: ";
}
cout << "Prompt = " << prompt << endl;
Prompt = ╠╠╠╠╠╠╠╠╠╠╠╠─╝,`d■‼
But the value from the device is not being read and it gives junk values.