Set breakpoint in specific instantiation of class

I have a UART class that provides much of the functionality that any sensor with a RS232 serial port interface needs. My UART class includes the data received interrupt handler. Every RS232 sensor in my system inherits the UART class. Is it possible to put a breakpoint in the UART data received handler that only fires when a specific sensor puts data on its UART? For example, assume I have a GPS receiver and a Oxygen sensor both with RS232 interfaces. They both inherit the UART class. I’d like to set a breakpoint that only fires when the Oxygen sensor puts data on its UART and its data received interrupt handler is called.

Thanks - Gene

Gene,

Are you familiar with conditional breakpoints in Visual Studio? If you create the breakpoint then right-click on it and choose “Conditions” then you can specify code that evaluates to a bool that determines if the breakpoint should be activated or not. So, for example, you could specify something like "this.SensorType == “Oxygen”.

Hopefully, it’s not too late to help.

Ian

2 Likes