Set up host-server connection in Ethernet networks

Start up readers

  1. Connect the reader to the network and to power supply as described in our installation guide.
  2. The reader starts up and obtains an IP address.
  3. The reader gets ready for a TCP connection, supporting both client and server implementation:

    • It waits for BRP commands, allowing a host to open a TCP connection.
    • It searches for a host in server mode to which it can connect.

View State Diagram

Client mode

Find readers

If you haven't assigned static IP addresses, you can find the readers and their IP addresses via SLP.

Open TCP connection

You can now open a TCP connection from the SDK. To do so, se up a protocol stack.

Only 1 TCP connection at a time

Readers will refuse any further incoming connection requests. To avoid being blocked by an unused BRP-over-TCP connection, the reader closes a connection after 60 seconds without data exchange. This timeout may be customized or disabled via the configuration.

Server mode

Search for host

The reader searches for a host to open a connection to.
If the reader isn't configured for a host yet, the host needs to deploy the configuration containing the host's IP address or host name. If you haven't assigned static IP addresses, you can find the readers and their IP addresses in 2 ways:

Both ways only work if readers are not protected by a firewall.

View State Diagram

Open TCP connection

  1. In your host application, create a BRP server that accepts incoming requests from readers.
    To do so, set up a protocol stack accordingly.
    In the SDK, see appnotes\tcp_server for a working example.
  2. Once the reader has found the host, it autonomously establishes a TCP connection to the host.
  3. The reader sends an identification frame to the host containing the reader's serial number and the connection reason.
  4. The host can now interact with the reader and send commands.
  5. When done, the host closes the connection. As a fallback, the reader closes the connection after a configurable timeout.

Only 1 TCP connection at a time

If a reader-initiated connection is open, it is not possible for another host to connect. If a host-initiated connection (e.g. from a maintenance PC) is open and an event is triggered that would cause the reader to open a connection, this outgoing connection attempt is delayed until the current connection is closed.

To avoid being blocked by an unused BRP-over-TCP connection, the reader closes a connection after 60 seconds without data exchange. This timeout may be customized or disabled via the configuration.

Connection setup when using a host application as an Ethernet server for BALTECH readers

Identification frame

When opening a TCP connection to the host, the reader sends the following identification frame via BRP over TCP/IP.

Name Type/Size Description
FormatVersion Integer (8 bits) Has to be 0x01
Connect reason Bit mask (16 bits) Reason for establishing a TCP connection to the host
PowerUp 0x0001 The reader has booted from a power-up (cold reboot).
LinkStatusChange 0x0002 An Ethernet cable has been connected to/disconnected from either of the 2 ports.
SessionKeyTimeout 0x0004 The current secure session has timed out and needs to be renewed.
CardPresentation 0x0008 A project card was detected by the reader
UDPIntrospection 0x0010 The reader has obtained the host IP address via UDP introspection.
Reset 0x0020 The reader has booted from a software reset (warm reboot)
- 0x8000 At least 1 connection trial has failed since the last successful connection.
This is no connect reason event, but an indication that previous events might have been missed.
SerialNumber Raw data (8 ASCII encoded decimal digits; no trailing zero byte) Serial number of reader