This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
You have encountered an unfortunate hole in thie Driver API as this function is not implemented as you saw.
Taking a quick look at the Z-Stack-v2.1.0, which is really geared at integrating the Z-Stack on the MSP430 processor family, the implementation of this API is as follows.
/**************************************************************************************************
* @fn HalUARTIoctl()
*
* @brief This function is used to get/set a control
*
* @param port - UART port
* cmd - Command
* pIoctl - control
*
* @return none
***************************************************************************************************/
uint8 HalUARTIoctl ( uint8 port, uint8 cmd, halUARTIoctl_t *pIoctl )
{
return HAL_UART_SUCCESS;
}
Basically a shell function at this point.
errata corrige
I think this seems appropriate. Reviewing the implementation of the HalUARTRead() function indicates that it will not return "more" data than the Rx buffer has in it. Even if you specify a length, using your example rxBufLen, which is greater than the actual number of bytes in the Rx buffer, the HalUARTRead() function will return only the number of bytes that were in the buffer.
Hi
I have issue regarding code that when i send some real time data it transmit accurately. when i add new data then it over write the previously written data from left and if written data less that previously send data then it transmit new data with the previous data . I tried the UARTflush code but it does not resolve my issue .I am using cc2530 to send real time data between router and coordinator . can any one help me in this regards
HalUARTRead(0, TxBuf, 12);
uint16 HalUARTWrite(uint8 port, uint8 *buf, uint16 len);
void flushUART (uint8 port)
{
uint16 bytesRead;
/* Dummy buffer declaration */
char rxbuf[100];
/* Read the number of bytes in Rx buffer */
uint16 rxBufLen = Hal_UART_RxBufLen(port);
/* Prevent dummy buffer overflow */
if (rxBufLen > 100)
rxBufLen = 100;
/* Read all the data of Rx buffer to flush it */
bytesRead = HalUARTRead( port, rxbuf, rxBufLen );
}
these codes i use in coding .i never use mt commands because of no devices found error . i do coding in generic app .c by adding HAL UART functions