User's Guide

Tarvos User Guide - Version 0.3 13
3. High Level Reader Connectivity
The Tarvos reader “Text Stream Interface” (TSI) protocol contains two main channels. The first channel
(port 50007) provides for a command and response protocol that will be described in more detail later. The
second channel (port 50008) provides for an event channel stream for asynchronous information
transmitted by the Tarvos reader.
Note, there is a maximum of 8 actively connected TCP channels to the Tarvos reader. This includes the TSI
ports (50007 and 50008) as well as the LLRP port (5084).
3.1 Command Channel (port 50007)
The reader port 50007 is a raw TCP port. Meaning, it is not a shell, there is no echo, and there is no
interpretation of special ASCII characters. It accepts ASCII characters as commands and responds with ASCII
characters.
The TSI protocol requires that each command terminates with “\r\n” and each response terminates with
\r\n\r\n”. As an example, the command to get the operating mode of the reader is
“setup.operating_mode”. Here is some Python code that would implement this command and process the
response:
import socket
host_ip = "169.254.0.20"
command_channel_port = 50007
command_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
command_socket.connect((host_ip, command_channel_port))
command = "setup.operating_mode\r\n"
command_socket.sendall(command)
expected_response = "ok standby\r\n\r\n"
response = command_socket.recv(256)
if response == expected_response:
print "Success"