Exemple #1
0
        // ...

        #endregion

        public static ForceSample Parse(IAtCommandResponse cmd)
        {
            if (cmd.Command != ForceSampleCommand.command)
            {
                throw new ArgumentException("This method is only applicable for the '" + ForceSampleCommand.command + "' command!", "cmd");
            }

            ByteReader br = new ByteReader(cmd.Value, ByteOrder.BigEndian);

            ForceSample fs = new ForceSample();

            fs.ReadBytes(br);

            return(fs);
        }
Exemple #2
0
        public static SleepMode Parse(IAtCommandResponse cmd)
        {
            if (cmd.Command != SleepModeCommand.command)
            {
                throw new ArgumentException("This method is only applicable for the '" + SleepModeCommand.command + "' command!", "cmd");
            }

            ByteReader br = new ByteReader(cmd.Value, ByteOrder.BigEndian);

            SleepMode sm = new SleepMode();

            sm.ReadBytes(br);

            return(sm);
        }
Exemple #3
0
        public static ReceivedSignalStrength Parse(IAtCommandResponse cmd)
        {
            if (cmd.Command != ReceivedSignalStrengthCommand.command)
            {
                throw new ArgumentException("This method is only applicable for the '" + ReceivedSignalStrengthCommand.command + "' command!", "cmd");
            }

            ByteReader br = new ByteReader(cmd.Value, ByteOrder.BigEndian);

            ReceivedSignalStrength rssi = new ReceivedSignalStrength();

            rssi.ReadBytes(br);

            return(rssi);
        }
Exemple #4
0
        public static SupplyVoltage Parse(IAtCommandResponse cmd)
        {
            if (cmd.Command != SupplyVoltageCommand.command)
            {
                throw new ArgumentException("This method is only applicable for the '" + SupplyVoltageCommand.command + "' command!", "cmd");
            }

            ByteReader br = new ByteReader(cmd.Value, ByteOrder.BigEndian);

            SupplyVoltage sv = new SupplyVoltage();

            sv.ReadBytes(br);

            return(sv);
        }
Exemple #5
0
        public static CyclicSleepPeriod Parse(IAtCommandResponse cmd)
        {
            if (cmd.Command != CyclicSleepPeriodCommand.command)
            {
                throw new ArgumentException("This method is only applicable for the '" + CyclicSleepPeriodCommand.command + "' command!", "cmd");
            }

            ByteReader br = new ByteReader(cmd.Value, ByteOrder.BigEndian);

            CyclicSleepPeriod csp = new CyclicSleepPeriod();

            csp.ReadBytes(br);

            return(csp);
        }
Exemple #6
0
        public static NodeIdentifier Parse(IAtCommandResponse cmd)
        {
            if (cmd.Command != NodeIdentifierCommand.command)
            {
                throw new ArgumentException("This method is only applicable for the '" + NodeIdentifierCommand.command + "' command!", "cmd");
            }

            ByteReader br = new ByteReader(cmd.Value, ByteOrder.BigEndian);

            NodeIdentifier ni = new NodeIdentifier();

            ni.ReadBytes(br);

            return(ni);
        }
Exemple #7
0
        public static TimeBeforeSleep Parse(IAtCommandResponse cmd)
        {
            if (cmd.Command != TimeBeforeSleepCommand.command)
            {
                throw new ArgumentException("This method is only applicable for the '" + TimeBeforeSleepCommand.command + "' command!", "cmd");
            }

            ByteReader br = new ByteReader(cmd.Value, ByteOrder.BigEndian);

            TimeBeforeSleep tbs = new TimeBeforeSleep();

            tbs.ReadBytes(br);

            return(tbs);
        }
Exemple #8
0
        public static ApiEnable Parse(IAtCommandResponse cmd)
        {
            if (cmd.Command != ApiEnableCommand.command)
            {
                throw new ArgumentException("This method is only applicable for the '" + ApiEnableCommand.command + "' command!", "cmd");
            }

            ByteReader br = new ByteReader(cmd.Value, ByteOrder.BigEndian);

            ApiEnable ae = new ApiEnable();

            ae.ReadBytes(br);

            return(ae);
        }