@@ -58,21 +58,21 @@ STATIC mp_obj_t usb_hid_device_send_report(mp_obj_t self_in, mp_obj_t buffer) {
58
58
}
59
59
MP_DEFINE_CONST_FUN_OBJ_2 (usb_hid_device_send_report_obj , usb_hid_device_send_report );
60
60
61
- //| report : bytes
62
- //| """The HID OUT report as a `bytes`. (read-only)"""
61
+ //| last_received_report : bytes
62
+ //| """The HID OUT report as a `bytes`. (read-only). `None` if nothing received. """
63
63
//|
64
- STATIC mp_obj_t usb_hid_device_obj_get_report (mp_obj_t self_in ) {
64
+ STATIC mp_obj_t usb_hid_device_obj_get_last_received_report (mp_obj_t self_in ) {
65
65
usb_hid_device_obj_t * self = MP_OBJ_TO_PTR (self_in );
66
66
if (self -> out_report_buffer == 0 ) {
67
67
return mp_const_none ;
68
68
}
69
69
return mp_obj_new_bytes (self -> out_report_buffer , self -> out_report_length );
70
70
}
71
- MP_DEFINE_CONST_FUN_OBJ_1 (usb_hid_device_get_report_obj , usb_hid_device_obj_get_report );
71
+ MP_DEFINE_CONST_FUN_OBJ_1 (usb_hid_device_get_last_received_report_obj , usb_hid_device_obj_get_last_received_report );
72
72
73
- const mp_obj_property_t usb_hid_device_report_obj = {
73
+ const mp_obj_property_t usb_hid_device_last_received_report_obj = {
74
74
.base .type = & mp_type_property ,
75
- .proxy = {(mp_obj_t )& usb_hid_device_get_report_obj ,
75
+ .proxy = {(mp_obj_t )& usb_hid_device_get_last_received_report_obj ,
76
76
(mp_obj_t )& mp_const_none_obj ,
77
77
(mp_obj_t )& mp_const_none_obj },
78
78
};
@@ -114,10 +114,10 @@ const mp_obj_property_t usb_hid_device_usage_obj = {
114
114
};
115
115
116
116
STATIC const mp_rom_map_elem_t usb_hid_device_locals_dict_table [] = {
117
- { MP_ROM_QSTR (MP_QSTR_send_report ), MP_ROM_PTR (& usb_hid_device_send_report_obj ) },
118
- { MP_ROM_QSTR (MP_QSTR_report ), MP_ROM_PTR (& usb_hid_device_report_obj ) },
119
- { MP_ROM_QSTR (MP_QSTR_usage_page ), MP_ROM_PTR (& usb_hid_device_usage_page_obj )},
120
- { MP_ROM_QSTR (MP_QSTR_usage ), MP_ROM_PTR (& usb_hid_device_usage_obj )},
117
+ { MP_ROM_QSTR (MP_QSTR_send_report ), MP_ROM_PTR (& usb_hid_device_send_report_obj ) },
118
+ { MP_ROM_QSTR (MP_QSTR_last_received_report ), MP_ROM_PTR (& usb_hid_device_report_obj ) },
119
+ { MP_ROM_QSTR (MP_QSTR_usage_page ), MP_ROM_PTR (& usb_hid_device_usage_page_obj )},
120
+ { MP_ROM_QSTR (MP_QSTR_usage ), MP_ROM_PTR (& usb_hid_device_usage_obj )},
121
121
};
122
122
123
123
STATIC MP_DEFINE_CONST_DICT (usb_hid_device_locals_dict , usb_hid_device_locals_dict_table );
0 commit comments