refractoring/auracast_config (#3)
- use pydantic for configuration management Reviewed-on: https://gitea.pstruebi.xyz/auracaster/bumble-auracast/pulls/3
This commit was merged in pull request #3.
This commit is contained in:
@@ -108,7 +108,7 @@ async def create_device(config: auracast_config.AuracastGlobalConfig) -> AsyncGe
|
||||
):
|
||||
device_config = bumble.device.DeviceConfiguration(
|
||||
name=config.device_name,
|
||||
address=config.auracast_device_address,
|
||||
address= hci.Address(config.auracast_device_address),
|
||||
keystore='JsonKeyStore',
|
||||
#le_simultaneous_enabled=True #TODO: What is this doing ?
|
||||
)
|
||||
@@ -201,7 +201,7 @@ async def init_broadcast(
|
||||
)
|
||||
bigs[f'big{i}']['broadcast_audio_announcement'] = bap.BroadcastAudioAnnouncement(conf.id)
|
||||
advertising_set = await device.create_advertising_set(
|
||||
random_address=conf.random_address,
|
||||
random_address=hci.Address(conf.random_address),
|
||||
advertising_parameters=bumble.device.AdvertisingParameters(
|
||||
advertising_event_properties=bumble.device.AdvertisingEventProperties(
|
||||
is_connectable=False
|
||||
@@ -496,18 +496,15 @@ async def broadcast(global_conf: auracast_config.AuracastGlobalConfig, big_conf:
|
||||
if __name__ == "__main__":
|
||||
import os
|
||||
|
||||
if os.environ['LOG_LEVEL']:
|
||||
log_level = getattr(logging, os.environ['LOG_LEVEL'])
|
||||
else:
|
||||
log_level = logging.DEBUG
|
||||
log_level = os.environ['LOG_LEVEL']
|
||||
logging.basicConfig(
|
||||
level=log_level,
|
||||
logging.basicConfig( #export LOG_LEVEL=INFO
|
||||
level=os.environ.get('LOG_LEVEL', logging.DEBUG),
|
||||
format='%(module)s.py:%(lineno)d %(levelname)s: %(message)s'
|
||||
)
|
||||
os.chdir(os.path.dirname(__file__))
|
||||
|
||||
global_conf = auracast_config.global_base_config
|
||||
global_conf = auracast_config.AuracastGlobalConfig(
|
||||
qos_config=auracast_config.AuracastQosHigh()
|
||||
)
|
||||
|
||||
#global_conf.transport='serial:/dev/serial/by-id/usb-ZEPHYR_Zephyr_HCI_UART_sample_81BD14B8D71B5662-if00,1000000,rtscts' # transport for nrf52 dongle
|
||||
|
||||
@@ -521,15 +518,13 @@ if __name__ == "__main__":
|
||||
|
||||
|
||||
# TODO: How can we use other iso interval than 10ms ?(medium or low rel) ? - nrf53audio receiver repports I2S tx underrun
|
||||
#global_conf.qos_config = auracast_config.qos_config_mono_medium_rel
|
||||
global_conf.qos_config = auracast_config.qos_config_mono_high_rel
|
||||
|
||||
bigs = [
|
||||
auracast_config.broadcast_de,
|
||||
auracast_config.broadcast_en,
|
||||
auracast_config.broadcast_fr,
|
||||
#auracast_config.broadcast_es,
|
||||
#auracast_config.broadcast_it,
|
||||
auracast_config.AuracastBigConfigDe(),
|
||||
auracast_config.AuracastBigConfigEn(),
|
||||
auracast_config.AuracastBigConfigFr(),
|
||||
#auracast_config.AuracastBigConfigEs(),
|
||||
#auracast_config.AuracastBigConfigIt(),
|
||||
]
|
||||
for big in bigs: # TODO: encrypted streams are not working
|
||||
#big.code = 'ff'*16 # returns hci/HCI_ENCRYPTION_MODE_NOT_ACCEPTABLE_ERROR
|
||||
|
||||
Reference in New Issue
Block a user