Communication Bridge

User guide

(version for Windows)

[under construction]

Download

Application is available for Windows and Android in their respective online stores.

Introduction

This is a user guide for Windows version of Communication Bridge application. If you are looking for user guide for Android version, follow this link.

Communication Bridge offers 2 modes of operation.

In Bridge mode it enables communication between different types of communication technologies - application acts as an interface. It connects to 2 remote devices which cannot communicate directly between each other and it creates communication bridge between them, enabling them to exchange data.

Commander mode allows connections to multiple (more than 2) remote devices and it can communicate with each separately. Data are not retransferred between remote devices themselves, only between PC and individual remote device, thus allowing to communicate or control them separately. [Commander mode is available from application version 2.0.1]

Following types of connections are currently supported:

  • Classic Bluetooth devices - devices such as Bluetooth modules (HC-05, HC-06), smartphones with Bluetooth terminal app, PC or any other device capable of opening Bluetooth port (serial port profile/SPP). Application can also create listening port to which remote Bluetooth devices can connect.

  • Bluetooth Low Energy (Bluetooth LE) / Bluetooth 4.0 devices - Devices such as Bluetooth LE modules(HM-10, MLT-BT05, etc.), smart sensors (heart rate monitors, thermostats...).

  • TCP server - Application can create listening TCP server socket to which TCP client running on a remote device can connect.

  • TCP client - Application can connect to listening TCP server.

  • UDP socket - UDP socket can be created in the application and communicate with remote UDP socket.

  • Serial port devices - Application can communicate with a connected device that exposes a serial port or some abstraction of a serial port. Typical examples are Serial-to-USB adapters. Serial-specific properties for flow control, such as setting baud rate, data bits, parity and stop bits can be setup.

Communication Bridge application displays all received data in log in hexadecimal or text form. It is also possible to send data directly to connected devices from the application as a hexadecimal number or as a text.

Application is available in Microsoft store.

Communication bridge for Android

Android version of this application is available to download from Play store. You can check user guide for Android version here. Currently it supports only Bridge mode.

Computer requirements and application access

  • Operating system Windows 10/11

  • Bluetooth adapter (for Bluetooth connections)

  • Wifi or ethernet connection (for TCP connections and UDP sockets)

Application requires access to the following system features:

  • Bluetooth - allows communication with paired Bluetooth devices over the Generic Attribute (GATT) or Classic Basic Rate (RFCOMM) protocols.

  • Internet (Client & Server) - provides inbound and outbound access to the Internet and the network in public places. Inbound access to critical ports is always blocked.

  • Private networks (Client & Server) - provides inbound and outbound access to the Internet networks that have an authenticated domain controller, or that the user has designated as either home or work networks. Inbound access to critical ports is always blocked.

Full privacy policy available here.

How it works - Bridge mode

Communication Bridge application can connect to 2 remote devices and create a communication link between them by being a device in between. These remote devices are represented as Device A and Device B in the application. Each device has a dedicated panel which displays type of active connection (if any), device name and connection status.

Device A and B have following connection possibilities or can perform following task:

  • Opening listening Bluetooth socket (serial port profile)

  • Connect to Classic Bluetooth device

  • Connect to Bluetooth LE device (BLE)

  • Start TCP server

  • Start TCP client

  • Open UDP socket

  • Connecting to serial port device

Note: In Android version, device A and B has slightly different connection possibilities. Only device A can connect to BLE device and only device B can connect to USB device.

Control panel of the application

App can create a communication link between above mentioned device types. On each side, device of different type can be selected and these two devices can than communicate with each other via Communication Bridge application.

To create a communication link between 2 remote devices, we first need to create a connection between them and Communication bridge application. After both connections are established, application in Bridge mode immediately bridges the communication. Connection process for each type of device is described in the Connections sections.

How it works - Commander mode

[Commander mode is available from application version 2.0.1]

In this mode, you can control or communicate with multiple remote devices individually. Separate communication channel is created for each device (PC to device communication) - devices does not influence each other in any way, no data are retransferred between them (no device to device communication). To add a device click + button (bottom left) and select task from the list based on a type of connection you want to establish. Individual connection are described in the following section.

Add device in Commander mode

Connections

Connecting to Classic Bluetooth device

To connect to a classic Bluetooth device, click on the "Select task" button. Classic Bluetooth device can be connected as a Device A or Device B, so it does not matter which of two "Select task" button you click.

Let`s connect Bluetooth module HC-05 as a Device A in this example.

NOTE: App can also open port and listen for incoming Bluetooth connections. To enable listening for remote connections, click on "Select task "button and select "Open Bluetooth listening socket". Then you can initialise connection from remote device.

Click on "Select task" button

On the next screen select "Connect to classic Bluetooth device". Make sure the device to which you want to connect is paired with your phone, turned on and is listening for incoming connections.

Click on "Connect to classic Bluetooth device" button

Then select device from the list of all paired devices and the connection should be established. After successful connection, name of the device will be displayed under Device A/B label with status "Connected".

If your Bluetooth device is not showing in the list because it is not paired with your phone, pair the device using Windows pairing function and then return to the application and click "Refresh" button.

In our case, we want to connect to HC-05 Bluetooth module. It was previously paired with the PC so it appears in the list. We just double-click on the name HC-05.

NOTE: Even if BLE devices might be listed as paired devices, they will not be connected using Serial port profile (SPP) protocol. To connect to BLE device select task "Connect to Bluetooth LE device" (see following section).

Select device and click "Connect"

Connecting to BLE device

Click on the button "Select task" of device panel A or B and select "Connect to Bluetooth LE device". Make sure your BLE device is turned ON, within range and is in discoverable mode.

Scanning for BLE devices will start and all discovered devices will be added to the list (name, device MAC address, and signal strength will be displayed)

Discovering of nearby devices has following options:

  • Discover only devices that advertise its name - as name implies, only devices that advertise their name will be discovered, other devices will be ignored.

  • Discover all devices - all nearby devices will be added to the list. If a device that does not advertise its name is discovered, its name will be displayed as [No name].

Default option is to discover only devices that advertise its name. You can change this in the "Settings" under "Bluetooth scanning" section.

Once your BLE device has been discovered, click on it and click on a button "Read services". Alternatively you can just double click on a selected device and services will be retrieved. At this point scanning for nearby devices is stopped.

In this example, we want to connect to BLE device MLT-BT05. It was successfully found by a scanner, so we just double click on it.

Select the device and click "Read services"

When you click "Read services", all services and characteristics (their UUIDs) are retrieved from the selected device and are displayed in list.

Scroll to the characteristic which you want to use for data transmitting and receiving (Rx+Tx characteristic), click on it and click on button "Set characteristic".

If you need different characteristics for sending and receiving, right click on it and assign it accordingly.

In our example we want to use characteristic which belong to the service 0000ffe0-0000-1000-8000-00805f9b34fb. The characteristic which we want to use has UUID 0000ffe1-0000-1000-8000-00805f9b34fb - this is the last characteristic in the list, so we double click on the respective item in the list.

NOTE: For data reading from device subscribing to notification mode will be used. Note also that not all services and characteristics support subscription mode.

Select characteristics for data transmission and click "Connect"

  • After successful setting of Rx and Tx characteristics, BLE device name will be displayed in the Device A/B panel of the main screen and status will be set as "Connected".

MLT-BT05 module has been successfully connected

Starting TCP server

App can start listening TCP server which allows connection of one TCP client. To start TCP server click on "Select task" button and select "Start TCP server". On the next screen enter valid port number and click "Start Server". The IP address displayed is an address of your device. However your device can be connected to multiple networks at the same time (ethernet, WiFi network...), so this IP address might be only one of multiple IP addresses assigned to your PC by DNS servers. When TCP server is started, it binds to all network interfaces. When you are connecting to the server from your client, you need to know IP address of the TCP server on that network (of that network interface). For example if you are connecting from a smarphone using WiFi connection, you need to know address of wireless network adapter of your PC. A simple way to check IP addresses of your PC is to run Command prompt and enter command "ipconfig".

When a connection is established and client disconnects itself, TCP server will automatically start listening for new connections.

Enter valid port number and start server

TCP client

Application can connect to a remote TCP server using TCP client. TCP server can be created on other PC, smartphone or any other device supporting TCP protocol. If you want to connect to TCP server on another PC make sure firewall is not blocking connections from TCP clients.

To connect to a remote TCP server, click on a "Select task" and select "Start TCP client". On the configuration page you need to enter IP address of TCP server and port number on which this server is listening. Then click "Connect to Server" and TCP client will attempt to connect to specified TCP server.

If for some reason connection is terminated or TCP server closes connection, TCP client will not reconnect automatically.

Enter port number on which TCP server is listening and click "Connect"

TCP connection limitations

Following information are from Windows App Development web pages:

As a consequence of network isolation, Windows disallows establishing a socket connection (Sockets or WinSock) between two UWP apps running on the same machine; whether that's via the local loopback address (127.0.0.0), or by explicitly specifying the local IP address. [source]

Network communications using an IP loopback address cannot be used for interprocess communication (between two different apps) in a Windows Runtime app since this is restricted by network isolation. Network communication using an IP loopback address is allowed within an app within the same process for communication purposes. [source]

Opening UDP socket

Connectionless UDP socket can be created in the app also. You can specify local listening port number. For remote device (remote UDP socket) you need to know and enter its IP address and a port number on which remote UDP socket is listening.

Unlike TCP, UDP is connectionless communication - no active connection is created when you create an UDP socket. Data transmitted over network are individually addressed and routed based on information carried in each data packet. Therefore status of this connection (on the Connection overview page) does not differentiate between connected / disconnected state.

Enter valid port numbers and IP address and click "Open socket"

Serial port device

Application can communicate with a connected device that exposes a serial port or some abstraction of a serial port. It is possible to set following serial-specific parameters: baud rate [bps], data bits, flow control(handshake), parity, stop bits and read timeout [ms].

Read timeout specifies wait time from reception of a first byte for all subsequent bytes. It has no effect on the first byte of a read call. Read calls always wait forever for the first byte. For example, if you set read timeout = 10000ms = 10s and sender sends one byte each second, data received event will be raised(data displayed in log and retransmitted to other device) after 10 seconds with the payload length of 10 bytes.

Which devices are supported? Following section is from Windows documents:

Windows natively supports ports exposed by Serial-to-USB adapters that belong to the USB-CDC device class using the inbox usbser.sys driver (such as those used in Arduino Uno R3s). USB-CDC compatible Ids are:

  • USB\Class_02&SubClass_02&Prot_01

  • USB\Class_02&SubClass_02

Other Serial-to-USB adapters (such as FTDI/Prolific/Silicon-Labs) that expose GUID_DEVINTERFACE_COMPORTs are also supported, but require additional vendor-specific drivers.

***

In this example we use USB to UART converter device C232HD (FTDI chip). As stated above, this device requires vendor-specific drivers, which can be downloaded from manufacturer website. We have already done that, so now the device is connected to the PC ands detected by the application on virtual COM port 7. We select it from the list and setup its parameters as in the following picture. To finish the setup we click "Connect" button. Serial device is now ready.

Select device, setup parameters and click "Connect"

Retransmission in Bridge mode

When in Bridge mode both connections are established (Device A and Device B) application immediately acts as a communication bridge. This is indicated by the status "Bridge active". All received data from one device are automatically send(retransmitted) to the second device and vice versa.

If needed, this bidirectional retransmission can be changed. Application can act as a one-way filter, re-sending only data from one device to the second, but ignoring incoming data from the second device. To activate this feature select the desired retransmission direction in the Retransmission drop-down menu. If needed, retransmission can also be (temporarily) disabled.

Retransmission option is not available in Commander mode.

Select Retransmission mode

Data sending

In both application modes, data can be send to remote devices directly from the application. There are 2 ways:

  • using simple text box (see below),

  • define command (see section Creating commands).

When using simple text box, you can select between hexadecimal or text form. To switch between these two options, click on "0x/txt" button - its content will change accordingly. Enter value (either valid hexadecimal number or text) and click "Send". In the checkboxes "A" and "B" you can specify to which connected devices(s) you want to send the data. Data will also appear in the log.

Note: From version 2.0.1 each device has its own TX checkbox which indicates if data from application shall be sent to this device.

This feature is useful for debugging purposes, when you want to test established connections, check correct port numbers or other connection parameters. String length which can be send to remote devices is limited to 40 characters (20 bytes). If entered hexadecimal number consist of odd number of characters, zero will be automatically appended at the beginning.

Enter text or hexadecimal number and click "Send". The value will be send to connected device(s)

Creating commands

In both modes, application allows you to define custom commands which can be sent to connected devices. Command is a payload with predefined value with assigned name and other optional parameters. Commands are stored in a list. To display this list (if hidden) click on "Open pane" button in the bottom of left control panel. To add a command click "+" button at the bottom and select type of a command to add. To delete all existing commands, click on "..." button and select "Remove all commands". Button "square" disables periodical sending of all commands which are currently being send (see following section).

List of commands example

When creating a command, to be easily identifiable, you can assign a custom name to it. The name is only informative to the user.

Depending on a type of a command being added, you can specify hexadecimal number or a text as a command value. In case of adding hexadecimal command with odd number of characters, zero will be automatically appended at the beginning. Note that for text commands, encoding can be selected in application settings (encoding setting influences sent and also received data).

Send interval allows you to send the command periodically with specified time period in milliseconds. Periodical sending will start when command is clicked. Next click will stop periodical sending. Multiple commands can be periodically transferred, each with its own specified time period. If one or more commands are being periodically transmitted to connected device(s) and device(s) disconnects, either by user request or by other side, and no device remains connected, periodical sending for all commands is automatically stopped. Expected timer accuracy is ~30ms. To disable periodical sending, leave this value zero.

Endianness (only for hexadecimal commands) allows you to define byte order used when command will be sent.

CRLF append (only for text commands) allows you to append CR (carriage return) or LF (line feed) (or both) characters at the end of the string.

Command is typically send to connected devices when it is clicked. You can also define a custom keyboard shortcut (shortcut key), which, when pressed, assigned command will be sent (or if it has send interval defined periodical transmission will start). Keyboard shortcut is registered only when application window is in focus. When application is minimized or in a background, key presses won`t be registered.

To finish command creation click "OK". Command will be added to the command list.

Creating hexadecimal command (example)

Data logging

Data transmitted from the application and incoming data from remote devices can be viewed in the log in both application modes. To log incoming data from remote devices turn on toggle button "Log incoming data" above the log. Data logging is not enabled by default since it can slow down data retransmission (if you use high transfer speeds and large amount of data you might notice a delay when logging is enabled).

In a drop-down menu you can select in which format you want to display incoming data.

  • HEX - data will be displayed as a hexadecimal number.

  • TXT - data will be displayed as a text using encoding selected in application settings.

When incoming message is displayed in a log, it consist of data identifier (name of the device from which message is received and optionally a time stamp of reception) and data itself. Data identifiers can be customised in settings. Size of the font used for logging can also be changed in settings.

In the following example 2 devices are active (BLE device MLT-BT05 and TCP client) and application is receiving data from both. You can identify sender by its name.

Logging of received data from Bluetooth device and TCP server in Bridge mode

Settings

To access application settings click on the gear symbol in the bottom left corner in the main screen.

  • Log font size - allows to adjust font size in log. Might be useful when you need to check the log from distance.

  • Message limit in log determines how many lines can main log contain. If this limit is exceeded, oldest messages will be automatically removed. This limit is adjustable within range of 100 - 4000 lines.

  • Message identifier content - allows to specify data identifier for incoming and outgoing messages. Time stamp contains time of the message reception or transmission.

  • Show message identifier - lets you select when you want the message identifier to be shown. Options are: never, always and only if sender changes.

  • Encoding - Encoding used when parsing received and transmitted data.

  • Appearance mode - Application theme can be changed between light, dark and system theme. Change in the theme setting will be applied after application restart.

  • Bluetooth scanning - you can select type of Bluetooth scanning from 2 modes: Discover only devices that advertise its name or Discover all devices.

To save changes in settings, click on the "Save" button. If you click "Cancel", all changes are discarded.

This application is available in Microsoft store.

Full privacy policy available here.