- // TODO: Handle "not ok" response to D7
-
- // Ask the coke machine
- sprintf(tmp, "s%i\r\n", Item);
- write(giCoke_SerialFD, tmp, 4);
-
- // 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);
- }
+ // Get slot
+ slot = Coke_int_GetSlotFromItem(Item, 0);
+ if(slot < 0) return -1;