Serial Port Monitoring Control - ActiveX Component Library for RS232 Data Monitoring, API for Software Developers
Download Serial Port Monitoring Control Hide this button

IMonitoring Interface

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.

Declaration

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);
};

IMonitoring Properties

ConnectedDevice

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.

Connected

readonly Connected: boolean;
bool Connected { get; }
VARIANT_BOOL Connected;  // get 

Returns true if this monitor object is currently connected to the serial device.

SerialMonitor

readonly SerialMonitor: ${ISerialMonitor};
${ISerialMonitor} SerialMonitor { get; }
${ISerialMonitorPtr#ISerialMonitor} SerialMonitor;  // get 

Returns the reference to the main Serial Monitor object.

IMonitoring Methods

Connect

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:

StringPort name. This string name will be used as an index to the ISerialMonitor.Devices collection and the resulting IDevice object will be used
IDevice pointerPointer to the serial device you want to connect to
OmittedTell the monitor to wait for the next serial device to be plugged to the computer and connect to it immediately.
highPrecision
Set this parameter to true to use high-precision time and false otherwise.

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

Disconnect(): void;
void Disconnect();
HRESULT Disconnect();

Disconnect the monitor object from the serial device.

AddNativeListener

// This method is not available in scripting environment
void AddNativeListener(${INativeListener} listener);
HRESULT AddNativeListener(${INativeListener *#INativeListener} listener);
listener
Pointer to the caller-implemented object with INativeListener interface.

Adds new native listener to the Monitor object. This method should only be called by native clients.

RemoveNativeListener

// This method is not available in scripting environment
void RemoveNativeListener(${INativeListener} listener);
HRESULT RemoveNativeListener(${INativeListener *#INativeListener} listener);
listener
Pointer to the caller-implemented object with INativeListener interface.

Removes the native listener from the list of registered native listeners. This method should only be called by native clients.