Move SubeMX pack creation

This commit is contained in:
cpq committed 2026-04-22 14:07:55 +01:00
1 parent 402096798a
commit d1f312236a
7 files changed
+111

No files matched your search

+3
View File
@@ -3411,6 +3411,9 @@ static inline void mg_dash_ev_handler(struct mg_connection *c, int ev,
}
}
}
extern void mongoose_init(void);
extern void mongoose_poll(void);
// Copyright (c) 2023 Cesanta Software Limited
// All rights reserved
@@ -0,0 +1,35 @@
// SPDX-FileCopyrightText: 2026 Cesanta Software Limited
// SPDX-License-Identifier: GPL-2.0-only or commercial
//
// See guides:
// https://mongoose.ws/docs/guides/web-dashboard-guide/ - device dashboard
#include "mongoose.h"
#if MG_ARCH == MG_ARCH_UNIX || MG_ARCH == MG_ARCH_WIN32
#define HTTP_ADDR "http://0.0.0.0:8000"
#else
#define HTTP_ADDR "http://0.0.0.0:80"
#endif
static struct mg_mgr s_mgr;
// Connection event handler function
static void http_ev_handler(struct mg_connection *c, int ev, void *ev_data) {
if (ev == MG_EV_HTTP_MSG) { // New HTTP request received
struct mg_http_message *hm = (struct mg_http_message *) ev_data;
if (mg_match(hm->uri, mg_str("/api/hello"), NULL)) {
mg_http_reply(c, 200, "", "{%m:%d}\n", MG_ESC("status"), 1);
} else {
mg_http_reply(c, 200, "", "Hello from Mongoose %s\n", MG_VERSION);
}
}
}
void mongoose_init(void) {
mg_mgr_init(&s_mgr);
mg_http_listen(&s_mgr, HTTP_ADDR, http_ev_handler, NULL);
}
void mongoose_poll(void) {
mg_mgr_poll(&s_mgr, 1);
}
@@ -0,0 +1,6 @@
// Mongoose configuration file. For full list of build options, see
// https://mongoose.ws/docs/getting-started/build-options/
#pragma once
#define MG_ARCH MG_ARCH_CUBE
@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<package schemaVersion="1.7.40" xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="PACK.xsd">
<vendor>Cesanta</vendor>
<name>I-CUBE-Mongoose</name>
<description>Mongoose - TCP/IP stack + TLS + HTTP + WebSocket + MQTT + Firmware OTA</description>
<url>https://mongoose.ws/</url>
<license>License.txt</license>
<supportContact>https://mongoose.ws/contact/</supportContact>
<releases>
<release date="2026-04-22" version="7.21.1">See https://github.com/cesanta/mongoose/releases/tag/7.21</release>
<release date="2026-04-08" version="7.21.0">See https://github.com/cesanta/mongoose/releases/tag/7.21</release>
<release date="2024-03-01" version="7.13.0">See https://github.com/cesanta/mongoose/releases/tag/7.13</release>
</releases>
<keywords>
<keyword>CUBE_RULES_COMPLIANT</keyword>
<keyword>IMPLEMENTED_WITH_STM32CUBEMX</keyword>
</keywords>
<taxonomy>
<description Cclass="Network" Cgroup="Mongoose">
Mongoose - TCP/IP stack + TLS + HTTP + WebSocket + MQTT + Firmware OTA
</description>
</taxonomy>
<components>
<component Cclass="Network" Cgroup="Mongoose" Cversion="7.21.1" maxInstances="1">
<description>Mongoose - TCP/IP stack + TLS + HTTP + WebSocket + MQTT + Firmware OTA</description>
<files>
<file category="header" name="Mongoose/mongoose.h" />
<file category="sourceC" name="Mongoose/mongoose.c" />
<file category="sourceC" name="App/mongoose_app.c" attr="config" version="7.21.1" />
<file category="header" name="App/mongoose_config.h" attr="config" version="7.21.1" />
</files>
</component>
</components>
</package>
+25
View File
@@ -0,0 +1,25 @@
VERSION = 7.21.1
PACKPATH = Mongoose
FILES = $(PACKPATH) App Cesanta.I-CUBE-Mongoose.pdsc License.txt Release_Notes.html
all: Cesanta.I-CUBE-Mongoose.$(VERSION).pack
Cesanta.I-CUBE-Mongoose.$(VERSION).pack: $(FILES) $(PACKPATH)/mongoose.h $(PACKPATH)/mongoose.c
zip -r $@ $^
# Get packchk from https://github.com/Open-CMSIS-Pack/cmsis-toolbox
check: Cesanta.I-CUBE-Mongoose.$(VERSION).pack
grep $(VERSION) Cesanta.I-CUBE-Mongoose.pdsc || exit 1
packchk Cesanta.I-CUBE-Mongoose.pdsc
License.txt:
cp ../../LICENSE $@
$(PACKPATH):
mkdir -p $(PACKPATH)
$(PACKPATH)/mongoose.h: $(PACKPATH)
cp ../../mongoose.h $@
$(PACKPATH)/mongoose.c: $(PACKPATH)
cp ../../mongoose.c $@
clean:
rm -rf *.pack License.txt $(PACKPATH)
@@ -0,0 +1,5 @@
<head>
<meta http-equiv="Refresh" content="0;url=https://github.com/cesanta/mongoose/releases">
</head>
<body>
</body>
+3
View File
@@ -266,3 +266,6 @@ static inline void mg_dash_ev_handler(struct mg_connection *c, int ev,
}
}
}
extern void mongoose_init(void);
extern void mongoose_poll(void);