bleio: Remove redundant struct field

This commit is contained in:
arturo182 2018-07-23 23:52:09 +02:00
parent c7b42d80b3
commit b5e5805bb4
4 changed files with 3 additions and 7 deletions

View File

@ -376,8 +376,6 @@ STATIC void on_char_discovery_rsp(ble_gattc_evt_char_disc_rsp_t *response, bleio
characteristic->props.write = gattc_char->char_props.write;
characteristic->props.write_wo_resp = gattc_char->char_props.write_wo_resp;
characteristic->handle = gattc_char->handle_value;
characteristic->service_handle = m_char_discovery_service->handle;
characteristic->service = m_char_discovery_service;
mp_obj_list_append(m_char_discovery_service->char_list, MP_OBJ_FROM_PTR(characteristic));

View File

@ -101,7 +101,7 @@ void common_hal_bleio_service_add_characteristic(bleio_service_obj_t *self, blei
ble_gatts_char_handles_t handles;
uint32_t err_code;
err_code = sd_ble_gatts_characteristic_add(characteristic->service_handle, &char_md, &attr_char_value, &handles);
err_code = sd_ble_gatts_characteristic_add(self->handle, &char_md, &attr_char_value, &handles);
if (err_code != NRF_SUCCESS) {
nlr_raise(mp_obj_new_exception_msg_varg(&mp_type_OSError,
"Failed to add characteristic, status: 0x%08lX", err_code));
@ -111,5 +111,4 @@ void common_hal_bleio_service_add_characteristic(bleio_service_obj_t *self, blei
characteristic->cccd_handle = handles.cccd_handle;
characteristic->sccd_handle = handles.sccd_handle;
characteristic->handle = handles.value_handle;
characteristic->service = self;
}

View File

@ -113,12 +113,12 @@ STATIC mp_obj_t bleio_service_add_characteristic(mp_obj_t self_in, mp_obj_t char
bleio_service_obj_t *self = MP_OBJ_TO_PTR(self_in);
bleio_characteristic_obj_t *characteristic = MP_OBJ_TO_PTR(characteristic_in);
characteristic->service_handle = self->handle;
// TODO: If service is 128b then update Chara UUID to be 128b too
common_hal_bleio_service_add_characteristic(self, characteristic);
characteristic->service = self;
mp_obj_list_append(self->char_list, characteristic);
return mp_const_none;

View File

@ -33,7 +33,6 @@
typedef struct {
mp_obj_base_t base;
bleio_service_obj_t *service;
uint16_t service_handle; // TODO: Is this needed?
bleio_uuid_obj_t *uuid;
mp_obj_t value_data;
uint16_t handle;