This interface is implemented by the Monitor object in the Serial Monitoring Control library. You get this interface by calling the ISerialMonitor.CreateMonitor method and use it to start monitoring the serial device.
interface IMonitoring {
// Properties
readonly ${ConnectedDevice}: ${IDevice};
readonly ${Connected}: boolean;
readonly ${SerialMonitor}: ${ISerialMonitor};
// Methods
${Connect}(device?: ${IDevice} | string, highPrecision = false): void;
${Disconnect}(): void;
}
public interface IMonitoring
{
// Properties
${IDevice} ${ConnectedDevice} { get; }
bool ${Connected} { get; }
${ISerialMonitor} ${SerialMonitor} { get; }
// Methods
void ${Connect}(object device, bool highPrecision = false);
void ${Disconnect}();
void ${AddNativeListener}(${INativeListener} listener);
void ${RemoveNativeListener}(${INativeListener} listener);
}
struct IMonitoring : IDispatch
{
// Properties
${IDevicePtr#IDevice} ${ConnectedDevice}; // get
VARIANT_BOOL ${Connected}; // get
${ISerialMonitorPtr#ISerialMonitor} ${SerialMonitor}; // get
// Methods
HRESULT ${Connect}(const _variant_t & device, VARIANT_BOOL highPrecision = VARIANT_FALSE);
HRESULT ${Disconnect}();
HRESULT ${AddNativeListener}(${INativeListener *#INativeListener} listener);
HRESULT ${RemoveNativeListener}(${INativeListener *#INativeListener} listener);
};
readonly ConnectedDevice: ${IDevice};
${IDevice} ConnectedDevice { get; }
${IDevicePtr#IDevice} ConnectedDevice; // get
Returns the device this monitor currently is connected to, or null if it is not connected.
readonly Connected: boolean;
bool Connected { get; }
VARIANT_BOOL Connected; // get
Returns true
if this monitor object is currently connected to the serial device.
readonly SerialMonitor: ${ISerialMonitor};
${ISerialMonitor} SerialMonitor { get; }
${ISerialMonitorPtr#ISerialMonitor} SerialMonitor; // get
Returns the reference to the main Serial Monitor object.
Connect(device?: ${IDevice} | string, highPrecision = false): void;
void Connect(object device, bool highPrecision = false);
HRESULT Connect(const _variant_t & device, VARIANT_BOOL highPrecision = VARIANT_FALSE);
device
This parameter may be one of the following:
String | Port name. This string name will be used as an index to the ISerialMonitor.Devices collection and the resulting IDevice object will be used |
IDevice pointer | Pointer to the serial device you want to connect to |
Omitted | Tell the monitor to wait for the next serial device to be plugged to the computer and connect to it immediately. |
highPrecision
Tell the Monitor object to connect to the serial device. device
can be the port name or the IDevice pointer. If omitted (VT_EMPTY
variant in native code), the monitor will connect to the next connected serial device.
If you have already attached a Native Listener or an event sink to the monitor object, you will immediately receive the OnConnection event. If you omitted the device
parameter, you would not receive the event until the new serial device is plugged.
Disconnect(): void;
void Disconnect();
HRESULT Disconnect();
Disconnect the monitor object from the serial device.
// This method is not available in scripting environment
void AddNativeListener(${INativeListener} listener);
HRESULT AddNativeListener(${INativeListener *#INativeListener} listener);
listener
Adds new native listener to the Monitor object. This method should only be called by native clients.
// This method is not available in scripting environment
void RemoveNativeListener(${INativeListener} listener);
HRESULT RemoveNativeListener(${INativeListener *#INativeListener} listener);
listener
Removes the native listener from the list of registered native listeners. This method should only be called by native clients.