Hi guys,
I'm using cc2530 Zigbee module and z-stack home automation 1.2.2a sample light code.
I'm trying to send/receive data to/from cc2530 module with UART I'm writing code but it's not working.
is there any doc or tutorial that help me do that?
or tell me where is the problem in my code?
here is my code:
void uart_send_data ()
{
uint8 *msg_ptr = 0;
uint8 len = 6;
uint16 buff = 0;
halUARTCfg_t uartConfig;
uartConfig.configured = TRUE;
uartConfig.baudRate = HAL_UART_BR_9600;
uartConfig.flowControl = HAL_UART_FLOW_OFF;
uartConfig.flowControlThreshold = 128;
uartConfig.rx.maxBufSize = 128;
uartConfig.tx.maxBufSize = 128;
uartConfig.idleTimeout = 6;
uartConfig.intEnable = TRUE;
uartConfig.callBackFunc = NULL;
HalUARTInit();
HalUARTOpen (HAL_UART_PORT_0, &uartConfig);
HalUARTRead (HAL_UART_PORT_0, msg_ptr, len);
buff = Hal_UART_RxBufLen (HAL_UART_PORT_0);
HalUARTWrite ( HAL_UART_PORT_0, msg_ptr, len);
}