Skip to content

Commit 6ed9bc1

Browse files
committed
Put PM5 UUID in scan response like real PM5 devices
OpenRowingMonitor puts the discovery UUID (CE060000) in the scan response, not the advertising data. This allows the device name to fit in the advertising packet while still being discoverable by PM5-compatible apps. - Advertising data: device name only - Scan response: PM5 discovery service UUID (CE060000) https://claude.ai/code/session_01XWBgRPWze8Mb7DEEm4oXiF
1 parent 8916f54 commit 6ed9bc1

1 file changed

Lines changed: 10 additions & 5 deletions

File tree

src/android/src/BleAdvertiser.java

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,16 +77,21 @@ public static void startAdvertisingRowerPM5(Context context) {
7777
.setConnectable(true)
7878
.build();
7979

80-
// PM5 advertising - only use device name, no service UUID
81-
// 128-bit UUIDs are too large for advertising packet (31 bytes max)
82-
// Apps like Mywhoosh should discover services after connection
80+
// PM5 advertising data - device name only (to save space)
81+
// Full name "PM5 430000000" is set via Bluetooth adapter
8382
AdvertiseData advertiseData = new AdvertiseData.Builder()
8483
.setIncludeDeviceName(true)
8584
.build();
8685

86+
// Scan response contains the PM5 discovery service UUID (CE060000)
87+
// This is how real PM5 devices advertise - UUID in scan response
88+
AdvertiseData scanResponse = new AdvertiseData.Builder()
89+
.addServiceUuid(new ParcelUuid(PM5_DISCOVERY_SERVICE_UUID))
90+
.build();
91+
8792
if (advertiser != null) {
88-
QLog.d("BleAdvertiser", "Starting PM5 advertising (name only, no UUID)");
89-
advertiser.startAdvertising(settings, advertiseData, advertiseCallback);
93+
QLog.d("BleAdvertiser", "Starting PM5 advertising with scan response UUID: " + PM5_DISCOVERY_SERVICE_UUID.toString());
94+
advertiser.startAdvertising(settings, advertiseData, scanResponse, advertiseCallback);
9095
}
9196
}
9297
}

0 commit comments

Comments
 (0)