ArcGIS for Developers

SensorPort QML Type

Provides functions to access sensor ports and transfer files through them. More...

Import Statement: import ArcGIS.AppFramework.Sensors 1.0

Properties

Signals

Methods

Detailed Description

The SensorPort component handles both access to and information about serial ports, as well as handling the files and data sent through them. After connecting to the port, the send and sendLine methods can be used to submit data.

This property will be deprecated soon, and should no longer be used. Instead, use the Device component.

Enumerations

DataFormat enumeration

This enum describes the type of data being transferred through the port.

NameValue
SensorPort.Text0
SensorPort.Csv1
SensorPort.Nmea2

Property Documentation

baudRate : int

Holds the data baud rate for the desired connection.


csvSeparator : QChar

Returns the character being used to separate values in CSV files. The default will most likely be a comma.


dataFormat : DataFormat

Returns the format of data the port is currently handling.


endOfLine : string

Returns the maximum length of the text sent by the sendLine() method.


[read-only] error : SerialPortError

Returns the error status of the port.


[read-only] errorString : string

Returns a human-readable string describing the error state.


[read-only] isConnected : bool

Returns true if the port is connected. Otherwise, returns false.


portName : string

Returns the name of the port.


Signal Documentation

baudRateChanged( int baudRate)

Signal emitted after the baud rate has been changed.


connectionStateChanged( bool isConnected)

Signal emitted when the connection state of the port has changed.


csvReceived( QStringList csv)

Signal emitted when a CSV file has been received.


csvSeparatorChanged( QChar separator)

Signal emitted when the character separating values in CSV files has been changed.


dataFormatChanged( SensorPort::DataFormat dataFormat)

Signal emitted when the data format the port is handling has changed.


endOfLineChanged( string endOfLine)

Returns when the endOfLine property has changed.


nmeaReceived( string talker, string type, QStringList fields, bool checksumValid)

Signal emitted when an NMEA file has been received.

NMEA is a data specification used by devices to capture information, particularly in navigation and mapping contexts. ArcGIS Online uses NMEA files for GPS values.


textReceived( string text)

Signal emitted when a text file has been sent through the port.


Method Documentation

object availablePorts()

Returns a list of all available ports on the system.


connect()

Opens the port to connections.


disconnect()

Closes the port to connections.


send(data)

Sends the given data through the port.

The data parameter

The data to be sent.


sendLine(line)

Sends the given line of text as a string. The maximum length of this line is governed by the endOfLine property.

The line parameter

The line of text to send.