API

Add on : Protocole Bonjour

Overview

Bonjour is a zero-configuration networking protocol developed by Apple to simplify device discovery and connection on local networks. On Android, the same functionality is provided by Network Service Discovery (NSD). Yavin terminals broadcast themselves with this protocol, so your POS can discover and connect to a terminal by name instead of by IP address. This is the recommended way to address a terminal with the Local API, because it survives IP changes.

How it works

  • Automatic device declaration: once activated, devices automatically broadcast their presence on the local network
  • Name-based discovery: devices are identified by unique names instead of IP addresses
  • Dynamic network adaptation: connections are maintained even if IP addresses change

Implementation on Yavin terminals

  • Activation: when the Local API is enabled on a Yavin terminal, it automatically starts broadcasting its presence
  • Service type: _yavin._tcp. Your discovery must search for this exact service type (for example NsdManager.discoverServices("_yavin._tcp", ...) on Android, or NWBrowser / NetServiceBrowser with type _yavin._tcp on Apple platforms)
  • Naming convention: terminals broadcast as yavin_<SN>, where <SN> is the terminal serial number
  • Name conflicts: if two services share a name on the network, Android can rename the service, for example yavin_<SN> (2). Match terminals by the yavin_<SN> prefix, not by exact name
  • Announced port: 16125 (HTTP Local API) only. The HTTPS port 16126 is not announced, and no TXT record is published
  • Discovery: any device on the network can run a Bonjour/NSD search for _yavin._tcp and list the available Yavin terminals, then resolve a service to get its IP address and port

Why use it

  • Simplified connection: users connect to a terminal with a single click, without knowing or typing an IP address
  • Improved reliability: the connection follows the name, so DHCP renewals and IP changes are invisible to the POS
  • Reduced setup complexity: plug-and-play behaviour for end users

Example: Android cash register

A complete Android cash register example, including terminal discovery via NSD: