Beispiel #1
0
 public void ReadBytes(ByteReader br)
 {
     _address16      = XBeeAddress16.ReadBytes(br);
     _address64      = XBeeAddress64.ReadBytes(br);
     _signalStrength = br.ReadByte();
     _ni             = br.ReadString(terminationCharacter);
 }
 public ZNetTxStatusResponse(short length, ByteReader br)
     : base(length, br)
 {
     _address16       = XBeeAddress16.ReadBytes(br);
     _retryCount      = br.ReadByte();
     _deliveryStatus  = br.ReadByte();
     _discoveryStatus = br.ReadByte();
 }
Beispiel #3
0
 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);
 }
Beispiel #4
0
 public RxResponse16(short length, ByteReader br)
     : base(length, br)
 {
     _address16 = XBeeAddress16.ReadBytes(br);
     _rssi      = br.ReadByte();
     _options   = br.ReadByte();
     _value     = br.ReadBytes(length - 5);
 }
Beispiel #5
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();
 }
Beispiel #6
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();
        }
Beispiel #7
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();
        }
Beispiel #8
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();
                }
            }
        }
        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();
        }
        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);
            }
        }