Identifiers for finding duplicate tests caused by Bluetooth retransmission

6 min read

A breathalyzer that pairs with a smartphone can display a breath test result on the device screen and then send it to an app over Bluetooth. Bluetooth is a way for a device and a smartphone to exchange data wirelessly over a short distance. For example, DATECH's official product information for the AF-40BT describes Bluetooth 5.0 LE smartphone pairing, a dual mode of standalone and app use, and storage of up to 10,000 test results. When the connection drops and recovers, or the app is restarted, a result that was already sent can arrive at the app again.

If the app or server counts the number of records received directly as the number of actual breath tests, double counting occurs. The core of the solution is not the result value or the time received, but confirming whether there is an identifier the device attaches to a single test result and keeps even when it is resent. Only by keeping separately the event of the device creating a result and the attempt to deliver that result to the smartphone can you avoid miscounting a retransmission as a new test.

Separate one test from multiple transmissions

A test is a single event in which a person provides breath to the device and the device generates a result. A transmission is the communication process of trying to send the generated result from the device to the smartphone. Even if the same result is received twice depending on the connection state, there may have been only one actual test.

So the time the device generated the result, the result stored inside the device, and the time the app received the result must not be treated as meaning the same thing. In particular, the app's reception time may indicate when the Bluetooth connection was restored. This is why the fact that the reception time is later, or that there are multiple reception records, does not by itself mean a new breath test took place.

The identifier to prioritize is the device's test number

The information that most directly identifies duplicates is the test number or test event number the device assigns to each test result. An identifier here is a value attached to distinguish one particular result from the others. If this number does not change when the same result is resent, you can group records under the original test event by the combination of device information and test number.

However, while the official AF-40BT product information mentions storage of test results and a cumulative test count, it does not state whether the test number is passed to the smartphone app or external systems, what format the number takes, or whether numbers are reused after a reset. So in integration design, do not assume the test number is always provided. You need a step of first sorting out which device identification and test identifiers can be confirmed in the results the actual device and app exchange.

You also need to look at device identification. To rule out even the possibility that different devices use the same test number, the test number alone may not be enough. If you do not know the conditions under which numbers are reused after a device replacement or reset, it is appropriate not to assume the combination is permanently unique and to record those conditions themselves in the judgment record.

Result values and times are clues for comparison, not confirmation criteria

If there is no unique test number, you can compare the test time recorded by the device, the result value, the display unit, and the result status to find similar received records. However, this information is not an identifier that confirms they are the same event. Several people may test at similar times, and different results can appear with the same displayed value.

For instance, if records with the same time notation and the same result value come in from two different devices, merging them into one makes one of two actual tests disappear. Conversely, if the device information, test number, and device test time are the same and only the app reception time differs, there are grounds to examine whether it is a retransmission. The safe approach is to use the result value to compare whether the transmitted content is the same, and not as the sole criterion for deciding whether the events are identical.

Information to distinguish Why it matters for judging duplicates What to do when it is missing
Information identifying the device Prevents results from different devices from being merged into one device's result Do not confirm a duplicate even if the value and time are the same
Test number generated by the device Most directly checks whether it is the same test resent Use the time and result value only as supporting clues for finding similar records
Device test time and app reception time Separates when the actual test happened from when communication took place Do not count it as a new test just because it was received late
Original received content and basis for judgment Lets you recheck later why something was excluded or linked Do not delete it; keep it as a record that needs review

Judgment sequence in a hypothetical reconnection case

Consider a hypothetical case. Suppose a result the device created at 8:10 a.m. arrived at the app, the connection then dropped, and the same result was received again at 8:13 a.m. Both records have the same device information and the same test number, and the test time stored by the device is also the same, 8:10 a.m.

In the observation step, keep both app reception records rather than removing either. In the interpretation step, although the reception times differ, the device information, test number, and device test time are the same, so you can classify the second reception not as a separate breath test but as a retransmission of the same result. A possible action is to link the first reception record to the original test event and record, on the second record, the original result it is linked to and the basis for judging it a retransmission.

The completion criterion for this judgment is a state where the actual number of tests is counted as one while the fact of two receptions and how the judgment was made are preserved. By contrast, in a case where there is no test number and only the result value and time are similar, the completion criterion is not confirming a duplicate. The right approach is to keep both records under review and preserve them so the original received content and device identification can be compared further.

If you delete a late-received record immediately because it looks like a duplicate, it becomes hard to confirm later why it was excluded from the count and whether its content was identical to the original. If you keep separately the original received content, the app reception time, the original test result it was linked to, and the basis for the duplicate judgment, you can explain the actual number of tests and the number of communication receptions separately.

Integration testing can include situations where the same result is received again after a connection drop, reconnection, or closing and restarting the app. What to check here is not the number of Bluetooth connections but whether the actual number of test events stays the same even when transmissions repeat. Using only the identifying information the device actually provides for confirmed judgments, and recording cases beyond that range not as presumed duplicates but as review records, is how you protect the reliability of test data.

References

#AF-40BT
#Bluetooth retransmission
#duplicate test records
#test identifiers
Considering our products?
We'll help you decide.