nc(aname, $index)
gives the device name for phone speaker, or the bluetooth connected device at some index. but it has some issues.
SETUP
- OnePlus 7T (HD1901, no audio jack port, bluetooth always on)
- OnePlus Bullets Wireless Z (BT Headphone, custom name in device "Bulletz")
- SmartBuy L60 (BT Speaker, in device custom name "Flipkart Speaker")
PROCESS/ACTIVITIES
- No external audio device connected
- only headphone connected
- only speaker connected
- connected speaker & headphone in altering sequence
OBSERVATIONS
- Phone Speaker is shown as device name "HD1901" (manageable)
- Bluetooth device's original names appear, not the ones I have set in device
- Headphone (when speaker not connected) appears at index
1
,nc(acount)
is 2. Device stays at index0
. (ok, cool, I can donc(aname, nc(acount) - 1))
to get the name) - Speaker (when headphone not connected) appears at index
0
, pushing device to index1
. (still I can check if index 0 is equal to device name, then pick from index 1 wheneveracount
is 2, else pick from index 0) - When I connect Speaker then Headphone, actual audio goes to Headphone
nc(acount) is 2
nc(aname, 1) is device
nc(aname, 0) is Speaker
disconnect Speaker and nc(aname, 0) is Headphone, nc(acount) is still 2
- When I connect Headphone then Speaker, actual audio goes to Speaker
nc(acount) is 2
nc(aname, 0) is device
nc(aname, 1) is Headphone
disconnect Headphone and nc(aname, 1) is Speaker, nc(acount) is still 2
- Multiple devices aren't updated unless I restart KLWP
- Disconnection updates immediately
- First Connection takes a while