8000 another API rework: less abstraction leakage · tannewt/circuitpython@f17059b · GitHub
[go: up one dir, main page]

Skip to content

Commit f17059b

Browse files
committed
another API rework: less abstraction leakage
1 parent 19c59b4 commit f17059b

File tree

12 files changed

+270
-252
lines changed

12 files changed

+270
-252
lines changed

ports/nrf/common-hal/bleio/Characteristic.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,8 @@ STATIC void characteristic_gattc_read(bleio_characteristic_obj_t *characteristic
124124
ble_drv_remove_event_handler(characteristic_on_gattc_read_rsp_evt, characteristic);
125125
}
126126

127-
void common_hal_bleio_characteristic_construct(bleio_characteristic_obj_t *self, bleio_uuid_obj_t *uuid, bleio_characteristic_properties_t props, bleio_attribute_security_mode_t read_perm, bleio_attribute_security_mode_t write_perm, mp_int_t max_length, bool fixed_length, mp_buffer_info_t *initial_value_bufinfo) {
128-
self->service = MP_OBJ_NULL;
127+
void common_hal_bleio_characteristic_construct(bleio_characteristic_obj_t *self, bleio_service_obj_t *service, bleio_uuid_obj_t *uuid, bleio_characteristic_properties_t props, bleio_attribute_security_mode_t read_perm, bleio_attribute_security_mode_t write_perm, mp_int_t max_length, bool fixed_length, mp_buffer_info_t *initial_value_bufinfo) {
128+
self->service = service;
129129
self->uuid = uuid;
130130
self->handle = BLE_GATT_HANDLE_INVALID;
131131
self->props = props;
@@ -222,9 +222,6 @@ bleio_characteristic_properties_t common_hal_bleio_characteristic_get_properties
222222
}
223223

224224
void common_hal_bleio_characteristic_add_descriptor(bleio_characteristic_obj_t *self, bleio_descriptor_obj_t *descriptor) {
225-
// Connect descriptor to parent characteristic.
226-
descriptor->characteristic = self;
227-
228225
ble_uuid_t desc_uuid;
229226
bleio_uuid_convert_to_nrf_ble_uuid(descriptor->uuid, &desc_uuid);
230227

ports/nrf/common-hal/bleio/Descriptor.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@
3535

3636
static volatile bleio_descriptor_obj_t *m_read_descriptor;
3737

38-
void common_hal_bleio_descriptor_construct(bleio_descriptor_obj_t *self, bleio_uuid_obj_t *uuid, bleio_attribute_security_mode_t read_perm, bleio_attribute_security_mode_t write_perm, mp_int_t max_length, bool fixed_length, mp_buffer_info_t *initial_value_bufinfo) {
39-
self->characteristic = MP_OBJ_NULL;
38+
void common_hal_bleio_descriptor_construct(bleio_descriptor_obj_t *self, bleio_characteristic_obj_t *characteristic, bleio_uuid_obj_t *uuid, bleio_attribute_security_mode_t read_perm, bleio_attribute_security_mode_t write_perm, mp_int_t max_length, bool fixed_length, mp_buffer_info_t *initial_value_bufinfo) {
39+
self->characteristic = characteristic;
4040
self->uuid = uuid;
4141
self->handle = BLE_GATT_HANDLE_INVALID;
4242
self->read_perm = read_perm;

ports/nrf/common-hal/bleio/Peripheral.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -223,8 +223,6 @@ void common_hal_bleio_peripheral_construct(bleio_peripheral_obj_t *self, mp_obj_
223223
}
224224

225225
void common_hal_bleio_peripheral_add_service(bleio_peripheral_obj_t *self, bleio_service_obj_t *service) {
226-
service->device = MP_OBJ_FROM_PTR(self);
227-
228226
ble_uuid_t uuid;
229227
bleio_uuid_convert_to_nrf_ble_uuid(service->uuid, &uuid);
230228

@@ -241,7 +239,6 @@ void common_hal_bleio_peripheral_add_service(bleio_peripheral_obj_t *self, bleio
241239
mp_obj_list_append(self->service_list, MP_OBJ_FROM_PTR(service));
242240
}
243241

244-
245242
mp_obj_list_t *common_hal_bleio_peripheral_get_services(bleio_peripheral_obj_t *self) {
246243
return self->service_list;
247244
}

ports/nrf/common-hal/bleio/Service.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,17 @@
3131
#include "common-hal/bleio/__init__.h"
3232
#include "shared-bindings/bleio/Characteristic.h"
3333
#include "shared-bindings/bleio/Descriptor.h"
34+
#include "shared-bindings/bleio/Peripheral.h"
3435
#include "shared-bindings/bleio/Service.h"
3536
#include "shared-bindings/bleio/Adapter.h"
3637

37-
void common_hal_bleio_service_construct(bleio_service_obj_t *self, bleio_uuid_obj_t *uuid, bool is_secondary) {
38+
void common_hal_bleio_service_construct(bleio_service_obj_t *self, bleio_peripheral_obj_t *peripheral, bleio_uuid_obj_t *uuid, bool is_secondary) {
39+
self->device = MP_OBJ_FROM_PTR(peripheral);
3840
self->handle = 0xFFFF;
3941
self->uuid = uuid;
4042
self->characteristic_list = mp_obj_new_list(0, NULL);
4143
self->is_remote = false;
4244
self->is_secondary = is_secondary;
43-
self->device = mp_const_none;
4445
}
4546

4647
bleio_uuid_obj_t *common_hal_bleio_service_get_uuid(bleio_service_obj_t *self) {
@@ -59,11 +60,7 @@ bool common_hal_bleio_service_get_is_secondary(bleio_service_obj_t *self) {
5960
return self->is_secondary;
6061
}
6162

62-
6363
void common_hal_bleio_service_add_characteristic(bleio_service_obj_t *self, bleio_characteristic_obj_t *characteristic) {
64-
// Connect characteristic to parent service.
65-
characteristic->service = self;
66-
6764
ble_gatts_char_md_t char_md = {
6865
.char_props.broadcast = (characteristic->props & CHAR_PROP_BROADCAST) ? 1 : 0,
6966
.char_props.read = (characteristic->props & CHAR_PROP_READ) ? 1 : 0,

ports/nrf/common-hal/bleio/__init__.c

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -158,9 +158,8 @@ STATIC void on_primary_srv_discovery_rsp(ble_gattc_evt_prim_srvc_disc_rsp_t *res
158158
service->base.type = &bleio_service_type;
159159

160160
// Initialize several fields at once.
161-
common_hal_bleio_service_construct(service, NULL, false);
161+
common_hal_bleio_service_construct(service, device, NULL, false);
162162

163-
service->device = device;
164163
service->is_remote = true;
165164
service->start_handle = gattc_service->handle_range.start_handle;
166165
service->end_handle = gattc_service->handle_range.end_handle;
@@ -218,11 +217,10 @@ STATIC void on_char_discovery_rsp(ble_gattc_evt_char_disc_rsp_t *response, mp_ob
218217

219218
// Call common_hal_bleio_characteristic_construct() to initalize some fields and set up evt handler.
220219
common_hal_bleio_characteristic_construct(
221-
characteristic, uuid, props, SECURITY_MODE_OPEN, SECURITY_MODE_OPEN,
220+
characteristic, m_char_discovery_service, uuid, props, SECURITY_MODE_OPEN, SECURITY_MODE_OPEN,
222221
GATT_MAX_DATA_LENGTH, false, // max_length, fixed_length: values may not matter for gattc
223222
mp_obj_new_list(0, NULL));
224223
characteristic->handle = gattc_char->handle_value;
225-
characteristic->service = m_char_discovery_service;
226224

227225
mp_obj_list_append(m_char_discovery_service->characteristic_list, MP_OBJ_FROM_PTR(characteristic));
228226
}
@@ -274,10 +272,11 @@ STATIC void on_desc_discovery_rsp(ble_gattc_evt_desc_disc_rsp_t *response, mp_ob
274272
// For now, just leave the UUID as NULL.
275273
}
276274

277-
common_hal_bleio_descriptor_construct(descriptor, uuid, SECURITY_MODE_OPEN, SECURITY_MODE_OPEN,
278-
GATT_MAX_DATA_LENGTH, false, mp_const_empty_bytes);
275+
common_hal_bleio_descriptor_construct(
276+
descriptor, m_desc_discovery_characteristic, uuid,
277+
SECURITY_MODE_OPEN, SECURITY_MODE_OPEN,
278+
GATT_MAX_DATA_LENGTH, false, mp_const_empty_bytes);
279279
descriptor->handle = gattc_desc->handle;
280-
descriptor->characteristic = m_desc_discovery_characteristic;
281280

282281
mp_obj_list_append(m_desc_discovery_characteristic->descriptor_list, MP_OBJ_FROM_PTR(descriptor));
283282
}

shared-bindings/bleio/Characteristic.c

Lines changed: 104 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
#include "py/runtime.h"
3131
#include "shared-bindings/bleio/Attribute.h"
3232
#include "shared-bindings/bleio/Characteristic.h"
33-
#include "shared-bindings/bleio/Descriptor.h"
33+
#include "shared-bindings/bleio/Service.h"
3434
#include "shared-bindings/bleio/UUID.h"
3535

3636
//| .. currentmodule:: bleio
@@ -41,12 +41,111 @@
4141
//| Stores information about a BLE service characteristic and allows reading
4242
//| and writing of the characteristic's value.
4343
//|
44-
//| A Characteristic cannot be created directly. A new local Characteristic can be created
45-
//| and attached to a Service by calling `Service.add_characteristic()`.
44+
//| There is no regular constructor for a Characteristic. A new local Characteristic can be created
45+
//| and attached to a Service by calling `Characteristic.add_to_service()`.
4646
//| Remote Characteristic objects are created by `Central.discover_remote_services()`
4747
//| or `Peripheral.discover_remote_services()` as part of remote Services.
4848
//|
4949

50+
//| .. method:: add_to_service(service, uuid, *, properties=0, read_perm=`Attribute.OPEN`, write_perm=`Attribute.OPEN`, max_length=20, fixed_length=False, initial_value=None)
51+
//|
52+
//| Create a new `Characteristic` object, and add it to this Service.
53+
//|
54+
//| :param bleio.Service service: The service that will provide this characteristic
55+
//| :param bleio.UUID uuid: The uuid of the characteristic
56+
//| :param int properties: The properties of the characteristic,
57+
//| specified as a bitmask of these values bitwise-or'd together:
58+
//| `Characteristic.BROADCAST`, `Characteristic.INDICATE`, `Characteristic.NOTIFY`,
59+
//| `Characteristic.READ`, `Characteristic.WRITE`, `Characteristic.WRITE_NO_RESPONSE`.
60+
//| :param int read_perm: Specifies whether the characteristic can be read by a client, and if so, which
61+
//| security mode is required. Must be one of the integer values `Attribute.NO_ACCESS`, `Attribute.OPEN`,
62+
//| `Attribute.ENCRYPT_NO_MITM`, `Attribute.ENCRYPT_WITH_MITM`, `Attribute.LESC_ENCRYPT_WITH_MITM`,
63+
//| `Attribute.SIGNED_NO_MITM`, or `Attribute.SIGNED_WITH_MITM`.
64+
//| :param int write_perm: Specifies whether the characteristic can be written by a client, and if so, which
65+
//| security mode is required. Values allowed are the same as ``read_perm``.
66+
//| :param int max_length: Maximum length in bytes of the characteristic value. The maximum allowed is
67+
//| is 512, or possibly 510 if ``fixed_length`` is False. The default, 20, is the maximum
68+
//| number of data bytes that fit in a single BLE 4.x ATT packet.
69+
//| :param bool fixed_length: True if the characteristic value is of fixed length.
70+
//| :param buf initial_value: The initial value for this characteristic. If not given, will be
71+
//| filled with zeros.
72+
//|
73+
//| :return: the new `Characteristic`.
74+
//|
75+
STATIC mp_obj_t bleio_characteristic_add_to_service(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
76+
// class is arg[0], which we can ignore.
77+
78+
enum { ARG_service, ARG_uuid, ARG_properties, ARG_read_perm, ARG_write_perm,
79+
ARG_max_length, ARG_fixed_length, ARG_initial_value };
80+
static const mp_arg_t allowed_args[] = {
81+
{ MP_QSTR_service, MP_ARG_REQUIRED | MP_ARG_OBJ },
82+
{ MP_QSTR_uuid, MP_ARG_REQUIRED | MP_ARG_OBJ },
83+
{ MP_QSTR_properties, MP_ARG_KW_ONLY| MP_ARG_INT, {.u_int = 0} },
84+
{ MP_QSTR_read_perm, MP_ARG_KW_ONLY| MP_ARG_INT, {.u_int = SECURITY_MODE_OPEN} },
85+
{ MP_QSTR_write_perm, MP_ARG_KW_ONLY| MP_ARG_INT, {.u_int = SECURITY_MODE_OPEN} },
86+
{ MP_QSTR_max_length, MP_ARG_KW_ONLY| MP_ARG_INT, {.u_int = 20} },
87+
{ MP_QSTR_fixed_length, MP_ARG_KW_ONLY| MP_ARG_BOOL, {.u_bool = false} },
88+
{ MP_QSTR_initial_value, MP_ARG_KW_ONLY| MP_ARG_OBJ, {.u_obj = mp_const_none} },
89+
};
90+
91+
mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)];
92+
mp_arg_parse_all(n_args - 1, pos_args + 1, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args);
93+
94+
const mp_obj_t service_obj = args[ARG_service].u_obj;
95+
if (!MP_OBJ_IS_TYPE(service_obj, &bleio_service_type)) {
96+
mp_raise_ValueError(translate("Expected a Service"));
97+
}
98+
99+
const mp_obj_t uuid_obj = args[ARG_uuid].u_obj;
100+
if (!MP_OBJ_IS_TYPE(uuid_obj, &bleio_uuid_type)) {
101+
mp_raise_ValueError(translate("Expected a UUID"));
102+
}
103+
104+
const bleio_characteristic_properties_t properties = args[ARG_properties].u_int;
105+
if (properties & ~CHAR_PROP_ALL) {
106+
mp_raise_ValueError(translate("Invalid properties"));
107+
}
108+
109+
const bleio_attribute_security_mode_t read_perm = args[ARG_read_perm].u_int;
110+
common_hal_bleio_attribute_security_mode_check_valid(read_perm);
111+
112+
const bleio_attribute_security_mode_t write_perm = args[ARG_write_perm].u_int;
113+
common_hal_bleio_attribute_security_mode_check_valid(write_perm);
114+
115+
const mp_int_t max_length = args[ARG_max_length].u_int;
116+
const bool fixed_length = args[ARG_fixed_length].u_bool;
117+
mp_obj_t initial_value = args[ARG_initial_value].u_obj;
118+
119+
// Length will be validated in common_hal.
120+
mp_buffer_info_t initial_value_bufinfo;
121+
if (initial_value == mp_const_none) {
122+
if (fixed_length && max_length > 0) {
123+
initial_value = mp_obj_new_bytes_of_zeros(max_length);
124+
} else {
125+
initial_value = mp_const_empty_bytes;
126+
}
127+
}
128+
mp_get_buffer_raise(initial_value, &initial_value_bufinfo, MP_BUFFER_READ);
129+
130+
bleio_characteristic_obj_t *characteristic = m_new_obj(bleio_characteristic_obj_t);
131+
characteristic->base.type = &bleio_characteristic_type;
132+
133+
// Range checking on max_length arg is done by the common_hal layer, because
134+
// it may vary depending on underlying BLE implementation.
135+
common_hal_bleio_characteristic_construct(
136+
characteristic, MP_OBJ_TO_PTR(service_obj), MP_OBJ_TO_PTR(uuid_obj),
137+
properties, read_perm, write_perm,
138+
max_length, fixed_length, &initial_value_bufinfo);
139+
140+
common_hal_bleio_service_add_characteristic(service_obj, characteristic);
141+
142+
return MP_OBJ_FROM_PTR(characteristic);
143+
}
144+
STATIC MP_DEFINE_CONST_FUN_OBJ_KW(bleio_characteristic_add_to_service_fun_obj, 3, bleio_characteristic_add_to_service);
145+
STATIC MP_DEFINE_CONST_CLASSMETHOD_OBJ(bleio_characteristic_add_to_service_obj, MP_ROM_PTR(&bleio_characteristic_add_to_service_fun_obj));
146+
147+
148+
50149
//| .. attribute:: properties
51150
//|
52151
//| An int bitmask representing which properties are set, specified as bitwise or'ing of
@@ -155,84 +254,6 @@ const mp_obj_property_t bleio_characteristic_service_obj = {
155254
(mp_obj_t)&mp_const_none_obj },
156255
};
157256

158-
//| .. method:: add_descriptor(uuid, *, read_perm=`Attribute.OPEN`, write_perm=`Attribute.OPEN`, max_length=20, fixed_length=False, initial_value=b'')
159-
//|
160-
//| Create a new `Descriptor` object, and add it to this Service.
161-
//|
162-
//| :param bleio.UUID uuid: The uuid of the descriptor
163-
//| :param int read_perm: Specifies whether the descriptor can be read by a client, and if so, which
164-
//| security mode is required. Must be one of the integer values `Attribute.NO_ACCESS`, `Attribute.OPEN`,
165-
//| `Attribute.ENCRYPT_NO_MITM`, `Attribute.ENCRYPT_WITH_MITM`, `Attribute.LESC_ENCRYPT_WITH_MITM`,
166-
//| `Attribute.SIGNED_NO_MITM`, or `Attribute.SIGNED_WITH_MITM`.
167-
//| :param int write_perm: Specifies whether the descriptor can be written by a client, and if so, which
168-
//| security mode is required. Values allowed are the same as ``read_perm``.
169-
//| :param int max_length: Maximum length in bytes of the descriptor value. The maximum allowed is
170-
//| is 512, or possibly 510 if ``fixed_length`` is False. The default, 20, is the maximum
171-
//| number of data bytes that fit in a single BLE 4.x ATT packet.
172-
//| :param bool fixed_length: True if the descriptor value is of fixed length.
173-
//| :param buf initial_value: The initial value for this descriptor.
174-
//|
175-
//| :return: the new `Descriptor`.
176-
//|
177-
STATIC mp_obj_t bleio_characteristic_add_descriptor(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
178-
bleio_characteristic_obj_t *self = MP_OBJ_TO_PTR(pos_args[0]);
179-
180-
enum { ARG_uuid, ARG_read_perm, ARG_write_perm,
181-
ARG_max_length, ARG_fixed_length, ARG_initial_value };
182-
static const mp_arg_t allowed_args[] = {
183-
{ MP_QSTR_uuid, MP_ARG_REQUIRED | MP_ARG_OBJ },
184-
{ MP_QSTR_read_perm, MP_ARG_KW_ONLY| MP_ARG_INT, {.u_int = SECURITY_MODE_OPEN} },
185-
{ MP_QSTR_write_perm, MP_ARG_KW_ONLY| MP_ARG_INT, {.u_int = SECURITY_MODE_OPEN} },
186-
{ MP_QSTR_max_length, MP_ARG_KW_ONLY| MP_ARG_INT, {.u_int = 20} },
187-
{ MP_QSTR_fixed_length, MP_ARG_KW_ONLY| MP_ARG_BOOL, {.u_bool = false} },
188-
{ MP_QSTR_initial_value, MP_ARG_KW_ONLY| MP_ARG_OBJ, {.u_obj = mp_const_empty_bytes} },
189-
};
190-
191-
mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)];
192-
mp_arg_parse_all(n_args - 1, pos_args + 1, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args);
193-
194-
const mp_obj_t uuid_obj = args[ARG_uuid].u_obj;
195-
196-
if (!MP_OBJ_IS_TYPE(uuid_obj, &bleio_uuid_type)) {
197-
mp_raise_ValueError(translate("Expected a UUID"));
198-
}
199-
bleio_uuid_obj_t *uuid = MP_OBJ_TO_PTR(uuid_obj);
200-
201-
const bleio_attribute_security_mode_t read_perm = args[ARG_read_perm].u_int;
202-
common_hal_bleio_attribute_security_mode_check_valid(read_perm);
203-
204-
const bleio_attribute_security_mode_t write_perm = args[ARG_write_perm].u_int;
205-
common_hal_bleio_attribute_security_mode_check_valid(write_perm);
206-
207-
const mp_int_t max_length = args[ARG_max_length].u_int;
208-
const bool fixed_length = args[ARG_fixed_length].u_bool;
209-
mp_obj_t initial_value = args[ARG_initial_value].u_obj;
210-
211-
// Length will be validated in common_hal.
212-
mp_buffer_info_t initial_value_bufinfo;
213-
if (initial_value == mp_const_none) {
214-
if (fixed_length && max_length > 0) {
215-
initial_value = mp_obj_new_bytes_of_zeros(max_length);
216-
} else {
217-
initial_value = mp_const_empty_bytes;
218-
}
219-
}
220-
mp_get_buffer_raise(initial_value, &initial_value_bufinfo, MP_BUFFER_READ);
221-
222-
bleio_descriptor_obj_t *descriptor = m_new_obj(bleio_descriptor_obj_t);
223-
descriptor->base.type = &bleio_descriptor_type;
224-
225-
// Range checking on max_length arg is done by the common_hal layer, because
226-
// it may vary depending on underlying BLE implementation.
227-
common_hal_bleio_descriptor_construct(
228-
descriptor, uuid, read_perm, write_perm, max_length, fixed_length, &initial_value_bufinfo);
229-
230-
common_hal_bleio_characteristic_add_descriptor(self, descriptor);
231-
232-
return MP_OBJ_FROM_PTR(descriptor);
233-
}
234-
STATIC MP_DEFINE_CONST_FUN_OBJ_KW(bleio_characteristic_add_descriptor_obj, 2, bleio_characteristic_add_descriptor);
235-
236257
//| .. method:: set_cccd(*, notify=False, indicate=False)
237258
//|
238259
//| Set the remote characteristic's CCCD to enable or disable notification and indication.
@@ -260,10 +281,10 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_KW(bleio_characteristic_set_cccd_obj, 1, bleio_ch
260281

261282

262283
STATIC const mp_rom_map_elem_t bleio_characteristic_locals_dict_table[] = {
263-
{ MP_ROM_QSTR(MP_QSTR_properties), MP_ROM_PTR(&bleio_characteristic_get_properties) },
284+
{ MP_ROM_QSTR(MP_QSTR_add_to_service), MP_ROM_PTR(&bleio_characteristic_add_to_service_obj) },
285+
{ MP_ROM_QSTR(MP_QSTR_properties), MP_ROM_PTR(&bleio_characteristic_get_properties_obj) },
264286
{ MP_ROM_QSTR(MP_QSTR_uuid), MP_ROM_PTR(&bleio_characteristic_uuid_obj) },
265287
{ MP_ROM_QSTR(MP_QSTR_value), MP_ROM_PTR(&bleio_characteristic_value_obj) },
266-
{ MP_ROM_QSTR(MP_QSTR_add_descriptor), MP_ROM_PTR(&bleio_characteristic_add_descriptor_obj) },
267288
{ MP_ROM_QSTR(MP_QSTR_set_cccd), MP_ROM_PTR(&bleio_characteristic_set_cccd_obj) },
268289

269290
// Bitmask constants to represent properties

shared-bindings/bleio/Characteristic.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,11 @@
3232
#include "shared-bindings/bleio/Descriptor.h"
3333
#include "shared-module/bleio/Characteristic.h"
3434
#include "common-hal/bleio/Characteristic.h"
35+
#include "common-hal/bleio/Service.h"
3536

3637
extern const mp_obj_type_t bleio_characteristic_type;
3738

38-
extern void common_hal_bleio_characteristic_construct(bleio_characteristic_obj_t *self, bleio_uuid_obj_t *uuid, bleio_characteristic_properties_t props, bleio_attribute_security_mode_t read_perm, bleio_attribute_security_mode_t write_perm, mp_int_t max_length, bool fixed_length, mp_buffer_info_t *initial_value_bufinfo);
39+
extern void common_hal_bleio_characteristic_construct(bleio_characteristic_obj_t *self, bleio_service_obj_t *service, bleio_uuid_obj_t *uuid, bleio_characteristic_properties_t props, bleio_attribute_security_mode_t read_perm, bleio_attribute_security_mode_t write_perm, mp_int_t max_length, bool fixed_length, mp_buffer_info_t *initial_value_bufinfo);
3940
extern mp_obj_t common_hal_bleio_characteristic_get_value(bleio_characteristic_obj_t *self);
4041
extern void common_hal_bleio_characteristic_set_value(bleio_characteristic_obj_t *self, mp_buffer_info_t *bufinfo);
4142
extern bleio_characteristic_properties_t common_hal_bleio_characteristic_get_properties(bleio_characteristic_obj_t *self);

0 commit comments

Comments
 (0)
0