Ejemplo n.º 1
0
        private byte[] PrepareCommand(CashCodeCommands command)
        {
            const byte dataLength = 0x06;

            byte[] preparedCommand = { Sync, DeviceType, dataLength, (byte)command, 0x00, 0x00 };
            char   crc             = CalculateCrc(preparedCommand, 4);

            preparedCommand[4] = (byte)crc;
            crc = CalculateCrc(preparedCommand, 5);
            preparedCommand[5] = (byte)crc;
            return(preparedCommand);
        }
Ejemplo n.º 2
0
        private byte[] PrepareLongCommand(CashCodeCommands command, byte first, byte last)
        {
            const byte dataLength = 0x0C;

            byte[] preparedCommand =
            {
                Sync, DeviceType, dataLength, (byte)command, first, first, first, last, last,
                last,       0x00, 0x00
            };
            char crc = CalculateCrc(preparedCommand, 10);

            preparedCommand[10] = (byte)crc;
            crc = CalculateCrc(preparedCommand, 11);
            preparedCommand[11] = (byte)crc;
            return(preparedCommand);
        }