Serial Port Monitoring Control - ActiveX Component Library for RS232 Data Monitoring, API for Software Developers
Docs

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): void;
    ${Disconnect}(): void;
}
public interface IMonitoring
{
    // Properties
    ${IDevice} ${ConnectedDevice} { get; }
    bool ${Connected} { get; }
    ${ISerialMonitor} ${SerialMonitor} { get; }
    // Methods
    void ${Connect}(object device);
    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);
    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): void;
void Connect(object device);
HRESULT Connect(const _variant_t & device);
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.

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.