44
44
//| lmk: Optional[bytes],
45
45
//| channel: int = 0,
46
46
//| interface: int = 0,
47
- //| encrypt : bool = False,
47
+ //| encrypted : bool = False,
48
48
//| ) -> None:
49
49
//| """Construct a new peer object.
50
50
//|
51
51
//| :param bytes mac: The mac address of the peer.
52
52
//| :param bytes lmk: The Local Master Key (lmk) of the peer.
53
53
//| :param int channel: The peer's channel. Default: 0 ie. use the current channel.
54
54
//| :param int interface: The WiFi interface to use. Default: 0 ie. STA.
55
- //| :param bool encrypt : Whether or not to use encryption.
55
+ //| :param bool encrypted : Whether or not to use encryption.
56
56
//| """
57
57
//| ...
58
58
STATIC mp_obj_t espnow_peer_make_new (const mp_obj_type_t * type , size_t n_args , size_t n_kw , const mp_obj_t * all_args ) {
59
- enum { ARG_mac , ARG_lmk , ARG_channel , ARG_interface , ARG_encrypt };
59
+ enum { ARG_mac , ARG_lmk , ARG_channel , ARG_interface , ARG_encrypted };
60
60
static const mp_arg_t allowed_args [] = {
61
61
{ MP_QSTR_mac , MP_ARG_OBJ | MP_ARG_REQUIRED },
62
62
{ MP_QSTR_lmk , MP_ARG_OBJ | MP_ARG_KW_ONLY , { .u_obj = mp_const_none } },
63
63
{ MP_QSTR_channel , MP_ARG_INT | MP_ARG_KW_ONLY , { .u_int = 0 } },
64
64
{ MP_QSTR_interface ,MP_ARG_INT | MP_ARG_KW_ONLY , { .u_int = 0 } },
65
- { MP_QSTR_encrypt , MP_ARG_BOOL | MP_ARG_KW_ONLY ,{ .u_bool = false } },
65
+ { MP_QSTR_encrypted , MP_ARG_BOOL | MP_ARG_KW_ONLY , { .u_bool = false } },
66
66
};
67
67
68
68
mp_arg_val_t args [MP_ARRAY_SIZE (allowed_args )];
@@ -82,7 +82,7 @@ STATIC mp_obj_t espnow_peer_make_new(const mp_obj_type_t *type, size_t n_args, s
82
82
83
83
self -> peer_info .ifidx = (wifi_interface_t )mp_arg_validate_int_range (args [ARG_interface ].u_int , 0 , 1 , MP_QSTR_interface );
84
84
85
- self -> peer_info .encrypt = args [ARG_encrypt ].u_bool ;
85
+ self -> peer_info .encrypt = args [ARG_encrypted ].u_bool ;
86
86
87
87
const mp_obj_t lmk = args [ARG_lmk ].u_obj ;
88
88
if (lmk != mp_const_none ) {
0 commit comments