- // TODO: Handle "not ok" response to D7
-
- #if TRACE_COKE
- printf("Coke_CanDispense: sending 's%i'\n", Item);
- #endif
-
- // Ask the coke machine
- sprintf(tmp, "s%i\r\n", Item);
- write(giCoke_SerialFD, tmp, 4);
-
- #if TRACE_COKE
- printf("Coke_CanDispense: reading response\n");
- #endif
- // Read from the machine (ignoring empty lines)
- while( (ret = ReadLine(sizeof(tmp)-1, tmp)) == 0 );
- printf("ret = %i, tmp = '%s'\n", ret, tmp);
- if( tmp[0] == ':' ) {
- ret = ReadLine(sizeof(tmp)-1, tmp);
- printf("ret = %i, tmp = '%s'\n", ret, tmp);
- }