+ else {
+ int i;
+ for( i = 0; i < 7; i ++ )
+ gaCoke_CachedStatus[i] = -1;
+ // Reset the slot names.
+ // - Dunno why this is needed, but the machine plays silly
+ // sometimes.
+ Writef("n0 Slot0\r\n");
+ if( !WaitForColon() )
+ {
+ Writef("n1 Slot1\r\n");
+ WaitForColon();
+ Writef("n2 Slot2\r\n");
+ WaitForColon();
+ Writef("n3 Slot3\r\n");
+ WaitForColon();
+ Writef("n4 Slot4\r\n");
+ WaitForColon();
+ Writef("n5 Slot5\r\n");
+ WaitForColon();
+ Writef("n6 Coke\r\n");
+ WaitForColon();
+
+ Coke_int_UpdateSlotStatuses();
+ }
+ else
+ fprintf(stderr, "Coke machine timed out.\n");
+ }
+
+ AddPeriodicFunction(Coke_int_UpdateSlotStatuses);