Other Parts Discussed in Thread: SYSCONFIG
Tool/software:
Hi,
Currently I am working on basic_ble Peripheral profile project.
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*)pData; uint16_t datalen = uartPacketSize; if (api_pkt_ptr->pkt_len == datalen) { UART2_write(uart,pData,uartPacketSize,0); } else UART2_write(uart,"Receive data not maching",24,0); memset(&uartReadBuffertemp[0], 0, sizeof(UART_MAX_READ_SIZE)); UART2_read(uart, uartReadBuffer, UART_MAX_READ_SIZE, 0); }
I am sending an payload which contains First byte is an length of the payload and remaining bytes is an data.
While sending data in a interval of 300ms continuously on UART and sent data printing on UART as expected, but when sending data in a interval of 100ms continuously on UART pData length (api_pkt_ptr->pkt_len) and uartPacketSize is not matching.
SDK Version : simplelink_lowpower_f3_sdk_8_10_01_02 (peripheral)
CCS version: CCS 12.7.1
regards,
Vignesh.