Device Monitoring Studio Server - TODO
Download Device Monitoring Studio Server Hide this button

ISession Interface

This interface is used to manage a monitoring session.

Declaration

interface ISession extends ${IDispatch} {
    // Properties
    readonly ${BytesTransferred}: number;
    readonly ${Connection}: ${IConnection};
    readonly ${CreationTime}: Date;
    readonly ${DataSource}: string;
    readonly ${Devices}: ${IDeviceCollection};
    readonly ${Id}: number;
    readonly ${Status}: SessionStatus;

    // Methods
    ${Drop}(): void;
    ${Pause}(): void;
    ${Resume}(): void;
}
public interface ISession : ${IDispatch}
{
    // Properties
    ulong ${BytesTransferred} { get; }
    ${IConnection} ${Connection} { get; }
    DateTime ${CreationTime} { get; }
    string ${DataSource} { get; }
    ${IDeviceCollection} ${Devices} { get; }
    ulong ${Id} { get; }
    SessionStatus ${Status} { get; }

    // Methods
    void ${Drop}();
    void ${Pause}();
    void ${Resume}();
}
struct ISession : IDispatch
{
    // Properties
    unsigned __int64 ${BytesTransferred};  // get 
    ${IConnectionPtr#IConnection} ${Connection};  // get 
    Date ${CreationTime};  // get 
    _bstr_t ${DataSource};  // get 
    ${IDeviceCollectionPtr#IDeviceCollection} ${Devices};  // get 
    unsigned __int64 ${Id};  // get 
    SessionStatus ${Status};  // get 

    // Methods
    HRESULT ${Drop}();
    HRESULT ${Pause}();
    HRESULT ${Resume}();
};

ISession Properties

BytesTransferred

readonly BytesTransferred: number;
ulong BytesTransferred { get; }
unsigned __int64 BytesTransferred;  // get 

This property holds the total number of transferred bytes for the current session.

Connection

readonly Connection: ${IConnection};
${IConnection} Connection { get; }
${IConnectionPtr#IConnection} Connection;  // get 

This property returns a reference to a session's connection object.

CreationTime

readonly CreationTime: Date;
DateTime CreationTime { get; }
Date CreationTime;  // get 

This property holds the session creation time.

DataSource

readonly DataSource: string;
string DataSource { get; }
_bstr_t DataSource;  // get 

Returns the type of the source for the current session. Can be Serial, USB or Network.

Devices

readonly Devices: ${IDeviceCollection};
${IDeviceCollection} Devices { get; }
${IDeviceCollectionPtr#IDeviceCollection} Devices;  // get 

Returns a collection of session devices.

Id

readonly Id: number;
ulong Id { get; }
unsigned __int64 Id;  // get 

This property holds a unique identifier of a session. This identifier is guaranteed to be unique for this server only.

Status

readonly Status: SessionStatus;
SessionStatus Status { get; }
SessionStatus Status;  // get 

This property holds the current session status. It equals one or more of the following values:

StatusValueDescription
SessionDisconnected0x00000000A session has been disconnected. Session objects are never re-used.
SessionPausedByClient0x00000001A session has been paused by the client.
SessionPausedByServer0x00000002A session has been paused by the server.
SessionRunning0x00000004A session is running.

ISession Methods

Drop

Drop(): void;
void Drop();
HRESULT Drop();

Disconnect the current session.

Pause

Pause(): void;
void Pause();
HRESULT Pause();

Pauses the session. ISession.Status property will have SessionPausedByServer flag set after this method is called. Use the ISession.Resume method to resume the paused session.

Resume

Resume(): void;
void Resume();
HRESULT Resume();

Resumes a paused session. It removes the SessionPausedByServer status, but cannot remove the SessionPausedByClient status.