public static void ReadMainMemory3WbpExample(string readerName)
        {
            try
            {
                var threeWireBusProtocol         = new Readers.AViatoR.Components.Synchronus3WBP();
                ISmartCardReader smartCardReader = Connect(readerName);

                if (!smartCardReader.IsConnected)
                {
                    return;
                }

                // address of first byte to be read
                ushort address    = 0x00;
                byte   notUsed    = 0x00;
                string cardMemory = string.Empty;

                // read data from addresses 0x0000 - 0x03FF
                for (int i = 0x00; i < 0x0400; i++)
                {
                    string command  = threeWireBusProtocol.GetApdu(Synchronus3WBP.ControlByte.Read9BitsDataWithProtectBit, address, notUsed);
                    string response = smartCardReader.Transmit(command);

                    if (response.StartsWith("9D02") && response.EndsWith("9000"))
                    {
                        string data           = response.Substring(4, 2);
                        string protectionByte = response.Substring(6, 2);
                        string bitSet         = protectionByte != "00" ? "not set" : "set";
                        PrintData($"Read Main Memory, Address 0x{address:X4}", command, response,
                                  $"Value 0x{data}, {protectionByte} -> protection bit {bitSet}");
                        cardMemory += data;
                    }
                    else
                    {
                        PrintData($"Read Main Memory, Address 0x{address:X4}", command, response, "Error Response");
                    }
                    address++;
                }
                Console.WriteLine($"\nMain Memory starting from address 0x0000 to address 0x03FF:\n{cardMemory}\n");
                smartCardReader.Disconnect(CardDisposition.Unpower);
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
            }
        }
        public static void UpdateMainMemory3WbpExample(string readerName)
        {
            try
            {
                var threeWireBusProtocol         = new Readers.AViatoR.Components.Synchronus3WBP();
                ISmartCardReader smartCardReader = Connect(readerName);

                if (!smartCardReader.IsConnected)
                {
                    return;
                }
                // Following code is commented to prevent usage of incorrect Pin code, which can lead to blocking the synchronus card if done several times in row
                // Verification with correct pin code is necessary to write any data into card memory
                // Be advice not to use VerifyUser2Wbp command if correct pin code is not known

                /*
                 * string pin = "FFFF";
                 *
                 * byte firstPinByte = byte.Parse(pin.Substring(0, 2), NumberStyles.HexNumber);
                 * byte secondPinByte = byte.Parse(pin.Substring(2, 2), NumberStyles.HexNumber);
                 *
                 * VerifyUser3Wbp(reader, firstPinByte, secondPinByte);
                 *
                 * //*/

                ushort address = 0x01FF;
                byte   data    = 0xAB;

                string command  = threeWireBusProtocol.GetApdu(Synchronus3WBP.ControlByte.WriteAndEraseWithoutProtectBit, address, data);
                string response = smartCardReader.Transmit(command);
                PrintData($"Write Main Memory, address: 0x{address:X4}, data: 0x{data:X2}", command, response, response.Equals("9D009000") ? "Success" : "Error Response");

                address  = 0x01FF;
                data     = 0xCC;
                command  = threeWireBusProtocol.GetApdu(Synchronus3WBP.ControlByte.WriteAndEraseWithoutProtectBit, address, data);
                response = smartCardReader.Transmit(command);
                PrintData($"Write Main Memory, address: 0x{address:X4}, data: 0x{data:X2}", command, response, response.Equals("9D009000") ? "Success" : "Error Response");


                smartCardReader.Disconnect(CardDisposition.Unpower);
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
            }
        }
        private static void VerifyUser3Wbp(ISmartCardReader smartCardReader, byte firstPinByte, byte secondPinByte)
        {
            var threeWireBusProtocol = new Readers.AViatoR.Components.Synchronus3WBP();

            byte newErrorCounter;

            Console.WriteLine("User Verification");

            // Read Error Counter
            string command             = threeWireBusProtocol.ReadErrorCounterApdu();
            string response            = smartCardReader.Transmit(command);
            string currentErrorCounter = response.Substring(4, 2);

            PrintData("Read Error Counter", command, response, $"0x{currentErrorCounter}");

            // decrement counter
            switch (currentErrorCounter)
            {
            case "7F":
                newErrorCounter = 0x7E;
                break;

            case "7E":
                newErrorCounter = 0x7C;
                break;

            case "7C":
                newErrorCounter = 0x78;
                break;

            case "78":
                newErrorCounter = 0x70;
                break;

            case "70":
                newErrorCounter = 0x60;
                break;

            case "60":
                newErrorCounter = 0x40;
                break;

            case "40":
                newErrorCounter = 0x00;
                break;

            default:
                Console.WriteLine("Returned error counter is not correct or card is blocked");
                return;
            }
            command  = threeWireBusProtocol.WriteErrorCounterApdu(newErrorCounter);
            response = smartCardReader.Transmit(command);
            PrintData("Write new Error Counter", command, response, $"0x{newErrorCounter:X2}");

            // Verify pin first byte
            command  = threeWireBusProtocol.VerifyFirstPinByte(firstPinByte);
            response = smartCardReader.Transmit(command);
            PrintData("Verify first pin byte", command, response, $"{firstPinByte:X2}");

            // Verify pin second byte
            command  = threeWireBusProtocol.VerifySecondPinByte(secondPinByte);
            response = smartCardReader.Transmit(command);
            PrintData("Verify second pin byte", command, response, $"{secondPinByte:X2}");

            // Reset Error Counter
            command  = threeWireBusProtocol.ResetErrorCounterApdu();
            response = smartCardReader.Transmit(command);
            PrintData("Reset Error Counter", command, response, "");
        }