public void ToVerboseStringFake(string base64)
        {
            byte[]     data    = Convert.FromBase64String(base64);
            PHYPayload payload = new PHYPayload(data);

            payload.ToVerboseString();
        }
Exemple #2
0
        private static int RunCommand(DecodePacketOptions opts)
        {
            byte[] data = !String.IsNullOrEmpty(opts.Hex) ? opts.Hex.FromHexString()
                : !String.IsNullOrEmpty(opts.Base64) ? opts.Base64.FromBase64String()
                : null;

            byte[] nwkSKey = null;
            byte[] appSKey = null;
            byte[] appKey  = null;
            if (!String.IsNullOrEmpty(opts.NwkSKey))
            {
                nwkSKey = ConvertExtension.FromHexString(opts.NwkSKey);
            }
            if (!String.IsNullOrEmpty(opts.AppSKey))
            {
                appSKey = ConvertExtension.FromHexString(opts.AppSKey);
            }
            if (!String.IsNullOrEmpty(opts.AppKey))
            {
                appKey = ConvertExtension.FromHexString(opts.AppKey);
            }
            PHYPayload packet = new PHYPayload(data, nwkSKey, appSKey, appKey, 0);

            Console.WriteLine(packet.ToVerboseString());

            return(0);
        }