Skip to content

Commit e3a1b89

Browse files
committed
fix firmata sketch issue
1 parent 267c1b2 commit e3a1b89

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

libraries/Bluefruit52Lib/keywords.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -423,6 +423,11 @@ BLE_PRPH_MAX_CONN LITERAL1
423423

424424
BLE_CONN_HANDLE_INVALID LITERAL1
425425

426+
BANDWIDTH_AUTO LITERAL1
427+
BANDWIDTH_LOW LITERAL1
428+
BANDWIDTH_NORMAL LITERAL1
429+
BANDWIDTH_HIGH LITERAL1
430+
BANDWIDTH_MAX LITERAL1
426431

427432
#######################################
428433
# Characteristic Constants (LITERAL1)

libraries/Bluefruit52Lib/src/BLEGap.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,14 @@ BLEGap::BLEGap(void)
4040
{
4141
memclr(_peers, sizeof(_peers));
4242

43-
#if SD_VER >= 500
4443
_cfg_prph.mtu_max = BLE_GATT_ATT_MTU_DEFAULT;
44+
_cfg_central.mtu_max = BLE_GATT_ATT_MTU_DEFAULT;
45+
46+
#if SD_VER >= 500
4547
_cfg_prph.event_len = BLE_GAP_EVENT_LENGTH_DEFAULT;
4648
_cfg_prph.hvn_tx_qsize = BLE_GATTS_HVN_TX_QUEUE_SIZE_DEFAULT;
4749
_cfg_prph.wr_cmd_qsize = BLE_GATTC_WRITE_CMD_TX_QUEUE_SIZE_DEFAULT;
4850

49-
_cfg_central.mtu_max = BLE_GATT_ATT_MTU_DEFAULT;
5051
_cfg_central.event_len = BLE_GAP_EVENT_LENGTH_DEFAULT;
5152
_cfg_central.hvn_tx_qsize = BLE_GATTS_HVN_TX_QUEUE_SIZE_DEFAULT;
5253
_cfg_central.wr_cmd_qsize = BLE_GATTC_WRITE_CMD_TX_QUEUE_SIZE_DEFAULT;

libraries/Bluefruit52Lib/src/services/BLEUart.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ void BLEUart::_disconnect_cb(void)
219219

220220
void BLEUart::_connect_cb (void)
221221
{
222-
if ( _tx_buffered)
222+
if ( _tx_buffered )
223223
{
224224
// create TXD timer TODO take connInterval into account
225225
// ((5*ms2tick(Bluefruit.connInterval())) / 4) / 2
@@ -257,6 +257,9 @@ size_t BLEUart::write (const uint8_t *content, size_t len)
257257
return _txd.notify(content, len) ? len : 0;
258258
}else
259259
{
260+
// skip if not enabled
261+
if ( !notifyEnabled() ) return 0;
262+
260263
uint16_t written = _tx_fifo->write(content, len);
261264

262265
// TODO multiple prph connections

0 commit comments

Comments
 (0)