Skip to content

Commit 1d0546d

Browse files
committed
Made tcp set arguments keywords
1 parent 40e8903 commit 1d0546d

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

shared-bindings/wifi/Radio.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -414,17 +414,17 @@ MP_DEFINE_CONST_FUN_OBJ_1(wifi_radio_get_ipv4_subnet_ap_obj, wifi_radio_get_ipv4
414414
MP_PROPERTY_GETTER(wifi_radio_ipv4_subnet_ap_obj,
415415
(mp_obj_t)&wifi_radio_get_ipv4_subnet_ap_obj);
416416

417-
//| def set_ipv4_address(self, ipv4: ipaddress.IPv4Address, netmask: ipaddress.IPv4Address, gateway: ipaddress.IPv4Address, ipv4_dns: Optional[ipaddress.IPv4Address]) -> None:
417+
//| def set_ipv4_address(self, *, ipv4: ipaddress.IPv4Address, netmask: ipaddress.IPv4Address, gateway: ipaddress.IPv4Address, ipv4_dns: Optional[ipaddress.IPv4Address]) -> None:
418418
//| """Sets the IP v4 address of the station. Must include the netmask and gateway. DNS address is optional.
419419
//| Setting the address manually will stop the DHCP client."""
420420
//| ...
421421
STATIC mp_obj_t wifi_radio_set_ipv4_address(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
422422
enum { ARG_ipv4, ARG_netmask, ARG_gateway, ARG_ipv4_dns };
423423
static const mp_arg_t allowed_args[] = {
424-
{ MP_QSTR_ipv4, MP_ARG_REQUIRED | MP_ARG_OBJ, },
425-
{ MP_QSTR_netmask, MP_ARG_REQUIRED | MP_ARG_OBJ, },
426-
{ MP_QSTR_gateway, MP_ARG_REQUIRED | MP_ARG_OBJ, },
427-
{ MP_QSTR_ipv4_dns, MP_ARG_OBJ, {.u_obj = MP_OBJ_NULL} },
424+
{ MP_QSTR_ipv4, MP_ARG_REQUIRED | MP_ARG_KW_ONLY | MP_ARG_OBJ, },
425+
{ MP_QSTR_netmask, MP_ARG_REQUIRED | MP_ARG_KW_ONLY | MP_ARG_OBJ, },
426+
{ MP_QSTR_gateway, MP_ARG_REQUIRED | MP_ARG_KW_ONLY | MP_ARG_OBJ, },
427+
{ MP_QSTR_ipv4_dns, MP_ARG_OBJ | MP_ARG_KW_ONLY, {.u_obj = MP_OBJ_NULL} },
428428
};
429429

430430
wifi_radio_obj_t *self = MP_OBJ_TO_PTR(pos_args[0]);
@@ -434,7 +434,7 @@ STATIC mp_obj_t wifi_radio_set_ipv4_address(size_t n_args, const mp_obj_t *pos_a
434434
common_hal_wifi_radio_set_ipv4_address(self, args[ARG_ipv4].u_obj, args[ARG_netmask].u_obj, args[ARG_gateway].u_obj, args[ARG_ipv4_dns].u_obj);
435435
return mp_const_none;
436436
}
437-
STATIC MP_DEFINE_CONST_FUN_OBJ_KW(wifi_radio_set_ipv4_address_obj, 4, wifi_radio_set_ipv4_address);
437+
STATIC MP_DEFINE_CONST_FUN_OBJ_KW(wifi_radio_set_ipv4_address_obj, 1, wifi_radio_set_ipv4_address);
438438

439439
//| ipv4_address: Optional[ipaddress.IPv4Address]
440440
//| """IP v4 Address of the station when connected to an access point. None otherwise."""

0 commit comments

Comments
 (0)