Skip to content

Commit 5e8a9ec

Browse files
Fixed the discovery mode in esp32 factory script to a bitmap value instead of enum (project-chip#34900)
1 parent 6165b62 commit 5e8a9ec

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

scripts/tools/generate_esp32_chip_factory_bin.py

+5-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')
@@ -566,9 +567,10 @@ def any_base_int(s): return int(s, 0)
566567
parser.add_argument('-cf', '--commissioning-flow', type=any_base_int, default=0,
567568
help='Device commissioning flow, 0:Standard, 1:User-Intent, 2:Custom. \
568569
Default is 0.', choices=[0, 1, 2])
569-
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+
parser.add_argument('-dm', '--discovery-mode', type=any_base_int, default=2,
571+
help='3-bit bitmap representing discovery modes for commissionable device discovery \
572+
Bit 0:WiFi-SoftAP, Bit 1:BLE, Bit 2:On-network. Default is BLE. Specify values between 0-7')
573+
572574
parser.set_defaults(generate_bin=True)
573575

574576
return parser.parse_args()

0 commit comments

Comments
 (0)