void ReadCode(char* code) { int fd; int i; char ch; char buffer[2]; buffer[1] = 0; i = 0; fflush(stdin); Serial_Open(&fd, "/dev/ttySP1", B9600); WaitForChar(&fd, '-'); while(1) { Serial_Read(&fd, buffer, 1); ch = buffer[0]; if(ch == '\n') break; code[i++] = ch; } code[i-1] = 0; Serial_Close(&fd); }
NEO_6M::~NEO_6M() { delete gps; Serial_Close(fd); }