- WaitForColon(); // Eat up rest of response
-
- #if TRACE_COKE
- printf("Coke_DoDispense: done\n");
- #endif
-
- // 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;
- }
- else {
- printf("Coke_DoDispense: Machine returned unknown value '%s'\n", tmp);
- ret = -1;
+int Coke_int_IsSlotEmpty(int Slot)
+{
+ uint8_t status;
+
+ if( Slot < 0 || Slot > 9 ) return -1;
+
+ errno = 0;
+ if( _ReadBit(ciCoke_StatusBitBase + Slot, &status) )
+ {
+ perror("Coke_int_IsSlotEmpty - modbus_read_bits");
+ return -2;