【單片機部分】
#include <stm32f10x.h>
#include "lwip/tcp.h"
#include "CAR527_main.h"
err_t CAR527_service(void *arg, struct tcp_pcb *newpcb, err_t err)
{
tcp_write(newpcb, "Hello World!", 12, NULL);
return ERR_OK;
}
void CAR527_main(void)
{
struct tcp_pcb *tpcb = tcp_new();
tcp_bind(tpcb, IP_ADDR_ANY, 8080);
tpcb = tcp_listen(tpcb);
tcp_accept(tpcb, CAR527_service);
}