I keep getting ÿ on my Serial Terminal?

Hey,

I keep getting ÿ on the Serial Terminal, here is my build:

Arduino Duemlinove + Sparkfun WiFly Shield.

I’m communication with the WiFly using a C# .NET based application on my PC that connectes to the WiFly shield using AdHoc connection, opening Socket and start transmitting using TCP

this.Soc = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);

The arduino has this loop:

void setup()
{
	Serial.begin(9600);
        Serial.println("Initializing...");
        SpiSerial.begin();
        Serial.println("Ready.");
}
void loop()
{
    while(SpiSerial.available() > 0) {
      byte b = SpiSerial.read();
      char c = char(b);
      Serial.print(c);
    }
}

When i print the char i get ÿ…

Any ideas why this heppends ?

Capture.JPG

That is how a terminal displays 255 (-1).

SurferTim: That is how a terminal displays 255 (-1).

So i just solved it with if(c != (char)-1) but still, any idea why this heppends ?

It seems that the available() function is not working correctly. That is the response I get from client.read() if client.available() returns 0. That is the read() function returning "no characters available".

What is the signature of SpiSerial ? does SPiSerial.Available returns a byte or an int ?

Have a link to the library?