/// <summary> /// Raises the NetworkScanned event. /// </summary> // Revision History // MM/DD/YY Who Version Issue# Description // -------- --- ------- ------ ------------------------------------------- // 02/22/08 RCG 1.00 Created private void OnNetworkScanned(ZigBeeRadioScannedEventArgs e) { if (NetworkScanned != null) { NetworkScanned(this, e); } }
/// <summary> /// Raises the CellRelaysUpdated event. /// </summary> /// <param name="e">The event arguments.</param> // Revision History // MM/DD/YY Who Version Issue# Description // -------- --- ------- ------ ------------------------------------------- // 03/18/08 RCG 1.00 Created private void OnCellRelaysUpdated(ZigBeeRadioScannedEventArgs e) { if (CellRelaysUpdated != null) { CellRelaysUpdated(this, e); } }
/// <summary> /// Raises the DevicesUpdated event. /// </summary> /// <param name="e">The event arguments.</param> // Revision History // MM/DD/YY Who Version Issue# Description // -------- --- ------- ------ ------------------------------------------- // 03/03/08 RCG 1.00 Created private void OnDevicesUpdated(ZigBeeRadioScannedEventArgs e) { if (DevicesUpdated != null) { DevicesUpdated(this, e); } }
/// <summary> /// Raises the ElectricMetersUpdated event. /// </summary> /// <param name="e">The event arguments.</param> // Revision History // MM/DD/YY Who Version Issue# Description // -------- --- ------- ------ ------------------------------------------- // 03/18/08 RCG 1.00 Created private void OnElectricMetersUpdated(ZigBeeRadioScannedEventArgs e) { if (ElectricMetersUpdated != null) { ElectricMetersUpdated(this, e); } }
/// <summary> /// Handles the networks scanned /// </summary> /// <param name="sender">The object that sent the event.</param> /// <param name="e">The event arguments.</param> // Revision History // MM/DD/YY Who Version Issue# Description // -------- --- ------- ------ ------------------------------------------- // 03/03/08 RCG 1.00 Created private void m_RadioCallBack_NetworkScanned(object sender, ZigBeeRadioScannedEventArgs e) { // Create a new list by copying the latest list of devices. List <ZigBeeDevice> UpdatedDeviceList = new List <ZigBeeDevice>(); foreach (ZigBeeDevice CurrentDevice in e.Devices) { UpdatedDeviceList.Add(CurrentDevice); } // Add in the older devices that have not already been added, and remove devices that // are too old. foreach (ZigBeeDevice CurrentDevice in m_Devices) { if (UpdatedDeviceList.Contains(CurrentDevice) == false && (DateTime.Now - CurrentDevice.ScanTime) < m_TimeToKeep) { UpdatedDeviceList.Add(CurrentDevice); } } m_Devices = UpdatedDeviceList; OnDevicesUpdated(new ZigBeeRadioScannedEventArgs(Devices)); OnElectricMetersUpdated(new ZigBeeRadioScannedEventArgs(ElectricMeters)); OnCellRelaysUpdated(new ZigBeeRadioScannedEventArgs(CellRelays)); }