예제 #1
0
        /// <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);
            }
        }
예제 #2
0
        // 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();
        }
예제 #3
0
 private void MacBeaconNotifyIndication(
     IMacMgmtSap sender,
     ushort BSN,
     PanDescriptor panDescriptor,
     ushort[] pendingShortAddrs,
     UInt64[] pendingExtendedAddrs,
     Frame beaconPayload)
 {
     _mgmt.MacBeaconNotifyIndication(sender, BSN, panDescriptor, pendingShortAddrs, pendingExtendedAddrs, beaconPayload);
 }
예제 #4
0
        // 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();
        }
예제 #5
0
        /// <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);
            }
        }
예제 #6
0
        // 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();
        }
예제 #7
0
        // 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();
        }
예제 #8
0
 private void MacBeaconNotifyIndication(
     IMacMgmtSap sender,
     ushort BSN,
     PanDescriptor panDescriptor,
     ushort[] pendingShortAddrs,
     UInt64[] pendingExtendedAddrs,
     Frame beaconPayload)
 {
     _mgmt.MacBeaconNotifyIndication(sender, BSN, panDescriptor, pendingShortAddrs, pendingExtendedAddrs, beaconPayload);
 }
예제 #9
0
 private void ResetConfirmHandler(
     IMacMgmtSap sender,
     MacEnum status)
 {
     // don't care
 }
예제 #10
0
 private void ResetConfirmHandler(
     IMacMgmtSap sender,
     MacEnum status)
 {
     // don't care
 }