Esempio n. 1
0
 public RemoteAtCommand CreateRequest(ushort atCommand, NodeInfo destination, params byte[] value)
 {
     return new RemoteAtCommand(atCommand, destination.SerialNumber, destination.NetworkAddress, value)
         { FrameId = _idGenerator.GetNext() };
 }
Esempio n. 2
0
        public XBeeRequest CreateRequest(byte[] payload, NodeInfo destination)
        {
            if (Config.IsSeries1())
                return new TxRequest(destination.SerialNumber, payload)
                    { FrameId = _idGenerator.GetNext() };

            return new Api.Zigbee.TxRequest(destination.SerialNumber, destination.NetworkAddress, payload)
                { FrameId = _idGenerator.GetNext() };
        }
Esempio n. 3
0
 public XBeeRequest CreateRequest(string payload, NodeInfo destination)
 {
     return CreateRequest(Arrays.ToByteArray(payload), destination);
 }
        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"));
        }
Esempio n. 5
0
 protected void Init()
 {
     ExpectedResponse = Response.Single;
     TimeoutValue = PacketParser.DefaultParseTimeout;
     DestinationAddress = null;
     DestinationNode = null;
     Filter = null;
 }
Esempio n. 6
0
 public IRequest To(NodeInfo destination)
 {
     DestinationNode = destination;
     return this;
 }