rename BLE_GATT_ATT_MTU_DEFAULT

This commit is contained in:
hathach committed 2017-10-05 16:05:35 +07:00
1 parent ed3776ee31
commit 9421a43b80
7 files changed
+15 -9

No files matched your search

+1 -1
View File
@@ -64,7 +64,7 @@ OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#if defined(_WIN32)
/* Do not include nrf specific files when building for PC host */
#elif defined(__unix)
//#elif defined(__unix)
/* Do not include nrf specific files when building for PC host */
#elif defined(__APPLE__)
/* Do not include nrf specific files when building for PC host */
@@ -56,6 +56,9 @@ extern "C" {
/** @brief Default MTU size. */
#define GATT_MTU_SIZE_DEFAULT 23
// Adafruit: make compatible with S132 5.0.0
#define BLE_GATT_ATT_MTU_DEFAULT 23
/** @brief Only the default MTU size of 23 is currently supported. */
#define GATT_RX_MTU 23
+1 -1
View File
@@ -114,7 +114,7 @@ bool BLEGap::getTxPacket(uint16_t conn_handle)
uint16_t BLEGap::getMTU (uint16_t conn_handle)
{
return GATT_MTU_SIZE_DEFAULT - 3;
return BLE_GATT_ATT_MTU_DEFAULT;
}
uint16_t BLEGap::getPeerName(uint16_t conn_handle, char* buf, uint16_t bufsize)
+1 -1
View File
@@ -50,7 +50,7 @@ class BLEGap
uint8_t getAddr(uint8_t mac[6]);
bool setAddr(uint8_t mac[6], uint8_t type);
// bool setPrivacy()
// bool setPrivacy(); sd_ble_gap_privacy_set()
bool connected(uint16_t conn_handle);
+7 -4
View File
@@ -508,8 +508,6 @@ void adafruit_ble_task(void* arg)
{
(void) arg;
enum { BLE_STACK_EVT_MSG_BUF_SIZE = (sizeof(ble_evt_t) + (GATT_MTU_SIZE_DEFAULT)) };
while (1)
{
if ( xSemaphoreTake(Bluefruit._ble_event_sem, portMAX_DELAY) )
@@ -519,11 +517,16 @@ void adafruit_ble_task(void* arg)
// Until no pending events
while( NRF_ERROR_NOT_FOUND != err )
{
uint32_t ev_buf[BLE_STACK_EVT_MSG_BUF_SIZE/4 + 1];
#if SD_VER < 500
__ALIGN(4) uint8_t ev_buf[ sizeof(ble_evt_t) + (BLE_GATT_ATT_MTU_DEFAULT) ];
#else
__ALIGN(4) uint8_t ev_buf[ BLE_EVT_LEN_MAX(BLE_GATT_ATT_MTU_DEFAULT) ];
#endif
uint16_t ev_len = sizeof(ev_buf);
// Get BLE Event
err = sd_ble_evt_get((uint8_t*)ev_buf, &ev_len);
err = sd_ble_evt_get(ev_buf, &ev_len);
// Handle valid event, ignore error
if( ERROR_NONE == err)
+1 -1
View File
@@ -83,7 +83,7 @@
#include "utility/AdaCallback.h"
#define BLE_MAX_DATA_PER_MTU (GATT_MTU_SIZE_DEFAULT - 3)
#define BLE_MAX_DATA_PER_MTU (BLE_GATT_ATT_MTU_DEFAULT - 3)
extern "C"
{
@@ -37,7 +37,7 @@
#include "bluefruit.h"
#include "utility/TimeoutTimer.h"
#define TXD_FIFO_SIZE (GATT_MTU_SIZE_DEFAULT-3)
#define TXD_FIFO_SIZE (BLE_GATT_ATT_MTU_DEFAULT-3)
/* UART Serivce: 6E400001-B5A3-F393-E0A9-E50E24DCCA9E
* UART RXD : 6E400002-B5A3-F393-E0A9-E50E24DCCA9E