Tool/software:
Hi,
Currently I am working on example basic_ble peripheral profile project.
#define UART_MAX_READ_SIZE 248 //MTU exchange value
uint8_t uartReadBuffer[UART_MAX_READ_SIZE];
void UART_Init()
{
/* Create a UART in CALLBACK read mode */
UART2_Params_init(&uartParams);
uartParams.readMode = UART2_Mode_CALLBACK;
uartParams.readCallback = UARTCallback;
uartParams.readReturnMode = UART2_ReadReturnMode_PARTIAL;
uartParams.baudRate = 115200;
uartParams.eventCallback = UARTEventCallback;
uartParams.eventMask = UART2_EVENT_OVERRUN;
uart = UART2_open(CONFIG_UART2_0, &uartParams);
if (uart == NULL)
{
/* UART2_open() failed */
while (1)
{
}
}
// Setup an initial read
UART2_read(uart, &uartReadBuffer, UART_MAX_READ_SIZE, 0);
}
void UARTCallback(UART2_Handle handle, void *buffer, size_t count, void *userArg, int_fast16_t status)
{
uartPacketSize = count;
BLEAppUtil_invokeFunction(HandlingFunction,buffer);
}
typedef struct
{
uint8_t pkt_len;
uint8_t *data;
}api_data;
void HandlingFunction(char *pData)
{
api_data *api_pkt_ptr = (api_data*)uartReadBuffer;
uint16_t datalen = uartPacketSize;
SimpleGattProfile_setParameter(SIMPLEGATTPROFILE_CHAR4, RemainDataLen,&uartReadBuffer[datalen]);
memset(&uartReadBuffer[0], 0, sizeof(UART_MAX_READ_SIZE));
UART2_read(uart, uartReadBuffer, UART_MAX_READ_SIZE, 0);
}
while sending 248 bytes from module to mobile, data receiving in mobile in single chunks 248(MTU exchanged value).If I send 250 bytes from module to mobile, data receiving in mobile 248 bytes in a single chunks 248(MTU exchanged value) those remaining 2 bytes will not receive. Those 2 bytes will receive on next packet send. Where the UART read callback is not occurring for those 2 bytes.
Upto 16 bytes UART read callback is not occurring.If more than 16 bytes callback is occuring.
SDK Version : simplelink_lowpower_f3_sdk_8_10_01_02 (peripheral)
CCS version: CCS 12.7.1
Thanks,
Vignesh.