+ in &= 0x0f;
+ switch (packet_pos) {
+ case 1: value_1 = in; break;
+ case 2: value_1 |= in << 4; break;
+ case 3: value_1 |= in << 8; break;
+ case 4: value_1 |= in << 12; break;
+ case 5: value_2 = in; break;
+ case 6: value_2 |= in << 4; break;
+ case 7: dec_point = in; break;
+ case 8: have_change = (in&0x01); break;
+ default:
+ if (packet_pos == 9) {
+ packet_pos = 0;
+ coin_value = value_1*value_2;
+ }
+ /* hmmm, else? */
+ }
+ packet_pos++;
+ send_byte(0x00); /* ack */