Add web toggle for Bluetooth discoverable window
The board stays hidden by default, so new phones could only pair via an SSH session. Add 'radxa-audio discoverable on|off' backed by a transient radxa-bt-pairing unit that auto-approves and trusts devices pairing in the window, expires on its own, and expose it in the web mixer with a countdown. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -48,6 +48,12 @@ def validate_action(data):
|
||||
return ['output','bluetooth',addr.upper()]
|
||||
raise ValueError('출력 종류가 잘못됐습니다.')
|
||||
if action=='scan': return ['scan','--seconds','15']
|
||||
if action=='discoverable':
|
||||
on=data.get('on'); seconds=data.get('seconds')
|
||||
if type(on) is not bool: raise ValueError('검색 허용 값이 잘못됐습니다.')
|
||||
if not on: return ['discoverable','off']
|
||||
if seconds not in (120,300,900) or type(seconds) is not int: raise ValueError('검색 허용 시간: 2, 5, 15분')
|
||||
return ['discoverable','on','--seconds',str(seconds)]
|
||||
if action=='pair-output':
|
||||
addr=data.get('address')
|
||||
if not isinstance(addr,str) or not audio.MAC.fullmatch(addr.upper()): raise ValueError('장비 주소가 잘못됐습니다.')
|
||||
|
||||
Reference in New Issue
Block a user