<feed xmlns='http://www.w3.org/2005/Atom'>
<title>thb-tracker.git/android/app/src/main/java, branch master</title>
<subtitle>thb-tracker</subtitle>
<id>http://dangofactory.net/cgit/cgit.cgi/Android/thb-tracker.git/atom/android/app/src/main/java?h=master</id>
<link rel='self' href='http://dangofactory.net/cgit/cgit.cgi/Android/thb-tracker.git/atom/android/app/src/main/java?h=master'/>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Android/thb-tracker.git/'/>
<updated>2026-11-15T14:07:34Z</updated>
<entry>
<title>Buzzer: start and stop, do not cut the song off after 10 s</title>
<updated>2026-11-15T14:07:34Z</updated>
<author>
<name>Koudai Kudo</name>
<email>k.kudo@dangofactory.net</email>
</author>
<published>2026-11-15T14:07:34Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Android/thb-tracker.git/commit/?id=b92cfcaff0ed87103c7c8bd1d6e7ddb88e9495c8'/>
<id>urn:sha1:b92cfcaff0ed87103c7c8bd1d6e7ddb88e9495c8</id>
<content type='text'>
ringBuzzer() held the connection for 10 s and then sent 0x1A 00, so a 163 s
score always stopped a tenth of the way in.  The tag keeps playing on its
own, so setBuzzer() now only writes the command and drops the link (with a
short delay so the write-without-response is really sent).

鳴らす turns into 止める while the tag is playing; a second press stops it.
Backing out of the screen no longer needs the buzzer to finish first.
</content>
</entry>
<entry>
<title>Protect the phone's own tag records from deletion</title>
<updated>2026-11-15T10:58:48Z</updated>
<author>
<name>Koudai Kudo</name>
<email>k.kudo@dangofactory.net</email>
</author>
<published>2026-11-15T10:58:48Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Android/thb-tracker.git/commit/?id=cf42fdfb2b4a7d1abb201189c08eddc12a867489'/>
<id>urn:sha1:cf42fdfb2b4a7d1abb201189c08eddc12a867489</id>
<content type='text'>
Deleting "self" (この端末) throws away the phone's position history and its
identity, so the server refuses DELETE for id=self and for any record with
"protected": true, and public_tag reports the flag.

The app shows 保護 instead of 削除 on those records and the button is
disabled. Other tags (the physical tag, spare keys) still delete normally.
</content>
</entry>
<entry>
<title>Connect with an explicit LE transport on Android 5.x</title>
<updated>2026-11-15T10:42:35Z</updated>
<author>
<name>Koudai Kudo</name>
<email>k.kudo@dangofactory.net</email>
</author>
<published>2026-11-15T10:42:35Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Android/thb-tracker.git/commit/?id=3b066269b6e6a3e1e0b045a727e1a9cc6df1a26a'/>
<id>urn:sha1:3b066269b6e6a3e1e0b045a727e1a9cc6df1a26a</id>
<content type='text'>
A scanned device reports type UNKNOWN on 5.1, so the 3-argument connectGatt
let the stack pick BR/EDR and every attempt to the tag failed with status
133 (or timed out without a callback) while the PC connected fine.

The 4-argument overload exists before API 23 but is hidden, so it is called
through reflection with TRANSPORT_LE. Reading the tag config (0x55) and
ringing the buzzer (0x1A 01/00) now work from the app.
</content>
</entry>
<entry>
<title>FindMyAdv: note that this phone reports success but never transmits</title>
<updated>2026-11-15T10:15:05Z</updated>
<author>
<name>Koudai Kudo</name>
<email>k.kudo@dangofactory.net</email>
</author>
<published>2026-11-15T10:15:05Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Android/thb-tracker.git/commit/?id=fef48db730d2a35481ac3afc2fd218cecea3ea4b'/>
<id>urn:sha1:fef48db730d2a35481ac3afc2fd218cecea3ea4b</id>
<content type='text'>
startAdvertising calls onStartSuccess and the app says the window was sent,
but a PC scanner in the same room never sees 00:ED:B8:0E:94:32 - neither
with connectable nor non-connectable settings. So the NP701KC cannot act as
a BLE peripheral; the framework path stays for other devices and FindMy is
left stopped on this one.
</content>
</entry>
<entry>
<title>Advertise the phone's FindMy key with BluetoothLeAdvertiser</title>
<updated>2026-11-15T09:57:02Z</updated>
<author>
<name>Koudai Kudo</name>
<email>k.kudo@dangofactory.net</email>
</author>
<published>2026-11-15T09:57:02Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Android/thb-tracker.git/commit/?id=e4baa982c69e3ddb0fe2d43797aa04869061e4d2'/>
<id>urn:sha1:e4baa982c69e3ddb0fe2d43797aa04869061e4d2</id>
<content type='text'>
The raw-HCI window takes the controller away from the Android stack and
leaves BLE scanning dead (sometimes until the battery is pulled), so the
FindMy advertisement now has a framework path: FindMyAdv builds the same
payload the firmware sends (manufacturer 0x004C, 12 19 00, key[6..28),
03 00) and advertises for N seconds.

The key is the 96a9fdb87bf8 record (files/findmy_key.txt), which is the
phone itself - the record with one point is the phone's own FindMy report,
not a duplicate of the tag.

The 端末 tab gets a "FindMy 広告 10 秒" button to check it on the device.
</content>
</entry>
<entry>
<title>Scan with BluetoothLeScanner only, and log scan start/stop</title>
<updated>2026-11-15T09:43:21Z</updated>
<author>
<name>Koudai Kudo</name>
<email>k.kudo@dangofactory.net</email>
</author>
<published>2026-11-15T09:43:21Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Android/thb-tracker.git/commit/?id=47e8385c8f9c24552e631a04aabad0ba184874cd'/>
<id>urn:sha1:47e8385c8f9c24552e631a04aabad0ba184874cd</id>
<content type='text'>
The legacy startLeScan results carry a BluetoothDevice without an address
type, so connecting to a random-address tag from a list entry created by
that path fails with status 133. The new API works on this phone, so the
fallback is gone.

The BLE log (files/ble.log) now shows scan start/stop next to the connect
attempts, which is the only way to see timing on a ROM that drops app logs
from logcat.
</content>
</entry>
<entry>
<title>Never enable Bluetooth from the app; wait longer after a scan</title>
<updated>2026-11-15T04:27:23Z</updated>
<author>
<name>Koudai Kudo</name>
<email>k.kudo@dangofactory.net</email>
</author>
<published>2026-11-15T04:27:23Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Android/thb-tracker.git/commit/?id=0d398f1379e16bc41c7e0a92c0a9ae20ee3460c6'/>
<id>urn:sha1:0d398f1379e16bc41c7e0a92c0a9ae20ee3460c6</id>
<content type='text'>
The phone's root-time FindMy window disables com.android.bluetooth, drives
the controller over raw HCI and then restarts the stack, which leaves LE
scanning dead until a reboot. The app made it worse by calling
adapter.enable() when Bluetooth was off, so that call is gone: the scan now
reports "turn Bluetooth on in Settings" instead.

Connecting right after a scan gives status 133 on this 5.1 ROM, so the scan
is given 2 s to stop and the connect is retried four times.
</content>
</entry>
<entry>
<title>Connect by address only for public addresses</title>
<updated>2026-11-15T03:41:26Z</updated>
<author>
<name>Koudai Kudo</name>
<email>k.kudo@dangofactory.net</email>
</author>
<published>2026-11-15T03:41:26Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Android/thb-tracker.git/commit/?id=b0a749dc030f9764f1b86d802a923b7e2da3c517'/>
<id>urn:sha1:b0a749dc030f9764f1b86d802a923b7e2da3c517</id>
<content type='text'>
A random static address cannot be used with getRemoteDevice: Android learns
the address type from a scan, so the attempt only burns a connect timeout
before the scan that follows. Skip it for addresses whose top two bits are
set (the tag's EF:D6:... is one).

The tag read still reports "not found" after the 20 s scan, which is the
truth on a phone whose scanner delivers nothing.
</content>
</entry>
<entry>
<title>BTHome: show how many advertisements arrived, and try the legacy scan</title>
<updated>2026-11-15T03:22:45Z</updated>
<author>
<name>Koudai Kudo</name>
<email>k.kudo@dangofactory.net</email>
</author>
<published>2026-11-15T03:22:45Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Android/thb-tracker.git/commit/?id=6fe4c34f6cc4e09de5e0de27a85ca19f0e52e8f4'/>
<id>urn:sha1:6fe4c34f6cc4e09de5e0de27a85ca19f0e52e8f4</id>
<content type='text'>
The phone's scan delivers nothing at all (0 results in 15 s while a PC in
the same room sees 11-19 devices), so the screen now prints the number of
advertisements received while it is empty. That separates "the tag is
quiet" from "this phone is not scanning".

The legacy BluetoothAdapter.startLeScan path runs alongside
BluetoothLeScanner: some 5.x ROMs accept startScan and never call back.
</content>
</entry>
<entry>
<title>Read the tag name from GAP 0x2A00 before the vendor 0x01 copy</title>
<updated>2026-11-15T03:01:21Z</updated>
<author>
<name>Koudai Kudo</name>
<email>k.kudo@dangofactory.net</email>
</author>
<published>2026-11-15T03:01:21Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Android/thb-tracker.git/commit/?id=4dc6adbcbf5f0a5e9184769ddd62a6592790f1b2'/>
<id>urn:sha1:4dc6adbcbf5f0a5e9184769ddd62a6592790f1b2</id>
<content type='text'>
The tag on the bench answers 0x01 with a single control byte while its GAP
device name (0x2A00) holds the real string (AYOCHILL), so the "BTHome name"
button would have saved garbage. Read the standard characteristic first and
fall back to 0x01 only when it is empty; control bytes are dropped either
way.

GattSession now keeps a read channel so plain characteristic reads work.
</content>
</entry>
</feed>
