docs: public static int getAPDUService(byte[] apdu)
  	{
  		// high 4 bits of APCI
  		final int apci4 = (apdu[0] & 0x03) << 2 | (apdu[1] & 0xC0) >> 6;
  		// lowest 6 bits of APCI
  		final int apci6 = apdu[1] & 0x3f;
  		// group value codes
  		if (apci4 == 0) {
  			if (apci6 == 0)
  				return 0;
  		}
  		else if (apci4 == 1)
  			return 0x40;
  		else if (apci4 == 2)
  			return 0x80;
  		// individual address codes
  		else if (apci4 == 3 || apci4 == 4 || apci4 == 5) {
  			if (apci6 == 0)
  				return apci4 << 6;
  		}
  		// ADC codes
  		else if (apci4 == 6 || apci4 == 7)
  			return apci4 << 6;
  		// memory codes
  		else if (apci4 == 8 || apci4 == 9 || apci4 == 10) {
  			if ((apci6 & 0x30) == 0)
  				return apci4 << 6;
  		}
  		// the rest
  		else
  			return apci4 << 6 | apci6;
  		// unknown codes
  		final int code = apci4 << 6 | apci6;
  		logger.warn("unknown APCI service code 0x" + Integer.toHexString(code));
  		return code;
  	}