Merge pull request #2531 from cesanta/mqttrndis

Add MQTT device through RNDIS example
This commit is contained in:
Sergio R. Caprile authored and GitHub committed 2023-12-15 13:39:21 -03:00
commit cd021daf79
17 files changed
+471 -22

No files matched your search

+4 -1
View File
@@ -450,7 +450,10 @@ static void rx_dhcp_server(struct mg_tcpip_if *ifp, struct pkt *pkt) {
memcpy(&res.options, opts, sizeof(opts));
res.magic = pkt->dhcp->magic;
res.xid = pkt->dhcp->xid;
// memcpy(ifp->gwmac, pkt->eth->src, sizeof(ifp->gwmac));
if (ifp->enable_get_gateway) {
ifp->gw = res.yiaddr;
memcpy(ifp->gwmac, pkt->eth->src, sizeof(ifp->gwmac));
}
tx_udp(ifp, pkt->eth->src, ifp->ip, mg_htons(67),
op == 1 ? ~0U : res.yiaddr, mg_htons(68), &res, sizeof(res));
}
+1
View File
@@ -21,6 +21,7 @@ struct mg_tcpip_if {
struct mg_str tx; // Output (TX) buffer
bool enable_dhcp_client; // Enable DCHP client
bool enable_dhcp_server; // Enable DCHP server
bool enable_get_gateway; // DCHP server sets client as gateway
bool enable_crc32_check; // Do a CRC check on RX frames and strip it
bool enable_mac_check; // Do a MAC check on RX frames
struct mg_tcpip_driver *driver; // Low level driver