As general introduction on thread https://community.freescale.com/docs/DOC-328302 , I did a smart LED application with GoKit and FRDM-KL02.
In this design, FRDM-KL02 will communicate with GoKit by WIFI, and control LED flash.
Code Basic Introduction
In this project structure, you need to do following items on code.
- ü Add your functions, such as UART, LED, motor driver code.
- ü Add function running functions in protocol.c
- ü Add functions order in main loop.
You can find my main.c and protocol.c as attachment.
In this document, I would like to detail introduce function MessageHandle()，
pro_headPart tmp_headPart; //Common command package
memset(&tmp_headPart, 0, sizeof(pro_headPart));
get_one_package = 0;
memcpy(&tmp_headPart, uart_buf, sizeof(pro_headPart));
//CRC error, send back error command
if(CheckSum(uart_buf, uart_Count) != uart_buf[uart_Count-1])
So, you can see that only get_one_package=1, we can receive frame completely.
After that, you can do operations mentioned in thread https://community.freescale.com/docs/DOC-328302. You can see smart LED device and been found.
Original Attachment has been moved to: protocol.c.zip
Original Attachment has been moved to: platinum.c.zip
Original Attachment has been moved to: protocol.h.zip