- }
-
- return ch;
-}
-
-int Writef(const char *Format, ...)
-{
- va_list args;
- int len;
-
- va_start(args, Format);
- len = vsnprintf(NULL, 0, Format, args);
- va_end(args);
-
- {
- char buf[len+1];
- va_start(args, Format);
- vsnprintf(buf, len+1, Format, args);
- va_end(args);
-
- #if DEBUG
- printf("Writef: %s", buf);
- #endif
-
- return write(giCoke_SerialFD, buf, len);
- }
-
-}
-
-int WaitForColon()
-{
- fd_set readfs;
- char ch = 0;
-
- FD_SET(giCoke_SerialFD, &readfs);
-
- while( (ch = ReadChar()) != ':' && ch != 0);
-
- if( ch == 0 ) return -1; // Timeout
-
- return 0;