Drivers Libraries Help > BM64 Bluetooth Driver Library > Library Interface > h) BLE Functions > DRV_BM64_ReadDataFromBLE Function
MPLAB Harmony Bluetooth Help
DRV_BM64_ReadDataFromBLE Function

Read data over BLE.

Description

Function DRV_BM64_ReadDataFromBLE: 

bool DRV_BM64_ReadDataFromBLE(const DRV_HANDLE handle, uint8_t* bytes, uint16_t size ); 

Read data over BLE using the BM64's "Transparent Service" feature.

Preconditions

DRV_BM64_Open must have been called to obtain a valid opened device handle.

Parameters
Parameters 
Description 
handle 
valid handle to an opened BM64 device driver unique to client 
bytes 
pointer to a uint8_t buffer at least size bytes long 
size 
length of buffer (including 
Returns

bool - true if data was returned, false if receive buffer empty

Example
#define BUFSIZE  100
uint8_t buf [BUFSIZE];

// note generic version of call (DRV_BT instead of DRV_BM64) is used
if (DRV_BT_ReadDataFromBLE(appData.bt.handle, buf, BUFSIZE))  // if data received
{
    // do something
} 
C
bool DRV_BM64_ReadDataFromBLE(
    const DRV_HANDLE handle, 
    uint8_t* byte, 
    uint16_t size
);