(args, options)
| 68 | return 7 |
| 69 | |
| 70 | def patch_unified(args, options): |
| 71 | json_flags = {} |
| 72 | if args.phrase is not None: |
| 73 | json_flags['uid'] = [x for x in generateUID(args.phrase)] |
| 74 | if args.ssid is not None: |
| 75 | json_flags['wifi-ssid'] = args.ssid |
| 76 | if args.password is not None and args.ssid is not None: |
| 77 | json_flags['wifi-password'] = args.password |
| 78 | if args.auto_wifi is not None: |
| 79 | json_flags['wifi-on-interval'] = args.auto_wifi |
| 80 | |
| 81 | if args.tlm_report is not None: |
| 82 | json_flags['tlm-interval'] = args.tlm_report |
| 83 | if args.fan_min_runtime is not None: |
| 84 | json_flags['fan-runtime'] = args.fan_min_runtime |
| 85 | |
| 86 | if args.airport_baud is not None: |
| 87 | json_flags['is-airport'] = True |
| 88 | if options.deviceType is DeviceType.RX: |
| 89 | json_flags['rcvr-uart-baud'] = args.airport_baud |
| 90 | else: |
| 91 | json_flags['airport-uart-baud'] = args.airport_baud |
| 92 | elif args.rx_baud is not None: |
| 93 | json_flags['rcvr-uart-baud'] = args.rx_baud |
| 94 | |
| 95 | if args.lock_on_first_connection is not None: |
| 96 | json_flags['lock-on-first-connection'] = args.lock_on_first_connection |
| 97 | |
| 98 | if args.domain is not None: |
| 99 | json_flags['domain'] = domain_number(args.domain) |
| 100 | |
| 101 | json_flags['flash-discriminator'] = randint(1,2**32-1) |
| 102 | |
| 103 | UnifiedConfiguration.doConfiguration( |
| 104 | args.file, |
| 105 | JSONEncoder().encode(json_flags), |
| 106 | args.target, |
| 107 | 'tx' if options.deviceType is DeviceType.TX else 'rx', |
| 108 | '2400' if options.radioChip is RadioType.SX1280 else '900' if options.radioChip is RadioType.SX127X else 'dual', |
| 109 | '32' if options.mcuType is MCUType.ESP32 and options.deviceType is DeviceType.RX else '', |
| 110 | options.luaName, |
| 111 | args.rx_as_tx |
| 112 | ) |
| 113 | |
| 114 | def length_check(l, f): |
| 115 | def x(s): |
no test coverage detected