Skip to content

Commit 938278b

Browse files
committed
try to add cross device stuff
1 parent 3a3074f commit 938278b

File tree

4 files changed

+31
-1
lines changed

4 files changed

+31
-1
lines changed

AAP Definitions.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,31 @@ For left bud
240240
00 0080 3F
241241
<same for the right bud>
242242
```
243+
244+
<!-- demo packet
245+
52 18 00 00 00 00 00 62 10 DA 41 62 10 DA 41 62 10 DA 41 62 10 DA 41 62 10 DA 41 62 10 DA 41 62 10 DA 41 62 10 DA 41 62 10 DA 41 00 00 80 3f 00 00 80 3f 00 00 80 3f 62 10 DA 41 62 10 DA 41 62 10 DA 41 62 10 DA 41 62 10 DA 41 62 10 DA 41 62 10 DA 41 62 10 DA 41 62 10 DA 41 00 00 80 3f 00 00 80 3f 00 00 80 3f
246+
247+
-->
248+
<!--
249+
5218 0000 0080 3F62 10DA 413D 0AF0 4160
250+
E50C 42AC 9C1E 421B 2F29 429E 6F33 4293
251+
1846 4293 1846 4206 9476 BF00 576E BB00
252+
0080 3F00 0080 3F62 10DA 413D 0AF0 4160
253+
E50C 42AC 9C1E 421B 2F29 429E 6F33 4293
254+
1846 4293 1846 4200 0080 BF00 576E BB00
255+
0080 3F00 0080 3F
256+
-->
257+
258+
<!--
259+
5218 0000 0000 0062 10DA 413D 0AF0 4160
260+
E50C 42AC 9C1E 421B 2F29 429E 6F33 4293
261+
1846 4293 1846 4206 9476 BF00 576E BB00
262+
0080 3F00 0080 3F62 10DA 413D 0AF0 4160
263+
E50C 42AC 9C1E 421B 2F29 429E 6F33 4293
264+
1846 4293 1846 4200 0080 BF00 576E BB00
265+
0080 3F00 0080 3F
266+
-->
267+
243268
All values are formatted as Little Endian from float values.
244269
| Data | Type | Value range |
245270
|---------------------|---------------|-------------|

android/app/src/main/java/me/kavishdevar/aln/utils/CrossDevice.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ object CrossDevice {
4545

4646
@SuppressLint("MissingPermission")
4747
fun startServer() {
48-
serverSocket = bluetoothAdapter.listenUsingRfcommWithServiceRecord("AirPodsSwitch", uuid)
48+
serverSocket = bluetoothAdapter.listenUsingRfcommWithServiceRecord("ALNCrossDevice", uuid)
4949
Log.d("AirPodsQuickSwitchService", "Server started")
5050
CoroutineScope(Dispatchers.IO).launch {
5151
while (serverSocket != null) {

libbluetooth_jni_juan.so

12.2 MB
Binary file not shown.

linux/main.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,11 @@ public slots:
322322
socket->close();
323323
socket = nullptr;
324324
}
325+
if (phoneSocket && phoneSocket->isOpen()) {
326+
QByteArray airpodsDisconnectedPacket = QByteArray::fromHex("00010000");
327+
phoneSocket->write(airpodsDisconnectedPacket);
328+
LOG_DEBUG("AIRPODS_DISCONNECTED packet written: " << airpodsDisconnectedPacket.toHex());
329+
}
325330
}
326331

327332
void connectToDevice(const QBluetoothDeviceInfo &device) {

0 commit comments

Comments
 (0)