Analyze the communication between application and reader
BALTECH SDK comes with a montitoring mechanism to analyze the communication between your application and the reader. When you enable monitoring, all commands and responses exchanged will be written to an HTML log file.
This feature requires SDK v3.04 or above.
Log content
Logs capture the communication between your application and the reader. If you use encryption, logs capture encrypted traffic by default 1. To log traffic in plaintext when using encryption, run brp_set_monitor(brp, PLAINTEXT).
Privacy measures
To help you protect the data in plaintext logs, we've implemented the following measures:
- Monitoring is disabled by default. You have to enable it manually for each day you want to use it. This prevents you from accidentally monitoring longer periods of time.
- Logs are created in your home directory, i.e. other users on the same computer cannot access them.
Enable monitoring
-
In your home directory, create a folder with the following name:
brp-logs-<yyyy>-<mm>-<dd>
In this folder, 1 HTML log file per reader will be created, capturing the communication taken place on that day. The log file name is as follows:- For Ethernet:
IP-<IP address>.html
- For USB HID:
HID-<reader serial number>.html
- For RS-232/UART or virtual COM port:
RS232-<COM port name>.html
- For Ethernet:
-
To create logs for e.g. the next day, create a new folder with the new date.
Read the logs
Browser support
You can view the HTML log files in any browser. For large files, however, we recommend Google Chrome or Microsoft Edge for performance reasons.
The start and end of every connection to the reader is indicated by a blue line. In between these lines, you'll see the commands and responses transmitted between the SDK and the reader. The timestamps are relative to the opening of the connection. Command parameters and return values are shown between angle brackets.
Get more detailed information
- Error codes: Click an error code to go to the error group overview page in the C API reference. Here, you can select the error code to get a detailed description (learn more about error codes and groups).
- Command codes: Click a command code to go to the respective page in the commands reference.
Retrieve certain entries
Click a timestamp to generate a link to a specific log entry. With this link, you can later easily retrieve this entry or refer a colleague to it (if you also choose to give them access to the file).
Activate live view
Click Activate Live View at the bottom of the log to update the log while you have it open. To disable Live View, scroll up or close the file.
Further low-level analyses
If the SDK logs contains an I/O error that can't be explained, we recommend you take a closer look using Wireshark or another low-level protocol analyzer. This approach works for host-reader connections via USB HID, RS-232/UART, virtual COM port, and Ethernet.
-
In SDK versions below v3.19.00, encrypted communication between application and SDK was always monitored in plaintext. Sensitive information, e.g. data you write to a card, was logged in plaintext. Thus, if you transfer sensitive data via an encrypted connection, we recommend you update the SDK to v3.19.00 or above and explicitly run brp_set_monitor(brp, BRP_MONITOR_ENABLED). ↩