Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions devices/ble_hci/common-hal/_bleio/Connection.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ typedef struct {
uint8_t disconnect_reason;
} bleio_connection_obj_t;

void common_hal_bleio_check_connected(uint16_t conn_handle);
Comment thread
tannewt marked this conversation as resolved.
Outdated
uint16_t bleio_connection_get_conn_handle(bleio_connection_obj_t *self);
mp_obj_t bleio_connection_new_from_internal(bleio_connection_internal_t *connection);
bleio_connection_internal_t *bleio_conn_handle_to_connection(uint16_t conn_handle);
Expand Down
27 changes: 7 additions & 20 deletions locale/circuitpython.pot
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@ msgstr ""
msgid "AP could not be started"
msgstr ""

#: shared-bindings/_bleio/Address.c shared-bindings/ipaddress/IPv4Address.c
#: shared-bindings/ipaddress/IPv4Address.c
#, c-format
msgid "Address must be %d bytes long"
msgstr ""
Expand Down Expand Up @@ -673,11 +673,6 @@ msgstr ""
msgid "Brightness not adjustable"
msgstr ""

#: shared-bindings/_bleio/UUID.c
#, c-format
msgid "Buffer + offset too small %d %d %d"
msgstr ""

#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
msgid "Buffer elements must be 4 bytes long or less"
msgstr ""
Expand Down Expand Up @@ -720,10 +715,6 @@ msgstr ""
msgid "Bus pin %d is already in use"
msgstr ""

#: shared-bindings/_bleio/UUID.c
msgid "Byte buffer must be 16 bytes."
msgstr ""

#: shared-bindings/aesio/aes.c
msgid "CBC blocks must be multiples of 16 bytes"
msgstr ""
Expand Down Expand Up @@ -1029,12 +1020,18 @@ msgstr ""
msgid "Failed to buffer the sample"
msgstr ""

#: ports/zephyr-cp/common-hal/_bleio/Adapter.c
msgid "Failed to connect"
msgstr ""

#: ports/espressif/common-hal/_bleio/Adapter.c
#: ports/nordic/common-hal/_bleio/Adapter.c
#: ports/zephyr-cp/common-hal/_bleio/Adapter.c
msgid "Failed to connect: internal error"
msgstr ""

#: ports/nordic/common-hal/_bleio/Adapter.c
#: ports/zephyr-cp/common-hal/_bleio/Adapter.c
msgid "Failed to connect: timeout"
msgstr ""

Expand Down Expand Up @@ -2247,10 +2244,6 @@ msgstr ""
msgid "USB error"
msgstr ""

#: shared-bindings/_bleio/UUID.c
msgid "UUID integer value must be 0-0xffff"
msgstr ""

#: shared-bindings/_bleio/UUID.c
msgid "UUID string not 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'"
msgstr ""
Expand Down Expand Up @@ -3393,10 +3386,6 @@ msgstr ""
msgid "initial values must be iterable"
msgstr ""

#: shared-bindings/_bleio/Characteristic.c shared-bindings/_bleio/Descriptor.c
msgid "initial_value length is wrong"
msgstr ""

#: py/compile.c
msgid "inline assembler must be a function"
msgstr ""
Expand Down Expand Up @@ -3808,7 +3797,6 @@ msgid "non-hex digit"
msgstr ""

#: ports/nordic/common-hal/_bleio/Adapter.c
#: ports/zephyr-cp/common-hal/_bleio/Adapter.c
msgid "non-zero timeout must be > 0.01"
msgstr ""

Expand Down Expand Up @@ -4292,7 +4280,6 @@ msgid "timeout duration exceeded the maximum supported value"
msgstr ""

#: ports/nordic/common-hal/_bleio/Adapter.c
#: ports/zephyr-cp/common-hal/_bleio/Adapter.c
msgid "timeout must be < 655.35 secs"
msgstr ""

Expand Down
1 change: 1 addition & 0 deletions ports/espressif/common-hal/_bleio/Connection.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ void bleio_connection_clear(bleio_connection_internal_t *self);

int bleio_connection_event_cb(struct ble_gap_event *event, void *connection_in);

void common_hal_bleio_check_connected(uint16_t conn_handle);
uint16_t bleio_connection_get_conn_handle(bleio_connection_obj_t *self);
mp_obj_t bleio_connection_new_from_internal(bleio_connection_internal_t *connection);
bleio_connection_internal_t *bleio_conn_handle_to_connection(uint16_t conn_handle);
9 changes: 9 additions & 0 deletions ports/nordic/common-hal/_bleio/Attribute.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,15 @@

#pragma once

#include <stdbool.h>

#include "py/obj.h"

#include "shared-module/_bleio/Attribute.h"

extern void bleio_attribute_gatts_set_security_mode(ble_gap_conn_sec_mode_t *perm, bleio_attribute_security_mode_t security_mode);

size_t common_hal_bleio_gatts_read(uint16_t handle, uint16_t conn_handle, uint8_t *buf, size_t len);
void common_hal_bleio_gatts_write(uint16_t handle, uint16_t conn_handle, mp_buffer_info_t *bufinfo);
size_t common_hal_bleio_gattc_read(uint16_t handle, uint16_t conn_handle, uint8_t *buf, size_t len);
void common_hal_bleio_gattc_write(uint16_t handle, uint16_t conn_handle, mp_buffer_info_t *bufinfo, bool write_no_response);
Comment thread
tannewt marked this conversation as resolved.
Outdated
1 change: 1 addition & 0 deletions ports/nordic/common-hal/_bleio/Connection.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ typedef struct {
void bleio_connection_clear(bleio_connection_internal_t *self);
bool connection_on_ble_evt(ble_evt_t *ble_evt, void *self_in);

void common_hal_bleio_check_connected(uint16_t conn_handle);
uint16_t bleio_connection_get_conn_handle(bleio_connection_obj_t *self);
mp_obj_t bleio_connection_new_from_internal(bleio_connection_internal_t *connection);
bleio_connection_internal_t *bleio_conn_handle_to_connection(uint16_t conn_handle);
1 change: 1 addition & 0 deletions ports/silabs/common-hal/_bleio/Connection.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ typedef struct

void bleio_connection_clear(bleio_connection_internal_t *self);

void common_hal_bleio_check_connected(uint16_t conn_handle);
uint16_t bleio_connection_get_conn_handle(bleio_connection_obj_t *self);

mp_obj_t bleio_connection_new_from_internal(
Expand Down
11 changes: 11 additions & 0 deletions ports/zephyr-cp/boards/nrf5340bsim_nrf5340_cpuapp.conf
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,20 @@ CONFIG_GPIO=y
# Enable Bluetooth stack - bsim is for BT simulation
CONFIG_BT=y
CONFIG_BT_HCI=y
CONFIG_BT_PERIPHERAL=y
CONFIG_BT_CENTRAL=y
CONFIG_BT_OBSERVER=y
CONFIG_BT_BROADCASTER=y

CONFIG_BT_L2CAP_TX_MTU=253
CONFIG_BT_BUF_CMD_TX_SIZE=255
CONFIG_BT_BUF_EVT_RX_COUNT=16
CONFIG_BT_BUF_EVT_RX_SIZE=255
CONFIG_BT_BUF_ACL_TX_COUNT=3
CONFIG_BT_BUF_ACL_TX_SIZE=251
CONFIG_BT_BUF_ACL_RX_COUNT_EXTRA=1
CONFIG_BT_BUF_ACL_RX_SIZE=255

CONFIG_BT_DEVICE_NAME_DYNAMIC=y
CONFIG_BT_DEVICE_NAME_MAX=28

Expand Down
Loading
Loading