|
48 | 48 | //| def matches(self, prefixes: ScanEntry, *, match_all: bool = True) -> bool:
|
49 | 49 | //| """Returns True if the ScanEntry matches all prefixes when ``match_all`` is True. This is stricter
|
50 | 50 | //| than the scan filtering which accepts any advertisements that match any of the prefixes
|
51 |
| -//| where ``match_all`` is False. |
52 |
| -//| |
53 |
| -//| ``all`` also works for ``match_all`` but will be removed in CircuitPython 8.""" |
| 51 | +//| where ``match_all`` is False.""" |
54 | 52 | //| ...
|
55 | 53 | //|
|
56 | 54 | STATIC mp_obj_t bleio_scanentry_matches(mp_uint_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
|
57 | 55 | bleio_scanentry_obj_t *self = MP_OBJ_TO_PTR(pos_args[0]);
|
58 | 56 |
|
59 |
| - enum { ARG_prefixes, ARG_all, ARG_match_all }; |
| 57 | + enum { ARG_prefixes, ARG_match_all }; |
60 | 58 | static const mp_arg_t allowed_args[] = {
|
61 | 59 | { MP_QSTR_prefixes, MP_ARG_OBJ | MP_ARG_REQUIRED },
|
62 |
| - { MP_QSTR_all, MP_ARG_BOOL | MP_ARG_KW_ONLY, {.u_bool = true} }, |
63 | 60 | { MP_QSTR_match_all, MP_ARG_BOOL | MP_ARG_KW_ONLY, {.u_bool = true} },
|
64 | 61 | };
|
65 | 62 |
|
66 | 63 | mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)];
|
67 | 64 | mp_arg_parse_all(n_args - 1, pos_args + 1, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args);
|
68 | 65 |
|
69 |
| - bool match_all = args[ARG_all].u_bool && args[ARG_match_all].u_bool; |
| 66 | + bool match_all = args[ARG_match_all].u_bool; |
70 | 67 |
|
71 | 68 | mp_buffer_info_t bufinfo;
|
72 | 69 | mp_get_buffer_raise(args[ARG_prefixes].u_obj, &bufinfo, MP_BUFFER_READ);
|
|
0 commit comments