Accessing the serial port on the back connector

There is an article for the pinout on Nautiz X2 and pinout on the Nautiz X6.
If you are using one of our RFID accessoriesyou can also use our Anysend app for easier implementation. Read this article to learn how.

To simplify the connection to the serial port on the Nautiz X2 and the Nautiz X6, we have created a library that takes care of providing the correct path and handles power control depending on the hardware. 

Below you’ll find a short code example in Java. If you need access to the AAR file directly, you can find it here. 

Implement dependency 

implementation 'com.handheldgroup.tools:serialport:1.5.0' 

If the library can’t be found, you have to add a custom repository to you build file:

allprojects {
    repositories {
        ...
        maven { url "https://repo.repsy.io/mvn/handheldgroup/handheldgroup" }
    }
}

Connection setup

File port = new File(SerialPort.getSerialPath()); 
SerialPort.setDevicePower(this, true); 
mSerialPort = new SerialPort(port, 9600, 0); 
mOutputStream = mSerialPort.getOutputStream(); 
mInputStream = mSerialPort.getInputStream(); 
// Start reading and writing to device 
Was this article helpful?
No
Copyright © 2024 Handheld Group. All rights reserved.
Images, texts and other material downloaded from the Handheld web pages may not be reproduced in any form, without prior written permission from the Handheld Group.
Algiz® and Nautiz® are registered trademarks of Handheld Group AB. l Privacy Policy l Device Policy l GDPR l Legal l