Main Site Documentation

How to know if Fez Config is connected?


#1

Say, I want to know if there’s a debug output listener (Fez Config, for example) connected to a NETMF device. How to know that from inside the program? I always thought that Debugger.IsAttached property can be used for that, but apparently it could not:


    public static void Main() {
            Debug.Print(Resources.GetString(Resources.StringResources.String1));
            var ledPort = new OutputPort(G400.PD18, false);

            while (true) {
                if (Debugger.IsAttached) ledPort.Write(true);
                else ledPort.Write(false);

                Debug.Print("Printing something");

                Thread.Sleep(1000);
            }
        }

This trivial program lights up a LED if IsAttached property is true. Works if connecting Visual Studio. Does not if using Fez Config. Any ideas?..


#2

@ Simon from Vilnius - Do you see the same behavior with MFDeploy?


#3

Yup. No LED with MFDeploy.


#4

So?.. No ideas? Anyone?..


#5

@ Simon from Vilnius - I’m not aware of a way to check.