changes for Finder, introduce Wifi-Enable flag

This commit is contained in:
hg
2015-05-18 12:36:47 +02:00
parent 655e8f6861
commit 34eddf58ce
5 changed files with 136 additions and 139 deletions

View File

@ -201,12 +201,15 @@ void waiting_for_turnaround()
// get the serial data from the buffer
void waiting_for_reply()
{
// Serial.println("A0");
if ((*ModbusPort).available()) // is there something to check?
{
Serial.println("A1");
unsigned char overflowFlag = 0;
buffer = 0;
while ((*ModbusPort).available())
{
Serial.println("A2");
// The maximum number of bytes is limited to the serial buffer size
// of BUFFER_SIZE. If more bytes is received than the BUFFER_SIZE the
// overflow flag will be set and the serial buffer will be read until
@ -220,7 +223,7 @@ void waiting_for_reply()
overflowFlag = 1;
frame[buffer] = (*ModbusPort).read();
// Serial.print("R: "); Serial.println(frame[buffer], 16);
Serial.print("R: "); Serial.println(frame[buffer], 16);
buffer++;
}
// This is not 100% correct but it will suffice.
@ -504,7 +507,7 @@ void sendPacket(unsigned char bufferSize)
digitalWrite(TxEnablePin, HIGH);
for (unsigned char i = 0; i < bufferSize; i++) {
// Serial.print("S: "); Serial.println(frame[i],16);
Serial.print("S: "); Serial.println(frame[i],16);
(*ModbusPort).write(frame[i]);
}