/// <summary> /// handler for mac beacon notifications /// </summary> /// <param name="sender"></param> /// <param name="BSN"></param> /// <param name="panDescriptor"></param> /// <param name="pendingShortAddrs"></param> /// <param name="pendingExtendedAddrs"></param> /// <param name="beaconPayload"></param> public void MacBeaconNotifyIndication( IMacMgmtSap sender, ushort BSN, PanDescriptor panDescriptor, ushort[] pendingShortAddrs, UInt64[] pendingExtendedAddrs, Frame beaconPayload) { if (!_scanning) { return; } ScanResultInternal res = new ScanResultInternal(); res.panDescriptor = panDescriptor; res.isMeshProtocol = false; if (beaconPayload.LengthDataUsed == 8) { UInt64 meshId = beaconPayload.ReadUInt64Canonical(0); if (meshId == NetworkLayer.cMeshId) { res.isMeshProtocol = true; } Frame.Release(ref beaconPayload); } lock (_scanResults) { _scanResults.Add(res); } }
// handler for scan result private void HandlerScanResult( IMacMgmtSap sender, MacEnum status, ScanType scanType, Byte channelPage, UInt32 unscannedChannel, byte[] energyDetectList, PanDescriptor[] panDescriptorList) { // store networks if (panDescriptorList != null) { lock (_scanResults) { int length = panDescriptorList.Length; for (int i = 0; i < length; i++) { ScanResultInternal res = new ScanResultInternal(); res.panDescriptor = panDescriptorList[i]; res.isMeshProtocol = false; _scanResults.Add(res); } } } ScanNextPage(); }
private void MacBeaconNotifyIndication( IMacMgmtSap sender, ushort BSN, PanDescriptor panDescriptor, ushort[] pendingShortAddrs, UInt64[] pendingExtendedAddrs, Frame beaconPayload) { _mgmt.MacBeaconNotifyIndication(sender, BSN, panDescriptor, pendingShortAddrs, pendingExtendedAddrs, beaconPayload); }
// handler for MacGetRequest for supported channels private void HandlerChannelsSupported( IMacMgmtSap sender, MacEnum status, PibAttribute attribute, int attributeIndex, PibValue value) { if (!_scanning || attribute != PibAttribute.phyChannelsSupported) { return; } if (status != MacEnum.Success) { FinishScanning(Status.Error); return; } _scanChannels = value.IntArray; _scanChannelsCurrent = 0; ScanNextPage(); }
/// <summary> /// handler for mac beacon notifications /// </summary> /// <param name="sender"></param> /// <param name="BSN"></param> /// <param name="panDescriptor"></param> /// <param name="pendingShortAddrs"></param> /// <param name="pendingExtendedAddrs"></param> /// <param name="beaconPayload"></param> public void MacBeaconNotifyIndication( IMacMgmtSap sender, ushort BSN, PanDescriptor panDescriptor, ushort[] pendingShortAddrs, UInt64[] pendingExtendedAddrs, Frame beaconPayload) { if (!_scanning) return; ScanResultInternal res = new ScanResultInternal(); res.panDescriptor = panDescriptor; res.isMeshProtocol = false; if (beaconPayload.LengthDataUsed == 8) { UInt64 meshId = beaconPayload.ReadUInt64Canonical(0); if (meshId == NetworkLayer.cMeshId) { res.isMeshProtocol = true; } Frame.Release(ref beaconPayload); } lock (_scanResults) { _scanResults.Add(res); } }
// handler for MacGetRequest for supported channels private void HandlerChannelsSupported( IMacMgmtSap sender, MacEnum status, PibAttribute attribute, int attributeIndex, PibValue value) { if (!_scanning || attribute != PibAttribute.phyChannelsSupported) return; if (status != MacEnum.Success) { FinishScanning(Status.Error); return; } _scanChannels = value.IntArray; _scanChannelsCurrent = 0; ScanNextPage(); }
private void ResetConfirmHandler( IMacMgmtSap sender, MacEnum status) { // don't care }