diff options
| author | Dan Halbert <halbert@halwitz.org> | 2019-08-06 22:55:25 -0400 |
|---|---|---|
| committer | Dan Halbert <halbert@halwitz.org> | 2019-08-06 22:55:25 -0400 |
| commit | d74c8b9425d38fe2dce56e044b128ab5693f5f06 (patch) | |
| tree | 2b53e13d4bcf7333225c45c16513f86f1d9c9449 /shared-bindings/bleio/Service.c | |
| parent | 243334da75bb765781aedef0b9927af72f6279e8 (diff) | |
WIP: more Descriptor work; refactor gattc/gatts read/write
Diffstat (limited to 'shared-bindings/bleio/Service.c')
| -rw-r--r-- | shared-bindings/bleio/Service.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/shared-bindings/bleio/Service.c b/shared-bindings/bleio/Service.c index b4aeab2bd..6961b0b52 100644 --- a/shared-bindings/bleio/Service.c +++ b/shared-bindings/bleio/Service.c @@ -96,6 +96,9 @@ STATIC mp_obj_t bleio_service_make_new(const mp_obj_type_t *type, size_t n_args, // The descriptor base UUID doesn't match the characteristic base UUID. mp_raise_ValueError(translate("Characteristic UUID doesn't match Service UUID")); } + if (common_hal_bleio_characteristic_get_service(characteristic) != MP_OBJ_NULL) { + mp_raise_ValueError(translate("Characteristic is already attached to a Service")); + } mp_obj_list_append(char_list_obj, characteristic_obj); } |
