예제 #1
0
        public static void Keyload(BaseDevice device, List <CmdKeyItem> keys)
        {
            try
            {
                ManualRekeyApplication mra = GetMra(device);

                mra.Keyload(keys);
            }
            catch (Exception)
            {
                throw;
            }
        }
예제 #2
0
        public static List <RspKeysetInfo> ViewKeysetTaggingInfo(BaseDevice device)
        {
            try
            {
                ManualRekeyApplication mra = GetMra(device);

                return(mra.ViewKeysetTaggingInfo());
            }
            catch (Exception)
            {
                throw;
            }
        }
예제 #3
0
        public static RspChangeoverInfo ActivateKeyset(BaseDevice device, int keysetSuperseded, int keysetActivated)
        {
            try
            {
                ManualRekeyApplication mra = GetMra(device);

                return(mra.ActivateKeyset(keysetSuperseded, keysetActivated));
            }
            catch (Exception)
            {
                throw;
            }
        }
예제 #4
0
        public static int ViewKmfRsi(BaseDevice device)
        {
            try
            {
                ManualRekeyApplication mra = GetMra(device);

                return(mra.ViewKmfRsi());
            }
            catch (Exception)
            {
                throw;
            }
        }
예제 #5
0
        public static List <RspRsiInfo> ViewRsiItems(BaseDevice device)
        {
            try
            {
                ManualRekeyApplication mra = GetMra(device);

                return(mra.ViewRsiItems());
            }
            catch (Exception)
            {
                throw;
            }
        }
예제 #6
0
        public static RspRsiInfo ChangeRsi(BaseDevice device, int rsiOld, int rsiNew, int mnp)
        {
            try
            {
                ManualRekeyApplication mra = GetMra(device);

                return(mra.ChangeRsi(rsiOld, rsiNew, mnp));
            }
            catch (Exception)
            {
                throw;
            }
        }
예제 #7
0
        public static RspRsiInfo LoadConfig(BaseDevice device, int kmfRsi, int mnp)
        {
            try
            {
                ManualRekeyApplication mra = GetMra(device);

                return(mra.LoadConfig(kmfRsi, mnp));
            }
            catch (Exception)
            {
                throw;
            }
        }
예제 #8
0
        public static void EraseAllKeys(BaseDevice device)
        {
            try
            {
                ManualRekeyApplication mra = GetMra(device);

                mra.EraseAllKeys();
            }
            catch (Exception)
            {
                throw;
            }
        }
예제 #9
0
        public static RspChangeoverInfo ActivateKeyset(BaseDevice device, int keysetSuperseded, int keysetActivated)
        {
            RspChangeoverInfo result = new RspChangeoverInfo();

            if (device.TwiKfdtoolDevice.ComPort == string.Empty)
            {
                throw new ArgumentException("No device selected");
            }

            AdapterProtocol ap = null;

            try
            {
                ap = new AdapterProtocol(device.TwiKfdtoolDevice.ComPort);

                ap.Open();

                ap.Clear();

                ManualRekeyApplication mra = new ManualRekeyApplication(ap);

                //result = mra.LoadConfig(kmfRsi, mnp);
                result = mra.ActivateKeyset(keysetSuperseded, keysetActivated);
            }
            catch (Exception)
            {
                throw;
            }
            finally
            {
                try
                {
                    if (ap != null)
                    {
                        ap.Close();
                    }
                }
                catch (System.IO.IOException ex)
                {
                    Logger.Warn("could not close serial port: {0}", ex.Message);
                }
            }

            return(result);
        }
예제 #10
0
        public static List <RspKeysetInfo> ViewKeysetTaggingInfo(BaseDevice device)
        {
            List <RspKeysetInfo> result = new List <RspKeysetInfo>();

            if (device.TwiKfdtoolDevice.ComPort == string.Empty)
            {
                throw new ArgumentException("No device selected");
            }

            AdapterProtocol ap = null;

            try
            {
                ap = new AdapterProtocol(device.TwiKfdtoolDevice.ComPort);

                ap.Open();

                ap.Clear();

                ManualRekeyApplication mra = new ManualRekeyApplication(ap);

                result = mra.ViewKeysetTaggingInfo();
            }
            catch (Exception)
            {
                throw;
            }
            finally
            {
                try
                {
                    if (ap != null)
                    {
                        ap.Close();
                    }
                }
                catch (System.IO.IOException ex)
                {
                    Logger.Warn("could not close serial port: {0}", ex.Message);
                }
            }

            return(result);
        }
예제 #11
0
        public static RspRsiInfo ChangeRsi(BaseDevice device, int rsiOld, int rsiNew, int mnp)
        {
            RspRsiInfo result = new RspRsiInfo();

            if (device.TwiKfdtoolDevice.ComPort == string.Empty)
            {
                throw new ArgumentException("No device selected");
            }

            AdapterProtocol ap = null;

            try
            {
                ap = new AdapterProtocol(device.TwiKfdtoolDevice.ComPort);

                ap.Open();

                ap.Clear();

                ManualRekeyApplication mra = new ManualRekeyApplication(ap);

                result = mra.ChangeRsi(rsiOld, rsiNew, mnp);
            }
            catch (Exception)
            {
                throw;
            }
            finally
            {
                try
                {
                    if (ap != null)
                    {
                        ap.Close();
                    }
                }
                catch (System.IO.IOException ex)
                {
                    Logger.Warn("could not close serial port: {0}", ex.Message);
                }
            }

            return(result);
        }
예제 #12
0
        public static int ViewKmfRsi(string port)
        {
            int result = new int();

            if (port == string.Empty)
            {
                throw new ArgumentException("port empty");
            }

            AdapterProtocol ap = null;

            try
            {
                ap = new AdapterProtocol(port);

                ap.Open();

                ap.Clear();

                ManualRekeyApplication mra = new ManualRekeyApplication(ap);

                result = mra.ViewKmfRsi();
            }
            catch (Exception)
            {
                throw;
            }
            finally
            {
                try
                {
                    if (ap != null)
                    {
                        ap.Close();
                    }
                }
                catch (System.IO.IOException ex)
                {
                    Logger.Warn("could not close serial port: {0}", ex.Message);
                }
            }

            return(result);
        }
예제 #13
0
        public static RspRsiInfo LoadConfig(string port, int kmfRsi, int mnp)
        {
            RspRsiInfo result = new RspRsiInfo();

            if (port == string.Empty)
            {
                throw new ArgumentException("port empty");
            }

            AdapterProtocol ap = null;

            try
            {
                ap = new AdapterProtocol(port);

                ap.Open();

                ap.Clear();

                ManualRekeyApplication mra = new ManualRekeyApplication(ap);

                result = mra.LoadConfig(kmfRsi, mnp);
            }
            catch (Exception)
            {
                throw;
            }
            finally
            {
                try
                {
                    if (ap != null)
                    {
                        ap.Close();
                    }
                }
                catch (System.IO.IOException ex)
                {
                    Logger.Warn("could not close serial port: {0}", ex.Message);
                }
            }

            return(result);
        }
예제 #14
0
        public static void EraseAllKeys(BaseDevice device)
        {
            if (device.TwiKfdtoolDevice.ComPort == string.Empty)
            {
                throw new ArgumentException("No device selected");
            }

            AdapterProtocol ap = null;

            try
            {
                ap = new AdapterProtocol(device.TwiKfdtoolDevice.ComPort);

                ap.Open();

                ap.Clear();

                ManualRekeyApplication mra = new ManualRekeyApplication(ap);

                mra.EraseAllKeys();
            }
            catch (Exception)
            {
                throw;
            }
            finally
            {
                try
                {
                    if (ap != null)
                    {
                        ap.Close();
                    }
                }
                catch (System.IO.IOException ex)
                {
                    Logger.Warn("could not close serial port: {0}", ex.Message);
                }
            }
        }
예제 #15
0
        public static void EraseKey(string port, List <CmdKeyItem> keys)
        {
            if (port == string.Empty)
            {
                throw new ArgumentException("port empty");
            }

            AdapterProtocol ap = null;

            try
            {
                ap = new AdapterProtocol(port);

                ap.Open();

                ap.Clear();

                ManualRekeyApplication mra = new ManualRekeyApplication(ap);

                mra.EraseKeys(keys);
            }
            catch (Exception)
            {
                throw;
            }
            finally
            {
                try
                {
                    if (ap != null)
                    {
                        ap.Close();
                    }
                }
                catch (System.IO.IOException ex)
                {
                    Logger.Warn("could not close serial port: {0}", ex.Message);
                }
            }
        }
예제 #16
0
        public static void Keyload(string port, bool useActiveKeyset, int keysetId, int sln, int keyId, int algId, List <byte> key)
        {
            if (port == string.Empty)
            {
                throw new ArgumentException("port empty");
            }

            AdapterProtocol ap = null;

            try
            {
                ap = new AdapterProtocol(port);

                ap.Open();

                ap.Clear();

                ManualRekeyApplication mra = new ManualRekeyApplication(ap);

                mra.Keyload(useActiveKeyset, keysetId, sln, keyId, algId, key);
            }
            catch (Exception)
            {
                throw;
            }
            finally
            {
                try
                {
                    if (ap != null)
                    {
                        ap.Close();
                    }
                }
                catch (System.IO.IOException ex)
                {
                    Logger.Warn("could not close serial port: {0}", ex.Message);
                }
            }
        }