- Writef("d%i\r\n", Item);
-
- // Read empty lines and echo-backs
- do {
- ret = ReadLine(sizeof(tmp)-1, tmp);
- if( ret == -1 ) {
- pthread_mutex_unlock(&gCoke_Mutex);
- return -1;
- }
- TRACE("read %i '%s'\n", ret, tmp);
- } while( ret == 0 || tmp[0] == ':' || tmp[0] == 'd' );
-
- WaitForColon(); // Eat up rest of response
-
- TRACE("done\n");
-
- // TODO: Regex instead?
- if( strcmp(tmp, "ok") == 0 ) {
- // We think dispense worked
- // - The machine returns 'ok' if an empty slot is dispensed, even if
- // it doesn't actually try to dispense (no sound)
- ret = 0;
+ if( _WriteBit(ciCoke_DropBitBase + Slot, 1) )
+ {
+ perror("Coke_int_DropSlot - modbus_write_bit");
+ return -2;