public override void Parse(IPacketParser parser)
        {
            Sender = new NodeInfo
            {
                SerialNumber   = parser.ParseAddress64(),
                NetworkAddress = parser.ParseAddress16()
            };

            Option = (PacketOption)parser.Read("Option");

            Remote = new NodeInfo
            {
                NetworkAddress = parser.ParseAddress16(),
                SerialNumber   = parser.ParseAddress64()
            };

            byte ch;

            // NI is terminated with 0
            while ((ch = parser.Read("Node Identifier")) != 0)
            {
                if (ch > 32 && ch < 126)
                {
                    Remote.NodeIdentifier += (char)ch;
                }
            }

            ParentAddress = parser.ParseAddress16();
            NodeType      = (NodeType)parser.Read("Device Type");
            SourceAction  = (SourceActions)parser.Read("Source Action");
            ProfileId     = UshortUtils.ToUshort(parser.Read("Profile MSB"), parser.Read("Profile LSB"));
            MfgId         = UshortUtils.ToUshort(parser.Read("MFG MSB"), parser.Read("MFG LSB"));
        }
 public override void Parse(IPacketParser parser)
 {
     base.Parse(parser);
     DestinationAddress = parser.ParseAddress16();
     RetryCount         = parser.Read("ZNet Tx Status Tx Count");
     DeliveryStatus     = (DeliveryResult)parser.Read("ZNet Tx Status Delivery Status");
     DiscoveryStatus    = (DiscoveryResult)parser.Read("ZNet Tx Status Discovery Status");
 }
Exemple #3
0
        public override void Parse(IPacketParser parser)
        {
            Source = parser.ApiId == ApiId.Rx16Response
                         ? (XBeeAddress) parser.ParseAddress16()
                         : parser.ParseAddress64();

            base.Parse(parser);

            Payload = parser.ReadRemainingBytes();
        }
Exemple #4
0
        public override void Parse(IPacketParser parser)
        {
            Source = parser.ApiId == ApiId.Rx16Response
                         ? (XBeeAddress)parser.ParseAddress16()
                         : parser.ParseAddress64();

            base.Parse(parser);

            Payload = parser.ReadRemainingBytes();
        }
        public override void Parse(IPacketParser parser)
        {
            FrameId = parser.Read("Frame Id");

            RemoteSerial = parser.ParseAddress64();
            RemoteAddress = parser.ParseAddress16();

            Command = UshortUtils.ToUshort(
                parser.Read("AT Response Char 1"),
                parser.Read("AT Response Char 2"));

            Status = (AtResponseStatus) parser.Read("AT Response Status");
            Value = parser.ReadRemainingBytes();
        }
        public override void Parse(IPacketParser parser)
        {
            FrameId = parser.Read("Frame Id");

            RemoteSerial  = parser.ParseAddress64();
            RemoteAddress = parser.ParseAddress16();

            Command = UshortUtils.ToUshort(
                parser.Read("AT Response Char 1"),
                parser.Read("AT Response Char 2"));

            Status = (AtResponseStatus)parser.Read("AT Response Status");
            Value  = parser.ReadRemainingBytes();
        }
        public override void Parse(IPacketParser parser)
        {
            Source = parser.ApiId == ApiId.Rx16IoResponse
             ? (XBeeAddress)parser.ParseAddress16()
             : parser.ParseAddress64();

            base.Parse(parser);

            SampleCount = parser.Read();
            ChannelIndicator = UshortUtils.ToUshort(parser.Read(), parser.Read());
            ContainsDigital = (ChannelIndicator & DigitalMask) > 0;
            ContainsAnalog = (ChannelIndicator & AnalogMask) > 0;
            Samples = new IoSample[SampleCount];

            for (var i = 0; i < SampleCount; i++)
            {
                Logger.LowDebug("Parsing I/O sample nr " + (i + 1));
                Samples[i] = ParseIoSample(parser);
            }
        }
        public override void Parse(IPacketParser parser)
        {
            Source = parser.ApiId == ApiId.Rx16IoResponse
             ? (XBeeAddress)parser.ParseAddress16()
             : parser.ParseAddress64();

            base.Parse(parser);

            SampleCount = parser.Read();
            ChannelIndicator = UshortUtils.ToUshort(parser.Read(), parser.Read());
            ContainsDigital = (ChannelIndicator & DigitalMask) > 0;
            ContainsAnalog = (ChannelIndicator & AnalogMask) > 0;
            Samples = new IoSample[SampleCount];

            for (var i = 0; i < SampleCount; i++)
            {
                Logger.LowDebug("Parsing I/O sample nr " + (i + 1));
                Samples[i] = ParseIoSample(parser);
            }
        }
 public override void Parse(IPacketParser parser)
 {
     base.Parse(parser);
     DestinationAddress = parser.ParseAddress16();
     RetryCount = parser.Read("ZNet Tx Status Tx Count");
     DeliveryStatus = (DeliveryResult) parser.Read("ZNet Tx Status Delivery Status");
     DiscoveryStatus = (DiscoveryResult) parser.Read("ZNet Tx Status Discovery Status");
 }
Exemple #10
0
 protected virtual void ParseFrameHeader(IPacketParser parser)
 {
     SourceSerial  = parser.ParseAddress64();
     SourceAddress = parser.ParseAddress16();
 }
        public override void Parse(IPacketParser parser)
        {
            Sender = new NodeInfo
            {
                SerialNumber = parser.ParseAddress64(),
                NetworkAddress = parser.ParseAddress16()
            };

            Option = (PacketOption) parser.Read("Option");

            Remote = new NodeInfo
            {
                NetworkAddress = parser.ParseAddress16(),
                SerialNumber = parser.ParseAddress64()
            };

            byte ch;

            // NI is terminated with 0
            while ((ch = parser.Read("Node Identifier")) != 0)
            {
                if (ch > 32 && ch < 126)
                    Remote.NodeIdentifier += (char) ch;
            }

            ParentAddress = parser.ParseAddress16();
            NodeType = (NodeType) parser.Read("Device Type");
            SourceAction = (SourceActions) parser.Read("Source Action");
            ProfileId = UshortUtils.ToUshort(parser.Read("Profile MSB"), parser.Read("Profile LSB"));
            MfgId = UshortUtils.ToUshort(parser.Read("MFG MSB"), parser.Read("MFG LSB"));
        }