The USBSerial component can be used to communicate with other USB devices connected to yours.
The default constructor values are:
To find out more about RTD and DTR or USB serial at all visit Wikipedia: RS-232
Note: this application only works on devices that support OTG and allow access to external serial devices.
Known to work: Nexus7, GalaxyS3/S4, ExperiaZUltra, TescoHudl
Dont work: Nexus4, GalaxyS1, AsusMemo
The following methods are available on the USBSerial object:
number: integer: 300 or 600 or 1200 or 2400 or 4800 or 9600 or 19200 or 38400 or 57600 or 115200 or 230400 or 460800 or 921600
number: integer: 5 or 6 or 7 or 8
number: integer: 1 or 2 or 15
number: integer: 0
string: “1st” or “2nd” or “3rd” or “...”
string: “End” or “Start-End” or “Size”
string: “US-ASCII” or “UTF16L/BE”
Returns the control class name.
Returns whether a USB serial device is connected.
Allows access to other functions defined on the object in Java via reflection.
Note: This function is a premium feature. Please consider subscribing to Premium to use this feature and support DroidScript in its further development.
Enable sending data in several modes.
Raises the Data Terminal Ready state.
Define the maximum amount of bytes you want to receive at once.
Define maximum amount of bytes to send at once.
The SetOnReceive callback is called automatically after data has been received via the USB serial connection.
Raises the Request To Send state.
Tells the serial listener how to split received data. Splitted data will result in multiple OnReceive calls.
p2 and p3 have different purposes for different modes:
|Size||Size of one data package||-|
|End||Byte indicating end of data||-|
|Start-End||Byte indicating start of data||Byte indicating end of data|
Start listening to the USB serial connection.
Stop listening on USB serial connection
Send data over the USB serial connection to the other device.