Skip to content

Device Not Ready #1

@wint100

Description

@wint100

Hi,

When running the shell application I get following unhandled exception in the EthernetPort class when the NIC is already being used by another BACnet OWS. I currently have Delta Controls enteliWEB connecting over ethernet so it can not bind to that adaptor.

private LibPcapLiveDevice _getCaptureDevice()
{
var devices = LibPcapLiveDeviceList.Instance.Where(dev => dev.Interface != null);

        if(_options.DeviceName != null)
            return devices.Where(dev => dev.Name == _options.DeviceName).FirstOrDefault();
        else
        {
            foreach(var device in devices)
            {
                **if (device.LinkType == PacketDotNet.LinkLayers.Ethernet
                    && device.Interface.MacAddress != null)
                    return device;**
            }

            return null;
        }
    }

An unhandled exception of type 'SharpPcap.DeviceNotReadyException' occurred in SharpPcap.dll

Maybe we should add some error checking to this to handle this common situation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions