nrf5/modules: Updating ubluepy peripheral to pass handle value to python event handler instead of data length. Data length can be derived from the bytearray structure.

This commit is contained in:
Glenn Ruben Bakke 2017-03-03 00:04:13 +01:00
parent 22f66e274d
commit db3dd8bc8b
1 changed files with 2 additions and 2 deletions

View File

@ -53,7 +53,7 @@ STATIC void gap_event_handler(mp_obj_t self_in, uint16_t event_id, uint16_t conn
mp_obj_t args[3]; mp_obj_t args[3];
mp_uint_t num_of_args = 3; mp_uint_t num_of_args = 3;
args[0] = MP_OBJ_NEW_SMALL_INT(event_id); args[0] = MP_OBJ_NEW_SMALL_INT(event_id);
args[1] = MP_OBJ_NEW_SMALL_INT(length); args[1] = MP_OBJ_NEW_SMALL_INT(conn_handle);
if (data != NULL) { if (data != NULL) {
args[2] = mp_obj_new_bytearray_by_ref(length, data); args[2] = mp_obj_new_bytearray_by_ref(length, data);
} else { } else {
@ -74,7 +74,7 @@ STATIC void gatts_event_handler(mp_obj_t self_in, uint16_t event_id, uint16_t at
mp_obj_t args[3]; mp_obj_t args[3];
mp_uint_t num_of_args = 3; mp_uint_t num_of_args = 3;
args[0] = MP_OBJ_NEW_SMALL_INT(event_id); args[0] = MP_OBJ_NEW_SMALL_INT(event_id);
args[1] = MP_OBJ_NEW_SMALL_INT(length); args[1] = MP_OBJ_NEW_SMALL_INT(attr_handle);
if (data != NULL) { if (data != NULL) {
args[2] = mp_obj_new_bytearray_by_ref(length, data); args[2] = mp_obj_new_bytearray_by_ref(length, data);
} else { } else {