コード例 #1
0
ファイル: TxRequest64.cs プロジェクト: joshjliu/Zigbee-3
        public TxRequest64(XBeeAddress64 address64, byte[] data)
        {
            this.ApiID = XBeeApiType.TxRequest64;
            _address64 = address64;

            _value = data;
        }
コード例 #2
0
 public void ReadBytes(ByteReader br)
 {
     _address16      = XBeeAddress16.ReadBytes(br);
     _address64      = XBeeAddress64.ReadBytes(br);
     _signalStrength = br.ReadByte();
     _ni             = br.ReadString(terminationCharacter);
 }
コード例 #3
0
 public RxResponse64(short length, ByteReader br)
     : base(length, br)
 {
     _address64 = XBeeAddress64.ReadBytes(br);
     _rssi      = br.ReadByte();
     _options   = br.ReadByte();
     _value     = br.ReadBytes(length - 11);
 }
コード例 #4
0
ファイル: ZNetRxResponse.cs プロジェクト: joshjliu/Zigbee-3
 public ZNetRxResponse(short length, ByteReader br)
     : base(length, br)
 {
     _address64 = XBeeAddress64.ReadBytes(br);
     _address16 = XBeeAddress16.ReadBytes(br);
     _options   = br.ReadByte();
     _value     = br.ReadBytes(length - 12);
 }
コード例 #5
0
        public ZNetTxRequest(XBeeAddress64 address64, XBeeAddress16 address16, byte[] data)
        {
            this.ApiID = XBeeApiType.ZNetTxRequest;
            _address64 = address64;
            _address16 = address16;

            _value = data;
        }
コード例 #6
0
ファイル: ZNetTxRequest.cs プロジェクト: valoni/NETMF-Toolkit
 public ZNetTxRequest(XBeeAddress64 address64, XBeeAddress16 address16, byte broadcastRadius, byte options, byte[] value)
 {
     this.ApiID       = XBeeApiType.ZigBeeTransmitRequest;
     _address64       = address64;
     _address16       = address16;
     _broadcastRadius = broadcastRadius;
     _options         = options;
     _value           = value;
 }
コード例 #7
0
 public ExplicitZigBeeCommand(XBeeAddress64 address64, XBeeAddress16 address16, byte sourceEndpoint, byte destinationEndpoint, ushort clusterId, ushort profileId, byte[] payload)
     : base(XBeeApiType.ExplicitAddressingZigBeeCommandFrame)
 {
     DestinationAddress64 = address64;
     DestinationAddress16 = address16;
     SourceEndpoint       = sourceEndpoint;
     DestinationEndpoint  = destinationEndpoint;
     ClusterId            = clusterId;
     ProfileId            = profileId;
     Payload = payload;
 }
コード例 #8
0
ファイル: RemoteAtRequest.cs プロジェクト: joshjliu/Zigbee-3
        public RemoteAtRequest(XBeeAddress64 address64, XBeeAddress16 address16, bool applyChanges, string command, byte[] value)
            : base(command, value)
        {
            this.ApiID = XBeeApiType.RemoteAtCommandRequest;
            _address64 = address64;
            _address16 = address16;

            if (applyChanges)
            {
                _options = 0x02;
            }
        }
コード例 #9
0
 public ExplicitZigBeeResponse(short length, ByteReader br)
     : base(length, br)
 {
     SourceAddress64     = XBeeAddress64.ReadBytes(br);
     SourceAddress16     = XBeeAddress16.ReadBytes(br);
     SourceEndpoint      = br.ReadByte();
     DestinationEndpoint = br.ReadByte();
     ClusterId           = br.ReadUInt16();
     ProfileId           = br.ReadUInt16();
     Options             = br.ReadByte();
     Payload             = br.GetAvailableBytes();
 }
コード例 #10
0
        public void ReadBytes(ByteReader br)
        {
            _address16 = XBeeAddress16.ReadBytes(br);
            _address64 = XBeeAddress64.ReadBytes(br);

            _ni = br.ReadString(terminationCharacter);

            _parent16      = XBeeAddress16.ReadBytes(br);
            _deviceType    = br.ReadByte();
            _status        = br.ReadByte();
            _profileID     = br.ReadUInt16();
            _manufactureID = br.ReadUInt16();
        }
コード例 #11
0
        public XBeeSensorRead(short length, ByteReader br)
            : base(length, br)
        {
            _address64 = XBeeAddress64.ReadBytes(br);
            _address16 = XBeeAddress16.ReadBytes(br);

            _options = br.ReadByte();

            _sensors = br.ReadByte();

            _sensorA = br.ReadUInt16();
            _sensorB = br.ReadUInt16();
            _sensorC = br.ReadUInt16();
            _sensorD = br.ReadUInt16();

            _temperature = br.ReadUInt16();
        }
コード例 #12
0
        public ZNetRxIoSampleResponse(short length, ByteReader br)
            : base(length, br)
        {
            _address64 = XBeeAddress64.ReadBytes(br);
            _address16 = XBeeAddress16.ReadBytes(br);

            _options = br.ReadByte();

            _numSamples          = br.ReadByte();
            _digitalChannelMask1 = br.ReadByte();
            _digitalChannelMask2 = br.ReadByte();
            _analogChannelMask   = br.ReadByte();

            if (_digitalChannelMask1 != 0x00 || _digitalChannelMask2 != 0x00)
            {
                _digital1 = br.ReadByte();
                _digital2 = br.ReadByte();
            }

            if (_analogChannelMask != 0x00)
            {
                if ((_analogChannelMask & 0x01) == 0x01)
                {
                    _AD0 = br.ReadUInt16();
                }
                if ((_analogChannelMask & 0x02) == 0x02)
                {
                    _AD1 = br.ReadUInt16();
                }
                if ((_analogChannelMask & 0x04) == 0x04)
                {
                    _AD2 = br.ReadUInt16();
                }
                if ((_analogChannelMask & 0x08) == 0x08)
                {
                    _AD3 = br.ReadUInt16();
                }
                if ((_analogChannelMask & 0x80) == 0x80)
                {
                    _supplyVoltage = br.ReadUInt16();
                }
            }
        }
コード例 #13
0
        public ZNetNodeIdentificationResponse(short length, ByteReader br)
            : base(length, br)
        {
            _address64 = XBeeAddress64.ReadBytes(br);
            _address16 = XBeeAddress16.ReadBytes(br);

            _options = br.ReadByte();

            _addressNode16 = XBeeAddress16.ReadBytes(br);
            _addressNode64 = XBeeAddress64.ReadBytes(br);

            _ni = br.ReadString((byte)0x00);            // TODO: verfiy if this is correct?!

            _parent16      = XBeeAddress16.ReadBytes(br);
            _deviceType    = br.ReadByte();
            _status        = br.ReadByte();
            _profileID     = br.ReadUInt16();
            _manufactureID = br.ReadUInt16();
        }
コード例 #14
0
        public RemoteAtResponse(short length, ByteReader br)
            : base(length, br)
        {
            _address64 = XBeeAddress64.ReadBytes(br);
            _address16 = XBeeAddress16.ReadBytes(br);

#if (MF)
            _command = ByteUtil.GetString(br.ReadBytes(2));
#elif (WindowsCE)
            byte[] tempArr = br.ReadBytes(2);
            _command = Encoding.ASCII.GetString(tempArr, 0, tempArr.Length);
#else
            _command = Encoding.ASCII.GetString(br.ReadBytes(2));
#endif

            _status = br.ReadByte();

            if (br.AvailableBytes > 0)
            {
                _value = br.ReadBytes(length - 14);
            }
        }
コード例 #15
0
ファイル: RemoteAtRequest.cs プロジェクト: joshjliu/Zigbee-3
 public RemoteAtRequest(XBeeAddress64 address64, bool applyChanges, AtCommand cmd)
     : this(address64, XBeeAddress16.BROADCAST, applyChanges, cmd.Command, cmd.Value)
 {
 }
コード例 #16
0
 public static DestinationAddressHighCommand FromSerialNumber(XBeeAddress64 address)
 {
     return(new DestinationAddressHighCommand(address.SH));
 }
コード例 #17
0
ファイル: RemoteAtRequest.cs プロジェクト: joshjliu/Zigbee-3
 public RemoteAtRequest(XBeeAddress64 address64, AtCommand cmd)
     : this(address64, true, cmd)
 {
 }
コード例 #18
0
ファイル: RemoteAtRequest.cs プロジェクト: joshjliu/Zigbee-3
 public RemoteAtRequest(XBeeAddress64 address64, string command)
     : this(address64, XBeeAddress16.BROADCAST, true, command, new byte[0])
 {
 }