Get own IP address #2869
-
Is there a way for the main program to obtain it own IP address of a server running in Mongoose? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Please see our documentation, and follow the guidelines in our tutorials. mongoose/examples/stm32/nucleo-h723zg-make-baremetal-builtin/main.c Lines 84 to 93 in 9729693 If using auto-init code (Wizard): Lines 39 to 53 in 9729693 then redefine macro above as you wish or cast mgr->priv->ip appropriately. e.g.:Lines 1124 to 1125 in 9729693 Lines 888 to 900 in 9729693 |
Beta Was this translation helpful? Give feedback.
-
OK, so I added this: uint32_t mongoose_get_ip(){
struct mg_tcpip_if *ifp = (struct mg_tcpip_if *) g_mgr.priv;
return ifp->ip;
} in mongoose_impl.c (one of the files generated by the wizard), and it works. Thanks! |
Beta Was this translation helpful? Give feedback.
Please see our documentation, and follow the guidelines in our tutorials.
mongoose/examples/stm32/nucleo-h723zg-make-baremetal-builtin/main.c
Lines 84 to 93 in 9729693
If using auto-init code…