Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
12 changes: 8 additions & 4 deletions src/utility/HCI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -663,10 +663,14 @@ int HCIClass::sendAclPkt(uint16_t handle, uint8_t cid, uint8_t plen, void* data)
Serial.println(".");
#endif

_pendingPkt++;
HCITransport.write(txBuffer, sizeof(aclHdr) + plen);

return 0;
size_t written = HCITransport.write(txBuffer, sizeof(aclHdr) + plen);
if (written > 0) {
_pendingPkt++;
return 0;
} else {
printf("!!!!!!!!!!!! HCI TRANSPORT WRITE FAILED\n");
return -1;
}
}

int HCIClass::disconnect(uint16_t handle)
Expand Down
7 changes: 7 additions & 0 deletions src/utility/HCISharedMemTransport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -516,6 +516,13 @@ int HCISharedMemTransportClass::read()
_read_index++;
if (_read_index == _write_index) {
/* Reset buffer index */
#if defined(MONITOR_BT_RX_BUFFER)
static uint16_t max_write_index = 0;
if (_write_index > max_write_index) {
max_write_index = _write_index;
printf("!!!!!!!!!!!! NEW BUFFER HIGH WATERMARK: %d bytes (max=%d)\n", max_write_index, BLE_MODULE_SHARED_MEM_BUFFER_SIZE);
}
#endif /*(MONITOR_BT_RX_BUFFER)*/
_read_index = 0;
_write_index = 0;
}
Expand Down
4 changes: 3 additions & 1 deletion src/utility/STM32_WPAN/app_conf_default.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@
#ifndef BLE_SHARED_MEM_BYTE_ORDER
#define BLE_SHARED_MEM_BYTE_ORDER MSBFIRST
#endif
#define BLE_MODULE_SHARED_MEM_BUFFER_SIZE 128
#ifndef BLE_MODULE_SHARED_MEM_BUFFER_SIZE
#define BLE_MODULE_SHARED_MEM_BUFFER_SIZE 128
#endif

/**
* Define Tx Power
Expand Down
Loading