You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Header files should have CPP header guards so functions can be called from CPP - mongoose_glue.h specifically should have this
Maybe mongoose_config.h should specify a value for MG_ENABLE_POSIX_FS now that it is used in the user code?
In mongoose_glue.c, glue_file_open_xxx() wraps fopen() with #if MG_ENABLE_POSIX_FS, but glue_file_write_xxx() and glue_file_close_xxx() do not wrap the posix calls. This should be consistent. eg
mongoose_glue.c should use explicit casts to cast pointers to permit unmodified compilation as cpp if required (eg. if hal.h or equivalent uses cpp functionality such as classes).
Noted in glue_file_open_xxx(), glue_file_write_xxx() and glue_file_close_xxx() casting fp(void*) to (FILE*)
Possibly not an issue, but: When an ota variable is created in the wizard, the mg_ota_xxx() functions must be created for the project to compile. On the ESP32 platform (and possible others where MG_OTA_CUSTOM is set?) these functions do not exist. It would be a convenience if stubbed out copies of these functions were placed in main.c (or glue?) to allow the project to build. Alternatively, setting MG_OTA_NONE instead of MG_OTA_CUSTOM would achieve this and prevent the compilation failure, leaving it to the user to implement the mg_ota_xxx() functions.
In mongoose_impl.c, mqtt_event_handler() prints a closing message MG_DEBUG(("%lu Closing")); with no supplied parameter. This should have a parameter as follows: MG_DEBUG(("%lu Closing", c->id));
mg_ota functions: those are user-defined, and generated project must ensure that they exist. Either dummy, or built-in, or generated. In case of ESP32, mongoose_config should set #define MG_OTA MG_OTA_ESP32 - a mongoose built-in support.
"Generating (or subscribing to?) the mqtt rx" - cannot reproduce that. If I just enable MQTT in a default config, works fine (uses non-empty device_id expansion). If I use a non-existent variable, works too. Let me know the way to reproduce, please!
MG_ENABLE_POSIX_FS
now that it is used in the user code?glue_file_open_xxx()
wrapsfopen()
with#if MG_ENABLE_POSIX_FS
, butglue_file_write_xxx()
andglue_file_close_xxx()
do not wrap the posix calls. This should be consistent. egand
Noted in
glue_file_open_xxx()
,glue_file_write_xxx()
andglue_file_close_xxx()
castingfp
(void*)
to(FILE*)
mg_ota_xxx()
functions must be created for the project to compile. On the ESP32 platform (and possible others whereMG_OTA_CUSTOM
is set?) these functions do not exist. It would be a convenience if stubbed out copies of these functions were placed in main.c (or glue?) to allow the project to build. Alternatively, settingMG_OTA_NONE
instead ofMG_OTA_CUSTOM
would achieve this and prevent the compilation failure, leaving it to the user to implement themg_ota_xxx()
functions.mongoose_impl.c
,mqtt_event_handler()
prints a closing messageMG_DEBUG(("%lu Closing"));
with no supplied parameter. This should have a parameter as follows:MG_DEBUG(("%lu Closing", c->id));
The text was updated successfully, but these errors were encountered: