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.
What the logs capture is the entire communication between your application and the SDK. This part is always in plain text. Any encryption you implement will only cover the communication between the SDK and the reader.
Sensitive information will be logged as well
Sensitive information, e.g. data you write to a card, will be logged in plain text as well. Please be aware of the data you transmit while monitoring is enabled.
To help you protect the data in your 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.
- You can exclude a certain host protocol from monitoring, even if you have enabled monitoring for the current day. To do so, run brp_suppress_monitoring() after opening the connection to the reader.
- Logs are created in your home directory, i.e. other users on the same computer cannot access them.
In your home directory, create a folder with the following name:
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:
- For USB HID:
HID-<reader serial number>.html
- For RS-232/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
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/virtual COM port, and Ethernet.