summaryrefslogtreecommitdiff
path: root/shared-bindings
diff options
context:
space:
mode:
authorhathach <thach@tinyusb.org>2019-12-18 16:52:04 +0700
committerhathach <thach@tinyusb.org>2019-12-18 16:52:04 +0700
commitd1f045880df1b97c0472ec86b0ea62cfdebb9e1f (patch)
tree88a6b4c3656c7de26b2cb29a505b392c1f7eab0a /shared-bindings
parentebc21144b8dc98dde7daf3f3832bdb33a5d8fc7d (diff)
parent25df6e613a7ef5fcd83c589652a349bbbc6f6c2e (diff)
Merge branch 'master' into hierophect-update-tusb
Diffstat (limited to 'shared-bindings')
-rw-r--r--shared-bindings/_bleio/Adapter.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/shared-bindings/_bleio/Adapter.c b/shared-bindings/_bleio/Adapter.c
index 9772fa830..5d3211b0c 100644
--- a/shared-bindings/_bleio/Adapter.c
+++ b/shared-bindings/_bleio/Adapter.c
@@ -29,6 +29,7 @@
#include "py/objproperty.h"
#include "py/runtime.h"
+#include "shared-bindings/_bleio/__init__.h"
#include "shared-bindings/_bleio/Address.h"
#include "shared-bindings/_bleio/Adapter.h"
@@ -185,7 +186,12 @@ STATIC mp_obj_t bleio_adapter_start_advertising(mp_uint_t n_args, const mp_obj_t
ADV_INTERVAL_MIN_STRING, ADV_INTERVAL_MAX_STRING);
}
- common_hal_bleio_adapter_start_advertising(self, args[ARG_connectable].u_bool, interval,
+ bool connectable = args[ARG_connectable].u_bool;
+ if (data_bufinfo.len > 31 && connectable && scan_response_bufinfo.len > 0) {
+ mp_raise_bleio_BluetoothError(translate("Cannot have scan responses for extended, connectable advertisements."));
+ }
+
+ common_hal_bleio_adapter_start_advertising(self, connectable, interval,
&data_bufinfo, &scan_response_bufinfo);
return mp_const_none;