Skip to content

Commit fbb1743

Browse files
Staacksclaude
andcommitted
ble-name-whitespace: iOS strips the device name too, delete the entry
BluetoothNameFilter.matches on iOS now trims surrounding whitespace before both criteria, as Android does, so both platforms conform to rule ble-name-regex. Remove the entry, its marker on the BLE page and the rule's reference to it, and record the stripping in the rule's iOS state. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 06078d1 commit fbb1743

3 files changed

Lines changed: 3 additions & 42 deletions

File tree

‎docs/file-format/bluetooth-low-energy.md‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,6 @@ The apps use the regular expression engine of their platform (`java.util.regex`
8080

8181
Both forms see the name with leading and trailing whitespace removed, as some devices pad their names: the phyphox:m advertises `phyphox:m 131` followed by a line break, and `nameRegex="phyphox:m( \d+)?"` matches it without having to allow for that. Whitespace inside the name is part of it.
8282

83-
{{inconsistency:ble-name-whitespace}}
84-
8583
### BLE as input
8684

8785
If data should be read from a BLE device and displayed in phyphox, the device should be defined within the input block of the phyphox file.

‎inconsistencies.yml‎

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -93,40 +93,3 @@
9393
length and different values on the two platforms; a power-of-two input
9494
gives identical results on both. This holds for fft and for its inverse
9595
ifft alike; dft and idft have no such restriction.
96-
97-
- id: ble-name-whitespace
98-
title: Whitespace around Bluetooth device names
99-
area: file-format
100-
status: decided
101-
since: "1.21"
102-
canonical: >-
103-
The name and nameRegex criteria of a bluetooth element see the device name
104-
with leading and trailing whitespace (spaces, tabs, line breaks) stripped;
105-
nameRegex then has to match that whole stripped name (rule ble-name-regex).
106-
Whitespace inside the name is part of it.
107-
affects:
108-
android: >-
109-
Conforms on the development branch since 2026-10-14: BluetoothNameFilter.matches
110-
strips the name, and every match site goes through it. Before, the scan dialog
111-
trimmed the name and the other two sites (shipped experiments for a scanned
112-
device in ExperimentListActivity.openBluetoothExperiments, the paired-device
113-
shortcut in Bluetooth.kt) did not, so a phyphox:m was listed as supported but
114-
offered an empty experiment list.
115-
ios: >-
116-
Matches the name as reported (BluetoothNameFilter.swift). The pattern is
117-
compiled as ^(?:...)$, and ICU's $ also matches before a final line
118-
terminator, so a single trailing newline - the phyphox:m case - is tolerated
119-
by accident; leading whitespace or a trailing space or tab is not.
120-
verified: >-
121-
Symptom observed on hardware 2026-10-14: a phyphox:m was listed as
122-
supported in the Android scan dialog but offered no shipped experiments
123-
(development branch), while iOS offered them. The trailing newline was seen
124-
in a BlueZ scan of a phyphox:m on 2026-08-27; that the Android stack
125-
reports the name the same way is inferred from the symptom. Not yet
126-
re-checked on a device after the Android fix.
127-
summary: >-
128-
Some devices pad their advertised names, the phyphox:m with a trailing
129-
newline. Android strips surrounding whitespace before matching; iOS does
130-
not, and only tolerates a single trailing newline by a quirk of its
131-
regular expression engine. A device with other padding would match its
132-
experiments on Android only.

‎spec/rules.yml‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,6 @@ rules:
483483
previously connected device rather than a shortened advertised one;
484484
an author who sees a device under a shortened name should match that.
485485
applies_to: "bluetooth@nameRegex in the input and the output block"
486-
inconsistency: ble-name-whitespace
487486
state:
488487
android: >-
489488
Conforms as of the development branch (24a3e752, 2026-10-05; the
@@ -499,15 +498,16 @@ rules:
499498
from the shipped files. Test BluetoothNameFilterTest carries the
500499
ble-name-regex-match tag.
501500
ios: >-
502-
Conforms as of the development branch (a8e25dbb, 2026-10-05):
501+
Conforms as of the development branch (a8e25dbb, 2026-10-05; the
502+
whitespace stripping, decided 2026-10-14, in
503+
BluetoothNameFilter.matches, which every match site goes through):
503504
BluetoothNameFilter (Experiments/BluetoothNameFilter.swift)
504505
compiles the pattern once at parse time with NSRegularExpression
505506
as ^(?:...)$, so alternatives backtrack to the whole name like
506507
Java's matches(); it replaces the name string on the descriptors,
507508
in BluetoothScan and in ExperimentManager's shipped-experiment
508509
lookup. A pattern that does not compile is an ElementHandlerError.
509510
Test BluetoothNameFilterTests carries the ble-name-regex-match tag.
510-
Does not strip whitespace yet (ble-name-whitespace).
511511
editor: >-
512512
Conforms as of main (8fa26a2, 2026-10-05): both bluetooth blocks
513513
carry a "device name (regular expression)" field

0 commit comments

Comments
 (0)