This code shows how to use SpcInterfaceControl class to communicate with a device running on SPC mode.
For details on SPC communication check Useful Links
- Java IDE (For implementing this sample eclipse IDE was used)
- Micro-Sensys RFID reader with appropriate script running
- RFID transponders
For compatible script files, check Useful Links
This code shows how to use SpcInterfaceControl class to communicate with a device running on SPC mode. Using this class the communication port can be open/closed. It automatically handles the data received and notifies the App using a Callback, and provides a function to send trigger commands to the script.
Class information is available under API documentation. See Useful Links
Import this project into your IDE and check the communication port name for the RFID reader (for example /dev/ttyUSB0) and fill the name into the JComboBox. Once the name is added to the code, start the debug/run session.
- Select the device you wish to connect to, and press CONNECT. Once the connect process finishes, the result will be shown in the EditText on the bottom side, and if the device is connected, the READ/WRITE buttons will be enabled.
- Received data will be automatically received on provided SpcInterfaceCallback "spcReaderHeartbeatReceived" will be called when Heartbeat is received "spcRawDataReceived" will be called when other data is received
- Use READ/WRITE buttons to trigger the processes built in the script
- Device has to be configured in USB VCP mode (ask microsensys for HowTo)
- To get VCP port name use:
dmesg | grep FTDI
- To get VCP port name use:
- To be able to communicate with RFID reader, the user must be part of the group "dialout".
- To add the user to the group use:
sudo gpasswd --add [username] dialout
- To add the user to the group use:
- JAR Library and API documentation
- Scripts
- iID® INTERFACE configuration tool (tool to upload script to reader)
- GitHub documentation repository: Micro-Sensys/documentation
- For coding questions or questions about this sample code, you can use support@microsensys.de
- For general questions about the company or our devices, you can contact us using info@microsensys.de
- Victor Garcia - Initial work - MICS-VGarcia