Exemplo n.º 1
0
        public BACnetObject(BACnetDevice bnd, BacnetObjectId boi)
        {
            this.BacnetDevice   = bnd;      //need this for communication - i.e. get sub-objects.
            this.BacnetObjectId = boi;

            this.Name = "";

            //GetName();  //or just get all properties....


            FetchRequiredProperties();    //obj type, obj instance (already known), name


            //may already know this from device...



            //Changed this.  Now treating structured views and groups just like any other type........
            //if (boi.type == BacnetObjectTypes.OBJECT_GROUP)
            //    FetchGroupProperties();     //should obj_id be a param?  Isn't it just this?
            //else if ((boi.type == BacnetObjectTypes.OBJECT_STRUCTURED_VIEW)) // && Yabe.Properties.Settings.Default.DefaultPreferStructuredView)
            //    FetchViewObjects();
            //else


            //FetchProperties();  //yes, even if device, I guess...
        }
Exemplo n.º 2
0
        //TODO: just put in network.
        public void OnIam(BacnetClient sender, BacnetAddress adr, uint device_id, uint max_apdu, BacnetSegmentations segmentation, ushort vendor_id)
        {
            if (BacnetDevices.ContainsKey(device_id))       //may happen since multiple WhoIs's are sent out...
            {
                return;
            }

            if (BacnetGlobalNetwork.FilterDeviceInstance && (device_id < BacnetGlobalNetwork.DeviceInstanceMin || device_id > BacnetGlobalNetwork.DeviceInstanceMax))
            {
                return;
            }

            var device = new BACnetDevice(this, adr, device_id, Instance);

            BacnetDevices.Add(device_id, device);
        }