Skip to content

Commit 03c3399

Browse files
committed
Fixed the discovery mode in esp32 factory script to a bitmap value instead of enum
1 parent 8423257 commit 03c3399

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

scripts/tools/generate_esp32_chip_factory_bin.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,7 @@ def validate_args(args):
276276
check_int_range(args.product_id, 0x0000, 0xFFFF, 'Product id')
277277
check_int_range(args.vendor_id, 0x0000, 0xFFFF, 'Vendor id')
278278
check_int_range(args.hw_ver, 0x0000, 0xFFFF, 'Hardware version')
279+
check_int_range(args.discovery_mode, 0b000, 0b111, 'Discovery-Mode')
279280

280281
check_str_range(args.serial_num, 1, 32, 'Serial number')
281282
check_str_range(args.vendor_name, 1, 32, 'Vendor name')
@@ -498,7 +499,6 @@ def clean_up():
498499
if FACTORY_DATA['dac-key']['value']:
499500
os.remove(FACTORY_DATA['dac-key']['value'])
500501

501-
502502
def get_args():
503503

504504
def any_base_int(s): return int(s, 0)
@@ -567,8 +567,9 @@ def any_base_int(s): return int(s, 0)
567567
help='Device commissioning flow, 0:Standard, 1:User-Intent, 2:Custom. \
568568
Default is 0.', choices=[0, 1, 2])
569569
parser.add_argument('-dm', '--discovery-mode', type=any_base_int, default=1,
570-
help='Commissionable device discovery networking technology. \
571-
0:WiFi-SoftAP, 1:BLE, 2:On-network. Default is BLE.', choices=[0, 1, 2])
570+
help='3-bit bitmap representing discovery modes for commissionable device discovery \
571+
Bit 0:WiFi-SoftAP, Bit 1:BLE, Bit 2:On-network. Default is BLE. Specify values between 0-7')
572+
572573
parser.set_defaults(generate_bin=True)
573574

574575
return parser.parse_args()

0 commit comments

Comments
 (0)