36
36
//| """For monitoring WiFi packets."""
37
37
//|
38
38
39
- //| def __init__(self, channel: Optional[int] = 1, queue: Optional[int] = 128) -> None:
40
- //| """Initialize `wifi.Monitor` singleton.
39
+ //| def __init__(self, channel: Optional[int] = 1, queue: Optional[int] = 128) -> None:
40
+ //| """Initialize `wifi.Monitor` singleton.
41
41
//|
42
- //| :param int channel: The WiFi channel to scan.
43
- //| :param int queue: The queue size for buffering the packet.
44
- //|
45
- //| """
46
- //| ...
42
+ //| :param int channel: The WiFi channel to scan.
43
+ //| :param int queue: The queue size for buffering the packet.
47
44
//|
45
+ //| """
46
+ //| ...
48
47
STATIC mp_obj_t wifi_monitor_make_new (const mp_obj_type_t * type , size_t n_args , size_t n_kw , const mp_obj_t * all_args ) {
49
48
enum { ARG_channel , ARG_queue };
50
49
static const mp_arg_t allowed_args [] = {
@@ -69,8 +68,8 @@ STATIC mp_obj_t wifi_monitor_make_new(const mp_obj_type_t *type, size_t n_args,
69
68
return MP_OBJ_FROM_PTR (self );
70
69
}
71
70
72
- //| channel: int
73
- //| """The WiFi channel to scan."""
71
+ //| channel: int
72
+ //| """The WiFi channel to scan."""
74
73
STATIC mp_obj_t wifi_monitor_obj_get_channel (mp_obj_t self_in ) {
75
74
return common_hal_wifi_monitor_get_channel (self_in );
76
75
}
@@ -90,8 +89,8 @@ MP_PROPERTY_GETSET(wifi_monitor_channel_obj,
90
89
(mp_obj_t )& wifi_monitor_get_channel_obj ,
91
90
(mp_obj_t )& wifi_monitor_set_channel_obj );
92
91
93
- //| queue: int
94
- //| """The queue size for buffering the packet."""
92
+ //| queue: int
93
+ //| """The queue size for buffering the packet."""
95
94
STATIC mp_obj_t wifi_monitor_obj_get_queue (mp_obj_t self_in ) {
96
95
return common_hal_wifi_monitor_get_queue (self_in );
97
96
}
@@ -100,29 +99,26 @@ MP_DEFINE_CONST_FUN_OBJ_1(wifi_monitor_get_queue_obj, wifi_monitor_obj_get_queue
100
99
MP_PROPERTY_GETTER (wifi_monitor_queue_obj ,
101
100
(mp_obj_t )& wifi_monitor_get_queue_obj );
102
101
103
- //| def deinit(self) -> None:
104
- //| """De-initialize `wifi.Monitor` singleton."""
105
- //| ...
106
- //|
102
+ //| def deinit(self) -> None:
103
+ //| """De-initialize `wifi.Monitor` singleton."""
104
+ //| ...
107
105
STATIC mp_obj_t wifi_monitor_obj_deinit (mp_obj_t self_in ) {
108
106
common_hal_wifi_monitor_deinit (self_in );
109
107
return mp_const_none ;
110
108
}
111
109
STATIC MP_DEFINE_CONST_FUN_OBJ_1 (wifi_monitor_deinit_obj , wifi_monitor_obj_deinit );
112
110
113
- //| def lost(self) -> int:
114
- //| """Returns the packet loss count. The counter resets after each poll."""
115
- //| ...
116
- //|
111
+ //| def lost(self) -> int:
112
+ //| """Returns the packet loss count. The counter resets after each poll."""
113
+ //| ...
117
114
STATIC mp_obj_t wifi_monitor_obj_get_lost (mp_obj_t self_in ) {
118
115
return common_hal_wifi_monitor_get_lost (self_in );
119
116
}
120
117
MP_DEFINE_CONST_FUN_OBJ_1 (wifi_monitor_lost_obj , wifi_monitor_obj_get_lost );
121
118
122
- //| def queued(self) -> int:
123
- //| """Returns the packet queued count."""
124
- //| ...
125
- //|
119
+ //| def queued(self) -> int:
120
+ //| """Returns the packet queued count."""
121
+ //| ...
126
122
STATIC mp_obj_t wifi_monitor_obj_get_queued (mp_obj_t self_in ) {
127
123
if (common_hal_wifi_monitor_deinited ()) {
128
124
return mp_obj_new_int_from_uint (0 );
@@ -131,9 +127,9 @@ STATIC mp_obj_t wifi_monitor_obj_get_queued(mp_obj_t self_in) {
131
127
}
132
128
MP_DEFINE_CONST_FUN_OBJ_1 (wifi_monitor_queued_obj , wifi_monitor_obj_get_queued );
133
129
134
- //| def packet(self) -> dict:
135
- //| """Returns the monitor packet."""
136
- //| ...
130
+ //| def packet(self) -> dict:
131
+ //| """Returns the monitor packet."""
132
+ //| ...
137
133
//|
138
134
STATIC mp_obj_t wifi_monitor_obj_get_packet (mp_obj_t self_in ) {
139
135
if (common_hal_wifi_monitor_deinited ()) {
0 commit comments