Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added methods for checking the FIFO buffer #20

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
26 changes: 26 additions & 0 deletions Adafruit_BLE.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -485,6 +485,32 @@ bool Adafruit_BLE::readNVM(uint16_t offset, int32_t* number)
return this->readNVM(offset, (uint8_t*)number, 4);
}

/******************************************************************************/
/*!
@brief Check the remaining space in the Rx Fifo buffer
@param
*/
/******************************************************************************/
uint16_t Adafruit_BLE::remainingFifoRxBuffer()
{
int32_t remainingBuffer = 0;
atcommandIntReply(F("AT+BLEUARTFIFO=RX"), &remainingBuffer);
return remainingBuffer;
}

/******************************************************************************/
/*!
@brief Check the remaining space in the Tx Fifo buffer
@param
*/
/******************************************************************************/
uint16_t Adafruit_BLE::remainingFifoTxBuffer()
{
int32_t remainingBuffer = 0;
atcommandIntReply(F("AT+BLEUARTFIFO=TX"), &remainingBuffer);
return remainingBuffer;
}

/******************************************************************************/
/*!
@brief Set handle for connect callback
Expand Down
2 changes: 2 additions & 0 deletions Adafruit_BLE.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@ class Adafruit_BLE : public Adafruit_ATParser
bool readNVM(uint16_t offset, char * str , uint16_t size);
bool readNVM(uint16_t offset, int32_t* number);

uint16_t remainingFifoRxBuffer();
uint16_t remainingFifoTxBuffer();

// No parameters
bool sendCommandCheckOK(const __FlashStringHelper *cmd) { return this->atcommand(cmd); }
Expand Down