Code: Alles auswählen
h2pas -p -T -d -c -e udp.h
at line 55 error : syntax error
at line 57 error : syntax error
at line 58 error : syntax error
at line 59 error : syntax error
at line 60 error : syntax error
at line 66 error : syntax error
at line 93 error : syntax error
at line 123 error : syntax error
at line 124 error : syntax error
at line 126 error : syntax error
at line 128 error : syntax error
at line 129 error : syntax error
at line 131 error : syntax error
at line 134 error : syntax error
at line 136 error : syntax error
at line 137 error : syntax error
at line 143 error : syntax error
at line 146 error : syntax error
at line 148 error : syntax error
at line 155 error : syntax error
at line 157 error : syntax error
at line 165 error : syntax error
at line 167 error : syntax error
Diese befinden sich in diesem Block:
Code: Alles auswählen
PACK_STRUCT_BEGIN
struct udp_hdr {
PACK_STRUCT_FIELD(u16_t src);
PACK_STRUCT_FIELD(u16_t dest); /* src/dest UDP ports */
PACK_STRUCT_FIELD(u16_t len);
PACK_STRUCT_FIELD(u16_t chksum);
} PACK_STRUCT_STRUCT;
PACK_STRUCT_ENDAlso schaut man was machen diese Makros:
Code: Alles auswählen
#ifndef PACK_STRUCT_BEGIN
#define PACK_STRUCT_BEGIN
#endif /* PACK_STRUCT_BEGIN */
#ifndef PACK_STRUCT_END
#define PACK_STRUCT_END
#endif /* PACK_STRUCT_END */
#ifndef PACK_STRUCT_FIELD
#define PACK_STRUCT_FIELD(x) x
#endif /* PACK_STRUCT_FIELD */Dann sehen die Zeilen so aus.
Code: Alles auswählen
struct udp_hdr {
u16_t src;
u16_t dest; /* src/dest UDP ports */
u16_t len;
u16_t chksum;
} ;Code: Alles auswählen
h2pas -p -T -d -c -e udp.h
at line 93 error : syntax error
at line 123 error : syntax error
.....
Code: Alles auswählen
struct udp_pcb {
/* Common members of all PCB types */
IP_PCB;
/* Protocol specific PCB members */
struct udp_pcb *next;
Code: Alles auswählen
#if LWIP_NETIF_HWADDRHINT
#define IP_PCB_ADDRHINT ;u8_t addr_hint
#else
#define IP_PCB_ADDRHINT
#endif /* LWIP_NETIF_HWADDRHINT */
/* This is the common part of all PCB types. It needs to be at the
beginning of a PCB type definition. It is located here so that
changes to this common part are made in one location instead of
having to change all PCB structs. */
#define IP_PCB \
/* ip addresses in network byte order */ \
ip_addr_t local_ip; \
ip_addr_t remote_ip; \
/* Socket options */ \
u8_t so_options; \
/* Type Of Service */ \
u8_t tos; \
/* Time To Live */ \
u8_t ttl \
/* link layer address resolution hint */ \
IP_PCB_ADDRHINT
Ich habe jetzt weiter unten geguckt, da scheint es, wie es nur einen Pointer auf "udp_pcb" braucht.
Je nachdem wie das ganze aufgebaut ist, reicht es PAscal Seitig nur einen Pointer zu definieren. dies sieht dann so aus:
Code: Alles auswählen
type
Pudp_pcb = type Pointer;Die scheint bei deinem Code auch der Fall zu sein, man beachte den * bei udp_pcb.
Code: Alles auswählen
extern struct udp_pcb *udp_pcbs;
/* The following functions is the application layer interface to the
UDP code. */
struct udp_pcb * udp_new (void)ICACHE_FLASH_ATTR;
void udp_remove (struct udp_pcb *pcb)ICACHE_FLASH_ATTR;
err_t udp_bind (struct udp_pcb *pcb, ip_addr_t *ipaddr,
u16_t port)ICACHE_FLASH_ATTR;
err_t udp_connect (struct udp_pcb *pcb, ip_addr_t *ipaddr,
u16_t port)ICACHE_FLASH_ATTR;
void udp_disconnect (struct udp_pcb *pcb)ICACHE_FLASH_ATTR;
void udp_recv (struct udp_pcb *pcb, udp_recv_fn recv,
void *recv_arg)ICACHE_FLASH_ATTR;
err_t udp_sendto_if (struct udp_pcb *pcb, struct pbuf *p,
ip_addr_t *dst_ip, u16_t dst_port,
struct netif *netif)ICACHE_FLASH_ATTR;
err_t udp_sendto (struct udp_pcb *pcb, struct pbuf *p,
ip_addr_t *dst_ip, u16_t dst_port)ICACHE_FLASH_ATTR;
err_t udp_send (struct udp_pcb *pcb, struct pbuf *p)ICACHE_FLASH_ATTR;
#if LWIP_CHECKSUM_ON_COPY
err_t udp_sendto_if_chksum(struct udp_pcb *pcb, struct pbuf *p,
ip_addr_t *dst_ip, u16_t dst_port,
struct netif *netif, u8_t have_chksum,
u16_t chksum)ICACHE_FLASH_ATTR;
err_t udp_sendto_chksum(struct udp_pcb *pcb, struct pbuf *p,
ip_addr_t *dst_ip, u16_t dst_port,
u8_t have_chksum, u16_t chksum)ICACHE_FLASH_ATTR;
err_t udp_send_chksum(struct udp_pcb *pcb, struct pbuf *p,
u8_t have_chksum, u16_t chksum)ICACHE_FLASH_ATTR;
Sehe ich das richtig, die ganzen Header sind da, um mit dem PC mit ESP8266 zu kommunizieren ?