DLM Events
DLM event types and the structure of a DlmEvent are defined in
dlmdef.h. Each event contains a type code in the
type field. Additional information about the
event may be contained in the event's tag and
flag fields. The auxiliary function dlm_EventMessage()
converts event type codes into human-readable strings.
The following event types are defined:
Note: Monitor events sent to the server do not generate callbacks
in the monitor.
- dlm_EVENT_DATA
- A single, complete data frame from the tap.
The tag field contains a data tag
code indicating type of data error, if any:
- dlm_DATA_TAG_OK
- dlm_DATA_TAG_CRC_ERROR
- dlm_DATA_TAG_LENGTH_ERROR
- dlm_DATA_TAG_ABORT
- dlm_DATA_TAG_RECEIVE_OVERRUN
(The auxiliary function
dlm_DataTagMessage()
converts data tag codes into human-readable strings.)
The size field contains the total
number of bytes in the frame.
The count field indicates how many bytes
of the frame are actually appended to the event.
The timestamp field indicates the tap relative
time in milliseconds that the frame was received or sent.
The source field indicates whether the frame
was sent by the application local to the tap or by the remote program:
- dlm_SOURCE_LOCAL
- dlm_SOURCE_REMOTE
(The auxiliary
function dlm_SourceMessage()
converts source codes into human-readable strings.)
- dlm_EVENT_SIGNALS
- A signal state change from the tap.
The tag field contains the signal flags
which have changed since the last signal update.
The flag field contains the signal flags
indicating the current state of all physical signals at the tap:
- dlm_SIGNAL_FLAG_CTS
- dlm_SIGNAL_FLAG_DCD
- dlm_SIGNAL_FLAG_DSR
- dlm_SIGNAL_FLAG_FLAG
- dlm_SIGNAL_FLAG_RI
- dlm_SIGNAL_FLAG_RTS
- dlm_SIGNAL_FLAG_DTR
Check if a signal is changed or high using bitwise and of the
manifest constant with the value in the flag
field.
The timestamp field indicates the tap relative
time in milliseconds that the frame was received or sent.
- dlm_EVENT_CONNECT_REQUEST
- The monitor connection request to the server.
- dlm_EVENT_CONNECT_FAILURE
- The monitor connection request failed.
- dlm_EVENT_CONNECT_ACCEPT
- The server accepts the monitor connection request to monitor data on
a particular line. The monitor must then authenticate to actually
start receiving tap status information and protocol data.
- dlm_EVENT_CONNECT_REJECT
- The server has rejected the monitor connection request.
The tag field contains a DLM API error code
indicating the reason the connection was rejected.
- dlm_EVENT_CONNECT_TIMEOUT
- The monitor connection request has timed out.
- dlm_EVENT_DISCONNECT
- The sender of the event is terminating the connection.
- dlm_EVENT_START
- The monitor requests that data flow be resumed.
- dlm_EVENT_STOP
- The monitor requests that data flow be stopped, but the connection maintained.
- dlm_EVENT_PROTOCOL_ERROR
- An DLM protocol error occurred.
The tag field contains a DLM API error code
indicating the nature of the failure.
- dlm_EVENT_SESSION_STOP
- The monitor session is complete and has returned to the Open state.
This is always the last event for which a callback will be received unless
the monitor issues another call to dlm_MonConnect().
- dlm_EVENT_REGISTRATION
- The tap registers itself as a data source.
- dlm_EVENT_SESSION_STATUS
- Server message to the monitor regarding the state of the tap.
The tag field contains a session
status code indicating the current state of the tap.
- dlm_STATUS_TAP_INACTIVE
- dlm_STATUS_TAP_ACTIVE
- dlm_STATUS_TAP_SHUTDOWN
- dlm_STATUS_TAP_ERROR
(The auxiliary function
dlm_StatusMessage()
converts status codes into human-readable strings.)
The flag field contains the last
reported state of the physical signals.
- dlm_EVENT_AUTHENTICATION
- Monitor authentication message to the server.