For the complete documentation index, see llms.txt. This page is also available as Markdown.
Page cover

MTDevice Events

OnDeviceList

The library will call this function when device information is available.

typedef void ( stdcall * OnDeviceListEvent)( 
void* sender,
MTConnectionType connectionType, 
int deviceCount, 
MTDeviceInformation* deviceList);

Parameter

Description

sender

Object representing the publisher of the event.

connectionType

MTConnectionType value: MTConnectionType.USB, MTConnectionType.IP, MTConnectionType.Serial

deviceCount

Number of devices in deviceList.

deviceList

A list of MTDeviceInformation objects.

Return Value: None

OnDeviceConnectionStateChanged

This event occurs when the connection state of the device is changed.

typedef void ( stdcall * OnDeviceConnectionStateChangedEvent)( 
void* sender,
MTConnectionState state);

Parameter

Description

sender

Object representing the publisher of the event.

state

MTConnectionState value indicating the state of the device: MTConnectionState.Disconnected MTConnectionState.Connecting MTConnectionState.Error MTConnectionState.Connected MTConnectionState.Disconnecting

OnDeviceDataString

This event occurs when a response is received from the device.

Parameter

Description

sender

Object representing the publisher of the event.

dataString

String representing data received.

Return Value: None

OnDeviceResponseMessage

This event occurs when a response is received from the device.

Parameter

Description

sender

Object representing the publisher of the event.

response

MTCMSMessage representing data received.

OnDeviceNotificationMessage

This event occurs when a response is received from the device.

Parameter

Description

sender

Object representing the publisher of the event.

notification

MTCMSMessage representing data received.

Last updated