Compare commits

...
1510 Commits
Author SHA1 Message Date
Sergio R. Caprile 6bb40e6ec9 update version 2024-05-20 11:21:09 -03:00
Sergio R. Caprile 94efcc83a1 update version 2024-05-20 10:54:40 -03:00
Sergey Lyubka 03402cf359 Add pack.js 2024-05-19 15:45:03 +01:00
Sergey Lyubka a473cf99b5 More complete MQTT example 2024-05-18 12:09:59 +01:00
Sergio R. Caprile c26bd2ffe8 Merge pull request #2757 from cesanta/wolf
fix WolfSSL
2024-05-17 18:11:30 -03:00
Sergio R. Caprile 9dc3d09981 fix WolfSSL 2024-05-17 17:54:52 -03:00
Sergio R. Caprile 76b4c9a6ff Merge pull request #2756 from cesanta/silwf
momentarily silence WolfSSL tests
2024-05-16 15:18:55 -03:00
Sergio R. Caprile 41add69294 momentarily silence WolfSSL tests 2024-05-16 15:17:19 -03:00
Sergio R. Caprile c911c9ad19 Merge pull request #2752 from cesanta/strip
add mg_str_to_num
2024-05-16 10:58:54 -03:00
Sergio R. Caprile dd883c0563 Merge pull request #2755 from cesanta/mbed
unbreak MbedTLS in Linux
2024-05-16 10:09:59 -03:00
Sergio R. Caprile 16a0c89d5f unbreak MbedTLS in Linux 2024-05-16 09:55:01 -03:00
Sergey Lyubka ac0e6f3377 Squash warnings on gcc 9.4 2024-05-16 11:13:21 +01:00
Sergey Lyubka 68f7be7a1a Merge pull request #2745 from cesanta/tls
Fix mbedTLS binding for 3.x
2024-05-16 10:45:46 +01:00
Sergey Lyubka b796e33ede Fix mbedTLS binding for 3.x 2024-05-16 10:45:11 +01:00
Sergey Lyubka 1051ba77c0 Merge pull request #2753 from julek-wolfssl/wolfssl
Add wolfSSL support
2024-05-16 10:18:38 +01:00
Juliusz Sosinowicz cb5b6b972a Turn off hanging test
Signed-off-by: Juliusz Sosinowicz <juliusz@wolfssl.com>
2024-05-16 10:37:31 +02:00
Juliusz Sosinowicz 925f21aca4 Update nightly
Signed-off-by: Juliusz Sosinowicz <juliusz@wolfssl.com>
2024-05-16 10:37:31 +02:00
Juliusz Sosinowicz dc09851ac8 Add wolfSSL support
- Added Makefile wolfSSL build option with `SSL=WOLFSSL`
- Fixed missing BIO symbol errors
- Rename `fe` to `mg_fe` as it collides with `fe` defined in `wolfssl/wolfcrypt/fe_operations.h`
- byte variable name shadows the wolfSSL byte type

Tested with `make test`

Signed-off-by: Juliusz Sosinowicz <juliusz@wolfssl.com>
2024-05-16 10:37:31 +02:00
Sergey Lyubka 323ba9d90c Merge pull request #2754 from cesanta/s390
Fix endianness issues in X25519 code
2024-05-15 22:01:53 +01:00
Sergey Lyubka c6ff8ab6dc Fix endianness issues in X25519 code 2024-05-15 21:56:47 +01:00
Sergio R. Caprile b5443f10c5 add mg_str_to_num 2024-05-15 16:46:31 -03:00
Sergio R. Caprile 3ae1a0f82a Merge pull request #2750 from cesanta/gbephy
fix LAN87x
2024-05-13 16:29:17 -03:00
Sergio R. Caprile 81f0f8a7c2 fix LAN87x 2024-05-13 16:12:51 -03:00
Sergey Lyubka 50963df42f Update mongoose.c 2024-05-11 13:29:40 +01:00
Sergio R. Caprile b316989378 Merge pull request #2749 from cesanta/strip
silence fuzzer
2024-05-10 12:14:59 -03:00
Sergio R. Caprile 23c68e2677 silence fuzzer 2024-05-10 11:12:12 -03:00
Sergio R. Caprile b46bee0540 Merge pull request #2737 from cesanta/strip
cleanup 'str' API
2024-05-09 14:43:39 -03:00
Sergio R. Caprile 4c6c27d8f6 fix 573f13c 2024-05-09 14:38:57 -03:00
Sergio R. Caprile 3c531897b6 cleanup 'str' API 2024-05-09 14:10:27 -03:00
Sergio R. Caprile 6c7672f4af Merge pull request #2747 from cesanta/t2
Reduce stack usage in mg_tls_hexdump()
2024-05-09 11:54:55 -03:00
Sergey Lyubka 2def6e867d Reduce stack usage in mg_tls_hexdump() 2024-05-09 15:48:55 +01:00
Sergey Lyubka 573f13c1ed Add mg_now() 2024-05-08 14:23:17 +01:00
Sergey Lyubka b7f9e5c947 Fix path 2024-05-08 14:07:20 +01:00
Sergey Lyubka da85affe5c Refactor OTA API 2024-05-08 05:38:13 +01:00
Sergio R. Caprile 3168a2aca0 Merge pull request #2743 from cesanta/warn
Squash warning
2024-05-07 17:08:07 -03:00
Sergio R. Caprile 1f5feaa103 Merge pull request #2744 from cesanta/certs
regenerate certs
2024-05-07 15:13:07 -03:00
Sergio R. Caprile 4be3dfd52b Fix nomadic brew 2024-05-07 14:56:48 -03:00
Sergio R. Caprile 1e26983263 Merge pull request #2742 from cesanta/esp32ota
Add MG_OTA_ESP32
2024-05-07 14:31:14 -03:00
Sergey Lyubka a620419b59 Add MG_OTA_ESP32 2024-05-07 18:15:32 +01:00
Sergey Lyubka ffdc9b0d3a Squash warning 2024-05-07 15:41:09 +01:00
Sergey Lyubka 379e047289 regenerate certs 2024-05-07 15:40:13 +01:00
Sergio R. Caprile 8e420406b9 Merge pull request #2740 from cesanta/newskeleton
move to new skeleton
2024-05-01 15:19:08 -03:00
Sergio R. Caprile fc0364b321 move to new skeleton 2024-05-01 15:17:39 -03:00
Sergio R. Caprile ea4986dec5 Merge pull request #2739 from cesanta/newskeleton
move to new skeleton
2024-05-01 14:44:15 -03:00
Sergio R. Caprile 2be30a3193 move to new skeleton 2024-05-01 14:42:21 -03:00
Sergio R. Caprile 81f90c7b51 Merge pull request #2738 from cesanta/newskeleton
move to new skeleton
2024-05-01 14:19:16 -03:00
Sergio R. Caprile 205a564482 move to new skeleton 2024-05-01 14:16:43 -03:00
Sergio R. Caprile 497df68de1 Merge pull request #2735 from cesanta/newskeleton
move to new skeleton
2024-04-29 13:47:14 -03:00
Sergio R. Caprile eaf8e24d4c move to new skeleton 2024-04-29 13:45:20 -03:00
Sergio R. Caprile 1721fb0484 Merge pull request #2734 from cesanta/newskeleton
move to new skeleton
2024-04-29 11:26:00 -03:00
Sergio R. Caprile fe0b144b84 move to new skeleton 2024-04-29 11:23:00 -03:00
Sergio R. Caprile d391bca2d3 Merge pull request #2733 from cesanta/newskeleton
move to new skeleton
2024-04-29 11:02:31 -03:00
Sergio R. Caprile a0b6e70ff8 move to new skeleton 2024-04-29 10:58:43 -03:00
robert 4f15392440 Patched XMC7 eth 2024-04-29 07:18:52 -04:00
Sergey Lyubka 959fcfdf1d Fix paths 2024-04-28 13:26:53 +01:00
Sergio R. Caprile 57f90d200d Merge pull request #2731 from cesanta/newskeleton
move to new skeleton
2024-04-26 17:01:58 -03:00
Sergio R. Caprile 663c645cf1 move to new skeleton 2024-04-26 16:58:58 -03:00
Sergio R. Caprile 972b255a48 Merge pull request #2729 from cesanta/newskeleton
move to new skeleton
2024-04-26 13:47:39 -03:00
Sergio R. Caprile 8c5dfa4227 move to new skeleton 2024-04-26 13:46:18 -03:00
Sergio R. Caprile 290d48e1aa Merge pull request #2727 from cesanta/newskeleton
move to new skeleton
2024-04-25 17:09:13 -03:00
Sergio R. Caprile 4eb3a1c978 move to new skeleton 2024-04-25 16:54:28 -03:00
Sergio R. Caprile b4a36a8303 Merge pull request #2726 from cesanta/newskeleton
move to new skeleton
2024-04-25 15:21:35 -03:00
Sergio R. Caprile d08ee4e63a move to new skeleton 2024-04-25 15:18:59 -03:00
Sergio R. Caprile 42f5802e47 Merge pull request #2725 from cesanta/newskeleton
move to new skeleton
2024-04-25 14:46:57 -03:00
Sergio R. Caprile 120ffb0b1f move to new skeleton 2024-04-25 14:45:28 -03:00
Sergey Lyubka d3a3ba0a32 Linkify mongoose.{c,h} 2024-04-25 11:32:57 +01:00
Sergio R. Caprile 79eebc14bb Merge pull request #2723 from cesanta/newskeleton
move to new skeleton
2024-04-24 17:12:17 -03:00
Sergey Lyubka 6fc41e2a3c Merge pull request #2720 from cesanta/tlsblues
TLS corner cases
2024-04-24 20:44:57 +01:00
Sergio R. Caprile 4843323f87 move to new skeleton 2024-04-24 16:09:24 -03:00
Sergio R. Caprile 04c6f3e6ef Merge pull request #2722 from cesanta/newskeleton
start moving to new skeleton
2024-04-24 12:03:10 -03:00
Sergio R. Caprile 5345c7260e start moving to new skeleton 2024-04-24 11:57:53 -03:00
Sergio R. Caprile 71a48ccde0 Merge pull request #2721 from cesanta/leftovers
track recent changes
2024-04-23 16:31:30 -03:00
Sergio R. Caprile 41e24d7733 track recent changes 2024-04-23 15:12:40 -03:00
Sergio R. Caprile f888b30863 TLS corner cases 2024-04-23 11:24:47 -03:00
Sergey Lyubka 10029d6a8d Merge pull request #2718 from cesanta/pathissane
change mg_path_is_sane()
2024-04-22 20:58:02 +01:00
Sergio R. Caprile 6697a2cfaa change mg_path_is_sane() 2024-04-22 11:27:22 -03:00
Sergey Lyubka 59020e0d5d Merge pull request #2717 from cesanta/xmc7
XMC7 full working example
2024-04-22 09:42:42 +01:00
robert 70abd1f98d XMC7 full working example 2024-04-22 03:15:10 -04:00
Sergey Lyubka 312ca8e978 Tiny nit - fix dependencies 2024-04-20 18:24:41 +01:00
Sergey Lyubka e1ccdc0570 Merge pull request #2657 from cesanta/xmc-eth
Added ethernet driver for Infineon XMC4 boards
2024-04-20 14:58:12 +01:00
Sergey Lyubka c7f9fe4a03 Merge pull request #2714 from cesanta/Makefly
move Makefile to test/
2024-04-20 08:12:23 +01:00
Sergio R. Caprile 89aaf1c30c move Makefile to test/ 2024-04-19 18:53:25 -03:00
Sergio R. Caprile 601af780c9 Merge pull request #2713 from cesanta/nodetemb
move Mongoose options to mongoose_config
2024-04-19 10:50:05 -03:00
Sergio R. Caprile 93477c8db4 move Mongoose options to mongoose_config 2024-04-19 10:47:16 -03:00
Sergey Lyubka ec5531dbf4 Merge pull request #2711 from cesanta/nodetemb
remove arch autodetection for embedded
2024-04-19 06:04:27 +01:00
Sergio R. Caprile 157f87f01a remove arch autodetection for embedded 2024-04-18 17:28:40 -03:00
Sergio R. Caprile 0f4ca8d010 Merge pull request #2710 from cesanta/2650plus
fix fuzzer
2024-04-18 10:15:00 -03:00
Sergio R. Caprile 0a168b6791 fix fuzzer 2024-04-18 10:05:41 -03:00
Sergey Lyubka a025577b30 Merge pull request #2709 from cesanta/bye_http_match_uri
remove http_match_uri()
2024-04-17 21:52:54 +01:00
Sergio R. Caprile ef61d6ea48 remove http_match_uri() 2024-04-17 16:13:10 -03:00
Sergey Lyubka e6bf658271 Fix #2685 - squash warnings in tls_builtin 2024-04-17 07:32:51 +01:00
Sergio R. Caprile 9cccb9839b Merge pull request #2691 from cesanta/mqtt12
add simple API support for app MQTT pub retries
2024-04-16 19:18:11 -03:00
Sergio R. Caprile 2bd188f3d6 add simple API support for app MQTT pub retries 2024-04-16 19:17:37 -03:00
Sergio R. Caprile 9fa840c1c7 Merge pull request #2650 from cesanta/str
Fix #2612 - struct mg_str::ptr -> buf
2024-04-16 19:12:03 -03:00
Sergey Lyubka e0e599ffa1 Fix #2612 - struct mg_str::ptr -> buf 2024-04-16 22:42:45 +01:00
Sergey Lyubka e93d18d200 Merge pull request #2707 from cesanta/mgcfg
Rename mongoose_custom as mongoose_config
2024-04-16 22:07:13 +01:00
Sergio R. Caprile 34150f3f71 Rename mongoose_custom as mongoose_config 2024-04-16 17:28:31 -03:00
Sergio R. Caprile db6730c8a3 Merge pull request #2706 from cesanta/tlspoll
poll TLS to process outstanding data in receive buffer
2024-04-15 14:24:22 -03:00
Sergio R. Caprile 08cac802a4 poll TLS to process outstanding data in receive buffer 2024-04-15 12:13:31 -03:00
Sergio R. Caprile af6a52e060 Merge pull request #2704 from cesanta/gbephy
Add support for DP83867
2024-04-15 11:58:47 -03:00
Sergio R. Caprile 1c63645254 Add support for DP83867 2024-04-12 17:11:10 -03:00
Sergey Lyubka be5d8b1d4f Merge pull request #2702 from cesanta/zlw
Allow zero-length 'last-will' messages
2024-04-12 08:12:28 +01:00
Sergio R. Caprile 2ac3552e6e Allow zero-length 'last-will' messages 2024-04-11 11:20:46 -03:00
Sergio R. Caprile 3c3c775213 Merge pull request #2699 from cesanta/rewact
increase builtin TLS test coverage
2024-04-10 17:17:10 -03:00
Sergio R. Caprile a24b7043ed increase builtin TLS test coverage 2024-04-10 17:07:12 -03:00
Sergio R. Caprile 7b621d7b5b Merge pull request #2697 from cesanta/ft
update to MG_EV_HTTP_HDRS
2024-04-10 14:38:15 -03:00
Sergio R. Caprile 8a335a8cea update to MG_EV_HTTP_HDRS 2024-04-10 12:20:33 -03:00
Sergio R. Caprile 355c292dbf Merge pull request #2696 from cesanta/rewact
fix missing install
2024-04-09 11:00:13 -03:00
Sergio R. Caprile 2511d747ae fix missing install 2024-04-09 10:57:52 -03:00
Sergey Lyubka 03c326a04e Add driver init for IMXRT 2024-04-09 12:07:36 +02:00
Sergio R. Caprile b3312f3761 Merge pull request #2690 from cesanta/rewact
fix Valgrind dependencies
2024-04-05 15:59:14 -03:00
Sergio R. Caprile 2e250ee7aa fix Valgrind dependencies 2024-04-05 15:56:50 -03:00
Sergey Lyubka 924984dde1 Merge pull request #2682 from sasha0552/patch-1
fix typo
2024-04-05 10:17:56 +01:00
Sergio R. Caprile 33b7bb91d9 Merge pull request #2688 from cesanta/rewact
improve test coverage and run time
2024-04-04 17:21:49 -03:00
Sergio R. Caprile f68fe0fb5c improve test coverage and run time 2024-04-04 17:16:38 -03:00
Sergio R. Caprile e6663ec186 Merge pull request #2687 from cesanta/shh
Keepup with Zephyr project's enjoyment of changing headers
2024-04-04 12:55:01 -03:00
Sergio R. Caprile 6ff0f9ccd8 Keepup with Zephyr project's enjoyment of changing headers 2024-04-04 12:49:37 -03:00
sasha0552 48830aa9a9 fix typo 2024-04-03 22:14:47 +00:00
Sergio R. Caprile 9276f764e0 Merge pull request #2681 from cesanta/ub
keep embedded-friendly config API
2024-04-03 15:53:02 -03:00
Sergio R. Caprile 7876d464f2 keep embedded-friendly config API 2024-04-03 15:48:57 -03:00
Sergio R. Caprile 5d0d01c2c1 Merge pull request #2678 from cesanta/noscrsh
no screenshots
2024-04-02 18:12:31 -03:00
Sergio R. Caprile 393418d50d no screenshots 2024-04-02 18:11:11 -03:00
Sergio R. Caprile 23bb912eb5 Merge pull request #2677 from cesanta/noscrsh
no screenshots
closes #2611
2024-04-02 16:38:16 -03:00
Sergio R. Caprile 1d5b5296da no screenshots 2024-04-02 16:37:14 -03:00
Sergey Lyubka 655f5db996 Merge pull request #2675 from dvosully/esp32_device_dashboard_firmware_update
Implement firmware update in ESP32 device-dashboard example
2024-04-02 05:12:26 +01:00
dvosully c20cc4ae09 Implement firmware update in ESP32 device-dashboard example using espressif OTA APIs 2024-03-31 19:40:44 +10:00
Sergey Lyubka 7581229bbf Merge pull request #2669 from cesanta/tls
Squash warnings
2024-03-27 09:05:31 +00:00
Sergey Lyubka d094e090ff Squash warnings 2024-03-27 08:58:48 +00:00
robert c7a13025e4 Added ethernet driver for Infineon XMC4 boards 2024-03-26 10:21:09 -04:00
Sergey Lyubka e4cd6bd824 Cleanup debugging leftovers 2024-03-26 11:33:59 +00:00
Sergio R. Caprile f3ad0572e2 Merge pull request #2667 from cesanta/rewact
code .remove MbedTLS from essentials. Add tests in full
2024-03-25 18:36:53 -03:00
Sergio R. Caprile 406d6cc305 remove MbedTLS from essentials. Add tests in full 2024-03-25 18:35:46 -03:00
Sergio R. Caprile d042697b10 Merge pull request #2663 from cesanta/tls
TLS client implementation
2024-03-25 16:56:43 -03:00
Sergey Lyubka ba678b9ad1 TLS client implementation 2024-03-25 19:20:40 +00:00
Sergio R. Caprile 7a5cf118e9 Merge pull request #2666 from cesanta/ra
silence pedantic new versions
2024-03-25 10:43:37 -03:00
Sergio R. Caprile e9a2da61ef silence pedantic new versions 2024-03-25 10:35:30 -03:00
Sergio R. Caprile d3fe1ef681 Merge pull request #2665 from cesanta/rewact
add RA6 and RT1170 build tests
2024-03-25 09:48:49 -03:00
Sergio R. Caprile 9725bca966 add RA6 and RT1170 build tests 2024-03-25 09:47:27 -03:00
Sergio R. Caprile 1f627e4263 Merge pull request #2664 from cesanta/rewact
add RA6 and RT1170 build tests
2024-03-25 09:41:08 -03:00
Sergio R. Caprile 7ac0c5fc2a add RA6 and RT1170 build tests 2024-03-25 09:34:56 -03:00
Sergey Lyubka 091ebd8a98 Update readme 2024-03-25 08:52:59 +00:00
Sergey Lyubka d9a6e85b65 Merge pull request #2658 from cesanta/rt1170
RT1170
2024-03-23 05:33:46 +00:00
Sergio R. Caprile 7cc3d89980 Add RT1170 example 2024-03-22 13:44:01 -03:00
Sergio R. Caprile f58b90f7ea Merge pull request #2655 from cesanta/z
Zephyr fcntl
2024-03-21 14:03:03 -03:00
Sergio R. Caprile fd84109c1d Zephyr fcntl 2024-03-21 13:57:10 -03:00
Sergio R. Caprile 626f605835 Support RT11, fix RTL PHY, fix RA err cntr 2024-03-20 10:35:05 -03:00
Sergio R. Caprile 943a8a2708 fix references to RM 2024-03-20 10:35:05 -03:00
Sergio R. Caprile d7b2b3f42e Merge pull request #2648 from cesanta/autoinit
Refactor autoinit code
2024-03-17 14:22:25 -03:00
Sergey Lyubka fafc5c8348 Refactor autoinit code 2024-03-15 20:23:37 +00:00
Sergio R. Caprile 15bd8b4fe9 Merge pull request #2647 from cesanta/phy
Split PHY code into phy.{c,h}
2024-03-15 11:04:45 -03:00
Sergio R. Caprile 928aed4342 Split PHY code into phy.{c,h}; add PHY config to STM32H driver 2024-03-15 10:37:54 -03:00
Sergey Lyubka 98782e44c2 Nit changes to the fleet dashboard 2024-03-13 13:41:22 +00:00
Sergio R. Caprile 65b23777b2 Merge pull request #2642 from cesanta/autoinit
Add driver init to mg_mgr_init()
2024-03-12 20:36:59 -03:00
Sergio R. Caprile c8fd3d6d25 Add driver init to mg_mgr_init() 2024-03-12 15:55:35 -03:00
Sergey Lyubka 01e7cd5f13 Merge pull request #2646 from cesanta/tls
Fix #2619 - use mg_tls_pending() API to check for buffered TLS data
2024-03-12 08:49:32 +00:00
Sergey Lyubka 3ac9bd0468 Fix #2619 - use mg_tls_pending() API to check for buffered TLS data 2024-03-12 08:30:04 +00:00
Sergio R. Caprile 9f498d2eea Merge pull request #2645 from cesanta/mp
tie Micropython examples to a stable release
2024-03-11 11:09:39 -03:00
Sergio R. Caprile 2d2d9ad277 tie Micropython examples to a stable release 2024-03-11 11:07:18 -03:00
Sergey Lyubka 2cc18a8ea3 Snippets 2024-03-10 19:00:32 +00:00
Sergey Lyubka 25036d5f48 Link to mongoose.ws 2024-03-10 18:59:02 +00:00
Sergey Lyubka defee39ef9 Link to mongoose.ws 2024-03-10 18:58:14 +00:00
Sergey Lyubka c78afb12a3 Remove dead link 2024-03-10 18:53:02 +00:00
Sergey Lyubka f72b0b5056 Merge pull request #2632 from cesanta/reorg
Reorg skeleton
2024-03-09 16:04:35 +00:00
Sergey Lyubka d46e505a80 Reorg skeleton 2024-03-09 16:01:06 +00:00
Sergey Lyubka 4027bcf7ea Update readme 2024-03-09 10:29:14 +00:00
Sergey Lyubka 2905392665 Update readme 2024-03-09 10:28:43 +00:00
Sergio R. Caprile 98db3360df Merge pull request #2641 from cesanta/aes
prefix macros in tls_aes128
2024-03-06 12:06:09 -03:00
Sergio R. Caprile f26c713482 prefix macros in tls_aes128 2024-03-06 11:59:12 -03:00
Sergey Lyubka 05e55334fc Fix vc98 build 2024-03-06 00:57:31 +00:00
Sergey Lyubka 01fe61276e Add unit test for semicolon in value 2024-03-06 00:49:55 +00:00
Sergey Lyubka 219253ad71 Merge pull request #2636 from cesanta/mg_http_upload
Increase local file buffer size in mg_http_upload()
2024-03-05 06:05:36 +00:00
Sergey Lyubka 7b125558cb Merge pull request #2639 from cesanta/ack2
Better acks
2024-03-05 06:05:20 +00:00
Sergey Lyubka 02120e24b6 Better acks 2024-03-03 10:59:31 +00:00
Sergey Lyubka 91bc79c14c Merge pull request #2638 from cesanta/ack
restart timer when acking
2024-03-02 20:59:04 +00:00
Sergio R. Caprile 5ca552cf1c restart timer when acking 2024-03-02 15:25:02 -03:00
Sergio R. Caprile 2066304b14 Merge pull request #2637 from cesanta/ack
Sending ACK when about to exhaust TCP WIN1
2024-03-02 12:50:29 -03:00
Sergey Lyubka 1c6f8b95eb Sending ACK when about to exhaust TCP WIN1 2024-03-02 15:44:08 +00:00
Sergio R. Caprile 5384591f5b Merge pull request #2635 from cesanta/uploads
Enhance upload example - write uploaded file
2024-03-02 11:21:55 -03:00
Sergey Lyubka 309668ccbc Increase local file buffer size in mg_http_upload() 2024-03-02 10:56:06 +00:00
Sergey Lyubka 06a9fb3f53 Enhance upload example 2024-03-02 10:12:43 +00:00
Sergio R. Caprile 00db56f7d7 Merge pull request #2634 from cesanta/MG_EV_HTTP_HDRS
Introduce MG_EV_HTTP_HDRS
2024-03-01 20:50:57 -03:00
Sergey Lyubka cec06eb25c Introduce MG_EV_HTTP_HDRS 2024-03-01 23:29:12 +00:00
Sergey Lyubka 73a3897e1b Merge pull request #2630 from cesanta/2593-mongoose-closes-the-connection-without-responding-to-post-requests-that-dont-have-explicit-lengths
HTTP: respond to messages which have no explicit lengths
2024-02-28 19:21:06 +00:00
Sergey Lyubka 100c4c15ce 2024 2024-02-28 18:16:00 +00:00
robert c59bf6613a HTTP: respond to messages which have no explicit lengths 2024-02-28 04:01:39 -05:00
Sergio R. Caprile ac435bcb91 Merge pull request #2629 from cesanta/z
Satisfy new Zephyr config
2024-02-27 11:51:45 -03:00
Sergio R. Caprile 5d0bfccbc7 Satisfy new Zephyr config 2024-02-27 11:32:16 -03:00
Sergio R. Caprile 813489dc2f Merge pull request #2627 from cesanta/z
update
2024-02-26 16:59:16 -03:00
Sergio R. Caprile 828f31d5e6 update 2024-02-26 16:58:04 -03:00
Sergio R. Caprile 8130f7f25f Merge pull request #2625 from cesanta/c89
Make net_builtin C89 friendly
2024-02-26 09:20:42 -03:00
Sergey Lyubka 943e1c5f77 Adopt arch_freertos.h for CCRH compiler 2024-02-26 12:05:35 +00:00
Sergey Lyubka ecb3301bcb Make net_builtin C89 friendly 2024-02-25 12:21:06 +00:00
Sergio R. Caprile a0f33aebf7 Merge pull request #2624 from cesanta/2620
test returned content-type for custom 404
2024-02-23 09:15:45 -03:00
Sergio R. Caprile 6862981640 test returned content-type for user page404 2024-02-23 09:11:42 -03:00
Sergey Lyubka f61f2d2e9f Merge pull request #2620 from cesanta/2617
fix wrong MIME type for custom 404
2024-02-23 01:50:02 +00:00
Sergey Lyubka 1743e175cd Merge pull request #2623 from cesanta/r2d2
Add support for RA6M4
2024-02-23 00:45:47 +00:00
Sergio R. Caprile a027f58744 Add support for RA6M4 2024-02-22 20:51:01 -03:00
Sergio R. Caprile c98886402b Merge pull request #2621 from cesanta/ccrh
Adopt CCRH compiler
2024-02-22 20:18:15 -03:00
Sergey Lyubka 112a1e908a Adopt CCRH compiler 2024-02-22 17:53:15 +00:00
Sergey Lyubka 01ae80ecd1 Fix fuzzer call for mg_span() 2024-02-22 08:36:25 +00:00
Sergio R. Caprile 52997c6c51 update version 2024-02-21 08:50:06 -03:00
Sergio R. Caprile 1c114a279e fix wrong MIME type for custom 404 2024-02-20 19:08:07 -03:00
Sergey Lyubka 93148e3223 Merge pull request #2616 from cesanta/upload
Add file upload functionality to the http-server example
2024-02-20 12:07:19 +00:00
Sergey Lyubka f01807ef17 Add file upload functionality to the http-server example 2024-02-20 11:39:28 +00:00
Sergio R. Caprile a4ed740518 Merge pull request #2610 from cesanta/file_read
Change mg_file_read() signature: return mg_str
2024-02-16 09:48:08 -03:00
Sergey Lyubka 0e2f3de154 Change mg_file_read() signature: return mg_str 2024-02-16 12:07:35 +00:00
Sergey Lyubka d128d2146a Online status 2024-02-15 09:49:59 +00:00
Sergey Lyubka c683e1e988 More style changes 2024-02-15 09:46:42 +00:00
Sergey Lyubka 0b7038d44d Fixed layout 2024-02-15 09:38:32 +00:00
Sergey Lyubka 55698b91c0 Disable OTA for now.. 2024-02-15 09:26:37 +00:00
Sergey Lyubka eff54827b2 Fix config reporting 2024-02-14 23:46:43 +00:00
Sergio R. Caprile 2c2c7f6894 Merge pull request #2609 from cesanta/loc
Fill c->loc for outbound connections
2024-02-14 09:51:10 -03:00
Sergey Lyubka 5baa4d969e Fill c->loc for outbound connections 2024-02-14 12:32:26 +00:00
Sergey Lyubka d745c41d5b Merge pull request #2608 from cesanta/mqtt-dash
Update mqtt-dashboard, adopt new UI, break OTA for now..
2024-02-14 12:18:17 +00:00
Sergey Lyubka a86bde7b3f Update mqtt-dashboard, adopt new UI, break OTA for now.. 2024-02-14 12:14:17 +00:00
Sergio R. Caprile 4ab2309a5d Merge pull request #2607 from cesanta/tls
Fix #2603: TLS read path
2024-02-14 08:50:44 -03:00
Sergey Lyubka 9172f62970 Fix #2603: TLS read path 2024-02-13 05:49:15 +00:00
Sergey Lyubka daa47e8272 Merge pull request #2604 from cesanta/pipeline
Fix #2592: do not close pipelined connection prematurely
2024-02-13 05:48:34 +00:00
Sergey Lyubka 2419f02766 Fix #2592: do not close pipelined connection prematurely 2024-02-11 09:05:19 +00:00
Sergio R. Caprile c8d45c9ff1 Merge pull request #2601 from cesanta/dns
cap # responses instead of rejecting
2024-02-09 12:35:15 -03:00
Sergio R. Caprile 0b667ca869 cap # responses instead of rejecting 2024-02-09 12:28:56 -03:00
Sergio R. Caprile 1a5ea930ab Update fuzz.c for mg_commalist -> mg_span 2024-02-04 23:41:16 -03:00
Sergey Lyubka e4bfb2b5b0 Merge pull request #2597 from cesanta/str
mg_split -> mg_span. Remove mg_commalist
2024-02-04 09:39:08 +00:00
Sergey Lyubka 936e7bbc88 mg_split -> mg_span. Remove mg_commalist 2024-02-04 09:26:42 +00:00
Sergey Lyubka 93b5063251 Merge pull request #2599 from cesanta/upload
Allow user specify file in mg_http_upload
2024-02-04 09:07:28 +00:00
Sergey Lyubka e0668bc1c0 Allow user specify file in mg_http_upload 2024-02-04 08:56:32 +00:00
Sergey Lyubka fa5aa308bc Merge pull request #2596 from cesanta/ls
Add helper mg_fs_ls()
2024-02-01 18:25:05 +00:00
Sergey Lyubka cbfa57a955 Add helper mg_fs_ls() 2024-02-01 18:24:37 +00:00
Sergey Lyubka f8898b016e More unit tests for mg_split() 2024-02-01 18:21:46 +00:00
Sergio R. Caprile 8a9630485f fix sorting issues with locales 2024-02-01 10:22:30 -03:00
Sergio R. Caprile 066e4ac332 Merge pull request #2594 from cesanta/mg_json_get_tok
Add helper function mg_json_get_tok
2024-02-01 09:35:08 -03:00
Sergey Lyubka f231760395 Add helper function mg_json_get_tok 2024-02-01 12:05:49 +00:00
Sergey Lyubka ebfa5f0ba7 Add ek-ra6m4 example 2024-01-27 17:06:28 +00:00
Sergio R. Caprile d7754516f0 no diff checks in nightly tests 2024-01-26 14:33:22 -03:00
Sergio R. Caprile 00fd1884ff no diff checks in nightly tests 2024-01-26 12:54:07 -03:00
Sergio R. Caprile b828be4873 no diff checks in nightly tests 2024-01-26 12:48:04 -03:00
Sergio R. Caprile 4045a541ef Merge pull request #2590 from cesanta/rewact
Rework tests
2024-01-26 12:28:48 -03:00
Sergio R. Caprile f7557c9e48 trigger 2024-01-26 12:27:04 -03:00
Sergio R. Caprile 7c62b5005e work in progress 2024-01-26 12:15:48 -03:00
Sergey Lyubka b804217501 Merge pull request #2581 from cesanta/2559
Fix #2559: order of handlers: protocol first, user second
2024-01-26 14:03:54 +00:00
Sergio R. Caprile c6128094b6 rebase and update file-transfer example 2024-01-26 10:40:59 -03:00
Sergey Lyubka 0fc0230364 Changed the order of handlers: protocol first, user second 2024-01-26 10:34:24 -03:00
Sergio R. Caprile dd6458262d Merge pull request #2588 from cesanta/ft
Add file transfer example
2024-01-25 15:12:49 -03:00
Sergio R. Caprile eb68bb2ce1 Add file-transfer example 2024-01-25 15:05:48 -03:00
Sergio R. Caprile 8dc62c25ed Merge pull request #2587 from cesanta/tls
Fix #2570: close only when TLS buffers drained
2024-01-23 14:03:33 -03:00
Sergey Lyubka d8fec13d2c Fix #2570: close only when TLS buffers drained 2024-01-23 11:10:15 +00:00
Sergey Lyubka 922d148ab5 Add misra target 2024-01-23 11:09:16 +00:00
Sergio R. Caprile 08f05d6f8c Merge pull request #2585 from cesanta/fai
prefix PHY-related constants
2024-01-22 18:45:00 -03:00
Sergio R. Caprile 7bec3b4954 Merge pull request #2586 from cesanta/pos9
rename MG_ENABLE_FILE to MG_ENABLE_POSIX_FS
2024-01-22 16:48:17 -03:00
Sergio R. Caprile 4d3fba57d4 rename MG_ENABLE_FILE to MG_ENABLE_POSIX_FS 2024-01-22 16:21:57 -03:00
Sergio R. Caprile 1a8a144726 prefix PHY-related constants 2024-01-22 14:27:22 -03:00
Sergio R. Caprile 00ea3830a7 Merge pull request #2580 from cesanta/2552
Fix #2552 - reject requests with invalid/absent chunk length
2024-01-22 09:20:56 -03:00
Sergey Lyubka 3880300cd9 Add 256/64 build 2024-01-21 12:49:57 +00:00
Sergey Lyubka 6b0e4a425d Fix #2552 - reject requests with invalid/absent chunk length 2024-01-20 09:35:01 +00:00
Sergey Lyubka f883504d2d Fix #2573 - GCC build warning in tls_builtin.c::mul() 2024-01-20 08:51:01 +00:00
robertc2000 a1c5995967 Merge pull request #2562 from cesanta/imxflash-2
RT1020 and RT1060 OTA
2024-01-19 15:55:35 +02:00
robert 8500afbbd4 RT1020 and RT1060 OTA 2024-01-19 02:47:23 -05:00
Sergio R. Caprile 13cb94cf2b Merge pull request #2575 from cesanta/flexsdk
remove flexspi.h
2024-01-18 17:51:02 -03:00
Sergio R. Caprile f26a79d75c remove flexspi.h 2024-01-18 17:47:02 -03:00
Sergey Lyubka 68e2cd9b29 Fix WCH example 2024-01-17 18:07:25 +00:00
Sergio R. Caprile 6e44bab3d5 Merge pull request #2572 from cesanta/armccnodet
change mongoose_custom for Keil
2024-01-16 16:59:23 -03:00
Sergio R. Caprile 677fea7bfa change mongoose_custom for Keil 2024-01-16 16:21:05 -03:00
Sergio R. Caprile 0d2ae10bd9 Merge pull request #2571 from cesanta/dhcpsidfb
Fallback to IP source address on DHCP servers not filling sid
2024-01-16 10:26:34 -03:00
Sergio R. Caprile faa582040b Fallback to IP source address on DHCP servers not filling sid 2024-01-16 09:56:05 -03:00
Sergey Lyubka 0ad4002569 Make TLS less verbose 2024-01-14 23:27:52 +00:00
Sergey Lyubka dfc2e97d5e Squash warning 2024-01-14 22:10:18 +00:00
Sergio R. Caprile 57159dc5c0 Merge pull request #2568 from cesanta/1020flash
default to flash 1020
2024-01-12 14:23:48 -03:00
Sergio R. Caprile 77ff1511ff default to flash 1020 2024-01-12 14:20:46 -03:00
Sergio R. Caprile 124ab99995 Merge pull request #2554 from cesanta/1060flash
1060flash
2024-01-11 16:25:21 -03:00
Sergey Lyubka 8ea08306b8 Update year to 2024 2024-01-10 14:31:09 +00:00
Sergey Lyubka 3e0d20a335 Fix H573 example 2024-01-10 14:25:38 +00:00
Sergio R. Caprile 727b3d4f19 Merge pull request #2565 from cesanta/backlog
Set default listen backlog size back to 128
2024-01-10 08:45:33 -03:00
Sergey Lyubka 80782b289f Set default listen backlog size back to 128 2024-01-10 11:10:43 +00:00
Sergey Lyubka 72127a4bed README 2024-01-10 11:01:20 +00:00
Sergey Lyubka d4a49e00e7 Add Usage section to README 2024-01-10 10:58:30 +00:00
Sergio R. Caprile 5826d0e41c Merge pull request #2560 from cesanta/fn_data
remove fn_data from event handler signature
2024-01-09 15:40:46 -03:00
Sergio R. Caprile 68cb7ce8d9 cleanup 2024-01-09 14:55:04 -03:00
Sergio R. Caprile 514699fc41 cleanup 2024-01-09 14:54:19 -03:00
Sergio R. Caprile deca1aaf46 remove fn_data from event handler signature 2024-01-09 14:51:19 -03:00
Sergey Lyubka b8bfa5565b Merge pull request #2556 from cesanta/mt12m
add multi-threaded one to many example
2024-01-07 19:04:53 +00:00
Sergio R. Caprile 50c7844031 Merge pull request #2557 from cesanta/xpresso
add RT1060 Xpresso example
2024-01-05 18:38:32 -03:00
Sergio R. Caprile cba0d1b2f9 add RT1060 Xpresso example 2024-01-05 18:24:47 -03:00
Sergio R. Caprile 5735ee3269 default to flash 1060
workaround SysTick race condition in FreeRTOS example
2024-01-05 13:49:50 -03:00
Sergio R. Caprile ee3593b887 add multi-threaded one to many example 2024-01-05 12:12:00 -03:00
Sergey Lyubka 9bebe7cf68 Update readme 2024-01-02 10:54:00 +00:00
Sergio R. Caprile bd5e4dba26 Merge pull request #2551 from cesanta/mqttpayload
Avoid calling mg_send on no actual payload
2023-12-29 15:13:02 -03:00
Sergio R. Caprile 2427c40a4c Avoid calling mg_send on no actual payload 2023-12-29 14:58:03 -03:00
Sergey Lyubka 744df7b244 Better checks in skip_chunk() 2023-12-29 11:59:02 +00:00
Sergey Lyubka 3965aecfd4 32/288, no TLS by default 2023-12-27 22:53:48 +00:00
Sergey Lyubka 93bcde0176 Enable TLS and 256/64 mode 2023-12-27 22:45:16 +00:00
Sergio R. Caprile 4b3884a49d Update README.md 2023-12-27 18:34:59 -03:00
Sergey Lyubka 768908ae4a Merge pull request #2547 from cesanta/opta
Add STM32H747I-DISCO example
2023-12-27 20:06:30 +00:00
Sergey Lyubka 1a965d5c43 Add STM32H747I-DISCO example 2023-12-27 20:04:53 +00:00
Sergey Lyubka 01b612cff5 WCH FW build fix. Introduce phy_addr for STM32F driver 2023-12-27 15:38:51 +00:00
Sergio R. Caprile 176db1aedb remove some compiler warning 2023-12-23 19:02:05 -03:00
Sergey Lyubka 06f8238107 Fix TLS codepath for pending data. Reuse c->rtls 2023-12-22 16:17:06 +00:00
Sergio R. Caprile 97127a57da Merge pull request #2542 from cesanta/pair
Add mg_wakeup()
2023-12-21 14:22:10 -03:00
Sergey Lyubka 61825b2390 Add mg_wakeup() 2023-12-21 14:03:33 -03:00
Sergio R. Caprile 669ffe2c74 Merge pull request #2543 from cesanta/gettimeofday
Remove gettimeofday implementation, to avoid clashes
2023-12-21 13:50:09 -03:00
Sergey Lyubka a50b8ff5d7 Remove gettimeofday implementation, to avoid clashes 2023-12-21 15:05:07 +00:00
Sergey Lyubka aae2954c14 Merge pull request #2541 from cesanta/multitls
default again to current doc defaults
2023-12-21 05:10:42 +00:00
Sergio R. Caprile abab569778 default again to current doc defaults 2023-12-20 18:13:09 -03:00
Sergio R. Caprile 365a731574 Merge pull request #2540 from cesanta/reformat_comments
reformat comments
2023-12-20 16:58:56 -03:00
Sergio R. Caprile 285dc63c5c reformat comments 2023-12-20 16:40:31 -03:00
Sergio R. Caprile 24d9fbffae fix MQTT device 2023-12-20 14:49:25 -03:00
Sergey Lyubka 04178ad0f7 Merge pull request #2538 from cesanta/tls13
Add built-in TLS 1.3 stack: server side, EC support
2023-12-20 16:36:04 +00:00
Sergey Lyubka a0e66fb9e6 Add built-in TLS 1.3 stack: server side, EC support 2023-12-20 11:04:31 +00:00
Sergio R. Caprile df3c216315 Merge pull request #2535 from cesanta/hal
Move clock_init() to hal.h
2023-12-18 16:36:51 -03:00
Sergey Lyubka e9a6bad751 Move clock_init() to hal.h 2023-12-18 19:21:12 +00:00
Sergio R. Caprile 4b7d871048 Merge pull request #2537 from cesanta/stm32driver
stm32 -> stm32f
2023-12-18 16:00:27 -03:00
Sergio R. Caprile 2528dd6425 stm32 -> stm32f 2023-12-18 14:33:49 -03:00
Sergey Lyubka b3fcd9c420 Win32 build fixes 2023-12-17 10:14:08 +00:00
Sergey Lyubka 9270fc0b15 Allow to bypass CSS rebuild 2023-12-16 20:42:34 +00:00
Sergey Lyubka 33aa021e96 Allow to bypass CSS rebuild 2023-12-16 20:39:29 +00:00
Sergey Lyubka 1c78ed1fed Prevent main.css rebuild 2023-12-16 20:19:21 +00:00
Sergey Lyubka 562c318648 Recreate packed fs 2023-12-16 20:11:59 +00:00
Sergey Lyubka 65cb894f0d Change TLS port 2023-12-16 20:01:52 +00:00
Sergey Lyubka bbd27a0a9c MQTT dashboard nitpicks 2023-12-16 19:57:18 +00:00
Sergio R. Caprile 79e138ef28 Merge pull request #2534 from cesanta/stm32driver
stm32 -> stm32f
2023-12-15 22:19:20 -03:00
Sergio R. Caprile 387334c8c2 stm32 -> stm32f 2023-12-15 21:55:52 -03:00
Sergio R. Caprile cd021daf79 Merge pull request #2531 from cesanta/mqttrndis
Add MQTT device through RNDIS example
2023-12-15 13:39:21 -03:00
Sergey Lyubka 536aa1fb62 Fix post-OTA status save 2023-12-15 11:32:46 +00:00
Sergio R. Caprile a14a838dab undo leftover from PR 2508 2023-12-14 11:52:19 -03:00
Sergio R. Caprile ad57731ae1 Add MQTT device through RNDIS example 2023-12-13 17:24:52 -03:00
Sergio R. Caprile ad90b0b7b1 fix for new IDF required version 2023-12-13 17:24:16 -03:00
Sergio R. Caprile 18325cb216 Merge pull request #2529 from cesanta/573
Add Discovery STM32H573I-DK examples
2023-12-13 11:45:43 -03:00
Sergio R. Caprile 8df70ba58b Add Discovery STM32H573I-DK examples 2023-12-13 10:50:28 -03:00
Sergey Lyubka ee43a5389f Merge pull request #2522 from cesanta/mqttd
MQTT Dashboard fixes/updates
2023-12-13 11:53:59 +00:00
Sergio R. Caprile 6192573eb8 Merge pull request #2525 from cesanta/bquiet
Be less verbose on unkown eth types
2023-12-10 16:21:50 -03:00
Sergio R. Caprile 92ecef7bd3 Be less verbose on unkown eth types 2023-12-10 15:17:20 -03:00
Sergio R. Caprile 45d7f4ca7e Merge pull request #2523 from cesanta/am
TLS layer: c->rtls to optimise recvd TLS data
2023-12-10 14:54:25 -03:00
cpq 144c2f443e TLS layer: c->rtls to optimise recvd TLS data 2023-12-10 12:18:07 +00:00
Sergey Lyubka 98d877c5f0 Reenable UART logging to fix the test 2023-12-10 12:17:54 +00:00
Sergio R. Caprile 9de31ba816 updates 2023-12-08 18:36:59 -03:00
Sergio R. Caprile 560561c5b7 fixes 2023-12-08 16:35:03 -03:00
Sergey Lyubka ed2d4c1c2b Merge pull request #2519 from cesanta/prof
Add profiling capability
2023-12-08 18:43:14 +00:00
Sergio R. Caprile e70628cbdc Merge pull request #2518 from cesanta/tls
Move TLS API to tls.h, fix builtin handshake codepath
2023-12-08 14:54:50 -03:00
Sergio R. Caprile 161edec195 Merge pull request #2521 from cesanta/z
update to current TLS API
2023-12-08 14:49:45 -03:00
Sergio R. Caprile 2ba4a74762 update to current API 2023-12-08 14:41:10 -03:00
cpq 693316de44 Add profiling capability 2023-12-08 17:00:42 +00:00
cpq 6e68124405 Move TLS API to tls.h, fix builtin handshake codepath 2023-12-08 00:30:09 +00:00
Sergio R. Caprile c8105cffba Merge pull request #2517 from cesanta/mqttest
refactor matrix build tests, add mqtt-dashboard build tests for embed…
2023-12-07 11:44:41 -03:00
Sergio R. Caprile 21f6944fc7 refactor matrix build tests, add mqtt-dashboard build tests for embedded targets 2023-12-07 11:42:45 -03:00
Sergio R. Caprile 5adcba7ba1 Merge pull request #2515 from cesanta/imxflash
fix for flash boot (ROM changes defaults)
2023-12-06 17:52:49 -03:00
Sergio R. Caprile fc8ba744dc fix for flash boot (ROM changes defaults) 2023-12-06 17:45:22 -03:00
Sergey Lyubka 4fc43cfbf7 Merge pull request #2514 from cesanta/mqtt2
Mock LED settings
2023-12-06 09:43:02 +00:00
cpq 22837f93c8 Mock LED settings 2023-12-06 09:41:48 +00:00
cpq b03ececbbb Disable mbedtls, add flash target 2023-12-06 09:10:46 +00:00
Sergio R. Caprile 708908dce5 Merge pull request #2511 from cesanta/workflow
hw tests
2023-12-04 17:23:10 -03:00
Sergio R. Caprile f33302acc9 hw tests 2023-12-04 17:21:48 -03:00
Sergio R. Caprile 7f8cdf1e79 fs ls 2023-12-01 20:43:39 -03:00
Sergey Lyubka dbc7b5e70b Merge pull request #2509 from cesanta/te
Fix #2460 - sanity check of the Transfer-Encoding: chunked header
2023-12-01 13:48:35 +00:00
cpq 4c445453d3 Fix #2460 - sanity check of the Transfer-Encoding: chunked header 2023-12-01 11:24:32 +00:00
cpq 4b8fb23def Typo in v307 makefile 2023-12-01 08:36:18 +00:00
cpq 253bc64c9e Add zip target 2023-12-01 00:03:31 +00:00
cpq 32d3fc6803 Add zip target 2023-12-01 00:02:48 +00:00
Sergey Lyubka 920875ecc9 Merge pull request #2508 from cesanta/v307
Use V307 flash
2023-12-01 00:01:20 +00:00
cpq 85d3e7f375 Use V307 flash 2023-11-30 23:51:34 +00:00
Sergio R. Caprile 4ceb50d485 more Mongoose-style 2023-11-30 12:16:56 -03:00
Sergey Lyubka 7d2fca9574 Merge pull request #2505 from cesanta/mqttdevice
more Mongoose-style
2023-11-30 11:15:39 +00:00
Sergey Lyubka d88e60a525 Merge pull request #2501 from cesanta/opthwtst
test specific hw example
2023-11-30 11:14:43 +00:00
Sergio R. Caprile 4b4dcb20ca more Mongoose-style 2023-11-29 16:14:09 -03:00
Sergio R. Caprile d4ab0aa7fd Merge pull request #2503 from cesanta/imxflash
Generate flash images for RT10xx
2023-11-29 11:04:38 -03:00
Sergio R. Caprile c02c1130ed Generate flash images
TODO(scaprile): check when and if following is needed

  flash_init();                   // setup pins and clocks to access board flash
2023-11-29 10:47:05 -03:00
Sergio R. Caprile f9bbb37721 Merge pull request #2502 from cesanta/fixcubex
fix text
2023-11-28 20:13:28 -03:00
Sergio R. Caprile 57837f285f fix text 2023-11-28 19:55:27 -03:00
Sergio R. Caprile 3379f11b23 test specific hw example 2023-11-28 19:34:05 -03:00
Sergey Lyubka c74534cf5e Merge pull request #2495 from cesanta/modbus
Add modbus dashboard
2023-11-27 21:31:37 +00:00
cpq 64ca1ad787 Add modbus dashboard 2023-11-27 21:26:19 +00:00
Sergey Lyubka 8022635c04 Merge pull request #2494 from cesanta/mqttws
make Mosquitto happy
2023-11-27 13:13:14 +00:00
Sergio R. Caprile 1f37595200 make Mosquitto happy 2023-11-26 15:38:28 -03:00
Sergio R. Caprile 30738f6638 Merge pull request #2493 from cesanta/wake
Fix #2456 - wake up mongoose thread
2023-11-25 09:27:52 -03:00
cpq bd53e46873 Do not allow invalid UTF8 in method, uri, header names 2023-11-25 11:33:07 +00:00
cpq 122115dbea Fix #2456 - wake up mongoose thread 2023-11-25 08:28:39 +00:00
Sergey Lyubka 28162f8034 Merge pull request #2492 from cesanta/xpro
Fix #2487 - correct GMAC_DCFGR, receive size -> full size
2023-11-25 08:05:52 +00:00
cpq 9cfd3124ef Fix #2487 - correct GMAC_DCFGR, receive size -> full size 2023-11-25 08:04:38 +00:00
Sergey Lyubka 36748ee406 Merge pull request #2486 from cesanta/st_v307
Post-IRQ DMASR flags cleanup
2023-11-25 07:49:32 +00:00
Sergey Lyubka 2a25e449a2 Merge pull request #2476 from cesanta/mqtt-dashboard-part-2
Added MQTT Dashboard support for H723ZG
2023-11-24 10:45:49 +00:00
cpq f2f60a7b3b Post-IRQ DMASR flags cleanup 2023-11-24 10:43:56 +00:00
cpq 82916a1cef Wrap dirty IRQ flag cleanup for v307 into a conditional 2023-11-22 15:41:45 +00:00
Sergey Lyubka f86c14abb3 Merge pull request #2485 from cesanta/ch32v307
Add example for ch32v307
2023-11-22 10:23:48 +00:00
cpq fa76312313 Add example for ch32v307 2023-11-22 10:22:10 +00:00
robert 46687f6fe3 Added MQTT Dashboard support for H723ZG 2023-11-20 02:08:07 -05:00
Sergio R. Caprile 6386cdff50 Merge pull request #2478 from cesanta/mg_bit
BIT -> MG_BIT in drivers
2023-11-16 17:32:49 -03:00
Sergio R. Caprile 7c25c0d6f3 BIT -> MG_BIT 2023-11-16 17:11:04 -03:00
Sergio R. Caprile 8ed57f57cb Merge pull request #2475 from cesanta/rt
Rt
2023-11-15 19:28:36 -03:00
Sergio R. Caprile c8f207c277 rename iMX-RT 2023-11-15 19:27:20 -03:00
Sergio R. Caprile d70d9aff11 fix bits not being reset 2023-11-15 16:33:20 -03:00
cpq 1118c997b5 Nitpick - simple handler changed 2023-11-15 18:41:03 +00:00
Sergio R. Caprile b999275550 fix Teensy PHY code in _up 2023-11-15 10:46:44 -03:00
Sergey Lyubka f549646ddd Merge pull request #2474 from cesanta/rtphy
update PHY code in _up
2023-11-15 08:27:38 +00:00
Sergey Lyubka 5ee8552e6c Merge pull request #2472 from cesanta/mqtt-dashboard
Added MQTT Dashboard
2023-11-14 12:34:03 +00:00
robert b0eb7b6dec Added MQTT Dashboard 2023-11-14 05:52:33 -05:00
Sergio R. Caprile a546d360d0 update PHY code in _up 2023-11-13 23:54:37 -03:00
Sergio R. Caprile 3cc8a98b9d Merge pull request #2473 from cesanta/db
update screenshot and README
2023-11-13 11:22:46 -03:00
Sergio R. Caprile 1032f0ade7 update screenshot and README 2023-11-13 09:55:54 -03:00
cpq eb65d269eb Disable noisy debug 2023-11-13 01:57:59 +00:00
cpq b379f81004 Nit picks 2023-11-13 01:56:50 +00:00
Sergey Lyubka d1b0342a18 Merge pull request #2468 from cesanta/teensy
Add teensy41 example
2023-11-11 21:28:28 +00:00
cpq b815e6bc04 Add teensy41 example 2023-11-11 21:22:00 +00:00
Sergio R. Caprile 81bf65954c Merge pull request #2469 from cesanta/std
standardize build options
2023-11-09 14:44:34 -03:00
Sergio R. Caprile 9cfe72af4a standardize build options 2023-11-09 14:40:12 -03:00
Sergey Lyubka 7c2e1e1339 Merge pull request #2459 from cesanta/openssl
Wrap OpenSSL errors in Mongoose log
2023-11-08 17:08:04 +00:00
Sergio R. Caprile 817115cb6c Merge pull request #2467 from cesanta/std
standardize naming and build options
2023-11-08 14:00:52 -03:00
Sergio R. Caprile 7a3734e54d standardize naming and build options 2023-11-08 13:54:44 -03:00
Sergio R. Caprile 79c3341f74 Merge pull request #2465 from cesanta/std
standardize build options
2023-11-07 17:23:44 -03:00
Sergio R. Caprile abdd14b0a1 standardize build options 2023-11-07 17:05:41 -03:00
Sergio R. Caprile 1f77e53b23 Wrap OpenSSL errors in Mongoose log 2023-11-06 17:24:30 -03:00
Sergey Lyubka a619de0508 Merge pull request #2455 from cesanta/micropython
Add Micropython on ESP32 example
2023-11-04 13:31:44 +00:00
Sergio R. Caprile 8faa11585c Add Micropython on ESP32 example 2023-11-03 19:15:57 -03:00
Sergio R. Caprile 13259f8902 Merge pull request #2452 from cesanta/tlsbuiltin
Make tls_builtin build with current API
2023-11-03 15:02:27 -03:00
Sergio R. Caprile bb5aba2e19 Make tls_builtin build with current API 2023-11-03 14:02:41 -03:00
Sergio R. Caprile 22fc01d5f2 workaround warning in mbedTLS code 2023-11-03 14:02:08 -03:00
Sergio R. Caprile 3b4672c109 workaround warning in mbedTLS code 2023-11-03 10:37:14 -03:00
Sergey Lyubka 351bd42bc4 Merge pull request #2450 from cesanta/micropython
Add Micropython example
2023-11-03 06:35:38 +00:00
Sergio R. Caprile e418da4bd8 Merge pull request #2451 from cesanta/fastclose
Allow fast close
2023-11-02 18:52:11 -03:00
Sergio R. Caprile 18d13f9848 Allow fast close 2023-11-02 18:27:39 -03:00
Sergio R. Caprile ee792db6a3 Add Micropython example 2023-11-02 18:17:33 -03:00
Sergio R. Caprile 129bf93b30 Merge pull request #2448 from cesanta/fixh743f
Fix H743 FreeRTOS early SysTick crash
2023-11-02 15:14:27 -03:00
Sergio R. Caprile 1dda8b9e60 Fix H743 FreeRTOS early SysTick crash 2023-11-02 14:58:52 -03:00
Sergey Lyubka 107e303282 Merge pull request #2445 from cesanta/cmsis-driver
Add driver for CMSIS-Driver
2023-11-02 14:55:16 +00:00
Sergey Lyubka 22f76091a2 Merge pull request #2446 from cesanta/o2
Single bank OTA
2023-11-02 14:55:01 +00:00
cpq 376e5ccaae Single bank OTA 2023-11-02 09:30:55 +00:00
Sergio R. Caprile b792304cf8 Add driver for CMSIS-Driver 2023-11-01 17:26:34 -03:00
Sergio R. Caprile b357485523 Merge pull request #2444 from cesanta/mqttst
improve randomness in non-random test environments
2023-10-31 19:24:26 -03:00
Sergio R. Caprile 07936343c8 improve randomness in non-random environments 2023-10-31 19:17:58 -03:00
Sergio R. Caprile 1b93ca0fb2 Merge pull request #2443 from cesanta/h563
fix H563 FreeRTOS Cortex-M33 port SystemInit
2023-10-31 12:43:36 -03:00
Sergio R. Caprile 18cd18d1e5 fix H563 FreeRTOS Cortex-M33 port SystemInit 2023-10-31 12:40:18 -03:00
Sergio R. Caprile deab6772e8 Merge pull request #2442 from cesanta/nerr
honor ifp->nerr
2023-10-31 12:06:44 -03:00
Sergey Lyubka d6d2d7575a Merge pull request #2441 from cesanta/mqttst
improve MQTT test speed
2023-10-30 23:12:30 +00:00
Sergio R. Caprile d63ec65663 honor ifp->nerr 2023-10-30 16:36:35 -03:00
Sergio R. Caprile f0a927831e improve MQTT test speed 2023-10-30 16:20:55 -03:00
Sergey Lyubka ef16a733d2 Merge pull request #2440 from cesanta/h723
Fix H723 FreeRTOS example failing on some compiler versions with optimizer on
2023-10-30 17:55:29 +00:00
Sergio R. Caprile 9044c02edc Fix H723 FreeRTOS example failing on some compiler versions with optimizer on 2023-10-30 14:13:28 -03:00
Sergey Lyubka 2fa98b00f2 Merge pull request #2437 from cesanta/rt1060
Add RT1060 examples
2023-10-27 20:42:42 +01:00
Sergio R. Caprile 15b4d566e7 Add RT1060 examples 2023-10-27 16:19:12 -03:00
Sergio R. Caprile 6dabbe237d unbreak RT1020 examples after removing IMX prefix 2023-10-25 14:56:29 -03:00
cpq 2caff93f83 Remove IMX, imx prefix for NXP 2023-10-24 17:30:22 +01:00
Sergio R. Caprile 2903937cba fix old trashing 2023-10-23 16:32:51 -03:00
Sergey Lyubka c33fd6a7fb Merge pull request #2429 from cesanta/h723
H7 combo
2023-10-17 10:22:00 +01:00
Sergio R. Caprile 64180e8fe8 minor fixes for H743
Clock H723 at 550MHz, fix RNG initialization
Add FreeRTOS example for H723
Add tests
2023-10-16 17:27:02 -03:00
Sergey Lyubka 001134af89 Merge pull request #2424 from cesanta/unit-test-coverage
Improved test coverage
2023-10-14 10:59:01 +01:00
cpq b91044dea7 Update UM 2023-10-14 10:34:41 +01:00
robert 34639f86b0 Improved test coverage 2023-10-13 07:22:21 -04:00
Sergio R. Caprile 32559f15ea fix Github editor line ending creativity 2023-10-12 10:56:38 -03:00
Sergio R. Caprile b10eef1e32 Update version in mongoose.h 2023-10-12 10:44:58 -03:00
Sergio R. Caprile 7c4911598c Update version.h 2023-10-12 10:27:55 -03:00
Sergio R. Caprile efacb20bdc Merge pull request #2423 from cesanta/same
rename same54
2023-10-11 17:36:09 -03:00
Sergio R. Caprile 2e6188205f rename same54 2023-10-11 16:58:21 -03:00
Sergio R. Caprile 83fec2cf45 cleanup 2023-10-11 16:39:24 -03:00
Sergio R. Caprile 9be36eb9cb Merge pull request #2422 from cesanta/tcp
Fix tcp example for 2-way TLS
2023-10-11 16:34:12 -03:00
Sergio R. Caprile a51802ecaf Fix tcp example for 2-way TLS 2023-10-11 16:25:24 -03:00
Sergio R. Caprile b1c220e610 Remove mg_mkpipe() leftovers 2023-10-10 18:16:02 -03:00
Sergey Lyubka 36f6b805e3 Merge pull request #2421 from cesanta/h723
Add h723 example
2023-10-10 19:19:51 +01:00
Sergey Lyubka 64efad9e46 Merge pull request #2419 from cesanta/rt1020
Add FreeRTOS example for RT1020
2023-10-10 07:57:05 +01:00
Sergio R. Caprile 8a8d5ce151 Add FreeRTOS example for RT1020 2023-10-09 17:03:58 -03:00
Sergey Lyubka 907417f9ec Merge pull request #2418 from cesanta/rt1020
Add TRNG
2023-10-09 17:24:39 +01:00
Sergio R. Caprile 0965177e72 Add TRNG 2023-10-09 13:03:52 -03:00
cpq 7d07ca8427 Add drivers 2023-10-09 09:36:43 +01:00
Sergey Lyubka d18b2b390a Merge pull request #2415 from cesanta/json
Add mg_json_next() for iterating objects/arrays
2023-10-09 07:55:44 +01:00
Sergey Lyubka fefe8b1c15 Merge pull request #2416 from cesanta/log
Add MG_ENABLE_CUSTOM_LOG
2023-10-09 07:55:31 +01:00
cpq ea2ff010a9 Add MG_ENABLE_CUSTOM_LOG 2023-10-08 17:09:14 +01:00
cpq e357cb3185 Bump up max DNS responses 10->15 2023-10-08 15:30:18 +01:00
cpq 293ee2162c Add mg_json_next() for iterating objects/arrays 2023-10-07 22:40:51 +01:00
cpq c29ee769bc Fix comment 2023-10-07 17:58:20 +01:00
Sergey Lyubka 82399f1561 Merge pull request #2414 from cesanta/rt1020
Rework  RT1020 driver
2023-10-07 11:21:29 +01:00
Sergio R. Caprile 9255ceaf8a Rework RT1020 driver
Add web server in example
Add to tests
2023-10-06 16:56:00 -03:00
cpq bb9c7c0eb3 Handle ECOS case in accept_conn() 2023-10-06 15:58:26 +01:00
Sergey Lyubka 8ec327f9c7 Merge pull request #2407 from cesanta/rt1020
Add RT1020-EVK baremetal example
2023-10-05 14:19:00 +01:00
Sergio R. Caprile c9b982eaff add update script to Makefile 2023-10-04 16:31:50 -03:00
Sergio R. Caprile 248e7b6e29 Add RT1020-EVK baremetal example 2023-10-04 15:18:57 -03:00
Sergey Lyubka cb1ae312a1 Merge pull request #2404 from cesanta/g031
Add nucleo-g031 baremetal example
2023-10-04 15:39:19 +01:00
cpq aec25cf547 Add h723 example 2023-10-04 11:11:56 +01:00
cpq 4db3fc2515 dd nucleo-g031 baremetal example 2023-10-03 13:55:47 +01:00
Sergey Lyubka 79d6017c56 Merge pull request #2402 from cesanta/bcast
send broadcasts in MIP
2023-10-03 13:53:58 +01:00
Sergio R. Caprile d4c122b17a send broadcasts in MIP 2023-10-02 13:37:27 -03:00
cpq 57fd93eeda Fix ring color 2023-10-01 23:20:42 +01:00
cpq 19cac05747 Enhance components 2023-10-01 23:08:10 +01:00
Sergey Lyubka 5ebede5096 Merge pull request #2395 from cesanta/scopeid
Fix #2192 - honor addr%scopeid ipv6 notation
2023-09-29 15:52:40 +01:00
cpq 46ecb07fc8 Fix #2192 - honor addr%scopeid ipv6 notation 2023-09-29 15:49:47 +01:00
cpq a628a05efb Restore pub. domain notice 2023-09-29 13:09:29 +01:00
cpq fc626bb57f Update pakced fs 2023-09-28 16:27:58 +01:00
cpq 1291839182 Update packed fs 2023-09-28 15:09:34 +01:00
Sergey Lyubka 736e7a2cf9 Merge pull request #2394 from cesanta/chunks
Get rid of MG_EV_HTTP_CHUNK
2023-09-26 20:45:40 +01:00
cpq 7884a2f3c7 Get rid of MG_EV_HTTP_CHUNK 2023-09-26 20:45:24 +01:00
Sergey Lyubka dde699ffda Merge pull request #2393 from cesanta/ota-api-refactoring
OTA API refactoring: renamed files and defines
2023-09-26 14:15:49 +01:00
robert fa54a22aed OTA API refactoring: renamed files and defines 2023-09-26 08:33:39 -04:00
cpq 822b0c011a Add sys_flash.c for common mg_flash_{load,save} 2023-09-25 07:55:35 +01:00
cpq a0f8a197c9 Split sys.h API over MG_SYS_* 2023-09-25 07:33:38 +01:00
Sergey Lyubka 7e75e51332 Merge pull request #2392 from cesanta/flash2
Commonise flash-based OTA. Add h7 support.
2023-09-25 05:21:52 +01:00
cpq b37efbe891 Commonise flash-based OTA. Add h7 support. 2023-09-24 21:55:49 +01:00
cpq 6e648c90b0 Added OTA to the feature list 2023-09-24 21:18:02 +01:00
cpq 377d6acc74 Fix leak in unit test 2023-09-22 08:12:09 +01:00
Sergey Lyubka f552d15fe4 Merge pull request #2390 from cesanta/tickets
Restore tickets support
2023-09-21 19:08:08 +01:00
cpq d1204e8a66 Better chunk length calculation 2023-09-21 19:04:32 +01:00
cpq 9ec48e41f7 Restore tickets support 2023-09-21 18:43:33 +01:00
Sergey Lyubka 9055a83b4f Merge pull request #2388 from cesanta/dns
dns.c slight refactor, no functional changes
2023-09-21 13:38:23 +01:00
cpq dd047b2613 dns.c slight refactor, no functional changes 2023-09-21 13:38:06 +01:00
Sergey Lyubka b7a32069b1 Merge pull request #2389 from cesanta/ipv6
Address discussions/2305 - bind to v6 only / v6 and v4
2023-09-21 13:37:29 +01:00
cpq 00d475bc7e Address https://github.com/cesanta/mongoose/discussions/2305 - bind to v6 only / v6 and v4 2023-09-21 12:35:47 +01:00
Sergio R. Caprile 33ab44430c Merge pull request #2386 from cesanta/timer
Revert to the old TLS API, but keep certs as mg_str for DER
2023-09-19 12:17:56 -03:00
Sergio R. Caprile b355da32b9 Add GA OpenSSL tests back 2023-09-19 12:08:02 -03:00
cpq 3f0366a514 Revert to the old TLS API, but keep certs as mg_str for DER 2023-09-19 11:15:23 +01:00
cpq 7ecbbc517d Using mg_bzero to cleanup memory in mg_close_conn() 2023-09-17 22:25:36 +01:00
cpq a04c94444e Add rt1020 baremetal sketch 2023-09-17 10:41:04 +01:00
Sergio R. Caprile 42b9ac1145 update 2023-09-12 18:30:23 -03:00
Sergio R. Caprile 7be4925c70 Merge pull request #2384 from cesanta/p_open
Do not use CLOEXEC on Windows
2023-09-12 18:28:39 -03:00
Sergio R. Caprile 7b19568683 Do not use CLOEXEC on Windows 2023-09-12 17:11:55 -03:00
Sergio R. Caprile 8f56779855 Merge pull request #2383 from cesanta/poll
Optimize test coverage
2023-09-12 16:41:17 -03:00
Sergio R. Caprile fdfad8462c Optimize test coverage 2023-09-12 16:28:10 -03:00
Sergio R. Caprile 3773ef45e7 Optimize test coverage 2023-09-12 16:22:54 -03:00
Sergio R. Caprile c0ca3cacb4 Fixing test.yml 2023-09-12 15:05:29 -03:00
Sergio R. Caprile bed0630698 Fixing test.yml 2023-09-12 09:13:38 -03:00
Sergey Lyubka 53baa18836 Merge pull request #2380 from cesanta/ip-fragmentation-2
IP fragmentation send path: added TCP/UDP packet splitting to fit within MTU
2023-09-12 12:51:04 +01:00
Sergey Lyubka 32a2144426 Merge pull request #2382 from cesanta/poll
increase test coverage
2023-09-12 12:50:50 +01:00
robert 264026acde added TCP/UDP packet splitting to fit within MTU 2023-09-12 07:05:13 -04:00
Sergio R. Caprile 43503ef73a increase test coverage 2023-09-11 17:46:25 -03:00
Sergio R. Caprile 7f52717e9d increase test coverage 2023-09-11 17:41:36 -03:00
Sergio R. Caprile bd59185ef1 Merge pull request #2381 from cesanta/tls
add host only validation
2023-09-11 16:38:18 -03:00
Sergio R. Caprile 310ffcd4eb add host only validation 2023-09-11 16:34:24 -03:00
cpq d23664a457 Move network code to net.* 2023-09-08 09:39:57 +01:00
Sergio R. Caprile a1e316ddcf make TCP example work with new TLS API 2023-09-06 18:50:33 -03:00
Sergio R. Caprile e328758fc7 Merge pull request #2379 from cesanta/tls
unifomize TLS examples, stage 1
2023-09-06 16:55:46 -03:00
Sergio R. Caprile dbf49255a3 fix 2023-09-06 16:19:21 -03:00
Sergio R. Caprile 1391bdcf8b remove certs.h 2023-09-06 15:49:02 -03:00
Sergio R. Caprile d8106a8ffe use packed ca.pem 2023-09-06 15:21:16 -03:00
Sergio R. Caprile ae55789c4b erase ca.pem 2023-09-06 15:21:16 -03:00
Sergio R. Caprile ec02ccf5b2 Merge pull request #2377 from cesanta/h5
uniformize examples
2023-09-05 13:43:39 -03:00
Sergio R. Caprile f970cd78d7 uniformize examples 2023-09-05 13:36:46 -03:00
Sergio R. Caprile 8140ea16a7 Merge pull request #2371 from cesanta/cloexec
Fix #2369 - set CLOEXEC on epoll and regular file fds
2023-09-05 10:15:58 -03:00
Sergey Lyubka 2883709756 Merge pull request #2370 from cesanta/ota
Add OTA to the device dashboard. Implement for H5
2023-09-05 13:28:22 +01:00
cpq ca4c2c6c41 Set CLOEXEC on epoll and regular file fds 2023-09-05 06:56:41 +01:00
Sergey Lyubka fbc56f4adf Merge pull request #2367 from cesanta/ip-fragmentation
closing connection if a fragmented packet is received
2023-09-05 06:34:29 +01:00
cpq 2f014237b2 Add OTA to the device dashboard. Implement for H5 2023-09-04 22:07:32 +01:00
robert f33e3a7752 closing connection if a fragmented packet is received 2023-08-30 10:30:51 -04:00
cpq d5b5cec797 Make fuzzer faster on large input/output 2023-08-26 00:52:24 +01:00
Sergey Lyubka f8e1f17651 Merge pull request #2366 from cesanta/h5
Add FreeRTOS example on H5
2023-08-25 21:21:41 +01:00
Sergio R. Caprile be58bfe22b Add FreeRTOS example on H5 2023-08-25 17:15:26 -03:00
Sergey Lyubka 995a63dc39 Merge pull request #2364 from cesanta/braces
Style: always braces around if + else
2023-08-25 15:00:52 +01:00
cpq e8d57ac4e1 Style: always braces around if + else 2023-08-25 14:46:38 +01:00
Sergio R. Caprile eab3a83548 Merge pull request #2362 from cesanta/h5
Update H5 HAL, enable RNG, work at 250MHz, add to tests
2023-08-24 13:35:37 -03:00
Sergio R. Caprile 3fb9e5fd56 Update H5 HAL, enable RNG, work at 250MHz, add to tests 2023-08-24 13:32:37 -03:00
Sergio R. Caprile 41448278cf Merge pull request #2360 from cesanta/h7
Fix sysinit in H7
2023-08-23 14:37:21 -03:00
cpq 48516b43c5 Use device 11 2023-08-23 00:38:57 +01:00
Sergio R. Caprile 80b7be0568 Fix sysinit in H7 2023-08-22 19:58:19 -03:00
Sergey Lyubka 4183552aee Merge pull request #2358 from cesanta/b64
Change base64 API
2023-08-22 14:43:33 +01:00
cpq 527e89754e Change base64 API 2023-08-22 12:11:13 +01:00
robertc2000 30e0f42c97 Merge pull request #2357 from cesanta/tcpip-conn-init
improved tcp connection initiation
2023-08-22 09:30:24 +03:00
Sergio R. Caprile 39b40daf5d cleanup 2023-08-21 19:34:04 -03:00
Sergio R. Caprile 94636f4d30 Merge pull request #2355 from cesanta/mqtt54
Add MQTT example and test for SAME54
2023-08-21 19:27:17 -03:00
Sergio R. Caprile fd53548c5e Add MQTT example and test for SAME54 2023-08-21 19:24:33 -03:00
Sergio R. Caprile 354ea30797 Add MQTT example and test for SAME54 2023-08-21 19:11:50 -03:00
Sergio R. Caprile 11303e0dc1 Merge pull request #2354 from cesanta/tst
Add MQTT test for MIP
2023-08-21 17:26:24 -03:00
Sergio R. Caprile b4c645f703 Add MQTT test for MIP 2023-08-21 17:22:42 -03:00
cpq 3256218fd2 Do uri len check after it is finalised 2023-08-21 17:16:48 +01:00
robert a4f14b0ddf improved tcp connection initiation 2023-08-21 10:22:53 -04:00
Sergio R. Caprile e7459d91f9 Merge pull request #2353 from cesanta/certs
Store certs in certs/. Add mg_unpacked()
2023-08-21 09:52:10 -03:00
cpq b32d1c15f0 Store certs in certs/. Add mg_unpacked() 2023-08-20 23:43:04 +01:00
Sergio R. Caprile 1e0d57a832 Merge pull request #2352 from cesanta/mip
Unify naming: all network stacks are in src/net_...
2023-08-18 16:40:57 -03:00
cpq f3617a1cf3 Add integer overflow protection 2023-08-18 20:33:57 +01:00
cpq 89a9a50b96 Unify naming: all network stacks are in src/net_... 2023-08-18 19:59:15 +01:00
cpq 69d2ba7316 Add example for nucleo-h563zi 2023-08-18 16:06:17 +01:00
robertc2000 3ea5f8dbde Merge pull request #2344 from cesanta/tcp-closure
improved tcp closure
2023-08-18 14:06:41 +03:00
Sergio R. Caprile d56152875d Merge pull request #2350 from cesanta/deprecate
deprecate mg_mkpipe()
2023-08-17 18:32:39 -03:00
Sergio R. Caprile 7459d30a28 deprecate mg_mkpipe() 2023-08-17 18:05:03 -03:00
Sergio R. Caprile 16bf9101aa Merge pull request #2349 from cesanta/isclosing
is_closing -> is_draining
2023-08-17 16:52:51 -03:00
Sergio R. Caprile 2b20af36a7 is_closing -> is_draining 2023-08-17 16:45:10 -03:00
robert f5e87cceec improved tcp closure 2023-08-17 10:34:31 -04:00
Sergey Lyubka 36fcb7ed21 Merge pull request #2347 from cesanta/cl
Fix #2322 - stricter Content-Length check, allow 1*DIGIT only
2023-08-17 14:58:01 +01:00
cpq 9fe7807b02 Fix #2322 - stricter Content-Length check, allow 1*DIGIT only 2023-08-17 12:55:08 +01:00
Sergey Lyubka 88e3017ee5 Merge pull request #2348 from cesanta/dns
Fix #2263 - allow multiple errors in DNS handler
2023-08-17 10:12:16 +01:00
cpq 17f3738192 Fix #2263 - allow multiple errors in DNS handler 2023-08-17 10:11:21 +01:00
Sergey Lyubka 6cfdc39005 Merge pull request #2346 from cesanta/regex
Fix #2345 - json parsing of arrays of objects
2023-08-16 22:10:13 +01:00
cpq 58886a9693 Fix #2345 - json parsing of arrays of objects 2023-08-16 22:09:45 +01:00
Sergey Lyubka 66e022c454 Merge pull request #2343 from cesanta/fuz
Add http serve to fuzzer
2023-08-16 20:46:27 +01:00
cpq ea3968601e Add http serve to fuzzer 2023-08-16 20:18:52 +01:00
Sergio R. Caprile 54be13d1d8 Merge pull request #2342 from cesanta/pio
Fix PIO assembly error
2023-08-14 16:17:37 -03:00
Sergio R. Caprile 22ea825d46 Fix PIO assembly error 2023-08-14 16:15:27 -03:00
Sergio R. Caprile 8c03aa2801 nit 2023-08-10 19:37:47 -03:00
Sergio R. Caprile 5bb952260a Merge pull request #2340 from cesanta/same54
SAME54 Ethernet driver
2023-08-10 19:26:50 -03:00
Sergio R. Caprile face6c44c6 SAME54 Ethernet driver
Add tls_builtin.c
2023-08-10 18:59:23 -03:00
Sergio R. Caprile 66c2bfe822 Merge pull request #2339 from cesanta/revert-2336-foo
Revert "Foo"
2023-08-10 18:16:38 -03:00
Sergio R. Caprile 3721bcc790 Revert "Foo" 2023-08-10 17:48:55 -03:00
Sergio R. Caprile cacab6fe4c Merge pull request #2338 from cesanta/keil
Keil
2023-08-09 17:17:57 -03:00
scaprile 6ad8674cd4 Add F4 Keil examples 2023-08-09 14:23:10 -03:00
novlean 847990ce49 Update README.md
Added URL to https://mongoose.ws/integration/
2023-08-09 17:50:57 +01:00
scaprile 1bfdc1f138 Add hw testing 2023-08-08 17:16:15 -03:00
Sergio R. Caprile 58367fe23e Merge pull request #2337 from cesanta/h7f
add H7 FreeRTOS example
2023-08-08 15:32:29 -03:00
Sergio R. Caprile a8712e2307 add H7 FreeRTOS example 2023-08-08 14:38:41 -03:00
robertc2000 8acfae1111 Merge pull request #2336 from cesanta/foo
Foo
2023-08-08 09:26:48 +03:00
cpq 70fc71c6f7 Changes 2023-08-07 06:18:49 -04:00
Sergio R. Caprile dd5118cab0 Merge pull request #2332 from cesanta/cube
update Cube test Makefile to support testing packaged examples
2023-08-04 17:11:22 -03:00
Sergio R. Caprile 2d75a6ccd4 update 2023-08-04 15:37:57 -03:00
Sergio R. Caprile e004ab1693 Merge pull request #2331 from cesanta/makefile
update Makefile
2023-08-04 14:45:56 -03:00
Sergio R. Caprile acddfc3bf4 update Makefile 2023-08-04 14:32:28 -03:00
cpq 519d4b0286 Changes 2023-08-04 13:53:01 +01:00
cpq 8005a5e687 Changes 2023-08-04 13:53:01 +01:00
cpq f5943fe591 Add tls_builtin.c 2023-08-04 13:53:01 +01:00
cpq cea7fcdb37 AVR build fixes 2023-08-04 13:52:59 +01:00
robert b5213c13dd SAME54 Ethernet driver 2023-08-04 13:48:55 +01:00
Sergio R. Caprile 3a06b4833c Merge pull request #2330 from cesanta/timeout
Timeout
2023-08-03 14:52:54 -03:00
Sergio R. Caprile 5cdf6c1d05 Add SYN timeout 2023-08-03 14:23:14 -03:00
Sergio R. Caprile 5754e5dd59 fix ARP timeout 2023-08-03 13:42:56 -03:00
Sergio R. Caprile e5ab1c454b Merge pull request #2329 from cesanta/arp
Implement ARP resolution for local LANs
2023-08-03 11:02:43 -03:00
cpq 697576b63c Implement ARP resolution for local LANs 2023-08-03 13:48:23 +01:00
Sergio R. Caprile 2db41aef09 Merge pull request #2328 from cesanta/ft
standardize example names
2023-08-02 16:20:05 -03:00
Sergio R. Caprile 7f4ad3cade standardize example names 2023-08-02 16:07:54 -03:00
Sergio R. Caprile 74c4c32082 Merge pull request #2327 from cesanta/rndis
standardize example names
2023-08-02 14:24:07 -03:00
Sergio R. Caprile 30d545443c standardize example names 2023-08-02 14:03:11 -03:00
Sergio R. Caprile dedba52315 Merge pull request #2325 from cesanta/fpu
FP unit in H743 is dp
2023-08-01 17:06:54 -03:00
Sergio R. Caprile 481f7b5cff FP unit in H743 is dp 2023-08-01 17:02:05 -03:00
Sergio R. Caprile 6ce4f4930c Merge pull request #2324 from cesanta/fb
standardize example names
2023-08-01 15:46:58 -03:00
Sergio R. Caprile e33a10db75 standardize example names 2023-08-01 15:24:28 -03:00
Sergio R. Caprile ef17055145 Merge pull request #2323 from cesanta/cube
standardize example names
2023-07-31 18:27:34 -03:00
Sergio R. Caprile 6a2fa10a4e standardize example names 2023-07-31 17:47:56 -03:00
Sergio R. Caprile 6b81a5846d Merge pull request #2320 from cesanta/2308collaterals
fix autogenerated
2023-07-28 17:47:49 -03:00
Sergio R. Caprile b54d086fde fix autogenerated 2023-07-28 17:06:58 -03:00
Sergio R. Caprile 5ee9d22263 momentarily disable MacOS OpenSSL tests 2023-07-26 15:53:59 -03:00
Sergio R. Caprile 7dcb097a5d momentarily disable OpenSSL tests 2023-07-26 15:49:03 -03:00
Sergio R. Caprile 29a30239ab momentarily disable OpenSSL tests 2023-07-26 15:33:30 -03:00
Sergio R. Caprile ed54b60ea3 update to new API 2023-07-25 18:41:41 -03:00
Sergio R. Caprile 199af33b30 update to new TLS API 2023-07-25 14:26:14 -03:00
Sergio R. Caprile adfa1d0e20 fix mongoose.h 2023-07-25 13:22:41 -03:00
Sergio R. Caprile ef25c42e86 fix unit tests for older compilers 2023-07-25 11:55:01 -03:00
Sergio R. Caprile 91a638156c Merge branch 'master' of https://github.com/cesanta/mongoose 2023-07-25 11:37:01 -03:00
Sergio R. Caprile 26ce666938 Merge branch 'master' of https://github.com/cesanta/mongoose 2023-07-25 11:35:29 -03:00
cpq 7548af895b H7 mbedtls build fixed 2023-07-25 15:34:22 +01:00
Sergio R. Caprile 9548437a9e update unit tests for new API 2023-07-25 11:27:01 -03:00
cpq 5e50b7104c Unit test fixed 2023-07-25 15:26:47 +01:00
cpq d824cf7dbd Add mbedtls to H7 baremetal 2023-07-25 15:03:01 +01:00
cpq 0613cc62f4 TLS API refactor 2023-07-25 13:07:28 +01:00
Sergey Lyubka d9cbcb5fa8 Merge pull request #2312 from cesanta/arduino
no Docker, in-place build for tests
2023-07-22 01:09:35 +01:00
Sergio R. Caprile a4f5355161 no Docker, in-place build for tests 2023-07-21 16:45:14 -03:00
Sergey Lyubka a24b6c1909 Merge pull request #2309 from cesanta/arduino
move Arduino tests to its dir
2023-07-21 14:33:00 +01:00
Sergio R. Caprile fd7dc72410 Merge pull request #2310 from cesanta/am
Add arduino/w5500-mqtt example
2023-07-21 10:27:20 -03:00
cpq e4f4dfab3b Add arduino/w5500-mqtt example 2023-07-21 13:54:41 +01:00
Sergio R. Caprile 66010be5a6 move Arduino tests to its dir 2023-07-20 20:22:06 -03:00
Sergio R. Caprile 852c42a8f3 static clue 2023-07-20 16:34:13 -03:00
Sergio R. Caprile 132725de7b Merge pull request #2308 from cesanta/nano
AVR build fixes
2023-07-20 14:12:49 -03:00
cpq 0a761c09e3 AVR build fixes 2023-07-20 16:07:53 +01:00
Sergey Lyubka 09ce6ae1c5 Merge pull request #2307 from cesanta/codeql
add CodeQL analysis
2023-07-20 14:37:18 +01:00
Sergio R. Caprile 85e60ed858 force run 2023-07-19 16:21:14 -03:00
Sergio R. Caprile 86fd18324b codeql 2023-07-19 16:14:44 -03:00
Sergio R. Caprile fdf82e5d6c codeql 2023-07-19 15:10:28 -03:00
Sergio R. Caprile eb0b1580d1 nits 2023-07-19 14:53:29 -03:00
Sergio R. Caprile 2d33c545b8 codeql 2023-07-19 14:53:29 -03:00
Sergio R. Caprile cdaf523aa8 codeql 2023-07-19 14:53:29 -03:00
Sergio R. Caprile 3195f2cec2 codeql 2023-07-19 14:53:29 -03:00
cpq ea89a4afab Revert "Integration page"
This reverts commit 3415b62d2d.
2023-07-19 18:50:27 +01:00
cpq 3415b62d2d Integration page 2023-07-19 16:25:14 +01:00
Sergey Lyubka ee80822564 Merge pull request #2306 from cesanta/nits
Nits
2023-07-19 06:00:32 +01:00
cpq 3c9e218d07 Nits 2023-07-19 05:08:28 +01:00
Sergio R. Caprile 387a602885 Merge pull request #2304 from cesanta/addressing
Addressing
2023-07-18 17:30:35 -03:00
Sergio R. Caprile ef0ff43975 static clue 2023-07-18 17:23:50 -03:00
Sergio R. Caprile ae37407369 static clue 2023-07-18 17:10:05 -03:00
cpq e1c91b5763 Merge branch 'master' of github.com:cesanta/mongoose 2023-07-18 17:47:02 +01:00
cpq c49b472f92 Ignore DHCP for static IP config 2023-07-18 17:46:52 +01:00
Sergey Lyubka 0a6b1b9418 Merge pull request #2297 from cesanta/2251-implement-tcp-retransmit-in-mip
implemented tcp retransmission
2023-07-16 04:53:06 +01:00
Sergio R. Caprile ac40673a9e test for retransmitted segment 2023-07-12 11:22:35 -04:00
cpq 818f99b286 Update examples to adopt to the new iface state 2023-07-12 14:09:30 +01:00
robert 320da5e84c implemented tcp retransmission 2023-07-11 06:20:47 -04:00
Sergey Lyubka 6957c379d5 Merge pull request #2294 from cesanta/hdr
Fix #2292 - fail on stray \r character in headers
2023-07-09 23:08:22 +01:00
cpq 88e880f107 Fix #2292 - fail on stray \r character in headers 2023-07-09 18:18:18 +01:00
cpq bf8c4dfc83 Merge branch 'master' of github.com:cesanta/mongoose 2023-07-07 08:44:33 +01:00
cpq 5dff282132 Fix #2293 - stricter header validity check 2023-07-07 08:44:25 +01:00
Sergio R. Caprile 1148ac0ae4 Merge pull request #2289 from cesanta/acl
update `mg_check_ip_acl`
2023-07-05 18:06:28 -03:00
Sergio R. Caprile 59c46fc594 update 2023-07-05 17:49:18 -03:00
cpq 03a94e3a6a Use \r\n for log messages, for terminal apps 2023-07-05 10:26:27 +01:00
Sergio R. Caprile 5c8e05a4fc bump revno up 2023-07-04 12:18:09 -03:00
Sergio R. Caprile d791ce393b remove old examples 2023-07-03 18:34:18 -03:00
Sergio R. Caprile a452231086 Merge pull request #2285 from cesanta/stm32
Stm32
2023-07-03 18:29:30 -03:00
Sergio R. Caprile a392a19c9c name changes 2023-07-03 18:27:32 -03:00
Sergio R. Caprile a864c04702 uniformize 2023-07-03 16:40:33 -03:00
Sergio R. Caprile 8d2f7296a1 remove old examples 2023-07-03 14:19:28 -03:00
robert 040936eb47 fixed mqtt vc98 warning 2023-07-03 10:49:18 -04:00
Sergey Lyubka 101beec3ae Merge pull request #2284 from cesanta/enhance-mg_remove_double_dots
enhanced path sanitizing
2023-07-03 14:43:32 +01:00
robert 2f1a836bf0 enhanced path sanitizing 2023-07-03 06:14:50 -04:00
cpq 62f5e0a1a9 Add SNTP to the list 2023-07-01 20:28:28 +01:00
cpq cca771e70e Stricter check for test_dns_error() 2023-07-01 20:23:59 +01:00
cpq 0c7e6b548f Standardise margin 2023-06-30 11:53:34 +01:00
robertc2000 8b87e8aa92 Merge pull request #2282 from cesanta/paginator
Make paginator bit more compact
2023-06-30 12:17:35 +03:00
Sergey Lyubka 415bbf2932 Merge pull request #2278 from cesanta/httpheaders
fix header truncation
2023-06-29 22:59:51 +01:00
Sergey Lyubka 48df4f18cd Merge pull request #2283 from cesanta/fuzz
Extend fuzzer, access parsed fields
2023-06-29 22:58:21 +01:00
Sergio R. Caprile dc0f9aca4a access only when parsing is valid 2023-06-29 18:37:10 -03:00
cpq 1b9b8e3f6c Extend fuzzer, access parsed fields 2023-06-29 16:34:15 +01:00
cpq 5d10e9dbee Make paginator bit more compact 2023-06-29 13:33:36 +01:00
Sergio R. Caprile 0adc858c85 add unit test 2023-06-28 11:01:59 -03:00
Sergio R. Caprile eda1e8a402 fix header truncation 2023-06-27 14:56:04 -03:00
Sergio R. Caprile 4b0e34cdf4 Merge pull request #2277 from cesanta/httpcodes
Reinstall extra HTTP codes
2023-06-27 14:53:10 -03:00
Sergio R. Caprile c688687ff8 Reinstall extra HTTP codes
the extra strings are not polluting the binary much
2023-06-27 13:44:44 -03:00
Sergio R. Caprile d56e5bea62 Merge pull request #2274 from cesanta/mqtt-var-length-issue
fixed mqtt variable length header issue
2023-06-27 09:48:20 -03:00
robert aed7b6b37a fixed mqtt variable length header issue 2023-06-27 01:00:45 -04:00
Sergio R. Caprile 8114443e97 Merge pull request #2276 from cesanta/keil
Keil
2023-06-26 18:33:43 -03:00
scaprile 8ba0a33f84 add hw test support 2023-06-26 18:29:52 -03:00
Sergio R. Caprile 661ed61779 add hw test support for Keil 2023-06-26 18:20:38 -03:00
robert 427f95337f event table device-dashboard: fixed wrong api call 2023-06-26 10:31:55 -04:00
Sergey Lyubka fa8490fb4e Merge pull request #2272 from WKJay/master
add RT-Thread support
2023-06-26 14:37:49 +01:00
WKJay 5be1c6381b add RT-Thread support 2023-06-26 16:18:40 +08:00
Sergey Lyubka 6794a89f79 Merge pull request #2270 from cesanta/dhcp
improve DHCP in MIP
2023-06-24 13:09:40 +01:00
robert 8f19ee7b97 event table POST request 404 error 2023-06-23 11:35:42 -04:00
robert c63135ec7f device-dashboard: fixed event table POST request 2023-06-23 08:03:44 -04:00
robert 5c87f2f22c improved device dashboard events table 2023-06-23 07:21:24 -04:00
Sergio R. Caprile 6e6e34c423 improve DHCP in MIP 2023-06-22 18:55:48 -03:00
Sergio R. Caprile bb983fb4b2 update tutorial link 2023-06-22 11:00:37 -03:00
Sergio R. Caprile 285bbf50e9 Merge pull request #2268 from cesanta/cube
add more FreeRTOS+lwIP on Cube examples
2023-06-22 10:59:06 -03:00
Sergio R. Caprile c2ad2e1151 add more FreeRTOS+lwIP on Cube examples 2023-06-21 19:00:10 -03:00
Sergio R. Caprile 46e796ffaa Merge pull request #2267 from cesanta/cube
add more FreeRTOS on Cube examples
2023-06-21 11:34:20 -03:00
Sergio R. Caprile 3bf25d86f2 add tests for new Cube examples 2023-06-21 11:32:10 -03:00
Sergio R. Caprile 2dca4805b0 add more FreeRTOS on Cube examples 2023-06-21 11:21:24 -03:00
Sergio R. Caprile 54aa4678d1 Merge pull request #2265 from cesanta/cube
Cube
2023-06-20 14:48:36 -03:00
Sergio R. Caprile 3ab0e6cade add new Cube examples 2023-06-20 14:35:59 -03:00
Sergio R. Caprile 41e3b23253 rename tutorial 2023-06-20 12:04:38 -03:00
Sergio R. Caprile b00d780a50 Merge pull request #2261 from cesanta/dhcp
fix DHCP xid being ignored
2023-06-19 19:07:22 -03:00
Sergio R. Caprile 71b3e26232 fix DHCP xid being ignored 2023-06-19 18:50:51 -03:00
Sergio R. Caprile 40f28c02b9 Merge pull request #2262 from cesanta/cubetests
Cubetests
2023-06-19 17:13:05 -03:00
Sergio R. Caprile 362b22a673 Add hw test to cube examples 2023-06-19 16:58:37 -03:00
Sergio R. Caprile d6be9a2bba wip 2023-06-19 14:36:49 -03:00
Sergey Lyubka 6bfd113a87 Merge pull request #2260 from cesanta/2259-refactor-event-log-page-for-examplesdevice-dashboard
refactored device-dashboard code
2023-06-19 18:24:15 +01:00
robert b7f86ba743 refactored device-dashboard code 2023-06-19 06:28:00 -04:00
cpq 2bab274056 Fix build error 2023-06-16 15:57:18 +01:00
robertc2000 dd6bffdd0d Merge pull request #2256 from cesanta/2253-implement-event-log-page-for-examplesdevice-dashboard
implemented event log page for the device dashboard
2023-06-16 11:44:49 +03:00
robert bcc044eb92 implemented event log page for the device dashboard 2023-06-16 04:32:45 -04:00
robert a7f1982d03 improved device table style from the wifi-router-dashboard 2023-06-14 09:18:07 -04:00
Sergey Lyubka d013e0fc78 Merge pull request #2254 from cesanta/2249-implement-connected-devices-page-for-wifi-router-dashboard
implemented connected devices page
2023-06-14 11:17:06 +01:00
robert 6f69ad93c1 implemented connected devices page 2023-06-13 03:33:11 -04:00
Sergey Lyubka 7ea2093a91 Merge pull request #2250 from cesanta/2241-optimise-struct-mg_addr
optimized mg_addr structure
2023-06-09 14:54:27 +01:00
robert dd32deb2ad optimized mg_addr structure 2023-06-09 09:19:37 -04:00
Sergey Lyubka ad71fb321c Merge pull request #2247 from cesanta/2243-refacrtor-wifi-router-dashboard-example
refactored dashboards
2023-06-08 16:03:11 +01:00
Sergey Lyubka cc6c28a7ff Merge pull request #2248 from cesanta/F746TLS
Improve performance on F746 with MbedTLS
2023-06-08 16:02:24 +01:00
Sergio R. Caprile c763087462 improve performance 2023-06-08 11:29:51 -03:00
robert 63ff4ddea0 refactored dashboards 2023-06-08 10:25:59 -04:00
Sergey Lyubka 4178fc125d Merge pull request #2245 from cesanta/2235-fix
byte-encoded properties issue fixed
2023-06-08 13:32:23 +01:00
Sergio R. Caprile dcfa7ad657 Merge pull request #2246 from cesanta/tst
Improve MQTT tests resiliency
2023-06-07 19:01:23 -03:00
Sergio R. Caprile c061e60664 Improve MQTT tests resiliency 2023-06-07 18:34:55 -03:00
Ubuntu a0dd3ecd68 byte-encoded properties issue fixed 2023-06-07 10:13:21 -04:00
Sergio R. Caprile 0168a312f2 Merge pull request #2240 from cesanta/dhcp
Renew dhcp lease
2023-06-07 09:39:01 -03:00
cpq 92fe5a5b58 Renew dhcp lease 2023-06-07 13:33:28 +01:00
Sergey Lyubka 7f3d450b32 Merge pull request #2242 from cesanta/FEATURE_Add_tls_context_to_mg_mgr
Adding tls_ctx into mg_mgr for storing TLS context shared by all TLS session
2023-06-07 08:44:53 +01:00
Allan Park 8166339920 Adding tls_ctx into mg_mgr for storing TLS context shared by all TLS sessions 2023-06-07 10:21:46 +03:00
Sergio R. Caprile 57424d4a26 Merge pull request #2239 from cesanta/rlcomments
comment
2023-06-06 18:51:31 -03:00
Sergio R. Caprile 6511b6dd5d comment 2023-06-06 18:48:45 -03:00
Sergio R. Caprile 0625b97246 Merge pull request #2238 from cesanta/f7
Improve driver
2023-06-06 18:46:50 -03:00
Sergio R. Caprile 9f8ce82825 Improve driver 2023-06-06 18:32:11 -03:00
Sergey Lyubka c3c925dc84 Merge pull request #2230 from cesanta/rl
RL: fix accept() not looping on BSD_EWOULDBLOCK
2023-06-06 19:42:17 +01:00
Sergio R. Caprile 36f3703499 Merge pull request #2236 from cesanta/devsys
move dependencies
2023-06-06 14:47:27 -03:00
Sergio R. Caprile 6ae59c3711 move dependencies 2023-06-06 14:35:44 -03:00
Sergio R. Caprile c8f5f85635 Merge pull request #2234 from cesanta/tests
speed up MQTT tests
2023-06-06 10:58:54 -03:00
Sergio R. Caprile 4e5e186784 speed up MQTT tests 2023-06-06 10:44:18 -03:00
cpq 828f7a513c Merge branch 'master' of github.com:cesanta/mongoose 2023-06-06 08:38:18 +01:00
cpq 6085998d57 Proper handling {} in JSON array + unit test 2023-06-06 08:38:08 +01:00
Sergio R. Caprile 71e44d5b65 Merge pull request #2233 from cesanta/disambiguate
disambiguate comments
2023-06-05 18:57:25 -03:00
Sergio R. Caprile e762bbdbf8 disambiguate comments 2023-06-05 18:39:13 -03:00
cpq fe0d2272f6 Export mg_json_unescape() 2023-06-03 09:28:59 +01:00
Sergio R. Caprile e017b88adf Merge pull request #2228 from cesanta/tls
Add TLS=1 option
2023-06-02 14:33:34 -03:00
Sergey Lyubka 5f76d9cf33 Merge pull request #2231 from cesanta/Kfixs
standardize header inclusion
2023-06-02 17:35:56 +01:00
Sergio R. Caprile 85a5bdf4dc standardize header inclusion 2023-06-02 13:27:27 -03:00
Sergio R. Caprile 4abc34ffd1 fix accept() not looping on BSD_EWOULDBLOCK 2023-06-02 11:56:27 -03:00
Sergey Lyubka 250b1d511b Merge pull request #2229 from cesanta/mqttst
MQTT QoS + v5
2023-06-02 10:49:49 +01:00
cpq 59e3b0285a Add TLS=mbedtls option 2023-06-02 09:57:36 +01:00
cpq f961f993c8 FD_SETSIZE fix 2023-06-02 06:57:39 +01:00
cpq adf124c00c Dont check fd against FD_SETSIZE if POLL or EPOLL are used 2023-06-01 22:55:15 +01:00
Sergio R. Caprile f8579131e8 MQTT QoS + v5 2023-05-31 21:35:03 -03:00
Sergio R. Caprile 1dde754724 Merge pull request #2223 from cesanta/devdash
Fix Secure
2023-05-31 09:32:57 -03:00
Sergio R. Caprile 771696fda8 Fix Secure 2023-05-31 09:30:24 -03:00
Sergey Lyubka dd5f469c83 Merge pull request #2224 from cesanta/qos2
fix qos=2 handling
2023-05-31 12:07:10 +01:00
Sergio R. Caprile 6d3fda12cd Merge pull request #2225 from cesanta/Kfixs
Add HTTP_URL
2023-05-30 17:13:05 -03:00
Sergio R. Caprile dc32480563 Add HTTP_URL 2023-05-30 16:02:00 -03:00
Sergio R. Caprile 06ac9e18cb fix qos=2 handling 2023-05-30 14:49:32 -03:00
Sergio R. Caprile 0648943220 Merge pull request #2221 from cesanta/Kfixs
Kfixs
2023-05-29 21:30:41 -03:00
Sergio R. Caprile 7a4a82e872 Add HTTP_URL 2023-05-29 20:59:56 -03:00
Sergio R. Caprile 6c0c05cf7f Add missing headers 2023-05-29 14:34:51 -03:00
Sergio R. Caprile efd2db129f Merge pull request #2219 from cesanta/Kfixs
standardize header inclusion
2023-05-29 11:57:00 -03:00
Sergio R. Caprile f4f276f370 standardize header inclusion 2023-05-29 11:44:59 -03:00
cpq bff1462e9e Add config var size check 2023-05-28 17:06:47 +01:00
Sergio R. Caprile 4d06f33089 fixes 2023-05-26 20:58:54 -03:00
Sergio R. Caprile a433d9ef03 Merge pull request #2217 from cesanta/db
Refactor device-dashboard
2023-05-26 20:53:17 -03:00
Sergio R. Caprile 58606e1702 Refactor device-dashboard 2023-05-26 20:45:08 -03:00
Sergey Lyubka 1ccc9aa72e Merge pull request #2205 from cesanta/arbitrary_content-length
improve negative Content-length handling
2023-05-26 17:16:08 +01:00
cpq 49a9bb5a8b Refactor device-dashboard 2023-05-26 16:20:25 +01:00
Sergey Lyubka 380d6ac5c2 Merge pull request #2215 from cesanta/tlsdash
improve TLS behaviour in dashboard
2023-05-26 08:24:53 +01:00
Sergio R. Caprile 7d9f76df05 improve TLS behaviour in dashboard 2023-05-25 15:23:45 -03:00
Sergey Lyubka 96707acb4e Merge pull request #2214 from cesanta/makelinux
make more distro-friendly
2023-05-24 21:02:46 +01:00
cpq 4e504823c0 Merge branch 'master' of github.com:cesanta/mongoose 2023-05-24 21:02:23 +01:00
cpq 82faa2e9c9 Make UI independent of URI 2023-05-24 21:02:15 +01:00
Sergio R. Caprile 1df9cd8071 make more distro-friendly 2023-05-24 15:37:24 -03:00
Sergio R. Caprile a8d5e4dd28 Merge pull request #2213 from cesanta/nitpicks
nitpicks
2023-05-24 15:20:08 -03:00
Sergio R. Caprile e59ea39a33 nitpicks 2023-05-24 15:17:24 -03:00
Sergio R. Caprile 62d1dc1eea Merge pull request #2212 from cesanta/lwipstack
set a more lwIP-friendly minimum stack in FreeRTOS
2023-05-24 14:46:28 -03:00
Sergio R. Caprile 379af7dec2 set a more lwIP-friendly minimum stack in FreeRTOS 2023-05-24 11:30:01 -03:00
cpq 68a45adac7 Update logo 2023-05-24 13:52:52 +01:00
cpq 9ea8e29cb0 Merge branch 'master' of github.com:cesanta/mongoose 2023-05-24 13:22:18 +01:00
cpq 90092c0762 Make WebUI API calls relative, to work under any URI 2023-05-24 13:22:11 +01:00
Sergio R. Caprile b379816178 Merge pull request #2210 from cesanta/devdash
run pack on Win
2023-05-23 11:06:47 -03:00
Sergio R. Caprile e4353255ca run pack on Win 2023-05-23 11:02:24 -03:00
cpq 923f2c7635 Add DHCP settings 2023-05-23 08:43:57 +01:00
cpq a8309ef705 Remove -DSIGPIPE=0 for Windows 2023-05-23 03:50:53 +01:00
cpq bad05485d0 Define SIGPIPE for Win32, fix sleep() for Win32 2023-05-23 03:49:24 +01:00
cpq 38d7799ffa Rename wifi-router -> wifi-router-dashboard 2023-05-23 02:40:45 +01:00
Sergio R. Caprile 6e6696ccd4 Merge pull request #2207 from cesanta/wifi
Add wifi-router example
2023-05-22 19:59:06 -03:00
cpq feb546920e Add wifi-router example 2023-05-22 19:48:34 -03:00
Sergio R. Caprile 81b05b9de4 Merge pull request #2208 from cesanta/fixwbind
fix bind issue in W
2023-05-22 19:46:42 -03:00
Sergio R. Caprile ab10b042be fix bind issue in W 2023-05-22 19:13:48 -03:00
Sergio R. Caprile 26699914cc improve negative Content-length handling 2023-05-22 17:40:08 -03:00
Sergio R. Caprile 45e4b3c423 bump revno up 2023-05-18 12:26:19 -03:00
Sergio R. Caprile 6a5a139e33 Merge pull request #2201 from cesanta/MG_ESC
Update to use MG_ESC()
2023-05-17 14:38:17 -03:00
Sergio R. Caprile 1908d3200e Update to use MG_ESC() 2023-05-17 14:26:45 -03:00
Sergio R. Caprile f4cf40d38f Merge pull request #2200 from cesanta/esc
Add MG_ESC helper macro
2023-05-17 09:41:39 -03:00
cpq 514de84b97 Add MG_ESC helper macro 2023-05-17 11:58:40 +01:00
Sergio R. Caprile 7e7d0bb354 Merge pull request #2199 from cesanta/docinsource
remove stalled doc in header
2023-05-16 18:40:41 -03:00
Sergio R. Caprile e468b90442 remove stalled doc in header 2023-05-16 18:08:48 -03:00
Sergio R. Caprile 926959ab47 Merge pull request #2197 from cesanta/BUGFIX_handle_http_negative_content_length
Added check for negative value for HTTP Content-Length header
2023-05-16 16:11:14 -03:00
Allan Park 4663090a8f Added check for negative value for HTTP Content-Length header 2023-05-16 18:52:33 +03:00
Sergey Lyubka b0868a4d0b Merge pull request #2194 from cesanta/frp
Fix http-reverse-proxy for keep-alive incoming connections
2023-05-16 09:20:21 +01:00
Sergio R. Caprile 9088b00006 Fix keep-alive 2023-05-15 14:11:12 -03:00
Sergio R. Caprile 9c0fe8999d Merge pull request #2193 from cesanta/tuts
link to tutorial
2023-05-12 17:30:52 -03:00
Sergio R. Caprile 901aa5f7c1 link to tutorial 2023-05-12 17:30:06 -03:00
Sergio R. Caprile 3ee28c035b Merge pull request #2191 from cesanta/tuts
link to tutorial
2023-05-12 10:21:42 -03:00
Sergio R. Caprile 1e31b90905 link to tutorial 2023-05-12 10:20:38 -03:00
cpq 48333041f4 Apply SO_EXCLUSIVEADDRUSE and SO_REUSEADDR on windows 2023-05-12 14:08:49 +01:00
cpq 717c9dbe89 On Windows, prefer EXCLADDRINUSE, then REUSEADDR 2023-05-09 11:25:18 +01:00
Sergio R. Caprile fd86eb7aa7 Merge pull request #2184 from cesanta/tuts
link to tutorial
2023-05-08 18:31:50 -03:00
Sergio R. Caprile 9b4b35eff5 link to tutorial 2023-05-08 18:23:35 -03:00
Sergio R. Caprile ac528caf2b Merge pull request #2182 from cesanta/keil
simplify RTOS-related Keil examples
2023-05-05 18:49:27 -03:00
scaprile fbe626e791 simplify RTOS-related Keil examples 2023-05-05 17:41:47 -03:00
Sergio R. Caprile 9ca37d30d8 Merge pull request #2179 from cesanta/tuts
link to tutorials
2023-05-04 19:17:51 -03:00
Sergio R. Caprile 84986898c8 link to tutorials 2023-05-04 19:16:43 -03:00
Sergey Lyubka 5cebce3f4b Merge pull request #2173 from cesanta/arp
Add multicast and local broadcast MAC resolution
2023-04-29 12:01:01 +01:00
Sergey Lyubka bb344b14a8 Merge pull request #2168 from cesanta/udp-listener
Fix UDP listeners in MIP
2023-04-29 12:00:33 +01:00
Sergey Lyubka 20e613b444 Merge pull request #2169 from cesanta/udp-printf
Fix mg_xprint() for UDP in MIP
2023-04-29 11:59:46 +01:00
Sergey Lyubka a0952e0012 Merge pull request #2171 from cesanta/null_fs
Check for calloc() failure in filesystem code
2023-04-29 11:59:03 +01:00
Sergey Lyubka 49e66f809e Merge pull request #2172 from cesanta/null_mip
Check for calloc() failure in MIP
2023-04-29 11:57:25 +01:00
Sergey Lyubka 5152ed8731 Merge pull request #2174 from cesanta/ti-rndis
Add TI RNDIS example
2023-04-29 11:56:29 +01:00
cpq 33811a826f Include TCP/IP API only if enabled 2023-04-29 11:45:28 +01:00
Sergio R. Caprile d33aebfd31 Add TI RNDIS example 2023-04-28 11:23:40 -03:00
Sergio R. Caprile 7d53c52a6b Check for calloc() failure in MIP 2023-04-27 11:34:23 -03:00
Sergio R. Caprile f015a8686e Check for calloc() failure in filesystem code 2023-04-27 11:19:02 -03:00
Sergio R. Caprile ab791d2a2d Add multicast and local broadcast MAC resolution 2023-04-26 19:56:03 -03:00
Sergio R. Caprile a303858da7 Fix mg_xprint() for UDP in MIP 2023-04-26 18:32:54 -03:00
Sergio R. Caprile 4c58c62cfe Fix UDP listeners 2023-04-26 15:09:27 -03:00
Sergey Lyubka 4593332204 Merge pull request #2166 from cesanta/gzip
Fix #1927: respect Accept-Encoding when serving .gz files
2023-04-26 10:01:24 +01:00
cpq 9f5d8c4280 Fix #1927: respect Accept-Encoding when serving .gz files 2023-04-26 09:07:43 +01:00
Sergey Lyubka b0d44bf0ba Merge pull request #2165 from cesanta/mqtt
mqtt fixes
2023-04-25 08:27:01 +01:00
cpq 59b8434e36 mqtt fixes 2023-04-25 07:48:33 +01:00
Sergey Lyubka e6f27cbaf3 Merge pull request #2160 from robertc2000/master
MQTT: support for user properties feature added
2023-04-23 18:33:56 +01:00
robert 6c13df1aff MQTT: support for properties feature added 2023-04-23 16:35:50 +03:00
Sergey Lyubka 44bf059b2f Merge pull request #2158 from cesanta/ipv6
Fix #2089 - allow to bind v4 and v6 sockets on the same port
2023-04-18 08:26:47 +01:00
cpq 9ade464c2e Fix #2089 - allow to bind v4 and v6 sockets on the same port 2023-04-18 08:26:18 +01:00
Sergio R. Caprile aed5d4e05b Merge pull request #2159 from cesanta/testf7ft
Testf7ft
2023-04-17 17:04:31 -03:00
Sergio R. Caprile b57648df14 Update test.yml 2023-04-17 17:02:52 -03:00
Sergio R. Caprile 7bce887077 Relax test time 2023-04-17 16:59:36 -03:00
Sergio R. Caprile cacd9c7f95 Merge pull request #2156 from cesanta/xprintf
Remove %H %V %Q %q modifiers
2023-04-14 14:24:46 -03:00
Sergio R. Caprile cd64bfe84b Remove %H %V %Q %q modifiers 2023-04-14 10:13:22 -03:00
Sergio R. Caprile 52ed68ed24 Merge pull request #2154 from cesanta/keil
Add Keil examples and preliminary test
2023-04-12 10:16:12 -03:00
Sergey Lyubka 20577021a6 Merge pull request #2151 from cesanta/multi-threaded
Fix for some compilers
2023-04-12 10:02:27 +01:00
scaprile 838a2236a1 Add preliminary test 2023-04-11 17:47:38 -03:00
scaprile d03941b792 Add Keil examples 2023-04-11 17:46:28 -03:00
Sergio R. Caprile 92299c3079 Fix for some compilers 2023-04-11 08:41:14 -03:00
cpq d9f05532cd Address #2125: treat negative poll time as infinite wait 2023-04-10 15:04:37 +01:00
Sergio R. Caprile 2fd2dff126 Merge pull request #2138 from cesanta/printh
Add printf.h
2023-04-07 19:53:07 -03:00
Sergio R. Caprile 8e14ad0536 Add printf.h 2023-04-07 19:28:00 -03:00
Sergio R. Caprile 2b325102f3 Merge pull request #2143 from cesanta/dbl
Fix #2104 - %.*f formatting
2023-04-07 12:27:15 -03:00
Sergio R. Caprile 1f2be606fa Fix wildcard usage 2023-04-07 12:21:14 -03:00
cpq 6b29a2a724 Fix #2104 - %.*f formatting 2023-04-07 08:38:28 +01:00
Sergey Lyubka f79edeb053 Merge pull request #2145 from cesanta/cube
Cube
2023-04-07 08:29:54 +01:00
Sergio R. Caprile 84b92096d4 Add STM32CubeIDE examples and test for build 2023-04-06 17:33:45 -03:00
Sergio R. Caprile 70f4814cb1 Merge pull request #2144 from cesanta/test
Test TLS host verif with no CA
2023-03-31 17:04:39 -03:00
Sergio R. Caprile 49579eb2b4 Test host only TLS mode 2023-03-31 17:00:05 -03:00
Sergey Lyubka cc6caeeca9 Merge pull request #2139 from cesanta/freertos-tcp
FreeRTOS+ TCP support
2023-03-30 10:51:52 +01:00
Sergey Lyubka 90af22eba1 Merge pull request #2141 from cesanta/hc1
fix outdated comment
2023-03-30 10:51:25 +01:00
cpq f4b4b41264 Merge branch 'master' of github.com:cesanta/mongoose 2023-03-30 10:50:27 +01:00
cpq 9918b03c11 Enhance MQTT client 2023-03-30 10:49:16 +01:00
Sergio R. Caprile 95f44246bf fix old comment 2023-03-29 11:46:40 -03:00
Sergio R. Caprile b098723f78 Update test.yml 2023-03-27 18:19:48 -03:00
Sergio R. Caprile a819513a92 Remove old example and its breadcrumbs 2023-03-27 18:14:55 -03:00
Sergio R. Caprile 7531b28b4c Add refactored FreeRTOS-Plus-TCP example 2023-03-25 13:07:31 -03:00
Sergio R. Caprile 2b8586d1b7 Merge pull request #2134 from cesanta/freertos-tcp
Fix FreeRTOS-Plus-TCP
2023-03-24 16:42:59 -03:00
Sergio R. Caprile 8167291ffc Fix FreeRTOS-Plus-TCP 2023-03-24 15:28:32 -03:00
Sergio R. Caprile 0dfcf9607a Merge pull request #2132 from cesanta/freertos-tcp
Let FreeRTOS-Plus-TCP build on Keil
2023-03-23 22:02:44 -03:00
Sergio R. Caprile 4827831107 Let FreeRTOS-Plus-TCP build on Keil 2023-03-23 17:13:02 -03:00
Sergio R. Caprile 0ebb6d5d30 Merge pull request #2131 from cesanta/cmsis-rtos
Add arch for CMSIS-RTOS v1 and v2
2023-03-22 11:18:37 -03:00
Sergio R. Caprile f4ed5062f6 Add arch for CMSIS-RTOS v1 and v2 2023-03-21 19:32:56 -03:00
Sergio R. Caprile 434b129746 Merge pull request #2129 from cesanta/frerrno
Remove no longer necessary includes
2023-03-21 14:13:35 -03:00
Sergio R. Caprile 2f5041ac7d Remove no longer necessary includes 2023-03-21 14:08:35 -03:00
Sergio R. Caprile 24f9766b39 Merge pull request #2128 from cesanta/keil
Let lwIP and FreeRTOS build on Keil
2023-03-21 13:58:09 -03:00
Sergio R. Caprile ba872217d7 Let lwIP and FreeRTOS build on Keil 2023-03-21 12:09:00 -03:00
Sergey Lyubka b2ae517dac Merge pull request #2119 from cesanta/armcc
Add MG_ARCH_ARMCC
2023-03-20 22:01:40 +00:00
Sergio R. Caprile 32b52dc0c8 Merge pull request #2121 from cesanta/nomip-collateral
remove references to MIP in examples (comments)
2023-03-15 10:10:46 -03:00
Sergio R. Caprile 33a3fe9bbd remove references to MIP in examples (comments) 2023-03-15 09:43:22 -03:00
Sergio R. Caprile 245dc76503 Add MG_ARCH_ARMCC 2023-03-15 09:39:36 -03:00
Sergio R. Caprile 21dbfd79d8 Merge pull request #2120 from cesanta/chaudocs
Move docs to website
2023-03-14 09:55:52 -03:00
Sergio R. Caprile b9f2250278 Move docs to website 2023-03-14 09:54:29 -03:00
Sergio R. Caprile a0601f1891 Merge pull request #2118 from cesanta/testTM4c
update Makefile
2023-03-10 10:58:51 -03:00
Sergio R. Caprile 70403ee433 update Makefile 2023-03-10 10:45:30 -03:00
Sergio R. Caprile f3cde58c8f Merge pull request #2117 from cesanta/testTM4C
test only TM4C examples that have changes
2023-03-10 10:20:18 -03:00
Sergio R. Caprile 71c267776a Update test.yml 2023-03-10 10:19:39 -03:00
Sergio R. Caprile 359ff94a8c Merge pull request #2116 from cesanta/testTM4c
Test TM4C
2023-03-10 10:01:48 -03:00
Sergio R. Caprile efe1c1492f Merge pull request #2115 from cesanta/scaprile-patch-1
test TM4C
2023-03-10 10:00:28 -03:00
Sergio R. Caprile 2aaaf7c358 test TM4C 2023-03-10 09:59:56 -03:00
Sergio R. Caprile cefaffa0f0 update Makefile 2023-03-10 09:54:26 -03:00
Sergio R. Caprile a22d56dc41 Merge pull request #2114 from cesanta/standex
update
2023-03-10 09:37:36 -03:00
Sergio R. Caprile 51eca94504 update 2023-03-10 09:35:29 -03:00
Sergio R. Caprile 2b6d24d328 Merge pull request #2112 from cesanta/nomip-collateral
MIP_STATE_* -> MG_TCPIP_STATE_*
2023-03-10 09:27:11 -03:00
Sergio R. Caprile 4932025423 Merge pull request #2113 from cesanta/scaprile-patch-1
Update test.yml
2023-03-09 11:44:11 -03:00
Sergio R. Caprile c466abf4d0 Update test.yml 2023-03-09 11:43:32 -03:00
Sergio R. Caprile 2ece3a8b4c MIP_STATE_* -> MG_TCPIP_STATE_* 2023-03-09 11:25:02 -03:00
Sergio R. Caprile 3f760e1875 Merge pull request #2111 from cesanta/standex
standardize Zephyr examples
2023-03-08 17:35:39 -03:00
Sergio R. Caprile 1da134c38c Merge pull request #2110 from cesanta/pico-w5500
Gen MAC from board ID, standardize
2023-03-08 17:30:54 -03:00
Sergio R. Caprile 0bf96e9864 standardize Zephyr examples 2023-03-08 16:41:21 -03:00
Sergio R. Caprile 1f5c19306e Gen MAC from board ID, standardize 2023-03-08 11:51:55 -03:00
Sergio R. Caprile db10b3821c Merge pull request #2109 from cesanta/standex
Standex
2023-03-08 11:50:30 -03:00
Sergio R. Caprile 4245a6d04d update 2023-03-08 11:44:34 -03:00
Sergio R. Caprile 6920c1159b rework serial config 2023-03-07 16:02:02 -03:00
Sergio R. Caprile 3801e1eade Merge pull request #2107 from cesanta/standex
read MAC from flash
2023-03-07 15:59:14 -03:00
Sergio R. Caprile 3e419303a7 read MAC from flash 2023-03-06 17:33:17 -03:00
Sergio R. Caprile 0de1e6a3af Merge pull request #2106 from cesanta/standex
Standardize TM4C FreeRTOS
2023-03-06 16:01:49 -03:00
Sergio R. Caprile 99c415f898 Standardize TM4C FreeRTOS 2023-03-06 15:57:51 -03:00
Sergio R. Caprile f68d83dbf0 Merge pull request #2103 from cesanta/standex
standardize TM4C baremetal
2023-03-02 20:57:41 -03:00
Sergio R. Caprile 6e97905bce standardize TM4C baremetal 2023-03-02 20:44:35 -03:00
Sergio R. Caprile 572a10d5a0 Merge pull request #2100 from cesanta/standex
Update Makefiles and READMEs
2023-03-01 11:30:08 -03:00
Sergio R. Caprile eaa6199de0 Update Makefiles and READMEs 2023-03-01 11:28:24 -03:00
Sergio R. Caprile 70799101e4 Merge pull request #2099 from cesanta/standex
Update symlinks and Makefiles
2023-02-28 18:25:24 -03:00
Sergio R. Caprile 9cc70d0323 Update symlinks and Makefiles 2023-02-28 18:18:26 -03:00
cpq 20c5da6e55 Fix build - NULL pointer check 2023-02-28 17:55:25 +00:00
cpq 4c356bc368 Merge branch 'master' of github.com:cesanta/mongoose 2023-02-28 17:41:37 +00:00
Sergio R. Caprile aeb04deae4 Merge pull request #2098 from cesanta/tstexmac 2023-02-28 14:22:05 -03:00
Sergio R. Caprile 873e4d6547 Update Makefile 2023-02-28 14:18:39 -03:00
Sergio R. Caprile 9ba20304c2 Update test.yml 2023-02-28 14:14:57 -03:00
Sergio R. Caprile 252619b1a0 Merge pull request #2097 from cesanta/tstexwin
Test some examples on Windows
2023-02-28 14:07:10 -03:00
Sergio R. Caprile 38b129de66 Test some examples on Windows
closes #2047
2023-02-28 14:04:02 -03:00
Sergey Lyubka da028d1af9 Merge pull request #2096 from cesanta/fixrmii
Update RMII example, enhance MIP
2023-02-28 08:34:20 +00:00
Sergio R. Caprile bba361016d Update RMII ex, enhance MIP 2023-02-27 18:30:53 -03:00
Sergio R. Caprile c362af1f81 Merge pull request #2095 from cesanta/fixrndis
Fix RNDIS examples
2023-02-27 11:35:05 -03:00
Sergio R. Caprile 520507afd9 unbreak RNDIS examples 2023-02-27 11:28:42 -03:00
Sergio R. Caprile 4e7584167b force check and failures 2023-02-27 10:54:32 -03:00
Sergio R. Caprile 112bd61a25 Merge pull request #2094 from cesanta/fixwf
Update test.yml
2023-02-27 10:23:52 -03:00
Sergio R. Caprile 1df8bc0dfe Update test.yml
Fix embedded matrix workflow not signalling changes and not running
2023-02-27 10:22:52 -03:00
cpq f2076fe309 Add more tests for mg_strstr() 2023-02-26 01:32:03 +00:00
Sergey Lyubka 67dea15bf2 Merge pull request #2076 from cesanta/q
Use mg_queue in mip
2023-02-24 19:57:20 +00:00
cpq 910f19fe55 Use mg_queue in mip 2023-02-24 19:40:31 +00:00
Sergio R. Caprile 290bf0b6d2 Merge pull request #2093 from cesanta/standex
update Makefiles and symlinks
2023-02-24 15:49:35 -03:00
Sergio R. Caprile 4c87a776e6 updated Makefiles and symlinks 2023-02-24 13:46:31 -03:00
Sergio R. Caprile 4436093816 Merge pull request #2092 from cesanta/standex
standardize examples
2023-02-23 19:07:44 -03:00
Sergio R. Caprile b85aa7b084 Merge pull request #2090 from cesanta/tcp
mark we consumed data
2023-02-23 14:38:14 -03:00
Sergio R. Caprile 99e28b639d mark we consumed data 2023-02-23 14:35:26 -03:00
Sergio R. Caprile 9b94b4da26 fix build for Windows
(read from stdin does not work)
2023-02-23 14:04:10 -03:00
Sergio R. Caprile 5b46986628 update Makefiles and symlinks 2023-02-23 11:32:53 -03:00
Sergio R. Caprile d0e5690bfd Merge pull request #2088 from cesanta/standex
update Makefiles and symlinks
2023-02-22 16:58:49 -03:00
Sergio R. Caprile ddbfa06bcc update Makefiles and symlinks 2023-02-22 16:38:21 -03:00
Sergio R. Caprile 2c6fc99c68 Merge pull request #2084 from cesanta/standex
updated Makefiles and symlinks
2023-02-21 17:31:02 -03:00
Sergio R. Caprile d8ad0ac72c updated Makefiles and symlinks 2023-02-21 16:05:25 -03:00
Sergio R. Caprile 9de50d7981 Merge pull request #2083 from cesanta/standex
#2046 #2047
2023-02-21 14:53:04 -03:00
Jean-François SimonandJean-Francois Simon 2c5c46dc48 Fix headers (drivers) (#2081)
Co-authored-by: Jean-Francois Simon <jfsimon@startmail.com>
2023-02-21 16:39:53 +01:00
Jean-François SimonandJean-Francois Simon 6423b4cbb9 rt1020 driver check frame crc/truncated (#2080)
Co-authored-by: Jean-Francois Simon <jfsimon@startmail.com>
2023-02-21 16:27:04 +01:00
Sergio R. Caprile 2566aa725a http-proxy-client Makefile 2023-02-21 12:16:39 -03:00
Sergio R. Caprile eb463bbb2b READMEs, golden update collaterals, etc 2023-02-21 12:07:48 -03:00
Sergio R. Caprile 1a8a559d84 Merge pull request #2079 from cesanta/time
Fix #2075. Add MG_HTTP_DIRLIST_TIME_FMT, remove MG_HTTP_DIRLIST_TIME and MG_HTTP_DIRLIST_TIME_UTC
2023-02-20 20:13:56 -03:00
cpq 57c1d787e3 Fix #2075. Add MG_HTTP_DIRLIST_TIME_FMT, remove MG_HTTP_DIRLIST_TIME and MG_HTTP_DIRLIST_TIME_UTC 2023-02-20 21:25:55 +00:00
Sergey Lyubka 999a32424f Merge pull request #2078 from cesanta/standex
Golden Makefiles
2023-02-20 19:54:02 +00:00
Sergio R. Caprile c2ed20ba23 Golden Makefiles 2023-02-20 16:20:28 -03:00
Sergio R. Caprile 01cbb37359 Merge pull request #2077 from cesanta/standex
huge response
2023-02-20 16:17:15 -03:00
Sergio R. Caprile 3e205e9536 huge response 2023-02-20 16:15:30 -03:00
Sergio R. Caprile b29d6b4478 _sbrk in TI 2023-02-17 11:11:31 -03:00
Sergey Lyubka b9424e4c21 Merge pull request #2073 from cesanta/sbrk
Fix _sbrk()
2023-02-17 14:00:32 +00:00
Sergio R. Caprile 87fe912d8d Merge pull request #2074 from cesanta/standex
Standardize examples and make them Windows friendly
2023-02-17 10:59:55 -03:00
Sergio R. Caprile 59343c2f82 http-client 2023-02-17 10:57:54 -03:00
Sergio R. Caprile 700fc64383 update devdash README 2023-02-17 10:40:53 -03:00
Sergio R. Caprile ca256b9949 Win friendly #2047 2023-02-17 10:40:53 -03:00
cpq 68750f3455 Expand on integration steps 2023-02-17 10:49:05 +00:00
cpq 906fc417c8 Expand on crossplatform ability 2023-02-17 10:46:45 +00:00
cpq ac203c56df Expand on crossplatform ability 2023-02-17 10:46:16 +00:00
cpq 734ad45f1c Expand on crossplatform ability 2023-02-17 10:44:55 +00:00
cpq 4a1f2e0dd3 Fix mg_fs_posix.st() for Windows symlinks using ftell 2023-02-17 10:36:06 +00:00
cpq 24e3514640 Fix mg_fs_posix.st() for Windows symlinks 2023-02-17 10:20:33 +00:00
Sergio R. Caprile dadb05e022 Add heap limit 2023-02-16 15:17:19 -03:00
cpq ca3dfb3c07 Docs notes 2023-02-16 16:41:26 +00:00
cpq cf452942fa More windows-friendly makefile for rp2040/pico-w5500 2023-02-16 14:23:52 +00:00
Sergey Lyubka 28ee40bebe Merge pull request #2067 from cesanta/pico
Use RNG in examples/pico-w5500
2023-02-16 08:01:11 +00:00
cpq 6267752a2a Use RNG in examples/pico-w5500 2023-02-16 07:53:11 +00:00
Sergey Lyubka 2ece24e077 Merge pull request #2066 from cesanta/queue
Refactor queue
2023-02-15 22:33:07 +00:00
Sergio R. Caprile 59013e62d3 Merge pull request #2072 from cesanta/standex
Standardize examples
2023-02-15 18:07:54 -03:00
Sergio R. Caprile 824763aae9 standardize 2023-02-15 18:04:48 -03:00
Sergey Lyubka a8c5b04feb Merge pull request #2070 from cesanta/fixcl
Fix content-length header in mg_http_reply()
2023-02-15 19:22:03 +00:00
Sergey Lyubka 64f069ec24 Merge pull request #2043 from cesanta/randomize
Seed fallback clib PRNG with some entropy
2023-02-15 19:20:50 +00:00
cpq 515e438d4f Refactor queue 2023-02-15 18:53:44 +00:00
Sergio R. Caprile 9ec064f9d9 symlinks 2023-02-15 15:22:46 -03:00
Sergio R. Caprile 60c6b04a01 Add mg_srand() and seed with some entropy 2023-02-15 14:29:02 -03:00
Sergio R. Caprile 9deaa81a72 Merge pull request #2071 from cesanta/standex
captive-dns
2023-02-15 14:27:15 -03:00
Sergio R. Caprile ae703db6ee captive-dns 2023-02-15 14:22:48 -03:00
Sergio R. Caprile 267f54bc0e Fix content-length header in mg_http_reply() 2023-02-15 11:28:14 -03:00
cpq 8aa26fb2cd Fix fuzzer workflow 2023-02-15 14:25:04 +00:00
cpq e7667f2537 Merge branch 'master' of github.com:cesanta/mongoose 2023-02-14 15:12:59 +00:00
cpq bac15d2ecf Fix #2063 - a typo 2023-02-14 15:12:51 +00:00
Sergio R. Caprile ae27e07903 Merge pull request #2068 from cesanta/stm32-rndis
Standardize STM32 RNDIS examples
2023-02-14 12:10:55 -03:00
Sergio R. Caprile 605dfa7366 Standardize STM32 RNDIS examples 2023-02-13 18:40:09 -03:00
Sergio R. Caprile 85db19e33f Merge pull request #2064 from cesanta/renaming-stm32
simplify names
2023-02-13 17:00:40 -03:00
Sergio R. Caprile 052bc6b356 Merge pull request #2065 from cesanta/scaprile-patch-1
Update test.yml
2023-02-13 16:59:09 -03:00
Sergio R. Caprile 24985e2bca Update test.yml 2023-02-13 16:58:33 -03:00
Sergio R. Caprile 8e3eb8b3d2 simplify names 2023-02-13 16:54:26 -03:00
Sergio R. Caprile 2be44dbd94 Merge pull request #2061 from cesanta/efe4f
Update and standardize F4 FreeRTOS
2023-02-13 11:08:31 -03:00
Sergio R. Caprile 7c6b26faa2 Merge pull request #2062 from cesanta/scaprile-patch-2
Update test.yml
2023-02-13 11:07:41 -03:00
Sergio R. Caprile cfc42512ed Update test.yml 2023-02-13 11:07:16 -03:00
Sergio R. Caprile 50f5834296 Update and standardize F4 FreeRTOS 2023-02-13 10:53:59 -03:00
Jean-François SimonandJean-Francois Simon 07e91bb73a Fix build mip -> mg_tcpip (#2060)
Co-authored-by: Jean-Francois Simon <jfsimon@startmail.com>
2023-02-13 12:02:57 +01:00
Sergey Lyubka 3c547eeed8 Merge pull request #2059 from cesanta/test
Serialize HW tests
2023-02-13 08:16:57 +00:00
cpq 6f011fce3b Serialize HW tests 2023-02-13 03:10:09 +00:00
cpq 5aebed95a4 Fix VC98 build 2023-02-12 10:41:51 +00:00
Sergey Lyubka 8321f9f6e9 Merge pull request #2034 from cesanta/queue
Add struct mg_queue and API, change examples/multi-threaded, add tests
2023-02-12 10:04:13 +00:00
cpq bf9d69ab56 Add struct mg_queue and API, change examples/multi-threaded, add tests 2023-02-11 13:24:26 +00:00
Sergio R. Caprile faaff57d2b update Makefile 2023-02-10 21:24:42 -03:00
Sergio R. Caprile 40667ef1c1 Update Makefile 2023-02-10 20:52:55 -03:00
Sergio R. Caprile 04b4e3298b Merge pull request #2056 from cesanta/f7f
Make example as README says
2023-02-10 20:30:06 -03:00
Sergio R. Caprile 43cbd3a61e Merge pull request #2058 from cesanta/scaprile-patch-1
make F7 FreeRTOS testable
2023-02-10 20:24:04 -03:00
Sergio R. Caprile bfb091f2f4 make F7 FreeRTOS testable 2023-02-10 20:23:39 -03:00
Sergio R. Caprile 4974303e6b Make example as README says 2023-02-10 20:06:25 -03:00
Sergio R. Caprile 664bb0a663 Merge pull request #2055 from cesanta/makefiles
minor updates
2023-02-10 19:45:09 -03:00
Sergio R. Caprile 491596d03d minor updates 2023-02-10 19:41:27 -03:00
Sergio R. Caprile 75538be235 Merge pull request #2054 from cesanta/efe4
Standardize F4 baremetal
2023-02-10 17:28:05 -03:00
Sergio R. Caprile 1cb99ea2fc Standardize F4 baremetal 2023-02-10 15:53:55 -03:00
Sergey Lyubka c0f4bde5fc Merge pull request #2051 from cesanta/fmt
Split mg_*printf* functions into src/printf.c/h
2023-02-10 16:52:34 +00:00
cpq a4430dd49d Split mg_*printf* functions into src/printf.c/h 2023-02-10 15:47:23 +00:00
Jean-François SimonandJean-Francois Simon b513d40bd6 add coverage ws.c (#2050)
Co-authored-by: Jean-Francois Simon <jfsimon@startmail.com>
2023-02-10 15:51:44 +01:00
cpq fbaaf89a21 Update screenshot 2023-02-09 22:47:48 +00:00
cpq 7625a0154e Using webp for screenshots 2023-02-09 22:41:49 +00:00
cpq 396ee803b2 Remove -c core.symlinks arg from the clone command 2023-02-09 20:06:53 +00:00
cpq 5a42319a07 Add readme rule 2023-02-09 20:04:59 +00:00
cpq 61b9820f78 Update READMEs 2023-02-09 20:04:07 +00:00
Sergio R. Caprile a383a45269 Merge pull request #2044 from cesanta/eph1
Fix ifp->eport init
2023-02-09 16:41:25 -03:00
Sergio R. Caprile 7bd4869ae6 Merge pull request #2048 from cesanta/rules
Add a rule on symlink
2023-02-09 16:12:23 -03:00
cpq 49a6559453 Add a rule on symlink 2023-02-09 19:00:10 +00:00
cpq 2e16a10720 Fix ifp->eport init 2023-02-09 18:39:14 +00:00
Sergey Lyubka cd973b50ff Merge pull request #2042 from cesanta/eph
Use linux ephemeral range (start from 32768). More TCP debug
2023-02-09 17:40:49 +00:00
cpq b6fc67fff2 Use linux ephemeral range (start from 32768). More TCP debug 2023-02-09 15:20:08 +00:00
Jean-François Simon 12f00d785d mg_tcpip_imxrt1020 (#2033)
MG_TCPIP driver for NXP i.MX RT1020
2023-02-09 15:31:59 +01:00
Jean-François Simon de1ff6ed49 Add test to mqtt (#2041)
Test coverage mqtt
2023-02-09 15:05:55 +01:00
Sergio R. Caprile d0a6cbe5dd Merge pull request #2038 from cesanta/h7
Use CMSIS for H7
2023-02-09 09:18:09 -03:00
cpq 35924ce550 Use CMSIS for H7 2023-02-09 11:08:22 +00:00
Jean-François Simon ad1d8cbedd Add test to mqtt (#2040)
coverage: mqtt
2023-02-09 11:36:08 +01:00
Sergey Lyubka 6294ce59f7 Merge pull request #2035 from cesanta/rndismass
Add mass-storage disk with an index file
2023-02-08 15:58:18 +00:00
Sergio R. Caprile d445ff40c2 Add mass-storage disk with an index file 2023-02-08 12:38:11 -03:00
Sergey Lyubka c6010c3ab4 Merge pull request #2031 from cesanta/sym
Note about symlinks
2023-02-08 12:56:16 +00:00
Sergio R. Caprile 9da80d7b7d Merge pull request #2032 from cesanta/move
Move mip/ -> src/tcpip/, rename mip_ -> mg_tcpip_
2023-02-08 09:49:06 -03:00
cpq 2c62e58dbd Move mip/ -> src/tcpip/, rename mip_ -> mg_tcpip_ 2023-02-07 21:35:37 +00:00
Sergio R. Caprile efc54375dd Merge pull request #2028 from cesanta/mip
Kill ARP cache, kill qprofile
2023-02-07 15:42:20 -03:00
cpq 0c3946033b Note about symlinks 2023-02-07 15:42:17 +00:00
cpq 9dc86aa77d Kill ARP cache, kill qprofile 2023-02-07 14:26:03 +00:00
Sergey Lyubka 0cbe320a5f Merge pull request #2029 from cesanta/rules
Add examples/readme with rules
2023-02-07 13:41:37 +00:00
cpq 1c749a5310 Add filter for cifuzz 2023-02-07 12:17:46 +00:00
cpq a647a69791 Add examples/readme with rules 2023-02-07 12:15:50 +00:00
Sergey Lyubka 12db089c73 Merge pull request #2027 from cesanta/mip
Introduce sysinit.c, better debug log, more verbose Makefile
2023-02-06 22:38:33 +00:00
cpq f5ff7cfcf1 Introduce sysinit.c, better debug log, more verbose Makefile 2023-02-06 21:26:14 +00:00
Sergey Lyubka 2ddf71ec46 Merge pull request #2024 from cesanta/cmsis
Use CMSIS headers for f429 and f746 baremetal examples
2023-02-06 19:16:24 +00:00
Sergio R. Caprile 9017374292 Merge pull request #2025 from cesanta/ga
Tune GA checker
2023-02-06 14:28:26 -03:00
cpq 633f50cf5b Tune GA checker 2023-02-06 15:18:40 +00:00
cpq 1993e9c65b Use CMSIS headers for f429 and f746 baremetal examples 2023-02-06 15:00:09 +00:00
Sergio R. Caprile 8edc8610dc Merge pull request #2023 from cesanta/push
Reduce the number of redundant test runs. Disable SNTP test on macos …
2023-02-06 11:25:33 -03:00
Sergey Lyubka 6700b373cd Merge pull request #2022 from cesanta/win
Adopt Makefile for Windows. Update examples readme section
2023-02-06 14:21:56 +00:00
cpq 8d824799a0 Reduce the number of redundant test runs. Disable SNTP test on macos - it is flaky 2023-02-05 01:11:22 +00:00
cpq dc86c62d8b Adopt Makefile for Windows. Update examples readme section 2023-02-04 14:15:53 +00:00
Sergio R. Caprile 4ae4ff72e3 Merge pull request #2020 from cesanta/h743zi
Add STM32H743ZI driver and example
2023-02-03 18:33:46 -03:00
Sergio R. Caprile 958eebb16c Add STM32H743ZI driver and example 2023-02-03 18:04:29 -03:00
Sergio R. Caprile 43e48d2ba6 Merge pull request #2017 from cesanta/mipneat
qprofile related fixes
2023-02-02 17:34:28 -03:00
Sergio R. Caprile b6d8099c74 small tweaks
fix qprofile with latest changes

minor tweaks and qpfrofile related fixes
2023-02-02 17:09:27 -03:00
Sergio R. Caprile 25bac7c5ce Merge pull request #2016 from cesanta/percentia
Docs update, remove %I and %A extensions
2023-02-02 16:33:18 -03:00
Sergio R. Caprile 5d7a080e39 Remove %I and %A 2023-02-02 16:28:24 -03:00
Sergio R. Caprile b2a76dba98 Merge pull request #2014 from cesanta/halfnofast
Add support for 10M and half-duplex in STM32 and TM4C drivers
2023-02-02 13:30:35 -03:00
cpq 15ad69c8cb Add How to build examples section 2023-02-02 15:34:27 +00:00
Sergio R. Caprile e3ca006265 Add support for 10M and half-duplex in STM32 and TM4C drivers 2023-02-02 12:02:44 -03:00
cpq 961cc13948 Nits: fix DNS resolution message. Add Makefile comment for testing targets 2023-02-02 10:33:00 +00:00
Sergio R. Caprile 50da233258 Merge pull request #2011 from cesanta/test-f746
Update test.yml
2023-02-01 20:14:24 -03:00
Sergio R. Caprile 15ad58b5cc Merge pull request #2010 from cesanta/f429-debug-uart
Use UART_DEBUG
2023-02-01 19:53:53 -03:00
Sergio R. Caprile 61a27ff430 Update test.yml
closes #1999
( mods in #2009 )
2023-02-01 19:49:14 -03:00
Sergio R. Caprile befdb0a708 Merge pull request #2009 from cesanta/test-f746
Mods to be testable
2023-02-01 19:39:53 -03:00
Sergio R. Caprile 06b79600ac Use UART_DEBUG 2023-02-01 19:37:35 -03:00
Sergio R. Caprile b9e633ad06 Mods to be testable 2023-02-01 19:26:47 -03:00
Sergio R. Caprile 736a78faed Merge pull request #2007 from cesanta/rl
Better error handling for RL NET
2023-02-01 18:23:13 -03:00
cpq d76e69f9a7 Use UART_DEBUG 2023-02-01 21:08:24 +00:00
cpq 1612e1d142 Better error handling for RL NET 2023-02-01 13:59:47 +00:00
Sergio R. Caprile 56a33fd4c5 Merge pull request #2003 from cesanta/mip-percentia
Do not use %I %A in MIP
2023-02-01 09:15:15 -03:00
Sergio R. Caprile 1ca3244868 Merge pull request #2005 from cesanta/nosymlink
Remove symlinks in pico example
2023-01-31 15:40:37 -03:00
Sergio R. Caprile 8f358f09b8 Remove symlinks in pico example 2023-01-31 15:34:15 -03:00
Sergio R. Caprile d903de6526 Merge pull request #2004 from cesanta/nodupfiles
Remove dups in Zephyr dirs
2023-01-31 15:14:10 -03:00
Sergio R. Caprile c41ade2983 Remove dups in Zephyr dirs 2023-01-31 14:51:48 -03:00
Sergio R. Caprile 99dbbc7f39 Do not use %I %A in MIP 2023-01-31 14:37:00 -03:00
Sergio R. Caprile 4dd51cc889 Merge pull request #2002 from cesanta/print_mac
Add mg_print_mac()
2023-01-31 13:49:42 -03:00
Sergio R. Caprile 54c651f7e2 Add mg_print_mac() 2023-01-31 13:31:46 -03:00
Sergio R. Caprile d1c9d7ffdc Merge pull request #2000 from cesanta/tls
Add TLS to pico-w5500 baremetal example
2023-01-30 18:37:00 -03:00
cpq 052b40680d Add TLS to pico-w5500 baremetal example 2023-01-30 21:30:10 +00:00
Sergio R. Caprile b0d2519192 Merge pull request #2001 from cesanta/examples-percentia
do not use %I in examples
2023-01-30 18:21:18 -03:00
Sergio R. Caprile 997da11cc5 do not use %I 2023-01-30 17:13:38 -03:00
Sergio R. Caprile 476232ea22 Merge pull request #1995 from cesanta/mg_print_ip
Add mg_print_ip, mg_print_ip_port helper functions
2023-01-30 16:57:45 -03:00
Sergey Lyubka 4c83f4e2de Merge pull request #1987 from hakabahitoyo/bugfix-openssl-tls-sni
Bugfix OpenSSL TLS SNI
2023-01-30 11:43:43 +00:00
cpq 4bf39e18d9 Add mg_print_ip, mg_print_ip_port helper functions 2023-01-29 14:30:06 +00:00
cpq edfa533a4d Correct the description 2023-01-27 22:45:35 +00:00
cpq 28262145ab Better upload flow 2023-01-27 22:16:24 +00:00
cpq 51136ce982 Merge branch 'master' of github.com:cesanta/mongoose 2023-01-27 09:36:24 +00:00
cpq 84893ec582 Small usability nits 2023-01-27 09:36:16 +00:00
Sergio R. Caprile 4236405b90 Ready to release 2023-01-24 13:30:45 -03:00
Sergio R. Caprile 292c66e25c Merge pull request #1992 from cesanta/revert-1920-patch-1
Revert "Update comment for the path of rest API"
2023-01-24 11:42:18 -03:00
Sergio R. Caprile 5aa6c15c76 Revert "Update comment for the path of rest API" 2023-01-24 11:41:51 -03:00
Sergio R. Caprile 1f89dc47cb Merge pull request #1991 from cesanta/revert-1797-fix-typo
Revert "Fix typo in documentation"
2023-01-24 11:36:51 -03:00
Sergio R. Caprile 31393128c8 Revert "Fix typo in documentation" 2023-01-24 11:35:26 -03:00
Sergio R. Caprile 232a18425a Merge pull request #1990 from cesanta/revert-1705-master
Revert "fix the doc error: htts to https"
2023-01-24 11:33:02 -03:00
Sergio R. Caprile 88e2eb2a49 Revert "fix the doc error: htts to https" 2023-01-24 11:31:25 -03:00
Sergey Lyubka e635d5f748 Merge pull request #1986 from cesanta/w5
Add examples/rp2040/pico-w5500 to hwtest
2023-01-23 12:32:14 +00:00
Sergey Lyubka 08a23cdb2f Merge pull request #1988 from cesanta/h743
Add nucleo-h743zi-baremetal boilerplate, with HW test
2023-01-23 12:31:55 +00:00
cpq 1ead940623 Add nucleo-h743zi-baremetal boilerplate, with HW test 2023-01-22 11:48:56 +00:00
Hakaba Hitoyo 382362668e bugfix openssl tls sni 2023-01-22 14:27:44 +09:00
cpq 987f8bc949 Prep for msc 2023-01-21 13:42:25 +00:00
cpq 6f096333d3 make clean: invoke docker only when there is something to clean 2023-01-21 07:44:50 +00:00
cpq 5a25111b20 Add examples/rp2040/pico-w5500 to hwtest 2023-01-21 02:21:20 +00:00
Sergio R. Caprile c7cb16cafa Merge pull request #1984 from cesanta/ti-nodocker
Get rid of Docker (TI), part 2: FreeRTOS
2023-01-20 18:47:55 -03:00
Sergio R. Caprile a746a698b6 Merge pull request #1983 from cesanta/stm32-nodocker
Get rid of Docker, part 2: FreeRTOS
2023-01-20 18:47:27 -03:00
Sergio R. Caprile 9a7f7255ff Get rid of Docker, part 2: FreeRTOS 2023-01-20 18:20:19 -03:00
Sergio R. Caprile d3df6b8f4f Get rid of Docker (TI), part 2: FreeRTOS 2023-01-20 18:19:29 -03:00
Sergio R. Caprile fcffd17b11 Merge pull request #1982 from cesanta/freertos
Fix FreeRTOS arch includes on newlib platforms
2023-01-20 18:16:55 -03:00
Sergio R. Caprile 7fc6be9f39 Fix FreeRTOS arch includes on newlib platforms 2023-01-20 18:09:21 -03:00
Sergio R. Caprile 7362744ff8 Merge pull request #1981 from cesanta/stm32uarts
Fix UART1,2 clocking in all other examples
2023-01-20 18:00:46 -03:00
Sergio R. Caprile f4d058155a Fix UART1,2 clocking in all other examples 2023-01-20 17:49:57 -03:00
Sergio R. Caprile b04612e80d Merge pull request #1975 from cesanta/hwtest
Cleanup, adopt for HW test
2023-01-20 16:26:05 -03:00
Sergio R. Caprile 5f00e4d34d Merge pull request #1980 from cesanta/ti-nodocker
Get rid of Docker (TI), part 1
2023-01-20 16:21:45 -03:00
cpq e967feb091 Cleanup, adopt for HW test 2023-01-20 18:46:19 +00:00
Sergio R. Caprile 0445b18bb9 Merge pull request #1977 from cesanta/reallyclean
Apply a deeper cleanser
2023-01-20 15:36:51 -03:00
Sergio R. Caprile 99f1f749cf Apply a deeper cleanser 2023-01-20 15:27:37 -03:00
Sergio R. Caprile f4d16f1c47 Get rid of Docker (TI), part 1 2023-01-20 15:06:03 -03:00
Sergio R. Caprile 68071d6caf Merge pull request #1976 from cesanta/stm32-nodocker
Get rid of Docker, part 1
2023-01-20 14:14:07 -03:00
Sergio R. Caprile 44975da7db Get rid of Docker, part 1 2023-01-20 12:42:38 -03:00
Sergio R. Caprile e4566518b2 Merge pull request #1978 from cesanta/test-nosprintf
Make MacOS happy by getting rid of sprintf()
2023-01-20 12:41:09 -03:00
novlean c038cb5b96 Merge pull request #1979 from cesanta/novlean-patch-1
2023
2023-01-20 15:31:07 +00:00
novlean d7eb3db60b 2023 2023-01-20 15:28:16 +00:00
Sergio R. Caprile 44e781d7da Make MacOS happy be getting rid of sprintf() 2023-01-20 11:54:56 -03:00
Sergio R. Caprile 0951d58c8f Merge pull request #1974 from cesanta/stm32uarts
Fix AF in UART1,2
2023-01-19 16:31:55 -03:00
Sergio R. Caprile 37c0ed0b49 Fix AF in UART1,2 2023-01-19 15:28:51 -03:00
cpq 556bf7b888 Fix uart_init(), use correct AF for UART1/UART2 2023-01-19 10:31:26 +00:00
Sergey Lyubka 280be2eaea Merge pull request #1968 from cesanta/ackstream
Don't retrigger ACK timer
2023-01-18 08:52:12 +00:00
Sergio R. Caprile 13f9357f8e Merge pull request #1970 from cesanta/test-pico-rndis
Update test.yml
2023-01-17 15:19:45 -03:00
Sergio R. Caprile 56e015db0e Enable test for pico-rndis-dashboard 2023-01-17 14:58:05 -03:00
Sergio R. Caprile 1068fbf079 Merge pull request #1969 from cesanta/pico-dash
Simplify build
2023-01-17 13:59:54 -03:00
Sergio R. Caprile 45f7afb3e1 Simplify build 2023-01-17 13:54:22 -03:00
Sergio R. Caprile 0d3fc2b656 Don't retrigger ACK timer 2023-01-16 20:16:59 -03:00
Sergio R. Caprile 2dc66b2e3b Merge pull request #1966 from cesanta/test-pico-rmii
Update test.yml
2023-01-16 16:48:10 -03:00
Sergio R. Caprile 0b9129d8f5 Update test.yml 2023-01-16 15:36:50 -03:00
cpq 82d702fedc mg_url_encode() 0-terminate the destination 2023-01-16 15:05:04 +00:00
Sergey Lyubka 197be75677 Merge pull request #1960 from cesanta/keepalive
TCP keepalives
2023-01-16 10:40:28 +00:00
cpq 3f9aff1b10 Update uart logs with Ethernet status 2023-01-15 12:03:40 +00:00
Sergey Lyubka f5ed50fa88 Merge pull request #1959 from cesanta/handle-rst
Handle TCP RST
2023-01-14 00:16:40 +00:00
Sergio R. Caprile 645b52602f Update main.c 2023-01-13 15:08:00 -03:00
Sergio R. Caprile 27a8e60e9a TCP keepalives 2023-01-12 15:58:25 -03:00
Sergio R. Caprile 201ffa108b Handle TCP RST 2023-01-11 17:33:37 -03:00
Sergey Lyubka 1661bd6691 Merge pull request #1955 from cesanta/picormii
Add RMII example for RP2040
2023-01-11 10:40:10 +00:00
Sergio R. Caprile d431f4bbc5 Merge pull request #1957 from cesanta/pico-w5500
updated to ARCH_RP2040
2023-01-10 11:21:23 -03:00
Sergio R. Caprile 2b8e92a70d updated to ARCH_RP2040 2023-01-10 10:54:27 -03:00
Sergey Lyubka d70ab3cfa8 Merge pull request #1944 from cesanta/devdash
Add reduced functionality version
2023-01-10 12:31:03 +00:00
Sergey Lyubka 9402c6ad28 Merge pull request #1956 from cesanta/lbl
Rename struct mg_connection::label -> data. Make its size configurable
2023-01-10 08:34:22 +00:00
cpq da5e8e9778 Rename struct mg_connection::label -> data. Make its size configurable 2023-01-10 08:19:49 +00:00
Sergio R. Caprile feedfdf810 Update main.c 2023-01-09 14:31:04 -03:00
Sergio R. Caprile 6db0a502bf Add RMII example 2023-01-09 11:16:01 -03:00
Sergey Lyubka f07957d45e Merge pull request #1952 from cesanta/mipqueue
Rename mip_rxcb to mip_qwrite, add mip_qread and enforce rx() for drivers
2023-01-08 06:47:38 +00:00
cpq 3d75d71767 Do not show response handler in the rpc.list result 2023-01-08 06:38:08 +00:00
Sergio R. Caprile b259bdeddd Rename mip_rxcb to mip_qwrite, add mip_qread and enforce rx() for drivers 2023-01-03 19:33:26 -03:00
Sergey Lyubka 042465387f Merge pull request #1950 from cesanta/picodash
Add Pico dashboard
2023-01-02 20:14:34 +00:00
Sergio R. Caprile d09e4d648c Add Pico dashboard 2023-01-02 16:49:15 -03:00
Sergio R. Caprile 754910ad5f Merge pull request #1947 from cesanta/pico
Moved pico-w example
2023-01-02 15:48:24 -03:00
Sergio R. Caprile 977e080215 Update test.yml 2023-01-02 15:29:21 -03:00
Sergio R. Caprile a9ac947c96 Merge pull request #1949 from cesanta/scaprile-patch-1
Update test.yml
2023-01-02 15:23:15 -03:00
Sergio R. Caprile 28e6ef1d63 Update test.yml 2023-01-02 15:22:24 -03:00
Sergio R. Caprile b0f273157d Fix Makefile 2023-01-02 15:16:50 -03:00
Sergio R. Caprile 49add531c4 Moved pico-w example 2023-01-02 15:12:07 -03:00
cpq 8a1d2a5dca Install gcc-arm-none-eabi for examples 2023-01-02 17:53:55 +00:00
Sergey Lyubka 31c5883f5f Merge pull request #1946 from cesanta/rp2040-w5500
Add pico-w5500 example
2023-01-02 16:48:43 +00:00
Sergey Lyubka c625fbb43d Merge branch 'master' into rp2040-w5500 2023-01-02 16:48:34 +00:00
cpq 0f474e8d2a Add pico-w5500 example 2023-01-02 16:36:55 +00:00
Sergey Lyubka 73813a8383 Merge pull request #1943 from cesanta/add-test-for-RNDIS-examples
Update tests
2022-12-28 02:47:56 +00:00
Sergio R. Caprile d8fb110b56 Update test.yml 2022-12-27 20:34:10 -03:00
Sergio R. Caprile 77e62626a9 Add RNDIS examples to tests, remove "stm32/nucleo*" examples from "examples" test group 2022-12-27 20:27:08 -03:00
Sergio R. Caprile 24ee83f13d Update test.yml 2022-12-27 18:31:39 -03:00
Sergio R. Caprile 6791a36d85 Add reduced functionality version 2022-12-27 18:12:55 -03:00
Sergio R. Caprile c6a5a64e64 Update test.yml 2022-12-26 10:51:44 -03:00
Sergey Lyubka 311062dc41 Merge pull request #1938 from cesanta/F746rndis
Add RNDIS example for F7
2022-12-24 15:10:00 +00:00
Sergio R. Caprile 391ce1f009 Merge pull request #1939 from cesanta/tireadme
Added link to tutorial
2022-12-23 19:47:14 -03:00
Sergio R. Caprile 9f6d99352a Added link to tutorial 2022-12-23 19:45:57 -03:00
Sergio R. Caprile 02b1d6260a Add RNDIS example for F7 2022-12-23 19:28:33 -03:00
Sergio R. Caprile e8ade14259 Merge pull request #1937 from cesanta/tm4cdriverdata
Rename driver data structure
2022-12-23 16:27:42 -03:00
Sergio R. Caprile f0804dfed4 Merge pull request #1936 from cesanta/stm32driverdata
Rename driver data structure
2022-12-23 15:57:19 -03:00
Sergio R. Caprile f506344ada Rename driver data structure 2022-12-23 15:56:46 -03:00
Sergio R. Caprile ddca518cca Rename driver data structure 2022-12-23 15:45:30 -03:00
cpq 21d3678fa7 Add more on logging 2022-12-21 11:31:14 +00:00
cpq 3dd8d7d8e5 Add diagrams 2022-12-21 11:18:50 +00:00
Sergio R. Caprile 92aa538a84 Merge pull request #1934 from cesanta/myheart
Unbreak
2022-12-20 19:39:22 -03:00
Sergio R. Caprile 557a5583e8 Unbreak 2022-12-20 19:38:20 -03:00
Sergio R. Caprile b00ddff7dd Merge pull request #1933 from cesanta/fixmqttserver
Fix MQTT server example
2022-12-20 16:08:56 -03:00
Sergio R. Caprile cc3b311ab0 Fix MQTT server example 2022-12-20 16:06:46 -03:00
cpq 6cedca5d76 Remove DS_Store 2022-12-19 14:40:17 +00:00
Sergey Lyubka d82452e00f Merge pull request #1929 from cesanta/usb
Add TinyUSB example
2022-12-19 14:33:11 +00:00
cpq 57a5c0ba38 Add TinyUSB example 2022-12-19 14:31:54 +00:00
Sergio R. Caprile 28c8519e5b Merge pull request #1924 from cesanta/scaprile-patch-1
Update README.md
2022-12-15 10:31:37 -03:00
Sergio R. Caprile cfcb7191ea Update README.md 2022-12-15 09:52:19 -03:00
Sergey Lyubka 6921227ec8 Merge pull request #1915 from jfsimon1981/miptap
Mip tests and tuntap example to compile on OpenBSD natively.
2022-12-13 16:42:09 +00:00
Sergey Lyubka 1c9991ee83 Merge pull request #1916 from cesanta/stm32
Minor tweaks in STM32 examples
2022-12-13 16:40:38 +00:00
Sergey Lyubka fd475fcfff Merge pull request #1917 from cesanta/tm4c
Correct stack initialization
2022-12-13 16:40:10 +00:00
Sergio R. Caprile f47f995e90 Merge pull request #1921 from cesanta/scaprile-patch-1
Update test.yml
2022-12-13 13:02:11 -03:00
Sergio R. Caprile d93e943326 Update test.yml 2022-12-13 12:51:43 -03:00
Sergio R. Caprile 7ca9f2d5cd Merge pull request #1920 from jojo2massol/patch-1
Update comment for the path of rest API
2022-12-13 12:39:28 -03:00
jojo2massol ff1d45a008 Update comment for the path of rest API
rest api is available at `/rest` and not `/api/rest`
2022-12-13 15:33:51 +01:00
Sergio R. Caprile 53f0a72362 Merge pull request #1919 from cesanta/doc1918
Update README.md
2022-12-10 20:14:30 -03:00
Sergio R. Caprile 3a47242219 Update README.md
Closes #1918
2022-12-10 20:12:58 -03:00
Jean-Francois Simon 5556568feb Mip tests and tuntap example to compile on OpenBSD natively.
(updated for c++ build)

Fix typo
2022-12-09 18:48:05 +00:00
Sergio R. Caprile 6011a15cd4 Correct stack initialization 2022-12-09 15:47:23 -03:00
Sergio R. Caprile 2c014778d9 Minor tweaks in STM32 examples
Fix comments in newer mip initialization (main.c)
Correct stack initialization (boot.c)
Remove SCC clock enable when not needed (mcu.h)
2022-12-09 15:20:51 -03:00
Sergey Lyubka 0b2712f52f Merge pull request #1911 from cesanta/gwarp
Ask for gw mac when needed and not known
2022-12-09 11:51:40 +00:00
Sergey Lyubka 69f1acd823 Merge pull request #1912 from cesanta/nodupack
Avoid duplicated ACKs
2022-12-09 11:50:30 +00:00
cpq c0f15d50d6 Squash cppcheck warn 2022-12-09 09:29:34 +00:00
Sergio R. Caprile 1d3fe51e8b Avoid duplicated ACKs 2022-12-08 18:59:18 -03:00
Sergio R. Caprile d364d50c05 Improve MIP resiliency 2022-12-08 17:17:05 -03:00
Sergey Lyubka 615d324b11 Merge pull request #1906 from jfsimon1981/armfix
Fix arm and armhf test builds and unit_test runtime.
2022-12-07 18:31:29 +00:00
Jean-Francois Simon eb36b6755f Fix arm and armhf test builds and unit_test runtime.
Generalized with the correct define (comment from SC).
2022-12-07 17:09:13 +00:00
Sergey Lyubka 40c28d3b21 Merge pull request #1905 from cesanta/percentA
Use %I in mip.c
2022-12-07 07:22:10 +00:00
Sergio R. Caprile e726282023 Merge pull request #1908 from cesanta/tm4creadme
Add README
2022-12-06 17:10:19 -03:00
Sergio R. Caprile 327f734e4f Add README 2022-12-06 17:09:15 -03:00
Sergio R. Caprile b361f64d4f Merge pull request #1907 from cesanta/tests
Update test.yml
2022-12-06 16:25:47 -03:00
Sergio R. Caprile b38d215b3d Update test.yml 2022-12-06 15:53:18 -03:00
Sergio R. Caprile 99aa498bc4 Use %I in mip.c
Add %A to print hw address and use it in mip.c
Fix some debug data
2022-12-06 13:44:31 -03:00
Sergio R. Caprile f14798dec9 Merge pull request #1904 from cesanta/tm4cdriver
Improve TM4C driver
2022-12-06 11:08:44 -03:00
Sergio R. Caprile 65873f3dee Improve TM4C driver
- Fix clock guessing
- Frames are now read in order, and only host owned descriptors are checked
- Read as many frames as possible (but don't loop forever)
- Discard bad frames
- Fixed incorrect handling of RU bit and exit out of suspended condition
- If a frame arrives while processing, it will now generate a new interrupt (formerly it would wait for another frame to arrive as we reset the flag on exit)
2022-12-06 10:45:41 -03:00
Sergio R. Caprile fc98c88358 Merge pull request #1903 from cesanta/freemgstrdupdoc
Update README.md
2022-12-05 16:30:24 -03:00
Sergio R. Caprile 7c0440c148 Update README.md 2022-12-05 16:24:28 -03:00
Sergio R. Caprile ad051269ed Merge pull request #1899 from cesanta/castREADME
Update README.md
2022-12-04 19:17:23 -03:00
Sergio R. Caprile 497d8f25a1 Update README.md 2022-12-04 19:16:34 -03:00
Sergey Lyubka eb142f26f2 Merge pull request #1897 from cesanta/i
Fix #1888: add %I *printf specifier for IP address. Remove mg_ntoa, m…
2022-12-03 14:39:47 +00:00
cpq b01989f041 Fix #1888: add %I *printf specifier for IP address. Remove mg_ntoa, mg_straddr 2022-12-03 14:27:07 +00:00
Sergey Lyubka 84d89e80cd Merge pull request #1896 from cesanta/stm32driver
Improve STM32 driver
2022-12-03 09:40:38 +00:00
Sergio R. Caprile d059d2cda4 Improve STM32 driver 2022-12-02 19:47:29 -03:00
jfsimon1981 751413f050 MIP tuntap with dhcp added, enabled gitactions (#1890)
Enable DHCP with MIP tests.
Separate sources for high and low level stack tests.
Fixed assertion.
Added dhcpd.conf file.
2022-12-02 17:40:46 +01:00
Sergey Lyubka ce5e28554f Merge pull request #1891 from cesanta/baremetalREADMEs
Add links to tool installation in MIP hw examples
2022-12-02 07:12:46 +00:00
Sergio R. Caprile 860be3f96c Add links to tool installation in MIP hw examples 2022-12-01 17:23:16 -03:00
Sergey Lyubka 89fb3a3d6e Merge pull request #1889 from cesanta/mippoll
MG_EV_POLL generation on MIP
2022-12-01 07:25:19 +00:00
Sergio R. Caprile 474a07564c Make test NOT fail 2022-11-30 18:16:13 -03:00
Sergio R. Caprile 59b69a3b3b Add test for MG_EV_POLL generation 2022-11-30 12:13:45 -03:00
Sergey Lyubka 2553392e42 Merge pull request #1885 from cesanta/tm4c-freertos-mip
Add FreeRTOS + MIP example on TM4C
2022-11-29 15:17:48 +00:00
cpq fcd6901558 Fix broken mip_test 2022-11-29 14:55:36 +00:00
Sergio R. Caprile 716ffbb945 Add FreeRTOS + MIP tutorial on TM4C 2022-11-29 11:16:43 -03:00
Sergey Lyubka cd4b9aeafe Merge pull request #1884 from cesanta/macfilter
Fix MAC address filtering on STM32 and TM4C
2022-11-29 14:05:11 +00:00
Sergey Lyubka 5d712b6f54 Merge pull request #1886 from jfsimon1981/master
Release MIP tests using tuntap
2022-11-29 11:24:52 +00:00
Jean-Francois Simon 754c68fccc Release MIP tests using tuntap 2022-11-29 11:20:22 +01:00
Sergio R. Caprile 858f4da0d1 Fix MAC address filtering on STM32 and TM4C 2022-11-28 10:16:10 -03:00
Sergey Lyubka 90910a7a4f Merge pull request #1883 from cesanta/arpbcast
Fix sending ARP request for IP broadcasts
2022-11-26 11:58:16 +00:00
Sergey Lyubka cd218b59f9 Merge pull request #1882 from cesanta/f746zg-frertos-mip
Add FreeRTOS + MIP example on F746
2022-11-26 11:57:43 +00:00
Sergio R. Caprile 9625c49c95 Fix sending ARP request for IP broadcasts 2022-11-25 17:42:35 -03:00
Sergio R. Caprile 2dfed10d2e Add FreeRTOS + MIP example on F746 2022-11-25 16:57:35 -03:00
cpq a74d3737dc Fix mip-pcap 2022-11-25 14:23:59 +00:00
cpq 6c82a34aa0 Remove unused code 2022-11-25 10:00:04 +00:00
cpq 320d5656ac Remove unused code 2022-11-25 10:00:04 +00:00
Sergio R. Caprile a4a5778001 Merge pull request #1879 from cesanta/freestdlib
Add stdlib.h to includes in FreeRTOS arch
2022-11-24 10:34:24 -03:00
Sergio R. Caprile a80a003865 Add stdlib.h to includes in FreeRTOS arch 2022-11-24 10:15:03 -03:00
cpq 4607e46c6f Disable mip_test on macos 2022-11-24 07:21:55 +00:00
cpq 0aa3e2e49c Enable macos test 2022-11-24 07:02:17 +00:00
Sergio R. Caprile 595bb36956 Merge pull request #1878 from cesanta/Makefile
be able to flash target
2022-11-23 17:09:05 -03:00
Sergio R. Caprile afdf7e6df3 actually be able to flash target 2022-11-23 16:13:37 -03:00
Sergey Lyubka 3e1c7d7ef2 Merge pull request #1874 from cesanta/makefix
Fix wildcard in Makefile
2022-11-23 10:16:11 +00:00
cpq 7ce7c3deb7 Fix mingw build 2022-11-22 09:50:35 +00:00
Sergio R. Caprile c9b390ec60 Fix wildcard in Makefile 2022-11-21 16:57:15 -03:00
Sergey Lyubka cc2b826356 Merge pull request #1865 from jfsimon1981/master
Implemented MIP stack http_fetch()
2022-11-21 18:35:14 +00:00
Jean-Francois Simon 0b2c493731 Merge branch 'master' of https://github.com/jfsimon1981/mongoose 2022-11-21 15:33:42 +01:00
Jean-Francois Simon 0d7bbc51e7 Implemented MIP stack http_fetch()
This approach used tuntap driver for Linux/Unices
2022-11-21 15:32:45 +01:00
Sergey Lyubka db81c30d24 Merge pull request #1871 from cesanta/straddr
Fix mg_straddr() stack overwrite
2022-11-21 07:00:23 +00:00
cpq 41ea8de0d6 Mark request close for HTTP redirects 2022-11-20 12:18:15 +00:00
Sergio R. Caprile c4b5b37568 Fix mg_straddr() stack overwrite 2022-11-19 19:44:52 -03:00
Sergio R. Caprile 76e6b23a4f Update README.md 2022-11-18 18:06:48 -03:00
Sergio R. Caprile 283e295a98 Merge pull request #1869 from cesanta/miptap
Add missing include
2022-11-18 12:28:59 -03:00
Sergio R. Caprile 606009afb0 Add missing include
linux/if uses struct sockaddr that is defined in sys/socket.h. This breaks building on some systems. It went unnoticed as it was hidden by mongoose.h being included first
2022-11-18 10:51:58 -03:00
Sergey Lyubka da303b8b4f Merge pull request #1858 from cesanta/LAA
change MIP MAC to LAA
2022-11-18 10:41:12 +00:00
Sergey Lyubka d4048661ae Merge pull request #1857 from cesanta/scaprile-patch-1
Update issue_template.md
2022-11-18 10:39:34 +00:00
Sergey Lyubka 47853547ca Merge pull request #1856 from cesanta/zephyr-tests
Zephyr tests
2022-11-18 10:39:13 +00:00
Jean-Francois Simon 6ae9188af4 Implemented MIP stack http_fetch()
This approach used tuntap driver for Linux/Unices
2022-11-16 18:26:49 +01:00
jfsimon1981 d958ec2ac8 Revert "mip_test.c http fetch (#1851)" (#1864)
This reverts commit 07aac8e6e9.
2022-11-16 18:02:23 +01:00
jfsimon1981andJean-Francois Simon 07aac8e6e9 mip_test.c http fetch (#1851)
* Update mip_test.c

* Adding mip_free() function.

* Adding mip_free() function.

* Added MIP free.

* Fixed C++ builds.

* Proper C/C++ struct initialization.

* Squashed commit of the following:

commit 7ba68dd20d
Author: Jean-Francois Simon <jfsimon@startmail.com>
Date:   Wed Nov 16 16:19:50 2022 +0100

    Proper C/C++ struct initialization.

commit aeab3ef7ac
Author: Jean-Francois Simon <jfsimon@startmail.com>
Date:   Tue Nov 15 17:09:29 2022 +0100

    Fixed C++ builds.

commit 2afd529107
Merge: 14710b81 f8445a4c
Author: jfsimon1981 <jfsimon1981@gmail.com>
Date:   Tue Nov 15 11:33:56 2022 +0100

    Merge branch 'cesanta:master' into master

commit 14710b81e4
Author: Jean-Francois Simon <jfsimon@startmail.com>
Date:   Tue Nov 15 11:07:15 2022 +0100

    Added MIP free.

commit 6393cd149d
Author: Jean-Francois Simon <jfsimon@startmail.com>
Date:   Tue Nov 15 11:06:44 2022 +0100

    Adding mip_free() function.

commit feee81b733
Author: Jean-Francois Simon <jfsimon@startmail.com>
Date:   Tue Nov 15 11:05:55 2022 +0100

    Adding mip_free() function.

commit f8445a4c85
Merge: a39b7ddb 71f5be01
Author: Sergio R. Caprile <scaprile@users.noreply.github.com>
Date:   Fri Nov 11 20:42:38 2022 -0300

    Merge pull request #1853 from cesanta/tibaremetaltest

    Update test.yml

commit 71f5be011b
Author: Sergio R. Caprile <scaprile@users.noreply.github.com>
Date:   Fri Nov 11 20:15:01 2022 -0300

    Update test.yml

commit b53d3cf032
Merge: 7a71038a a39b7ddb
Author: jfsimon1981 <jfsimon1981@gmail.com>
Date:   Fri Nov 11 16:10:53 2022 +0100

    Merge branch 'cesanta:master' into master

commit 7a71038a27
Author: jfsimon1981 <jfsimon1981@gmail.com>
Date:   Fri Nov 11 16:09:22 2022 +0100

    Update mip_test.c

commit a39b7ddbac
Author: cpq <valenok@gmail.com>
Date:   Fri Nov 11 15:03:48 2022 +0000

    Fix fuzzer use-after-poison READ 1

* Squashed commit of the following:

commit 192ae56ece
Merge: 7b0509c8 7ba68dd2
Author: Jean-Francois Simon <jfsimon@startmail.com>
Date:   Wed Nov 16 17:44:03 2022 +0100

    Merge branch 'master' of https://github.com/jfsimon1981/mongoose

commit 7b0509c878
Author: Jean-Francois Simon <jfsimon@startmail.com>
Date:   Wed Nov 16 17:43:33 2022 +0100

    Squashed commit of the following:

    commit 7ba68dd20d
    Author: Jean-Francois Simon <jfsimon@startmail.com>
    Date:   Wed Nov 16 16:19:50 2022 +0100

        Proper C/C++ struct initialization.

    commit aeab3ef7ac
    Author: Jean-Francois Simon <jfsimon@startmail.com>
    Date:   Tue Nov 15 17:09:29 2022 +0100

        Fixed C++ builds.

    commit 2afd529107
    Merge: 14710b81 f8445a4c
    Author: jfsimon1981 <jfsimon1981@gmail.com>
    Date:   Tue Nov 15 11:33:56 2022 +0100

        Merge branch 'cesanta:master' into master

    commit 14710b81e4
    Author: Jean-Francois Simon <jfsimon@startmail.com>
    Date:   Tue Nov 15 11:07:15 2022 +0100

        Added MIP free.

    commit 6393cd149d
    Author: Jean-Francois Simon <jfsimon@startmail.com>
    Date:   Tue Nov 15 11:06:44 2022 +0100

        Adding mip_free() function.

    commit feee81b733
    Author: Jean-Francois Simon <jfsimon@startmail.com>
    Date:   Tue Nov 15 11:05:55 2022 +0100

        Adding mip_free() function.

    commit f8445a4c85
    Merge: a39b7ddb 71f5be01
    Author: Sergio R. Caprile <scaprile@users.noreply.github.com>
    Date:   Fri Nov 11 20:42:38 2022 -0300

        Merge pull request #1853 from cesanta/tibaremetaltest

        Update test.yml

    commit 71f5be011b
    Author: Sergio R. Caprile <scaprile@users.noreply.github.com>
    Date:   Fri Nov 11 20:15:01 2022 -0300

        Update test.yml

    commit b53d3cf032
    Merge: 7a71038a a39b7ddb
    Author: jfsimon1981 <jfsimon1981@gmail.com>
    Date:   Fri Nov 11 16:10:53 2022 +0100

        Merge branch 'cesanta:master' into master

    commit 7a71038a27
    Author: jfsimon1981 <jfsimon1981@gmail.com>
    Date:   Fri Nov 11 16:09:22 2022 +0100

        Update mip_test.c

    commit a39b7ddbac
    Author: cpq <valenok@gmail.com>
    Date:   Fri Nov 11 15:03:48 2022 +0000

        Fix fuzzer use-after-poison READ 1

commit 7ba68dd20d
Author: Jean-Francois Simon <jfsimon@startmail.com>
Date:   Wed Nov 16 16:19:50 2022 +0100

    Proper C/C++ struct initialization.

commit aeab3ef7ac
Author: Jean-Francois Simon <jfsimon@startmail.com>
Date:   Tue Nov 15 17:09:29 2022 +0100

    Fixed C++ builds.

commit 2afd529107
Merge: 14710b81 f8445a4c
Author: jfsimon1981 <jfsimon1981@gmail.com>
Date:   Tue Nov 15 11:33:56 2022 +0100

    Merge branch 'cesanta:master' into master

commit 14710b81e4
Author: Jean-Francois Simon <jfsimon@startmail.com>
Date:   Tue Nov 15 11:07:15 2022 +0100

    Added MIP free.

commit 6393cd149d
Author: Jean-Francois Simon <jfsimon@startmail.com>
Date:   Tue Nov 15 11:06:44 2022 +0100

    Adding mip_free() function.

commit feee81b733
Author: Jean-Francois Simon <jfsimon@startmail.com>
Date:   Tue Nov 15 11:05:55 2022 +0100

    Adding mip_free() function.

commit f8445a4c85
Merge: a39b7ddb 71f5be01
Author: Sergio R. Caprile <scaprile@users.noreply.github.com>
Date:   Fri Nov 11 20:42:38 2022 -0300

    Merge pull request #1853 from cesanta/tibaremetaltest

    Update test.yml

commit 71f5be011b
Author: Sergio R. Caprile <scaprile@users.noreply.github.com>
Date:   Fri Nov 11 20:15:01 2022 -0300

    Update test.yml

commit b53d3cf032
Merge: 7a71038a a39b7ddb
Author: jfsimon1981 <jfsimon1981@gmail.com>
Date:   Fri Nov 11 16:10:53 2022 +0100

    Merge branch 'cesanta:master' into master

commit a39b7ddbac
Author: cpq <valenok@gmail.com>
Date:   Fri Nov 11 15:03:48 2022 +0000

    Fix fuzzer use-after-poison READ 1

Co-authored-by: Jean-Francois Simon <jfsimon@startmail.com>
2022-11-16 17:55:27 +01:00
Sergio R. Caprile 9a341c9032 change MIP MAC to LAA 2022-11-15 14:56:51 -03:00
Sergio R. Caprile 21e8b08ed9 Reduce Zephyr test time 2022-11-14 18:06:00 -03:00
Sergio R. Caprile c41d477adc Update issue_template.md 2022-11-14 14:58:36 -03:00
Sergio R. Caprile f8445a4c85 Merge pull request #1853 from cesanta/tibaremetaltest
Update test.yml
2022-11-11 20:42:38 -03:00
Sergio R. Caprile 71f5be011b Update test.yml 2022-11-11 20:15:01 -03:00
cpq a39b7ddbac Fix fuzzer use-after-poison READ 1 2022-11-11 15:03:48 +00:00
Sergio R. Caprile cab5c822c5 Merge pull request #1850 from cesanta/miplocal
Fix incorrect local network address detection
2022-11-11 11:58:29 -03:00
Sergey Lyubka 4056bd3c2d Merge pull request #1847 from cesanta/xiao
Fix arduino-xiao build and add GA test
2022-11-11 14:53:40 +00:00
Sergio R. Caprile a985ae9c0a Fix incorrect local network address detection 2022-11-11 11:18:47 -03:00
cpq 804a3bf380 Fix #1801 - report ipv4 accepted address for ipv4 listeners 2022-11-11 14:01:17 +00:00
Sergey Lyubka a8bef96463 Merge pull request #1844 from cesanta/tm4c129x
Add TM4C129x driver
2022-11-11 13:15:35 +00:00
Sergey Lyubka 5e43a3f695 Merge pull request #1846 from cesanta/ektm4c129x
Add EK-TM4C1294XL example
2022-11-11 13:15:20 +00:00
cpq 8e46e05e1b Fix arduino-xiao build and add GA test 2022-11-11 10:04:47 +00:00
Sergio R. Caprile ec0e27dbb4 Add EK-TM4C1294XL example 2022-11-10 21:14:30 -03:00
Sergio R. Caprile 3f55d93b41 Merge pull request #1845 from cesanta/mip-tap
Unbreak
2022-11-10 15:01:10 -03:00
Sergio R. Caprile 5418a8c28a Unbreak
userdata was changed to a pointer to a socket, but tx() was not updated

My Linux system does not like mongoose.h at the end...
2022-11-10 15:00:43 -03:00
Sergio R. Caprile e180192379 Add TM4C129x driver 2022-11-10 14:41:41 -03:00
cpq f498d69b7d Fix examples/stm32/nucleo-f429zi-freertos-mip 2022-11-10 03:01:10 +00:00
Sergio R. Caprile dfae1b3f70 Merge pull request #1843 from cesanta/mip
Expose mip guts
2022-11-09 17:40:46 -03:00
Sergio R. Caprile a9ebb55f95 Merge pull request #1842 from cesanta/ft
Add nucleo-f429zi-freertos-mip example
2022-11-09 16:28:33 -03:00
cpq abfac8aa40 Expose mip guts 2022-11-09 19:25:40 +00:00
cpq 78956ccf83 Add nucleo-f429zi-freertos-mip example 2022-11-09 18:25:11 +00:00
Sergey Lyubka eed25f23f6 Merge pull request #1839 from cesanta/stm32uart
Fix wrong reference to prescaler
2022-11-09 09:24:24 +00:00
Sergey Lyubka 134ce56f80 Merge pull request #1841 from cesanta/small
Endianness test
2022-11-09 09:23:04 +00:00
cpq 28a4778187 Endianness test 2022-11-09 09:20:15 +00:00
Sergio R. Caprile c654c2e5e8 Fix wrong reference to prescaler 2022-11-08 11:23:10 -03:00
Sergey Lyubka e580d4e637 Merge pull request #1837 from cesanta/arch
Create MG_ARCH_FREERTOS, MG_ENABLE_LWIP, MG_ENABLE_FREERTOS_TCP. Remo…
2022-11-08 00:13:28 +00:00
cpq 2192914cbb Create MG_ARCH_FREERTOS, MG_ENABLE_LWIP, MG_ENABLE_FREERTOS_TCP. Remove MG_ARCH_FREERTOS_TCP, MG_ARCH_RTX_LWIP 2022-11-07 23:58:58 +00:00
Sergio R. Caprile ca6dee1777 Merge pull request #1836 from cesanta/dewarning
Remove some warnings
2022-11-07 15:29:33 -03:00
Sergio R. Caprile 6f3bdc5dca Remove some warnings 2022-11-07 15:23:47 -03:00
Sergey Lyubka 095cdcd69e Merge pull request #1834 from cesanta/sock
Generalize socket constants
2022-11-05 13:11:57 +00:00
cpq f022633f29 Generalize socket constants 2022-11-05 12:33:49 +00:00
Sergey Lyubka 1f85fcc9b0 Merge pull request #1831 from cesanta/mqtt
Accept zero-length payload messages
2022-11-03 16:46:56 +00:00
Sergio R. Caprile a3ede75842 Accept zero-length payload messages 2022-11-03 11:26:08 -03:00
cpq 0defce37f0 Pull mongoose_custom.h 2022-11-03 12:59:55 +00:00
Sergey Lyubka 4355b39b1e Merge pull request #1830 from cesanta/mip
ARP lookup hosts in the same net. Use up-to-date code in zephyr dash …
2022-11-03 12:35:17 +00:00
cpq efec738c89 ARP lookup hosts in the same net. Use up-to-date code in zephyr dash example 2022-11-03 08:06:17 +00:00
Sergey Lyubka 10c09a361b Merge pull request #1829 from cesanta/cr
CR incorrectly set in STM32 driver
2022-11-02 23:18:20 +00:00
Sergio R. Caprile e3d1a69223 CR incorrectly set in STM32 driver 2022-11-02 19:25:05 -03:00
Sergey Lyubka 4b82253ae9 Merge pull request #1826 from cesanta/custom
mongoose_custom.h not pulled in when MG_ARCH=MG_ARCH_CUSTOM
2022-11-02 12:05:59 +00:00
Sergio R. Caprile 47a12c30ca mongoose_custom.h not pulled in when MG_ARCH=MG_ARCH_CUSTOM 2022-11-01 21:01:33 -03:00
cpq 613655767b Housekeeping at the end of c->label 2022-11-01 21:01:03 +00:00
Sergey Lyubka 1182027f1c Merge pull request #1823 from cesanta/ti-rtos
Fix TI-RTOS port
2022-10-30 09:41:48 +00:00
Sergio R. Caprile e9421d557a Fix TI-RTOS port
Sockets were not being put in non-blocking mode as the setsockopt() call wasn't using SOL_SOCKET
Do not include errno.h but serrno.h, otherwise error codes are mangled... NDK functions use serrno, errno belongs to the compiler
UDP sockets require binding to receive responses
select() does not return write-ready on connect if the amount of bytes to write is below the "low-water mark". This parameter defaults to 2048, there was some code apparently setting this otherwise, with no success. Reworked the code to set this water mark at half the buffer size by just using plain getsockopt/setsockopt calls.

For the record:
	TI typedef's void * SOCKET for internal use, INVALID_SOCKET is cast to (void *). Their BSD compatible socket interface expects and returns int; while Mongoose uses SOCKET... this generates lots of warnings 169 and 515, disabled in the examples
2022-10-28 18:55:10 -03:00
cpq bbc0c0df94 Unbreak test 2022-10-28 15:35:40 +01:00
Sergio R. Caprile 610e32714c Merge pull request #1822 from cesanta/hello
Add mg_hello()
2022-10-28 09:48:43 -03:00
cpq 7ab81d3805 Add mg_hello() 2022-10-28 10:57:06 +01:00
Sergey Lyubka 9a1e41e1fa Merge pull request #1821 from cesanta/docs
Augment WS documentation
2022-10-27 23:09:47 +01:00
Sergio R. Caprile ae71d12f06 Augment WS documentation 2022-10-27 12:03:16 -03:00
cpq c25234df83 Better MIP description 2022-10-27 08:12:22 +01:00
Sergey Lyubka 03284ba046 Merge pull request #1810 from cesanta/zephyresp
Support Zephyr on ESP32
2022-10-25 17:22:47 +01:00
Sergey Lyubka 5fa433ecca Merge pull request #1814 from cesanta/ti-rtos
Improve TI-RTOS timing support
2022-10-25 17:07:33 +01:00
Sergio R. Caprile ac2a4c700a Merge pull request #1818 from cesanta/ti
Allow flash and cloning without build
2022-10-25 10:55:46 -03:00
Sergio R. Caprile eeb7b00f60 Allow flash and cloning without build 2022-10-25 10:41:53 -03:00
Sergio R. Caprile c8c540b453 Improve TI-RTOS timing support 2022-10-24 11:48:54 -03:00
Sergio R. Caprile a0585f75f7 Support Zephyr on ESP32 2022-10-21 11:44:09 -03:00
Sergey Lyubka 637af1d392 Merge pull request #1809 from cesanta/picow
Make pico-w device-dashboard example fully functional
2022-10-20 18:24:38 +01:00
Sergio R. Caprile fe6c31acc1 Make pico-w device-dashboard example fully functional 2022-10-20 11:57:00 -03:00
Sergio R. Caprile 04cfcf751e Merge pull request #1805 from cesanta/invsock
Fix unintended socket close on systems with valid fd=0 descriptor numbering
2022-10-20 11:04:03 -03:00
Sergio R. Caprile 51c51d49ad Fix unintended socket close on systems with valid fd=0 descriptor numbering 2022-10-20 10:34:26 -03:00
cpq 4271aa5b1f Update matrix example name 2022-10-19 09:24:19 +01:00
cpq 17ada1c894 Fix #1803 - conditional for SSL_set1_host(). In unit test, disable time.windows.com, use google and apple SNTP servers 2022-10-19 09:06:47 +01:00
cpq 2e14d125ba Fuzzer nits 2022-10-18 15:21:59 +01:00
cpq ce8fa4c24b Echo WS CLOSE payload back 2022-10-18 14:31:47 +01:00
Sergey Lyubka cfe2e83e6b Merge pull request #1798 from Yeicor/patch-1
Remove mg_hexdump from deliver_chunked_chunks
2022-10-17 07:14:24 +01:00
Yeicor b17c62618d Remove mg_hexdump from deliver_chunked_chunks 2022-10-16 21:11:00 +02:00
Sergey Lyubka 6b162a1193 Merge pull request #1796 from cesanta/rpicow
Dettach git clone and fix clean
2022-10-16 16:59:19 +01:00
Sergey Lyubka 6653530b63 Merge pull request #1797 from strager/fix-typo
Fix typo in documentation
2022-10-16 16:58:20 +01:00
cpq aacae6444e Fix stack overflow in fuzzer - too big on-stack array 2022-10-15 17:18:31 +01:00
Matthew "strager" Glazar b91fe12258 Fix typo in documentation 2022-10-14 18:27:06 -07:00
Sergio R. Caprile ae7ca00e69 Dettach git clone and fix clean
The user has to clone the repo, then edit the Makefile to change WiFi credentials. Running make build does both and the tests go flawlessly
The user can run make to clone the repo, then change credentials and run make build, it will skip cloning if the repo is already there

In some systems the compiled files are not owned by the user as Docker runs as root, so we first invoke clean in the cloned repo (which erases the compiled files), and then remove the cloned repo that the user owns and can rm.
2022-10-14 12:09:39 -03:00
Sergio R. Caprile 0103f1f080 Merge pull request #1795 from cesanta/z
Use board nucleo_f429zi
2022-10-14 08:54:20 -03:00
cpq e8d29d54d6 Use board nucleo_f429zi 2022-10-14 11:39:00 +01:00
Sergey Lyubka 092f2ce0b3 Merge pull request #1794 from cesanta/addMissingTests
Update test.yml
2022-10-11 07:37:53 +01:00
Sergio R. Caprile d89233276b Update test.yml 2022-10-10 17:16:42 -03:00
Sergio R. Caprile 7d797187e8 Merge pull request #1793 from cesanta/device-dashboard
fix paths in Makefile (like other examples)
2022-10-10 17:01:43 -03:00
Sergio R. Caprile 6edcc72364 fix paths in Makefile 2022-10-10 16:51:07 -03:00
Sergey Lyubka 250dfc1377 Merge pull request #1790 from cesanta/zephyr-device-dashboard
Add device-dashboard example on Zephyr
2022-10-10 15:59:08 +01:00
Sergey Lyubka 45489c1c87 Merge pull request #1789 from zudwalex/picow
Add Pico-W example
2022-10-10 15:58:53 +01:00
Sergey Lyubka 09b250f189 Merge pull request #1787 from cesanta/zephyr
Update Zephyr examples
2022-10-10 15:58:39 +01:00
cpq a84465ddba Use MG_SOCK_LISTEN_BACKLOG_SIZE -> 128 for FreeRTOS-TCP 2022-10-10 13:41:07 +01:00
Sergey Lyubka 3b95671442 Merge pull request #1791 from zahar517/fix-json-rpc-example
Fix json-rpc-over-ws example
2022-10-10 10:35:29 +01:00
zahar517 52e66077a7 Fix json-rpc-over-ws example 2022-10-08 14:39:01 +03:00
Sergio R. Caprile 84bf4d21a3 Add device-dashboard example on Zephyr 2022-10-07 11:52:31 -03:00
Alex Alashkin 04cfc510d0 Add Pico-W example 2022-10-07 09:11:35 +03:00
Sergio R. Caprile d846e67ec1 Update Zephyr examples 2022-10-06 17:30:27 -03:00
Sergio R. Caprile 9c60a1bc10 Merge pull request #1788 from cesanta/mod-tests4zephyr
Update test.yml
2022-10-06 17:11:30 -03:00
Sergio R. Caprile f06ac52a43 Update test.yml 2022-10-06 16:55:13 -03:00
Sergio R. Caprile 9e5fd43a2d Update test.yml 2022-10-06 16:46:26 -03:00
Sergio R. Caprile 8d50e7dc82 Update test.yml 2022-10-06 16:32:33 -03:00
cpq 1e6b7bd2a6 Fix broken link 2022-10-05 11:49:06 +01:00
Sergey Lyubka 8346be7a81 Merge pull request #1783 from cesanta/zephyr
Update to latest Zephyr and their Docker repo
2022-10-05 11:41:55 +01:00
Sergey Lyubka 9dc5683fc2 Merge pull request #1785 from cesanta/device-dashboard
rename time() to ourtime()
2022-10-05 11:40:08 +01:00
Sergio R. Caprile e7cb82175a rename time() to ourtime() 2022-10-04 19:27:38 -03:00
Sergio R. Caprile 1ef0aa14c0 Update to latest Zephyr and their Docker repo 2022-10-04 17:24:13 -03:00
cpq 0b3f6d6aab Use CC for fuzzer, not CXX 2022-09-30 11:44:50 +01:00
Sergey Lyubka 0beef1d770 Merge pull request #1781 from jameshilliard/update-spdx
Update GPL license identifier
2022-09-29 20:29:07 +01:00
James Hilliard b944db30fd Update GPL license identifier
GPL-2.0 was deprecated in favor of GPL-2.0-only.

GPL-2.0+ was deprecated in favor of GPL-2.0-or-later.

See: https://spdx.org/licenses/
2022-09-29 15:18:10 -04:00
cpq 6cf3a3feaf Fix fuzzer 2022-09-29 19:31:52 +01:00
cpq 9680b8ccb3 Fix overflow in rx_icmp 2022-09-29 16:53:11 +01:00
cpq a88a11c243 Fix TX overflow in rx_icmp() 2022-09-29 11:13:40 +01:00
Sergey Lyubka 7ff76f69a1 Merge pull request #1777 from jameshilliard/disable-big-endian
Disable broken 32 bit tests and enable 32 bit little endian tests.
2022-09-29 07:33:15 +01:00
James Hilliard c2e4e6d221 Disable broken 32 bit tests and enable 32 bit little endian tests.
It appears there's a bunch of endian specific failing 32 bit tests.
2022-09-28 22:18:08 -06:00
Sergey Lyubka 60edc456a9 Merge pull request #1774 from cesanta/smtp-client
Fix wrong ca.pem path +
2022-09-28 21:58:20 +01:00
Sergey Lyubka 625f804130 Merge pull request #1776 from jameshilliard/32-bit-bigendian
Also test on 32 bit big endian ppc
2022-09-28 21:56:37 +01:00
Sergey Lyubka 7100aaedec Merge pull request #1775 from cesanta/endian
Fix endianness issues in unit test
2022-09-28 21:55:46 +01:00
James Hilliard c867dbc7b2 Also test on 32 bit big endian ppc 2022-09-28 16:02:32 -04:00
cpq 88097f1829 Fix endianness issues in unit test 2022-09-28 20:22:09 +01:00
Sergio R. Caprile 7cf4834336 Fix wrong ca.pem path
Remove extra EHLO before AUTH (there were two)
2022-09-28 16:05:29 -03:00
Sergey Lyubka b5355307a3 Merge pull request #1767 from jameshilliard/bigendian-tests
Test on big endian CPU architectures
2022-09-28 08:08:38 +01:00
James Hilliard 76f693e5d7 Test on big endian CPU architectures 2022-09-26 05:16:49 -04:00
Sergey Lyubka fb3b0ca6e3 Merge pull request #1765 from jameshilliard/rpc-add-calloc-null
Fix null pointer dereference in mg_rpc_add()
2022-09-25 23:22:57 +01:00
James Hilliard 3c71977e2e Fix null pointer dereference in mg_rpc_add()
Fixes #1736
2022-09-25 14:08:58 -04:00
cpq 5574a2663a Close connection on 3 keep-alive misses 2022-09-25 17:35:14 +01:00
cpq 41960b4212 Optimize fuzzer 2022-09-25 11:58:28 +01:00
Sergey Lyubka 6a500b8d40 Merge pull request #1764 from cesanta/fuzz
Optimize fuzzer
2022-09-25 10:31:21 +01:00
Sergey Lyubka dcede59379 Merge pull request #1743 from cesanta/stm32-nucleo-f746z
Stm32 nucleo f746z
2022-09-25 10:22:52 +01:00
Sergey Lyubka 695153c527 Merge pull request #1762 from gdawg/ssdp-example-fix-dupe-responses
Fix SSDP example for second and subsequent responses
2022-09-25 10:20:55 +01:00
cpq c409cca20e Optimize fuzzer 2022-09-25 10:19:17 +01:00
Sergey Lyubka a5a9204f83 Merge pull request #1754 from cesanta/iobuf_init
issue #1734, avoid passing null ptr to memmove
2022-09-24 07:18:42 +01:00
Andrew Griffiths 25d42ad345 Fix SSDP example for second and subsequent responses 2022-09-24 14:14:26 +10:00
Sergio R. Caprile f70a407611 issue #1734, avoid passing null ptr to memmove 2022-09-23 19:34:36 -03:00
Sergio R. Caprile 89f2e66c80 Merge pull request #1752 from cesanta/asan
Activate asan for mip_test
2022-09-23 09:45:18 -03:00
Sergio R. Caprile 4562be52d4 Merge pull request #1753 from cesanta/mg_vprintf
Get rid of va_copy
2022-09-23 09:30:09 -03:00
cpq ebd931f7af Get rid of va_copy 2022-09-23 08:59:02 +01:00
cpq 6a47ff6422 Activate asan for mip_test 2022-09-23 08:35:59 +01:00
cpq 1237185bb4 MIP: atomic -> volatile. Add lease time 2022-09-22 17:16:52 +01:00
Sergio R. Caprile d7fe819699 Merge pull request #1751 from cesanta/stm32-nucleo-f746zg
Add new example as per the tutorial
2022-09-22 12:00:15 -03:00
Sergio R. Caprile 770ffd1483 Add new example as per the tutorial 2022-09-22 11:32:52 -03:00
Sergio R. Caprile 9373e77636 Update Makefile as per the tutorial, enhance it 2022-09-22 11:01:40 -03:00
cpq cb5034548d Fix oob read in rx_dhcp() 2022-09-22 13:42:17 +01:00
Sergey Lyubka f9ad870ff0 Merge pull request #1750 from cesanta/make
Optimize makefile
2022-09-22 13:26:57 +01:00
cpq b538bc3871 Optimize makefile 2022-09-22 12:55:45 +01:00
Sergey Lyubka e5b0528aca Merge pull request #1742 from cesanta/mip-fuzz
Fuzzing MIP
2022-09-21 21:15:50 +01:00
cpq a12bd2271e Fuzzing MIP 2022-09-21 20:29:49 +01:00
Sergey Lyubka 15c5858732 Merge pull request #1746 from cesanta/dtoa
Fix issue #1733
2022-09-21 17:48:06 +01:00
Sergio R. Caprile dd4227f444 Fix issue #1733 2022-09-21 11:38:39 -03:00
Sergey Lyubka fe8a7d8db9 Merge pull request #1748 from cesanta/va_end
Fix issue #1735
2022-09-21 09:43:47 +01:00
Sergey Lyubka ec79ca71b2 Merge pull request #1747 from cesanta/timer_add
Fix issue #1737
2022-09-21 07:16:27 +01:00
Sergio R. Caprile 7a1544e76a Fix issue #1735 2022-09-20 14:26:06 -03:00
Sergio R. Caprile 27ffc23664 Fix issue #1737 2022-09-20 13:54:17 -03:00
Sergio R. Caprile 8ef8ee91e9 Merge pull request #1745 from cesanta/tls-hs
Update README.md with TLS_HS event
2022-09-20 10:53:27 -03:00
Sergio R. Caprile 571625f0c3 Update README.md 2022-09-20 10:52:45 -03:00
Sergio R. Caprile fc2d6eb6bb Merge pull request #1744 from cesanta/smtp
Add smtp client example
2022-09-20 10:38:16 -03:00
cpq 48800504be Add smtp client example 2022-09-20 11:34:22 +01:00
Sergey Lyubka f94a019733 Merge pull request #1741 from cesanta/tls
Fix mbedtls MG_IO_WAIT case
2022-09-19 14:06:31 +01:00
cpq 535d8b9e02 Fix mbedtls MG_IO_WAIT case 2022-09-19 13:38:59 +01:00
Sergey Lyubka 161d44ee04 Merge pull request #1730 from cesanta/stm32-nucleo-f429z
Update Makefile as per the tutorial
2022-09-13 21:46:41 +01:00
Sergey Lyubka 7ea155b943 Merge pull request #1729 from cesanta/mip-tap
Add example to use TAP interface on Linux
2022-09-13 21:46:06 +01:00
Sergio R. Caprile 30acef2452 Merge pull request #1727 from cesanta/mdc
Pass MDC clock divider explicitly rather than guess
2022-09-12 20:43:00 -03:00
cpq 82b50fd3a5 Pass MDC clock divider explicitly rather than guess 2022-09-12 23:57:04 +01:00
Sergio R. Caprile 9e5503dd04 Update Makefile as per the tutorial 2022-09-12 17:29:47 -03:00
Sergio R. Caprile 2ec2ed62c8 Add example to use TAP interface on Linux 2022-09-12 10:52:23 -03:00
cpq 274c11c3ec Update README 2022-09-11 13:42:59 +01:00
cpq 76c4bb556f Update README 2022-09-11 11:23:58 +01:00
cpq 40f484cc54 Update README 2022-09-11 11:20:53 +01:00
cpq 85b701b8c2 Formatting 2022-09-10 21:49:20 +01:00
Sergey Lyubka 7e875ba89d Merge pull request #1726 from cesanta/qp
Add MAC addr filtering to stm32 driver. Record free space in q profiler
2022-09-10 18:19:36 +01:00
cpq c718d7999f Add MAC addr filtering to stm32 driver. Record free space in q profiler 2022-09-10 16:38:03 +01:00
Sergey Lyubka d1472992da Merge pull request #1725 from cesanta/qprofile
Add irq and drop counters to qprofiler
2022-09-09 20:19:19 +01:00
Sergio R. Caprile 995f90aa49 Add irq and drop counters to qprofiler 2022-09-09 14:47:46 -03:00
Sergio R. Caprile a4c27618b4 Update README.md 2022-09-09 14:10:48 -03:00
Sergio R. Caprile 05019529f1 Merge pull request #1724 from cesanta/mgread
Pass long *bytes_read to MG_EV_READ
2022-09-09 14:09:50 -03:00
Sergio R. Caprile 1b5ab3261c Merge pull request #1722 from cesanta/mip-tls
Add mbedtls support to MIP
2022-09-09 14:09:19 -03:00
Sergey Lyubka 6033555ac0 Merge pull request #1723 from cesanta/pcap
Added Linux howto
2022-09-09 17:43:53 +01:00
cpq fd4e1975a3 Pass long *bytes_read to MG_EV_READ 2022-09-09 17:09:18 +01:00
cpq 124ac12150 Add mbedtls support to MIP 2022-09-09 15:53:42 +01:00
Sergio R. Caprile 8c1ffa3f5d Added Linux howto 2022-09-09 10:42:46 -03:00
cpq f76a7e36e8 Corrected MacOS setup diagram 2022-09-08 12:11:01 +01:00
cpq 6484c4bc8b Updated description 2022-09-08 12:09:30 +01:00
cpq bba2421ba9 Corrected MacOS setup diagram 2022-09-08 11:36:01 +01:00
cpq 3c69c7feaf Add MacOS setup diagram 2022-09-08 11:28:16 +01:00
cpq 45b2ffe1af Use DMG_HTTP_DIRLIST_TIME 2022-09-08 11:02:32 +01:00
cpq a57c0f4700 Fix #1712 - JSON parsing for keys with arrays 2022-09-08 10:59:23 +01:00
Sergey Lyubka c33116166f Merge pull request #1720 from cesanta/qprofile
Add rudimentary queue profiler
2022-09-08 10:37:01 +01:00
Sergey Lyubka 50a2063e45 Merge pull request #1713 from behnejad/master
display file modify date in "%Y/%m/%d %H:%M:%S".
2022-09-08 08:55:22 +01:00
cpq cd30cf2d6c Fix #1710 - free MIP in mg_mgr_free() 2022-09-08 08:53:54 +01:00
cpq 419126652e Merge branch 'master' of github.com:cesanta/mongoose 2022-09-08 08:50:51 +01:00
cpq 06ab83dca6 Implement keep-alive, 45 sec interval. Correct ACK piggyback 2022-09-08 08:50:42 +01:00
Sergio R. Caprile 313fddf722 Add rudimentary queue profiler
ETH IRQ and mip_poll() can both write to the queue, so if a memcpy() is interrupted we might see some weird records.
2022-09-07 17:14:03 -03:00
Sergey Lyubka f4def36ccb Merge pull request #1717 from cesanta/fixmipq
Fix MIP Q
2022-09-07 20:59:12 +01:00
Sergey Lyubka 4be8f2ba93 Merge pull request #1719 from cesanta/testq
Make mip_test fail with current queue algo
2022-09-07 20:58:29 +01:00
cpq 881b282604 Implement ack timer 2022-09-07 20:48:23 +01:00
Sergio R. Caprile 9675bfe07d Fix MIP Q 2022-09-07 14:59:58 -03:00
Sergio R. Caprile 443351e95a Make mip_test fail with current queue algo 2022-09-07 14:46:36 -03:00
Behnejad d4cd1c61ee fixing defines. 2022-09-07 22:08:50 +04:30
cpq 75892cb523 Add %f to src/fmt.c 2022-09-07 15:09:52 +01:00
Sergey Lyubka 63e0041644 Merge pull request #1715 from davidhozic/feature/1714
Bug Fix #1714
2022-09-07 15:03:51 +01:00
Sergey Lyubka 70e2d8dd4e Merge pull request #1716 from cesanta/pcap
Make mip-pcap work on Mac
2022-09-07 13:36:14 +01:00
cpq b2624f6055 Make mip-pcap work on Mac 2022-09-07 13:36:00 +01:00
David Hozic 0bb8144677 Bug Fix #1714 2022-09-07 13:35:32 +02:00
Behnejad ad50447ec6 display file modify date in "%Y/%m/%d %H:%M:%S".
adding compile time option to display file modification date as "%Y/%m/%d %H:%M:%S" in http directory indexing.
2022-09-07 09:04:15 +04:30
Sergey Lyubka 84de7437c6 Merge pull request #1711 from cesanta/ethrxsz
Fix Ethernet buffer size
2022-09-06 22:29:23 +01:00
Sergio R. Caprile 419dd50255 Fix Ethernet buffer size
1500 bytes is payload size, which is OK for tx. On the rx side, a full 802.1Q-tagged frame size is 1522 bytes, without the 4-byte CRC = 1518 bytes (1514 for non-VLAN-tagged frames).
2022-09-06 16:53:26 -03:00
Sergio R. Caprile 9dea02e578 Merge pull request #1708 from cesanta/ack
Add mip test
2022-09-05 12:11:24 -03:00
cpq 1c181e091e Add mip test 2022-09-05 15:56:03 +01:00
Sergio R. Caprile 32782bab0e Merge pull request #1706 from cesanta/mg_timer_expired
Introduce mg_timer_expired(). Adopt DHCP and link status to use it
2022-09-05 11:45:53 -03:00
cpq 330783cb5a Corrected clean and examples targets 2022-09-05 14:14:50 +01:00
Sergio R. Caprile 504b004e01 Merge pull request #1707 from cesanta/comments
Use single-line comments
2022-09-05 09:05:28 -03:00
cpq edb861da70 docs 2022-09-05 12:29:06 +01:00
cpq 64ad15895f Small nit in minimal HTTP server example 2022-09-05 12:26:43 +01:00
cpq 44b4944334 Use single-line comments 2022-09-03 09:49:41 +01:00
cpq f9272d0959 Introduce mg_timer_expired(). Adopt DHCP and link status to use it 2022-09-03 09:45:19 +01:00
Sergey Lyubka a113e344a1 Merge pull request #1704 from cesanta/acknow
Re-enable sending ACKs until proper mechanism is in place
2022-09-03 07:46:43 +01:00
Sergey Lyubka 2d80f03f01 Merge pull request #1705 from lionsoul2014/master
fix the doc error: htts to https
2022-09-03 07:44:01 +01:00
lion 542fe9f029 fix the doc error: htts to https 2022-09-03 10:51:09 +08:00
Sergio R. Caprile a1992f5910 Re-enable sending ACKs until proper mechanism is in place 2022-09-02 20:48:30 -03:00
Sergey Lyubka 45a057b0c6 Merge pull request #1703 from cesanta/stm32driver
Extend explanation for MDC clock
2022-09-02 20:02:05 +01:00
Sergio R. Caprile 4a1a26e8b7 Extend explanation for MDC clock 2022-09-02 15:03:46 -03:00
Sergey Lyubka db35e6a427 Merge pull request #1702 from cesanta/stm32driver
Add CR setup, set MDC based on HCLK
2022-09-02 18:46:31 +01:00
Sergio R. Caprile 7358ed25a5 Add CR setup, set MDC based on HCLK 2022-09-02 14:02:02 -03:00
cpq 0d385c29a3 More JSON tests 2022-09-02 16:23:39 +01:00
Sergey Lyubka 51076e68c8 Merge pull request #1701 from cesanta/enableFPU
Enable FPU
2022-09-02 15:46:00 +01:00
Sergio R. Caprile 3270f1252b Enable FPU 2022-09-02 11:18:11 -03:00
Sergey Lyubka d8ee105e1e Merge pull request #1699 from cesanta/scb
Fix SCB address for scb struct
2022-09-02 14:09:08 +01:00
cpq 567fccd7ee Refactor W5500 driver, add arduino w5500 example 2022-09-02 12:58:54 +01:00
cpq f7f7319698 Refactor W5500 driver, add arduino w5500 example 2022-09-02 12:58:54 +01:00
Sergio R. Caprile 62a6b61fc9 Fix SCB address for scb struct 2022-09-01 17:14:31 -03:00
Sergey Lyubka 1a87d9fa77 Merge pull request #1698 from oakfire/master
Fix mg_json_get for the array element result not as expected.
2022-09-01 09:14:10 +01:00
oakfire 8131e30002 Fix mg_json_get for the array element result not as expected. 2022-09-01 15:02:17 +08:00
cpq 83c76bdafc Make mongoose_custom.h a local include, for Arduino builds 2022-08-31 18:20:34 +01:00
cpq cf1566e116 Add more comments in json code 2022-08-31 17:59:04 +01:00
Sergey Lyubka 5d2c977029 Merge pull request #1697 from oakfire/master
fix: #1696  mg_json_get() bugs.
2022-08-31 17:55:12 +01:00
cpq 823c0ef5fb Add enc28j60 driver skeleton 2022-08-31 08:54:33 +01:00
cpq aefc588e6e Unbreak win98 build 2022-08-31 08:53:22 +01:00
cpq 1949439d69 Adopt mip changes 2022-08-31 08:44:05 +01:00
cpq c131b8daf1 struct mip_ipcfg -> struct mip_cfg 2022-08-31 08:41:16 +01:00
cpq 8a61969c8f Add struct mip_spi for SPI drivers, and skeleton for enc28j60 driver 2022-08-31 08:35:06 +01:00
Sergey Lyubka 3cf85770c7 Merge pull request #1694 from cesanta/nucleo-f746zg-baremetal
Group clock setup dependencies
2022-08-30 12:25:41 +01:00
Sergey Lyubka 310b339f0d Merge pull request #1691 from cesanta/docs
Moved packed filesystem section out of the docs
2022-08-30 12:24:30 +01:00
Sergey Lyubka 229b7810df Merge pull request #1695 from cesanta/nucleo-f429zi-baremetal
Add baremetal example on Nucleo-F429ZI
2022-08-30 12:24:15 +01:00
oakfire a686beb9a7 fix: #1696 mg_json_get() bugs. 2022-08-30 14:22:58 +08:00
Sergio R. Caprile 42c1bee8ea Add baremetal example on Nucleo-F429ZI 2022-08-29 19:20:20 -03:00
Sergio R. Caprile c289556775 Group clock setup dependencies 2022-08-29 14:36:40 -03:00
Sergio R. Caprile 941d2f2a3e Moved packed filesystem section out of the docs (relevant parts into the tutorial) 2022-08-29 10:43:29 -03:00
3397 changed files with 1820544 additions and 98758 deletions

No files matched your search

+1
View File
@@ -10,3 +10,4 @@
- Compiler/IDE and SDK: ZZZ version _X.Y_ - Compiler/IDE and SDK: ZZZ version _X.Y_
- Target hardware/board: _?_ - Target hardware/board: _?_
- Connectivity chip/module: _?_ - Connectivity chip/module: _?_
- Target RTOS/OS (if applicable): _?_
+12 -2
View File
@@ -1,17 +1,27 @@
name: CIFuzz name: CIFuzz
on: [pull_request] on:
schedule:
- cron: '0 2 * * *' # run at 2 AM UTC
# Allow manual runs
workflow_dispatch:
jobs: jobs:
Fuzzing: Fuzzing:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v4
with: { fetch-depth: 2 }
- run: if ./test/match_changed_files.sh '^src/' ; then echo GO=1 >> $GITHUB_ENV ; fi
- name: Build Fuzzers - name: Build Fuzzers
id: build id: build
if: ${{ env.GO == 1 }}
uses: google/oss-fuzz/infra/cifuzz/actions/build_fuzzers@master uses: google/oss-fuzz/infra/cifuzz/actions/build_fuzzers@master
with: with:
oss-fuzz-project-name: 'mongoose' oss-fuzz-project-name: 'mongoose'
dry-run: false dry-run: false
language: c++ language: c++
- name: Run Fuzzers - name: Run Fuzzers
if: ${{ env.GO == 1 }}
uses: google/oss-fuzz/infra/cifuzz/actions/run_fuzzers@master uses: google/oss-fuzz/infra/cifuzz/actions/run_fuzzers@master
with: with:
oss-fuzz-project-name: 'mongoose' oss-fuzz-project-name: 'mongoose'
@@ -20,7 +30,7 @@ jobs:
language: c++ language: c++
- name: Upload Crash - name: Upload Crash
uses: actions/upload-artifact@v1 uses: actions/upload-artifact@v1
if: failure() && steps.build.outcome == 'success' if: env.GO == 1 && failure() && steps.build.outcome == 'success'
with: with:
name: artifacts name: artifacts
path: ./out/artifacts path: ./out/artifacts
+32
View File
@@ -0,0 +1,32 @@
name: "CodeQL Scanning"
# https://github.com/github/codeql-action
on:
schedule:
- cron: '30 2 * * *' # run at 2:30 AM UTC
# Allow manual runs
workflow_dispatch:
env:
IPV6: 0
jobs:
CodeQL-Build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
permissions:
security-events: write
steps:
- uses: actions/checkout@v3
with: { fetch-depth: 2 }
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: cpp
- run: |
make -C test test CC=gcc ASAN= ASAN_OPTIONS=
./test/setup_ga_network.sh && make -C test mip_test CC=gcc ASAN= ASAN_OPTIONS=
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
+621
View File
@@ -0,0 +1,621 @@
name: Full build and test
on:
schedule:
- cron: '0 1 * * *' # run at 1 AM UTC
# Allow manual runs
workflow_dispatch:
env:
IPV6: 0
jobs:
linux:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
cc: [gcc, clang, g++, clang++]
target: [test, mip_test]
ssl: ["", BUILTIN, MBEDTLS, OPENSSL, WOLFSSL]
select: ["-DMG_ENABLE_POLL=0 -DMG_ENABLE_EPOLL=0", "-DMG_ENABLE_POLL=1 -DMG_ENABLE_EPOLL=0", "-DMG_ENABLE_POLL=0 -DMG_ENABLE_EPOLL=1"]
exclude:
- ssl: MBEDTLS
select: "-DMG_ENABLE_POLL=0 -DMG_ENABLE_EPOLL=0"
- ssl: MBEDTLS
select: "-DMG_ENABLE_POLL=1 -DMG_ENABLE_EPOLL=0"
- ssl: OPENSSL
select: "-DMG_ENABLE_POLL=0 -DMG_ENABLE_EPOLL=0"
- ssl: OPENSSL
select: "-DMG_ENABLE_POLL=1 -DMG_ENABLE_EPOLL=0"
- ssl: WOLFSSL
select: "-DMG_ENABLE_POLL=0 -DMG_ENABLE_EPOLL=0"
- ssl: WOLFSSL
select: "-DMG_ENABLE_POLL=1 -DMG_ENABLE_EPOLL=0"
name: linux ${{ matrix.target }} CC=${{ matrix.cc }} SSL=${{ matrix.ssl }} TFLAGS=${{ matrix.select }}
env:
CC: ${{ matrix.cc }}
SSL: ${{ matrix.ssl }}
TFLAGS: ${{ matrix.select }}
steps:
- uses: actions/checkout@v4
with: { fetch-depth: 2 }
- run: ./test/setup_ga_network.sh && sudo apt -y update ; sudo apt -y install libmbedtls-dev libwolfssl-dev && make -C test ${{ matrix.target }}
s390:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ssl: ["", BUILTIN]
name: S390 SSL=${{ matrix.ssl }}
steps:
- uses: actions/checkout@v4
with: { fetch-depth: 2 }
- run: sudo apt -y update ; sudo apt -y install qemu binfmt-support qemu-user-static && docker run --rm --privileged multiarch/qemu-user-static --reset -p yes && make -C test s390 SSL=${{ matrix.ssl }}
armhf:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ssl: ["", BUILTIN]
name: ArmHF SSL=${{ matrix.ssl }}
steps:
- uses: actions/checkout@v4
with: { fetch-depth: 2 }
- run: sudo apt -y update ; sudo apt -y install qemu binfmt-support qemu-user-static && docker run --rm --privileged multiarch/qemu-user-static --reset -p yes && make -C test armhf SSL=${{ matrix.ssl }}
unamalgamated-mg_prefix:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ssl: ["", BUILTIN, MBEDTLS, OPENSSL, WOLFSSL]
name: unamalgamated-mg_prefix SSL=${{ matrix.ssl }}
steps:
- uses: actions/checkout@v4
with: { fetch-depth: 2 }
- run: sudo apt -y update ; sudo apt -y install libmbedtls-dev libwolfssl-dev
- run: make -C test unamalgamated && make -C test mg_prefix
valgrind:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ssl: ["", BUILTIN, MBEDTLS, OPENSSL, WOLFSSL]
name: Valgrind SSL=${{ matrix.ssl }}
steps:
- uses: actions/checkout@v4
with: { fetch-depth: 2 }
- run: sudo apt -y update ; sudo apt -y install libmbedtls-dev libwolfssl-dev valgrind
- run: make -C test valgrind SSL=${{ matrix.ssl }}
macos:
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
ssl: ["", BUILTIN, MBEDTLS, OPENSSL, WOLFSSL]
select: [-DMG_ENABLE_POLL=0, -DMG_ENABLE_POLL=1]
exclude:
- ssl: MBEDTLS
select: -DMG_ENABLE_POLL=0
- ssl: OPENSSL
select: -DMG_ENABLE_POLL=0
- ssl: WOLFSSL
select: -DMG_ENABLE_POLL=0
name: macos SSL=${{ matrix.ssl }} TFLAGS=${{ matrix.select }}
env:
SSL: ${{ matrix.ssl }}
TFLAGS: ${{ matrix.select }} -DNO_SNTP_CHECK -Wno-sign-conversion # Workaround for MbedTLS 3.5.0
HOMEBREW_NO_AUTO_UPDATE: 1
steps:
- uses: actions/checkout@v4
with: { fetch-depth: 2 }
- run: brew install mbedtls wolfssl # jq openssl already pre-installed
- run: make -C test test ASAN_OPTIONS= MBEDTLS=$(echo $(brew --cellar)/mbedtls*/*) OPENSSL=$(echo $(brew --cellar)/openssl*/*) WOLFSSL=$(echo $(brew --cellar)/wolfssl*/*)
windows:
runs-on: ubuntu-latest
strategy:
fail-fast: false
max-parallel: 1 # no parallel runs, to minimize MQTT errors
matrix:
target: [vc98, vc17, vc22, mingw, mingw++]
ssl: ["", BUILTIN]
select: [-DMG_ENABLE_POLL=0, -DMG_ENABLE_POLL=1]
exclude:
- target: vc98
select: -DMG_ENABLE_POLL=1
name: windows ${{ matrix.target }} SSL=${{ matrix.ssl }} TFLAGS=${{ matrix.select }}
env:
SSL: SSL=${{ matrix.ssl }}
TFLAGS: ${{ matrix.select }}
steps:
- uses: actions/checkout@v4
with: { fetch-depth: 2 }
- run: make -C test ${{ matrix.target }}
arm:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ssl: ["", BUILTIN]
name: Arm SSL=${{ matrix.ssl }}
steps:
- uses: actions/checkout@v4
- run: make -C test arm SSL=${{ matrix.ssl }}
riscv:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ssl: ["", BUILTIN]
name: RISC-V SSL=${{ matrix.ssl }}
steps:
- uses: actions/checkout@v4
- run: make -C test riscv SSL=${{ matrix.ssl }}
examples:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ssl: ["", -DMG_TLS=MG_TLS_BUILTIN]
name: examples ${{ matrix.ssl }}
steps:
- uses: actions/checkout@v4
- run: sudo apt -y install libpcap-dev
- run: make -C test examples CFLAGS_EXTRA="${{ matrix.ssl }}"
- run: make -C test clean_examples
examples_win:
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
ssl: ["", -DMG_TLS=MG_TLS_BUILTIN]
name: examples_win ${{ matrix.ssl }}
steps:
- uses: actions/checkout@v4
# - uses: egor-tensin/setup-mingw@v2
# with:
# platform: x64
- name: test they build
run: make -C test examples_win CFLAGS_EXTRA="${{ matrix.ssl }}"
shell: cmd
- name: test they clean
run: make -C test clean_examples_win
shell: cmd
examples_mac:
runs-on: macos-latest
env: { HOMEBREW_NO_AUTO_UPDATE: 1 }
strategy:
fail-fast: false
matrix:
ssl: ["", -DMG_TLS=MG_TLS_BUILTIN]
name: examples_mac ${{ matrix.ssl }}
steps:
- uses: actions/checkout@v4
- run: make -C test examples_mac CFLAGS_EXTRA="${{ matrix.ssl }}"
- run: make -C test clean_examples_mac
refprojs:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ssl: ["", -DMG_TLS=MG_TLS_BUILTIN]
name: reference-projects ${{ matrix.ssl }}
steps:
- uses: actions/checkout@v4
- run: make -C test refprojs CFLAGS_EXTRA="${{ matrix.ssl }}"
- run: make -C test clean_refprojs
refprojs_win:
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
ssl: ["", -DMG_TLS=MG_TLS_BUILTIN]
name: reference-projects_win ${{ matrix.ssl }}
steps:
- uses: actions/checkout@v4
# - uses: egor-tensin/setup-mingw@v2
# with:
# platform: x64
- name: test they build
run: make -C test refprojs_win CFLAGS_EXTRA="${{ matrix.ssl }}"
shell: cmd
- name: test they clean
run: make -C test clean_refprojs_win
shell: cmd
refprojs_mac:
runs-on: macos-latest
env: { HOMEBREW_NO_AUTO_UPDATE: 1 }
strategy:
fail-fast: false
matrix:
ssl: ["", -DMG_TLS=MG_TLS_BUILTIN]
name: reference-projects_mac ${{ matrix.ssl }}
steps:
- uses: actions/checkout@v4
- run: make -C test refprojs CFLAGS_EXTRA="${{ matrix.ssl }}"
- run: make -C test clean_refprojs
tutorials:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ssl: ["", -DMG_TLS=MG_TLS_BUILTIN]
name: tutorials ${{ matrix.ssl }}
steps:
- uses: actions/checkout@v4
- run: sudo apt -y install libpcap-dev
- run: make -C test tutorials CFLAGS_EXTRA="${{ matrix.ssl }}"
- run: make -C test clean_tutorials
tutorials_win:
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
ssl: ["", -DMG_TLS=MG_TLS_BUILTIN]
name: tutorials_win ${{ matrix.ssl }}
steps:
- uses: actions/checkout@v4
# - uses: egor-tensin/setup-mingw@v2
# with:
# platform: x64
- name: test they build
run: make -C test tutorials_win CFLAGS_EXTRA="${{ matrix.ssl }}"
shell: cmd
- name: test they clean
run: make -C test clean_tutorials_win
shell: cmd
tutorials_mac:
runs-on: macos-latest
env: { HOMEBREW_NO_AUTO_UPDATE: 1 }
strategy:
fail-fast: false
matrix:
ssl: ["", -DMG_TLS=MG_TLS_BUILTIN]
name: tutorials_mac ${{ matrix.ssl }}
steps:
- uses: actions/checkout@v4
- run: make -C test tutorials_mac CFLAGS_EXTRA="${{ matrix.ssl }}"
- run: make -C test clean_tutorials_mac
arduino:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with: { fetch-depth: 2 }
- run: echo # nothing specific to install or do
- run: make -C examples/arduino arduino-xiao
# - run: make -C examples/arduino arduino-nano
- run: make -C examples/arduino clean
generic_examples:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
example:
- path: esp32/uart-bridge
- path: esp32/micropython
- path: esp8266/http-client-server
name: ${{ matrix.example.path }}
env:
GO: 0
steps:
- uses: actions/checkout@v4
with: { fetch-depth: 2 }
- run: if ./test/match_changed_files.sh '^src|^examples/${{ matrix.example.path }}'; then echo GO=1 >> $GITHUB_ENV ; fi
- run: echo # nothing specific to install or do
- run: make -C examples/${{ matrix.example.path }} build
generic_examples_arm:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
example:
- path: microchip/same54-xpro/mqtt-client
- path: infineon/infineon-xmc4700_4800-lwip-rtx-rtos
- path: nxp/nxp-mimxrt1020-azurertos
- path: nxp/nxp-frdmk66f-freertos
- path: nxp/nxp-lpcxpresso54s018m-freertos
- path: nxp/nxp-mimxrt1020-freertos
- path: nxp/nxp-evkbimxrt1050-lwip-freertos
- path: nxp/nxp-evkmimxrt1020-lwip-freertos
- path: nxp/nxp-evkmimxrt1024-lwip-freertos
- path: nxp/nxp-evkmimxrt1060-lwip-freertos
- path: nxp/nxp-evkmimxrt1064-lwip-freertos
- path: nxp/nxp-evkmimxrt1160-cm7-lwip-freertos
- path: nxp/nxp-evkmimxrt1170-cm7-lwip-freertos
- path: nxp/nxp-frdmk64f-lwip-freertos
- path: nxp/nxp-frdmk66f-lwip-freertos
- path: nxp/nxp-lpcxpresso54018-lwip-freertos
- path: nxp/nxp-lpcxpresso54608-lwip-freertos
- path: nxp/nxp-lpcxpresso54618-lwip-freertos
- path: nxp/nxp-lpcxpresso54628-lwip-freertos
- path: nxp/nxp-twrk65f180m-lwip-freertos
- path: nxp/nxp-twrkv58f220m-lwip-freertos
- path: rp2040/pico-rmii
- path: stm32/nucleo-f429zi-make-baremetal-builtin-rndis
- path: stm32/nucleo-f746zg-make-baremetal-builtin-rndis
- path: stm32/nucleo-g031-make-baremetal-builtin
- path: ti/ti-ek-tm4c1294xl-http-server
- path: ti/ek-tm4c1294xl-make-baremetal-builtin-rndis
name: ${{ matrix.example.path }}
steps:
- uses: actions/checkout@v4
with: { fetch-depth: 2 }
- run: sudo apt -y update && sudo apt -y install gcc-arm-none-eabi
- run: make -C examples/${{ matrix.example.path }} build
device_dashboard_examples:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
example:
- path: esp32/device-dashboard
name: ${{ matrix.example.path }}
steps:
- uses: actions/checkout@v4
with: { fetch-depth: 2 }
- run: echo # nothing specific to install or do
- run: make -C examples/${{ matrix.example.path }} build
device_dashboard_examples_arm:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ssl: ["", -DMG_TLS=MG_TLS_BUILTIN]
example:
- path: microchip/same54-xpro/device-dashboard
- path: nxp/rt1020-evk-make-baremetal-builtin
- path: nxp/rt1020-evk-make-freertos-builtin
- path: nxp/rt1060-evk-make-baremetal-builtin
- path: nxp/rt1060-evk-make-freertos-builtin
- path: nxp/rt1170-evk-make-baremetal-builtin
- path: renesas/ek-ra6m4-make-baremetal-builtin
- path: rp2040/pico-rndis-dashboard
- path: rp2040/pico-w
- path: rp2040/pico-w5500
- path: stm32/nucleo-f429zi-make-baremetal-builtin
- path: stm32/nucleo-f429zi-make-freertos-builtin
- path: stm32/nucleo-f746zg-make-baremetal-builtin
- path: stm32/nucleo-f746zg-make-freertos-builtin
- path: stm32/nucleo-f746zg-make-freertos-tcp
- path: stm32/nucleo-f746zg-make-baremetal-builtin-cmsis_driver
- path: stm32/nucleo-h563zi-make-baremetal-builtin
- path: stm32/nucleo-h563zi-make-freertos-builtin
- path: stm32/nucleo-h723zg-make-freertos-builtin
- path: stm32/nucleo-h743zi-make-baremetal-builtin
- path: stm32/nucleo-h743zi-make-freertos-builtin
- path: stm32/stm32h573i-dk-make-baremetal-builtin
- path: stm32/stm32h573i-dk-make-freertos-builtin
- path: ti/ek-tm4c1294xl-make-baremetal-builtin
- path: ti/ek-tm4c1294xl-make-freertos-builtin
name: ${{ matrix.example.path }} ${{ matrix.ssl }}
steps:
- uses: actions/checkout@v4
with: { fetch-depth: 2 }
- run: sudo apt -y update && sudo apt -y install gcc-arm-none-eabi
- run: make -C examples/${{ matrix.example.path }} build CFLAGS_EXTRA="${{ matrix.ssl }}"
# mqtt_dashboard_examples:
# runs-on: ubuntu-latest
# strategy:
# fail-fast: false
# matrix:
# example:
# - path:
# name: ${{ matrix.example.path }}
# steps:
# - uses: actions/checkout@v4
# with: { fetch-depth: 2 }
# - run: echo # nothing specific to install or do
# - run: make -C examples/${{ matrix.example.path }} build
mqtt_dashboard_examples_arm:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
example:
- path: rp2040/pico-rndis-device
name: ${{ matrix.example.path }}
steps:
- uses: actions/checkout@v4
with: { fetch-depth: 2 }
- run: sudo apt -y update && sudo apt -y install gcc-arm-none-eabi
- run: make -C examples/${{ matrix.example.path }} build
# dual_examples:
# runs-on: ubuntu-latest
# strategy:
# fail-fast: false
# matrix:
# example:
# - path:
# name: ${{ matrix.example.path }}
# steps:
# - uses: actions/checkout@v4
# with: { fetch-depth: 2 }
# - run: echo # nothing specific to install or do
# - run: make -C examples/${{ matrix.example.path }} device_dashboard
# - run: make -C examples/${{ matrix.example.path }} mqtt_dashboard
dual_examples_arm:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
example:
- path: stm32/nucleo-h723zg-make-baremetal-builtin
name: ${{ matrix.example.path }}
steps:
- uses: actions/checkout@v4
with: { fetch-depth: 2 }
- run: sudo apt -y update && sudo apt -y install gcc-arm-none-eabi
- run: make -C examples/${{ matrix.example.path }} device_dashboard
- run: make -C examples/${{ matrix.example.path }} mqtt_dashboard
cube_examples:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with: { fetch-depth: 2 }
- run: echo # nothing specific to install or do
- run: cd test/cube && make
zephyr_examples:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with: { fetch-depth: 2 }
- run: sudo apt -y update && sudo apt -y install gcc-arm-none-eabi
- run: make -C examples/zephyr init
- name: minify manifest
uses: mikefarah/yq@master
with:
cmd: yq -i eval '(.manifest.defaults, .manifest.remotes, .manifest.projects[] | select(.name == "cmsis" or .name == "hal_stm32" or .name == "mbedtls" or .name == "mcuboot" or .name == "picolibc" | del(.null) ), .manifest.self) as $i ireduce({};setpath($i | path; $i)) | del(.manifest.projects.[].null) | del(..|select(length==0))' examples/zephyr/zephyrproject/zephyr/west.yml
- run: make -C examples/zephyr update
- run: make -C examples/zephyr/device-dashboard build
- run: make -C examples/zephyr/http-client build
- run: make -C examples/zephyr/http-server build
- run: make -C examples/zephyr/mqtt-aws-client build
- run: make -C examples/zephyr/websocket-server build
test_f7:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with: { fetch-depth: 2 }
- name: baremetal
run: sudo apt -y update && sudo apt -y install gcc-arm-none-eabi
- run: make -C examples/stm32/nucleo-f746zg-make-baremetal-builtin test VCON_API_KEY=${{secrets.VCON_API_KEY}}
- run: make -C examples/stm32/nucleo-f746zg-make-freertos-builtin test VCON_API_KEY=${{secrets.VCON_API_KEY}}
- run: make -C examples/stm32/nucleo-f746zg-make-freertos-tcp test VCON_API_KEY=${{secrets.VCON_API_KEY}}
- name: Cube
run: echo # nothing specific to install or do
- run: make -C test/cube test PROJECTS=../../examples/stm32/nucleo-f746zg-cube-baremetal-builtin VCON_API_KEY=${{secrets.VCON_API_KEY}} DEVICE=5
- run: make -C test/cube test PROJECTS=../../examples/stm32/nucleo-f746zg-cube-freertos-builtin VCON_API_KEY=${{secrets.VCON_API_KEY}} DEVICE=5
- run: make -C test/cube test PROJECTS=../../examples/stm32/nucleo-f746zg-cube-freertos-lwip VCON_API_KEY=${{secrets.VCON_API_KEY}} DEVICE=5
test_f4:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with: { fetch-depth: 2 }
- name: baremetal
run: sudo apt -y update && sudo apt -y install gcc-arm-none-eabi
- run: make -C examples/stm32/nucleo-f429zi-make-baremetal-builtin test VCON_API_KEY=${{secrets.VCON_API_KEY}}
- run: make -C examples/stm32/nucleo-f429zi-make-freertos-builtin test VCON_API_KEY=${{secrets.VCON_API_KEY}}
- name: Cube
run: echo # nothing specific to install or do
- run: make -C test/cube test PROJECTS=../../examples/stm32/nucleo-f429zi-cube-baremetal-builtin VCON_API_KEY=${{secrets.VCON_API_KEY}} DEVICE=2
- run: make -C test/cube test PROJECTS=../../examples/stm32/nucleo-f429zi-cube-freertos-builtin VCON_API_KEY=${{secrets.VCON_API_KEY}} DEVICE=2
- run: make -C test/cube test PROJECTS=../../examples/stm32/nucleo-f429zi-cube-freertos-lwip VCON_API_KEY=${{secrets.VCON_API_KEY}} DEVICE=2
test_h743:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with: { fetch-depth: 3 }
- name: baremetal
run: sudo apt -y update && sudo apt -y install gcc-arm-none-eabi
- run: make -C examples/stm32/nucleo-h743zi-make-baremetal-builtin test VCON_API_KEY=${{secrets.VCON_API_KEY}}
- run: make -C examples/stm32/nucleo-h743zi-make-freertos-builtin test VCON_API_KEY=${{secrets.VCON_API_KEY}}
- name: Cube
run: echo # nothing specific to install or do
- run: make -C test/cube test PROJECTS=../../examples/stm32/nucleo-h743zi-cube-baremetal-builtin VCON_API_KEY=${{secrets.VCON_API_KEY}} DEVICE=6
- run: make -C test/cube test PROJECTS=../../examples/stm32/nucleo-h743zi-cube-freertos-builtin VCON_API_KEY=${{secrets.VCON_API_KEY}} DEVICE=6
test_h723:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with: { fetch-depth: 3 }
- name: baremetal
run: sudo apt -y update && sudo apt -y install gcc-arm-none-eabi
- run: make -C examples/stm32/nucleo-h723zg-make-baremetal-builtin test VCON_API_KEY=${{secrets.VCON_API_KEY}}
- run: make -C examples/stm32/nucleo-h723zg-make-freertos-builtin test VCON_API_KEY=${{secrets.VCON_API_KEY}}
test_h5:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with: { fetch-depth: 3 }
- name: baremetal
run: sudo apt -y update && sudo apt -y install gcc-arm-none-eabi
- run: make -C examples/stm32/nucleo-h563zi-make-baremetal-builtin test VCON_API_KEY=${{secrets.VCON_API_KEY}}
- run: make -C examples/stm32/nucleo-h563zi-make-freertos-builtin test VCON_API_KEY=${{secrets.VCON_API_KEY}}
test_rt1020:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with: { fetch-depth: 3 }
- name: baremetal
run: sudo apt -y update && sudo apt -y install gcc-arm-none-eabi
- run: make -C examples/nxp/rt1020-evk-make-baremetal-builtin test VCON_API_KEY=${{secrets.VCON_API_KEY}}
- run: make -C examples/nxp/rt1020-evk-make-freertos-builtin test VCON_API_KEY=${{secrets.VCON_API_KEY}}
test_rt1060:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with: { fetch-depth: 3 }
- name: baremetal
run: sudo apt -y update && sudo apt -y install gcc-arm-none-eabi
- run: make -C examples/nxp/rt1060-evk-make-baremetal-builtin test VCON_API_KEY=${{secrets.VCON_API_KEY}}
- run: make -C examples/nxp/rt1060-evk-make-freertos-builtin test VCON_API_KEY=${{secrets.VCON_API_KEY}}
test_rt1170:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with: { fetch-depth: 3 }
- name: baremetal
run: sudo apt -y update && sudo apt -y install gcc-arm-none-eabi
- run: make -C examples/nxp/rt1170-evk-make-baremetal-builtin test VCON_API_KEY=${{secrets.VCON_API_KEY}}
# - run: make -C examples/nxp/rt1170-evk-make-freertos-builtin test VCON_API_KEY=${{secrets.VCON_API_KEY}}
test_ra6m4:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with: { fetch-depth: 3 }
- name: baremetal
run: sudo apt -y update && sudo apt -y install gcc-arm-none-eabi
- run: make -C examples/renesas/ek-ra6m4-make-baremetal-builtin test VCON_API_KEY=${{secrets.VCON_API_KEY}}
# - run: make -C examples/renesas/ek-ra6m4-make-freertos-builtin test VCON_API_KEY=${{secrets.VCON_API_KEY}}
test_tm4c:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with: { fetch-depth: 2 }
- name: baremetal
run: sudo apt -y update && sudo apt -y install gcc-arm-none-eabi
- run: make -C examples/ti/ek-tm4c1294xl-make-baremetal-builtin test VCON_API_KEY=${{secrets.VCON_API_KEY}}
- run: make -C examples/ti/ek-tm4c1294xl-make-freertos-builtin test VCON_API_KEY=${{secrets.VCON_API_KEY}}
test_same54:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with: { fetch-depth: 2 }
- name: baremetal
run: sudo apt -y update && sudo apt -y install gcc-arm-none-eabi
- run: make -C examples/microchip/same54-xpro/device-dashboard test VCON_API_KEY=${{secrets.VCON_API_KEY}}
- run: make -C examples/microchip/same54-xpro/mqtt-client test VCON_API_KEY=${{secrets.VCON_API_KEY}}
test_pico_w5500:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with: { fetch-depth: 2 }
- name: SDK
run: sudo apt -y update && sudo apt -y install gcc-arm-none-eabi
- run: make -C examples/rp2040/pico-w5500 test VCON_API_KEY=${{secrets.VCON_API_KEY}}
+754
View File
@@ -0,0 +1,754 @@
name: Build and test - essentials
on:
push:
paths:
- "**Makefile"
- "**.c"
- "**.h"
env:
IPV6: 0
jobs:
linux:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
cc: [gcc, clang++]
target: [test, mip_test]
ssl: ["", BUILTIN]
name: linux ${{ matrix.target }} CC=${{ matrix.cc }} SSL=${{ matrix.ssl }}
env:
CC: ${{ matrix.cc }}
SSL: ${{ matrix.ssl }}
steps:
- uses: actions/checkout@v4
with: { fetch-depth: 2 }
- run: if ./test/match_changed_files.sh '^test|^src/.*.[ch]' ; then echo GO=1 >> $GITHUB_ENV ; fi
- if: ${{ env.GO == 1 }}
run: ./test/setup_ga_network.sh && make -C test ${{ matrix.target }}
s390:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with: { fetch-depth: 2 }
- run: if ./test/match_changed_files.sh '^test|^src/.*.[ch]' ; then echo GO=1 >> $GITHUB_ENV ; fi
- if: ${{ env.GO == 1 }}
run: sudo apt -y update ; sudo apt -y install qemu binfmt-support qemu-user-static && docker run --rm --privileged multiarch/qemu-user-static --reset -p yes && make -C test s390
armhf:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with: { fetch-depth: 2 }
- run: if ./test/match_changed_files.sh '^test|^src/.*.[ch]' ; then echo GO=1 >> $GITHUB_ENV ; fi
- if: ${{ env.GO == 1 }}
run: sudo apt -y update ; sudo apt -y install qemu binfmt-support qemu-user-static && docker run --rm --privileged multiarch/qemu-user-static --reset -p yes && make -C test armhf
unamalgamated-mg_prefix:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with: { fetch-depth: 2 }
- run: if ./test/match_changed_files.sh '^test|^src/.*.[ch]' ; then echo GO=1 >> $GITHUB_ENV ; fi
- if: ${{ env.GO == 1 }}
run: make -C test unamalgamated && make -C test mg_prefix
macos:
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
ssl: ["", BUILTIN]
name: macos SSL=${{ matrix.ssl }}
env:
SSL: ${{ matrix.ssl }}
TFLAGS: -DNO_SNTP_CHECK
HOMEBREW_NO_AUTO_UPDATE: 1
steps:
- uses: actions/checkout@v4
with: { fetch-depth: 2 }
- run: if ./test/match_changed_files.sh '^test|^src/.*.[ch]' ; then echo GO=1 >> $GITHUB_ENV ; fi
- if: ${{ env.GO == 1 }}
run: make -C test test ASAN_OPTIONS=
windows:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
target: [vc98, vc22, mingw++]
name: windows ${{ matrix.target }}
steps:
- uses: actions/checkout@v4
with: { fetch-depth: 2 }
- run: if ./test/match_changed_files.sh '^test|^src/.*.[ch]' ; then echo GO=1 >> $GITHUB_ENV ; fi
- if: ${{ env.GO == 1 }}
run: make -C test ${{ matrix.target }}
arm:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: make -C test arm
riscv:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: make -C test riscv
examples:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: make -C test examples_essential
- run: make -C test clean_examples_essential
examples_win:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
# - uses: egor-tensin/setup-mingw@v2
# with:
# platform: x64
- name: test they build
run: make -C test examples_win
shell: cmd
- name: test they clean
run: make -C test clean_examples_win
shell: cmd
examples_mac:
runs-on: macos-latest
env: { HOMEBREW_NO_AUTO_UPDATE: 1 }
steps:
- uses: actions/checkout@v4
- run: make -C test examples_mac
- run: make -C test clean_examples_mac
refprojs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: make -C test refprojs
- run: make -C test clean_refprojs
refprojs_win:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
# - uses: egor-tensin/setup-mingw@v2
# with:
# platform: x64
- name: test they build
run: make -C test refprojs_win
shell: cmd
- name: test they clean
run: make -C test clean_refprojs_win
shell: cmd
refprojs_mac:
runs-on: macos-latest
env: { HOMEBREW_NO_AUTO_UPDATE: 1 }
steps:
- uses: actions/checkout@v4
- run: make -C test refprojs
- run: make -C test clean_refprojs
tutorials:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: make -C test tutorials_essential
- run: make -C test clean_tutorials_essential
tutorials_win:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
# - uses: egor-tensin/setup-mingw@v2
# with:
# platform: x64
- name: test they build
run: make -C test tutorials_win
shell: cmd
- name: test they clean
run: make -C test clean_tutorials_win
shell: cmd
tutorials_mac:
runs-on: macos-latest
env: { HOMEBREW_NO_AUTO_UPDATE: 1 }
steps:
- uses: actions/checkout@v4
- run: make -C test tutorials_mac
- run: make -C test clean_tutorials_mac
generic_examples:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
example:
- path: esp32/uart-bridge
- path: esp8266/http-client-server
name: ${{ matrix.example.path }}
env:
GO: 0
steps:
- uses: actions/checkout@v4
with: { fetch-depth: 2 }
- run: if ./test/match_changed_files.sh '^src|^examples/${{ matrix.example.path }}'; then echo GO=1 >> $GITHUB_ENV ; fi
- if: ${{ env.GO == 1 }}
run: |
# nothing specific to install or do
- if: ${{ env.GO == 1 }}
run: make -C examples/${{ matrix.example.path }} build
generic_examples_arm:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
example:
- path: infineon/infineon-xmc4700_4800-lwip-rtx-rtos
- path: stm32/nucleo-g031-make-baremetal-builtin
name: ${{ matrix.example.path }}
env:
GO: 0
steps:
- uses: actions/checkout@v4
with: { fetch-depth: 2 }
- run: if ./test/match_changed_files.sh '^src|^examples/${{ matrix.example.path }}'; then echo GO=1 >> $GITHUB_ENV ; fi
- if: ${{ env.GO == 1 }}
run: sudo apt -y update && sudo apt -y install gcc-arm-none-eabi
- if: ${{ env.GO == 1 }}
run: make -C examples/${{ matrix.example.path }} build
device_dashboard_examples:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
example:
- path: esp32/device-dashboard
name: ${{ matrix.example.path }}
env:
GO: 0
steps:
- uses: actions/checkout@v4
with: { fetch-depth: 2 }
- run: |
if ./test/match_changed_files.sh '^src|examples/device-dashboard|^examples/${{ matrix.example.path }}'; then
echo GO=1 >> $GITHUB_ENV
# nothing specific to install or do
fi
- if: ${{ env.GO == 1 }}
run: make -C examples/${{ matrix.example.path }} build
device_dashboard_examples_arm:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
example:
- path: microchip/same54-xpro/device-dashboard
- path: nxp/rt1020-evk-make-baremetal-builtin
- path: nxp/rt1020-evk-make-freertos-builtin
- path: nxp/rt1060-evk-make-baremetal-builtin
- path: nxp/rt1060-evk-make-freertos-builtin
- path: nxp/rt1170-evk-make-baremetal-builtin
- path: renesas/ek-ra6m4-make-baremetal-builtin
- path: rp2040/pico-rndis-dashboard
- path: rp2040/pico-w
- path: rp2040/pico-w5500
- path: stm32/nucleo-f429zi-make-baremetal-builtin
- path: stm32/nucleo-f429zi-make-freertos-builtin
- path: stm32/nucleo-f746zg-make-baremetal-builtin
- path: stm32/nucleo-f746zg-make-freertos-builtin
- path: stm32/nucleo-f746zg-make-freertos-tcp
- path: stm32/nucleo-f746zg-make-baremetal-builtin-cmsis_driver
- path: stm32/nucleo-h563zi-make-baremetal-builtin
- path: stm32/nucleo-h563zi-make-freertos-builtin
- path: stm32/nucleo-h723zg-make-freertos-builtin
- path: stm32/nucleo-h743zi-make-baremetal-builtin
- path: stm32/nucleo-h743zi-make-freertos-builtin
- path: stm32/stm32h573i-dk-make-baremetal-builtin
- path: stm32/stm32h573i-dk-make-freertos-builtin
- path: ti/ek-tm4c1294xl-make-baremetal-builtin
- path: ti/ek-tm4c1294xl-make-freertos-builtin
name: ${{ matrix.example.path }}
env:
GO: 0
steps:
- uses: actions/checkout@v4
with: { fetch-depth: 2 }
- run: |
if ./test/match_changed_files.sh '^src|examples/device-dashboard|^examples/${{ matrix.example.path }}'; then
echo GO=1 >> $GITHUB_ENV
sudo apt -y update && sudo apt -y install gcc-arm-none-eabi
fi
- if: ${{ env.GO == 1 }}
run: make -C examples/${{ matrix.example.path }} build
# mqtt_dashboard_examples:
# runs-on: ubuntu-latest
# strategy:
# fail-fast: false
# matrix:
# example:
# - path:
# name: ${{ matrix.example.path }}
# env:
# GO: 0
# steps:
# - uses: actions/checkout@v4
# with: { fetch-depth: 2 }
# - run: |
# if ./test/match_changed_files.sh '^src|examples/mqtt-dashboard/device|^examples/${{ matrix.example.path }}'; then
# echo GO=1 >> $GITHUB_ENV
# # nothing specific to install or do
# fi
# - if: ${{ env.GO == 1 }}
# run: make -C examples/${{ matrix.example.path }} build
mqtt_dashboard_examples_arm:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
example:
- path: rp2040/pico-rndis-device
name: ${{ matrix.example.path }}
env:
GO: 0
steps:
- uses: actions/checkout@v4
with: { fetch-depth: 2 }
- run: |
if ./test/match_changed_files.sh '^src|examples/mqtt-dashboard/device|^examples/${{ matrix.example.path }}'; then
echo GO=1 >> $GITHUB_ENV
sudo apt -y update && sudo apt -y install gcc-arm-none-eabi
fi
- if: ${{ env.GO == 1 }}
run: make -C examples/${{ matrix.example.path }} build
# dual_examples:
# runs-on: ubuntu-latest
# strategy:
# fail-fast: false
# matrix:
# example:
# - path:
# name: ${{ matrix.example.path }}
# env:
# GO: 0
# steps:
# - uses: actions/checkout@v4
# with: { fetch-depth: 2 }
# - run: |
# if ./test/match_changed_files.sh '^src|examples/device-dashboard|examples/mqtt-dashboard/device|^examples/${{ matrix.example.path }}'; then
# echo GO=1 >> $GITHUB_ENV
# # nothing specific to install or do
# fi
# - if: ${{ env.GO == 1 }}
# run: |
# if ./test/match_changed_files.sh '^src|examples/device-dashboard|^examples/${{ matrix.example.path }}'; then
# make -C examples/${{ matrix.example.path }} device_dashboard
# fi
# - if: ${{ env.GO == 1 }}
# run: |
# if ./test/match_changed_files.sh '^src|examples/mqtt-dashboard/device|^examples/${{ matrix.example.path }}'; then
# make -C examples/${{ matrix.example.path }} mqtt_dashboard
# fi
dual_examples_arm:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
example:
- path: stm32/nucleo-h723zg-make-baremetal-builtin
name: ${{ matrix.example.path }}
env:
GO: 0
steps:
- uses: actions/checkout@v4
with: { fetch-depth: 2 }
- run: |
if ./test/match_changed_files.sh '^src|examples/device-dashboard|examples/mqtt-dashboard/device|^examples/${{ matrix.example.path }}'; then
echo GO=1 >> $GITHUB_ENV
sudo apt -y update && sudo apt -y install gcc-arm-none-eabi
fi
- if: ${{ env.GO == 1 }}
run: |
if ./test/match_changed_files.sh '^src|examples/device-dashboard|^examples/${{ matrix.example.path }}'; then
make -C examples/${{ matrix.example.path }} device_dashboard
fi
- if: ${{ env.GO == 1 }}
run: |
if ./test/match_changed_files.sh '^src|examples/mqtt-dashboard/device|^examples/${{ matrix.example.path }}'; then
make -C examples/${{ matrix.example.path }} mqtt_dashboard
fi
cube_examples:
runs-on: ubuntu-latest
env:
GO: 0
steps:
- uses: actions/checkout@v4
with: { fetch-depth: 2 }
- run: |
if ./test/match_changed_files.sh '^src|examples/stm32/nucleo-*-cube-*'; then
echo GO=1 >> $GITHUB_ENV
# nothing specific to install or do
fi
- if: ${{ env.GO == 1 }}
run: cd test/cube && make
test_f7:
runs-on: ubuntu-latest
env:
GO: 0
steps:
- uses: actions/checkout@v4
with: { fetch-depth: 2 }
- name: baremetal
run: |
if ./test/match_changed_files.sh "^src|examples/device-dashboard|examples/stm32|examples/nxp|examples/ti|examples/microchip/same" ; then
echo GO=1 >> $GITHUB_ENV
sudo apt -y update && sudo apt -y install gcc-arm-none-eabi
fi
# always run baremetal on core or dashboard or specific example changes; other examples only on specific example changes
- if: ${{ env.GO == 1 }}
continue-on-error: true # continue so next test has a chance to re-flash and exit from collisions and flash failures
run: |
if ./test/match_changed_files.sh '^src|examples/device-dashboard|examples/stm32/nucleo-f746zg-make-baremetal-builtin'; then
make -C examples/stm32/nucleo-f746zg-make-baremetal-builtin test VCON_API_KEY=${{secrets.VCON_API_KEY}}
fi
- if: ${{ env.GO == 1 }}
run: |
if ./test/match_changed_files.sh 'examples/stm32/nucleo-f746zg-make-freertos-builtin'; then
make -C examples/stm32/nucleo-f746zg-make-freertos-builtin test VCON_API_KEY=${{secrets.VCON_API_KEY}}
fi
- if: ${{ env.GO == 1 }}
run: |
if ./test/match_changed_files.sh 'examples/stm32/nucleo-f746zg-make-freertos-tcp'; then
make -C examples/stm32/nucleo-f746zg-make-freertos-tcp test VCON_API_KEY=${{secrets.VCON_API_KEY}}
fi
- name: Cube
run: |
echo GO=0 >> $GITHUB_ENV
if ./test/match_changed_files.sh 'examples/stm32/nucleo-f7.*-cube-'; then
echo GO=1 >> $GITHUB_ENV
# nothing specific to install or do
fi
- if: ${{ env.GO == 1 }}
run: |
if ./test/match_changed_files.sh 'examples/stm32/nucleo-f746zg-cube-baremetal-builtin'; then
make -C test/cube test PROJECTS=../../examples/stm32/nucleo-f746zg-cube-baremetal-builtin VCON_API_KEY=${{secrets.VCON_API_KEY}} DEVICE=5
fi
- if: ${{ env.GO == 1 }}
run: |
if ./test/match_changed_files.sh 'examples/stm32/nucleo-f746zg-cube-freertos-builtin'; then
make -C test/cube test PROJECTS=../../examples/stm32/nucleo-f746zg-cube-freertos-builtin VCON_API_KEY=${{secrets.VCON_API_KEY}} DEVICE=5
fi
- if: ${{ env.GO == 1 }}
run: |
if ./test/match_changed_files.sh 'examples/stm32/nucleo-f746zg-cube-freertos-lwip'; then
make -C test/cube test PROJECTS=../../examples/stm32/nucleo-f746zg-cube-freertos-lwip VCON_API_KEY=${{secrets.VCON_API_KEY}} DEVICE=5
fi
test_f4:
runs-on: ubuntu-latest
env:
GO: 0
steps:
- uses: actions/checkout@v4
with: { fetch-depth: 2 }
- name: baremetal
run: |
if ./test/match_changed_files.sh "^src|examples/device-dashboard|examples/stm32/nucleo-f4.*-make-" ; then
echo GO=1 >> $GITHUB_ENV
sudo apt -y update && sudo apt -y install gcc-arm-none-eabi
fi
- if: ${{ env.GO == 1 }}
continue-on-error: true
run: |
if ./test/match_changed_files.sh '^src|examples/device-dashboard|examples/stm32/nucleo-f429zi-make-baremetal-builtin'; then
make -C examples/stm32/nucleo-f429zi-make-baremetal-builtin test VCON_API_KEY=${{secrets.VCON_API_KEY}}
fi
- if: ${{ env.GO == 1 }}
run: |
if ./test/match_changed_files.sh 'examples/stm32/nucleo-f429zi-make-freertos-builtin'; then
make -C examples/stm32/nucleo-f429zi-make-freertos-builtin test VCON_API_KEY=${{secrets.VCON_API_KEY}}
fi
- name: Cube
run: |
echo GO=0 >> $GITHUB_ENV
if ./test/match_changed_files.sh 'examples/stm32/nucleo-f4.*-cube-'; then
echo GO=1 >> $GITHUB_ENV
# nothing specific to install or do
fi
- if: ${{ env.GO == 1 }}
run: |
if ./test/match_changed_files.sh 'examples/stm32/nucleo-f429zi-cube-baremetal-builtin'; then
make -C test/cube test PROJECTS=../../examples/stm32/nucleo-f429zi-cube-baremetal-builtin VCON_API_KEY=${{secrets.VCON_API_KEY}} DEVICE=2
fi
- if: ${{ env.GO == 1 }}
run: |
if ./test/match_changed_files.sh 'examples/stm32/nucleo-f429zi-cube-freertos-builtin'; then
make -C test/cube test PROJECTS=../../examples/stm32/nucleo-f429zi-cube-freertos-builtin VCON_API_KEY=${{secrets.VCON_API_KEY}} DEVICE=2
fi
- if: ${{ env.GO == 1 }}
run: |
if ./test/match_changed_files.sh 'examples/stm32/nucleo-f429zi-cube-freertos-lwip'; then
make -C test/cube test PROJECTS=../../examples/stm32/nucleo-f429zi-cube-freertos-lwip VCON_API_KEY=${{secrets.VCON_API_KEY}} DEVICE=2
fi
test_h743:
runs-on: ubuntu-latest
env:
GO: 0
steps:
- uses: actions/checkout@v4
with: { fetch-depth: 3 }
- name: baremetal
run: |
if ./test/match_changed_files.sh "^src|examples/device-dashboard|examples/stm32/nucleo-h74.*-make-" ; then
echo GO=1 >> $GITHUB_ENV
sudo apt -y update && sudo apt -y install gcc-arm-none-eabi
fi
- if: ${{ env.GO == 1 }}
continue-on-error: true
run: |
if ./test/match_changed_files.sh '^src|examples/device-dashboard|examples/stm32/nucleo-h743zi-make-baremetal-builtin'; then
make -C examples/stm32/nucleo-h743zi-make-baremetal-builtin test VCON_API_KEY=${{secrets.VCON_API_KEY}}
fi
- if: ${{ env.GO == 1 }}
run: |
if ./test/match_changed_files.sh 'examples/stm32/nucleo-h743zi-make-freertos-builtin'; then
make -C examples/stm32/nucleo-h743zi-make-freertos-builtin test VCON_API_KEY=${{secrets.VCON_API_KEY}}
fi
- name: Cube
run: |
echo GO=0 >> $GITHUB_ENV
if ./test/match_changed_files.sh 'examples/stm32/nucleo-h74.*-cube-'; then
echo GO=1 >> $GITHUB_ENV
# nothing specific to install or do
fi
- if: ${{ env.GO == 1 }}
run: |
if ./test/match_changed_files.sh 'examples/stm32/nucleo-h743zi-cube-baremetal-builtin'; then
make -C test/cube test PROJECTS=../../examples/stm32/nucleo-h743zi-cube-baremetal-builtin VCON_API_KEY=${{secrets.VCON_API_KEY}} DEVICE=6
fi
- if: ${{ env.GO == 1 }}
run: |
if ./test/match_changed_files.sh 'examples/stm32/nucleo-h743zi-cube-freertos-builtin'; then
make -C test/cube test PROJECTS=../../examples/stm32/nucleo-h743zi-cube-freertos-builtin VCON_API_KEY=${{secrets.VCON_API_KEY}} DEVICE=6
fi
test_h723:
runs-on: ubuntu-latest
env:
GO: 0
steps:
- uses: actions/checkout@v4
with: { fetch-depth: 3 }
- name: baremetal
run: |
if ./test/match_changed_files.sh "^src|examples/device-dashboard|examples/stm32/nucleo-h72.*-make-" ; then
echo GO=1 >> $GITHUB_ENV
sudo apt -y update && sudo apt -y install gcc-arm-none-eabi
fi
- if: ${{ env.GO == 1 }}
continue-on-error: true
run: |
if ./test/match_changed_files.sh '^src|examples/device-dashboard|examples/stm32/nucleo-h723zg-make-baremetal-builtin'; then
make -C examples/stm32/nucleo-h723zg-make-baremetal-builtin test VCON_API_KEY=${{secrets.VCON_API_KEY}}
fi
- if: ${{ env.GO == 1 }}
run: |
if ./test/match_changed_files.sh 'examples/stm32/nucleo-h723zg-make-freertos-builtin'; then
make -C examples/stm32/nucleo-h723zg-make-freertos-builtin test VCON_API_KEY=${{secrets.VCON_API_KEY}}
fi
test_h5:
runs-on: ubuntu-latest
env:
GO: 0
steps:
- uses: actions/checkout@v4
with: { fetch-depth: 3 }
- name: baremetal
run: |
if ./test/match_changed_files.sh "^src|examples/device-dashboard|examples/stm32/nucleo-h5.*-make-" ; then
echo GO=1 >> $GITHUB_ENV
sudo apt -y update && sudo apt -y install gcc-arm-none-eabi
fi
- if: ${{ env.GO == 1 }}
continue-on-error: true
run: |
if ./test/match_changed_files.sh '^src|examples/device-dashboard|examples/stm32/nucleo-h563zi-make-baremetal-builtin'; then
make -C examples/stm32/nucleo-h563zi-make-baremetal-builtin test VCON_API_KEY=${{secrets.VCON_API_KEY}}
fi
- if: ${{ env.GO == 1 }}
run: |
if ./test/match_changed_files.sh 'examples/stm32/nucleo-h563zi-make-freertos-builtin'; then
make -C examples/stm32/nucleo-h563zi-make-freertos-builtin test VCON_API_KEY=${{secrets.VCON_API_KEY}}
fi
test_rt1020:
runs-on: ubuntu-latest
env:
GO: 0
steps:
- uses: actions/checkout@v4
with: { fetch-depth: 3 }
- name: baremetal
run: |
if ./test/match_changed_files.sh "^src|examples/device-dashboard|examples/nxp/rt1020.*-make-" ; then
echo GO=1 >> $GITHUB_ENV
sudo apt -y update && sudo apt -y install gcc-arm-none-eabi
fi
- if: ${{ env.GO == 1 }}
continue-on-error: true
run: |
if ./test/match_changed_files.sh '^src|examples/device-dashboard|examples/nxp/rt1020-evk-make-baremetal-builtin'; then
make -C examples/nxp/rt1020-evk-make-baremetal-builtin test VCON_API_KEY=${{secrets.VCON_API_KEY}}
fi
- if: ${{ env.GO == 1 }}
run: |
if ./test/match_changed_files.sh 'examples/nxp/rt1020-evk-make-freertos-builtin'; then
make -C examples/nxp/rt1020-evk-make-freertos-builtin test VCON_API_KEY=${{secrets.VCON_API_KEY}}
fi
test_rt1060:
runs-on: ubuntu-latest
env:
GO: 0
steps:
- uses: actions/checkout@v4
with: { fetch-depth: 3 }
- name: baremetal
run: |
if ./test/match_changed_files.sh "^src|examples/device-dashboard|examples/nxp/rt1060.*-make-" ; then
echo GO=1 >> $GITHUB_ENV
sudo apt -y update && sudo apt -y install gcc-arm-none-eabi
fi
- if: ${{ env.GO == 1 }}
continue-on-error: true
run: |
if ./test/match_changed_files.sh '^src|examples/device-dashboard|examples/nxp/rt1060-evk-make-baremetal-builtin'; then
make -C examples/nxp/rt1060-evk-make-baremetal-builtin test VCON_API_KEY=${{secrets.VCON_API_KEY}}
fi
- if: ${{ env.GO == 1 }}
run: |
if ./test/match_changed_files.sh 'examples/nxp/rt1060-evk-make-freertos-builtin'; then
make -C examples/nxp/rt1060-evk-make-freertos-builtin test VCON_API_KEY=${{secrets.VCON_API_KEY}}
fi
test_rt1170:
runs-on: ubuntu-latest
env:
GO: 0
steps:
- uses: actions/checkout@v4
with: { fetch-depth: 3 }
- name: baremetal
run: |
if ./test/match_changed_files.sh "^src|examples/device-dashboard|examples/nxp/rt1170.*-make-" ; then
echo GO=1 >> $GITHUB_ENV
sudo apt -y update && sudo apt -y install gcc-arm-none-eabi
fi
- if: ${{ env.GO == 1 }}
continue-on-error: true
run: |
if ./test/match_changed_files.sh '^src|examples/device-dashboard|examples/nxp/rt1170-evk-make-baremetal-builtin'; then
make -C examples/nxp/rt1170-evk-make-baremetal-builtin test VCON_API_KEY=${{secrets.VCON_API_KEY}}
fi
# - if: ${{ env.GO == 1 }}
# run: |
# if ./test/match_changed_files.sh 'examples/nxp/rt1170-evk-make-freertos-builtin'; then
# make -C examples/nxp/rt1170-evk-make-freertos-builtin test VCON_API_KEY=${{secrets.VCON_API_KEY}}
# fi
test_ra6m4:
runs-on: ubuntu-latest
env:
GO: 0
steps:
- uses: actions/checkout@v4
with: { fetch-depth: 3 }
- name: baremetal
run: |
if ./test/match_changed_files.sh "^src|examples/device-dashboard|examples/renesas/ek-ra6m4.*-make-" ; then
echo GO=1 >> $GITHUB_ENV
sudo apt -y update && sudo apt -y install gcc-arm-none-eabi
fi
- if: ${{ env.GO == 1 }}
continue-on-error: true
run: |
if ./test/match_changed_files.sh '^src|examples/device-dashboard|examples/renesas/ek-ra6m4-make-baremetal-builtin'; then
make -C examples/renesas/ek-ra6m4-make-baremetal-builtin test VCON_API_KEY=${{secrets.VCON_API_KEY}}
fi
# - if: ${{ env.GO == 1 }}
# run: |
# if ./test/match_changed_files.sh 'examples/renesas/ek-ra6m4-make-freertos-builtin'; then
# make -C examples/renesas/ek-ra6m4-make-freertos-builtin test VCON_API_KEY=${{secrets.VCON_API_KEY}}
# fi
test_tm4c:
runs-on: ubuntu-latest
env:
GO: 0
steps:
- uses: actions/checkout@v4
with: { fetch-depth: 2 }
- name: baremetal
run: |
if ./test/match_changed_files.sh "^src|examples/device-dashboard|examples/ti/ek-tm4c.*-make-" ; then
echo GO=1 >> $GITHUB_ENV
sudo apt -y update && sudo apt -y install gcc-arm-none-eabi
fi
- if: ${{ env.GO == 1 }}
run: |
if ./test/match_changed_files.sh '^src|examples/device-dashboard|examples/ti/ek-tm4c1294xl-make-baremetal-builtin'; then
make -C examples/ti/ek-tm4c1294xl-make-baremetal-builtin test VCON_API_KEY=${{secrets.VCON_API_KEY}}
fi
- if: ${{ env.GO == 1 }}
run: |
if ./test/match_changed_files.sh 'examples/ti/ek-tm4c1294xl-make-freertos-builtin'; then
make -C examples/ti/ek-tm4c1294xl-make-freertos-builtin test VCON_API_KEY=${{secrets.VCON_API_KEY}}
fi
test_same54:
runs-on: ubuntu-latest
env:
GO: 0
steps:
- uses: actions/checkout@v4
with: { fetch-depth: 2 }
- name: baremetal
run: |
if ./test/match_changed_files.sh "^src|examples/device-dashboard|examples/microchip/same54-xpro" ; then
echo GO=1 >> $GITHUB_ENV
sudo apt -y update && sudo apt -y install gcc-arm-none-eabi
fi
- if: ${{ env.GO == 1 }}
run: |
if ./test/match_changed_files.sh '^src|examples/device-dashboard|examples/microchip/same54-xpro/device-dashboard'; then
make -C examples/microchip/same54-xpro/device-dashboard test VCON_API_KEY=${{secrets.VCON_API_KEY}}
fi
- if: ${{ env.GO == 1 }}
run: |
if ./test/match_changed_files.sh 'examples/microchip/same54-xpro/mqtt-client'; then
make -C examples/microchip/same54-xpro/mqtt-client test VCON_API_KEY=${{secrets.VCON_API_KEY}}
fi
test_pico_w5500:
runs-on: ubuntu-latest
env:
GO: 0
steps:
- uses: actions/checkout@v4
with: { fetch-depth: 2 }
- name: SDK
run: |
if ./test/match_changed_files.sh "^src|examples/device-dashboard|examples/rp2040/pico-w5500" ; then
echo GO=1 >> $GITHUB_ENV
sudo apt -y update && sudo apt -y install gcc-arm-none-eabi
fi
- if: ${{ env.GO == 1 }}
run: make -C examples/rp2040/pico-w5500 test VCON_API_KEY=${{secrets.VCON_API_KEY}}
+705 -93
View File
@@ -1,128 +1,740 @@
name: build name: original workflow, outdated # *** YES, OUTDATED *** kept for hystorical/reference purposes, attachment, etc.
on: [push, pull_request] on:
workflow_dispatch:
env:
IPV6: 0
jobs: jobs:
linux: linux:
runs-on: ubuntu-latest runs-on: ubuntu-latest
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
cc: [gcc, clang] cc: [gcc, clang, g++, clang++]
target: [test, test++, valgrind] target: [test, mip_test]
ssl: [MBEDTLS, OPENSSL] ssl: ["", MBEDTLS, OPENSSL]
name: linux ${{ matrix.target }} CC=${{ matrix.cc }} SSL=${{ matrix.ssl }} select: ["-DMG_ENABLE_POLL=0 -DMG_ENABLE_EPOLL=0", "-DMG_ENABLE_POLL=1 -DMG_ENABLE_EPOLL=0", "-DMG_ENABLE_POLL=0 -DMG_ENABLE_EPOLL=1"]
exclude:
- ssl: MBEDTLS
select: "-DMG_ENABLE_POLL=0 -DMG_ENABLE_EPOLL=0"
- ssl: MBEDTLS
select: "-DMG_ENABLE_POLL=1 -DMG_ENABLE_EPOLL=0"
- ssl: OPENSSL
select: "-DMG_ENABLE_POLL=0 -DMG_ENABLE_EPOLL=0"
- ssl: OPENSSL
select: "-DMG_ENABLE_POLL=1 -DMG_ENABLE_EPOLL=0"
name: linux ${{ matrix.target }} CC=${{ matrix.cc }} SSL=${{ matrix.ssl }} TFLAGS=${{ matrix.select }}
env: env:
IPV6: 0
CC: ${{ matrix.cc }} CC: ${{ matrix.cc }}
SSL: ${{ matrix.ssl }} SSL: ${{ matrix.ssl }}
TFLAGS: ${{ matrix.select }}
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: Install packages with: { fetch-depth: 2 }
run: sudo apt-get update ; sudo apt-get install libmbedtls-dev valgrind - run: if ./test/match_changed_files.sh '^test|^src/.*.[ch]' ; then echo GO=1 >> $GITHUB_ENV ; fi
- name: test - if: ${{ env.GO == 1 }}
run: make ${{ matrix.target }} run: ./test/setup_ga_network.sh && sudo apt -y update ; sudo apt -y install libmbedtls-dev && make ${{ matrix.target }}
- name: unamalgamated s390:
run: make unamalgamated
examples:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- run: sudo apt-get install libmbedtls-dev libpcap-dev with: { fetch-depth: 2 }
- run: make clean examples - run: if ./test/match_changed_files.sh '^test|^src/.*.[ch]' ; then echo GO=1 >> $GITHUB_ENV ; fi
- run: make clean test IPV6=0 MG_ENABLE_POLL=1 - if: ${{ env.GO == 1 }}
run: sudo apt -y update ; sudo apt -y install qemu binfmt-support qemu-user-static && docker run --rm --privileged multiarch/qemu-user-static --reset -p yes && make s390
armhf:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with: { fetch-depth: 2 }
- run: if ./test/match_changed_files.sh '^test|^src/.*.[ch]' ; then echo GO=1 >> $GITHUB_ENV ; fi
- if: ${{ env.GO == 1 }}
run: sudo apt -y update ; sudo apt -y install qemu binfmt-support qemu-user-static && docker run --rm --privileged multiarch/qemu-user-static --reset -p yes && make armhf
linux2:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with: { fetch-depth: 2 }
- run: if ./test/match_changed_files.sh '^test|^src/.*.[ch]' ; then echo GO=1 >> $GITHUB_ENV ; fi
- if: ${{ env.GO == 1 }}
run: sudo apt -y update ; sudo apt -y install libmbedtls-dev valgrind
- if: ${{ env.GO == 1 }}
run: make unamalgamated && make valgrind && make mg_prefix
macos: macos:
runs-on: macos-latest runs-on: macos-latest
strategy:
fail-fast: false
matrix:
ssl: ["", MBEDTLS, OPENSSL]
select: [-DMG_ENABLE_POLL=0, -DMG_ENABLE_POLL=1]
exclude:
- ssl: MBEDTLS
select: -DMG_ENABLE_POLL=0
- ssl: OPENSSL
select: -DMG_ENABLE_POLL=0
name: macos SSL=${{ matrix.ssl }} TFLAGS=${{ matrix.select }}
env:
SSL: ${{ matrix.ssl }}
TFLAGS: ${{ matrix.select }} -DNO_SNTP_CHECK -Wno-sign-conversion # Workaround for MbedTLS 3.5.0
HOMEBREW_NO_AUTO_UPDATE: 1
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- run: HOMEBREW_NO_AUTO_UPDATE=1 brew install jq mbedtls openssl with: { fetch-depth: 2 }
- run: make test++ upload-coverage IPV6=0 ASAN_OPTIONS= - run: if ./test/match_changed_files.sh '^test|^src/.*.[ch]' ; then echo GO=1 >> $GITHUB_ENV ; fi
- run: make test SSL=OPENSSL IPV6=0 ASAN_OPTIONS= OPENSSL=`echo /usr/local/Cellar/openssl*/*` - if: ${{ env.GO == 1 }}
- run: make mg_prefix run: brew install jq mbedtls openssl
- if: ${{ env.GO == 1 }}
run: make test ASAN_OPTIONS= MBEDTLS=`echo /usr/local/Cellar/mbedtls*/*` OPENSSL=`echo /usr/local/Cellar/openssl*/*`
- if: ${{ env.GO == 1 }}
run: make mg_prefix
windows: windows:
runs-on: ubuntu-latest runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
target: [vc98, vc17, vc22, mingw, mingw++]
select: [-DMG_ENABLE_POLL=0, -DMG_ENABLE_POLL=1]
exclude:
- target: vc98
select: -DMG_ENABLE_POLL=1
name: windows ${{ matrix.target }} TFLAGS=${{ matrix.select }}
env:
TFLAGS: ${{ matrix.select }}
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- run: make vc98 with: { fetch-depth: 2 }
- run: make vc17 - run: if ./test/match_changed_files.sh '^test|^src/.*.[ch]' ; then echo GO=1 >> $GITHUB_ENV ; fi
- run: make vc22 - if: ${{ env.GO == 1 }}
- run: make mingw run: make ${{ matrix.target }}
- run: make mingw++
arm: arm:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- run: make arm - run: make arm
matrix_examples: riscv:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: make riscv
examples:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: sudo apt -y install libmbedtls-dev libpcap-dev
- run: make examples
- run: make clean
examples_win:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
# - uses: egor-tensin/setup-mingw@v2
# with:
# platform: x64
- name: test they build
run: make examples_win
shell: cmd
- name: test they clean
run: make clean_examples_win
shell: cmd
examples_mac:
runs-on: macos-latest
env: { HOMEBREW_NO_AUTO_UPDATE: 1 }
steps:
- uses: actions/checkout@v3
- run: make examples_mac
- run: make clean_examples_mac
arduino:
runs-on: ubuntu-latest
env:
GO: 0
steps:
- uses: actions/checkout@v3
with: { fetch-depth: 2 }
- run: |
if ./test/match_changed_files.sh "^src|examples/device-dashboard|examples/arduino" ; then
echo GO=1 >> $GITHUB_ENV
# nothing specific to install or do
fi
- if: ${{ env.GO == 1 }}
run: |
if ./test/match_changed_files.sh '^src|examples/arduino'; then
make -C examples/arduino arduino-xiao
fi
# - if: ${{ env.GO == 1 }}
# run: |
# if ./test/match_changed_files.sh '^src|examples/arduino'; then
# make -C examples/arduino arduino-nano
# fi
- if: ${{ env.GO == 1 }}
run: make -C examples/arduino clean
generic_examples:
runs-on: ubuntu-latest runs-on: ubuntu-latest
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
example: example:
- name: esp32/device-dashboard - path: esp32/uart-bridge
path: esp32/device-dashboard - path: esp32/micropython
- name: esp8266 - path: esp8266/http-client-server
path: esp8266 name: ${{ matrix.example.path }}
- name: stm32-freertos-tcp env:
path: stm32/stm32-freertos-tcp GO: 0
- name: stm32-nucleo-f746z
path: stm32/stm32-nucleo-f746z
- name: stm32-nucleo-f429z
path: stm32/stm32-nucleo-f429z
- name: stm32-nucleo-h743z
path: stm32/stm32-nucleo-h743z
- name: stm32-nucleo-f746zg-baremetal
path: stm32/nucleo-f746zg-baremetal
- name: nxp-mimxrt1020-azurertos
path: nxp/nxp-mimxrt1020-azurertos
- name: nxp-frdmk66f-freertos
path: nxp/nxp-frdmk66f-freertos
- name: nxp-lpcxpresso54s018m-freertos
path: nxp/nxp-lpcxpresso54s018m-freertos
- name: nxp-mimxrt1020-freertos
path: nxp/nxp-mimxrt1020-freertos
- name: nxp-evkbimxrt1050-lwip-freertos
path: nxp/nxp-evkbimxrt1050-lwip-freertos
- name: nxp-evkmimxrt1020-lwip-freertos
path: nxp/nxp-evkmimxrt1020-lwip-freertos
- name: nxp-evkmimxrt1024-lwip-freertos
path: nxp/nxp-evkmimxrt1024-lwip-freertos
- name: nxp-evkmimxrt1060-lwip-freertos
path: nxp/nxp-evkmimxrt1060-lwip-freertos
- name: nxp-evkmimxrt1064-lwip-freertos
path: nxp/nxp-evkmimxrt1064-lwip-freertos
- name: nxp-evkmimxrt1160-cm7-lwip-freertos
path: nxp/nxp-evkmimxrt1160-cm7-lwip-freertos
- name: nxp-evkmimxrt1170-cm7-lwip-freertos
path: nxp/nxp-evkmimxrt1170-cm7-lwip-freertos
- name: nxp-frdmk64f-lwip-freertos
path: nxp/nxp-frdmk64f-lwip-freertos
- name: nxp-frdmk66f-lwip-freertos
path: nxp/nxp-frdmk66f-lwip-freertos
- name: nxp-lpcxpresso54018-lwip-freertos
path: nxp/nxp-lpcxpresso54018-lwip-freertos
- name: nxp-lpcxpresso54608-lwip-freertos
path: nxp/nxp-lpcxpresso54608-lwip-freertos
- name: nxp-lpcxpresso54618-lwip-freertos
path: nxp/nxp-lpcxpresso54618-lwip-freertos
- name: nxp-lpcxpresso54628-lwip-freertos
path: nxp/nxp-lpcxpresso54628-lwip-freertos
- name: nxp-twrk65f180m-lwip-freertos
path: nxp/nxp-twrk65f180m-lwip-freertos
- name: nxp-twrkv58f220m-lwip-freertos
path: nxp/nxp-twrkv58f220m-lwip-freertos
- name: infineon-xmc4700_4800-lwip-rtx-rtos
path: infineon/infineon-xmc4700_4800-lwip-rtx-rtos
- name: ti
path: ti/ti-ek-tm4c1294xl-http-server
- name: nucleo_f746zg-zephyr-http-client
path: zephyr/http-client
- name: nucleo_f746zg-zephyr-http-server
path: zephyr/http-server
- name: nucleo_f746zg-zephyr-mqtt-aws-client
path: zephyr/mqtt-aws-client
- name: nucleo_f746zg-zephyr-websocket-server
path: zephyr/websocket-server
name: ${{ matrix.example.name }}
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: ${{ matrix.example.name }} with: { fetch-depth: 2 }
- run: if ./test/match_changed_files.sh '^src|^examples/${{ matrix.example.path }}'; then echo GO=1 >> $GITHUB_ENV ; fi
- if: ${{ env.GO == 1 }}
run: |
# nothing specific to install or do
- if: ${{ env.GO == 1 }}
run: make -C examples/${{ matrix.example.path }} build run: make -C examples/${{ matrix.example.path }} build
generic_examples_arm:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
example:
- path: microchip/same54-xpro/mqtt-client
- path: infineon/infineon-xmc4700_4800-lwip-rtx-rtos
- path: nxp/nxp-mimxrt1020-azurertos
- path: nxp/nxp-frdmk66f-freertos
- path: nxp/nxp-lpcxpresso54s018m-freertos
- path: nxp/nxp-mimxrt1020-freertos
- path: nxp/nxp-evkbimxrt1050-lwip-freertos
- path: nxp/nxp-evkmimxrt1020-lwip-freertos
- path: nxp/nxp-evkmimxrt1024-lwip-freertos
- path: nxp/nxp-evkmimxrt1060-lwip-freertos
- path: nxp/nxp-evkmimxrt1064-lwip-freertos
- path: nxp/nxp-evkmimxrt1160-cm7-lwip-freertos
- path: nxp/nxp-evkmimxrt1170-cm7-lwip-freertos
- path: nxp/nxp-frdmk64f-lwip-freertos
- path: nxp/nxp-frdmk66f-lwip-freertos
- path: nxp/nxp-lpcxpresso54018-lwip-freertos
- path: nxp/nxp-lpcxpresso54608-lwip-freertos
- path: nxp/nxp-lpcxpresso54618-lwip-freertos
- path: nxp/nxp-lpcxpresso54628-lwip-freertos
- path: nxp/nxp-twrk65f180m-lwip-freertos
- path: nxp/nxp-twrkv58f220m-lwip-freertos
- path: rp2040/pico-rmii
- path: stm32/nucleo-f429zi-make-baremetal-builtin-rndis
- path: stm32/nucleo-f746zg-make-baremetal-builtin-rndis
- path: stm32/nucleo-g031-make-baremetal-builtin
- path: ti/ti-ek-tm4c1294xl-http-server
- path: ti/ek-tm4c1294xl-make-baremetal-builtin-rndis
name: ${{ matrix.example.path }}
env:
GO: 0
steps:
- uses: actions/checkout@v3
with: { fetch-depth: 2 }
- run: if ./test/match_changed_files.sh '^src|^examples/${{ matrix.example.path }}'; then echo GO=1 >> $GITHUB_ENV ; fi
- if: ${{ env.GO == 1 }}
run: sudo apt -y update && sudo apt -y install gcc-arm-none-eabi
- if: ${{ env.GO == 1 }}
run: make -C examples/${{ matrix.example.path }} build
device_dashboard_examples:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
example:
- path: esp32/device-dashboard
name: ${{ matrix.example.path }}
env:
GO: 0
steps:
- uses: actions/checkout@v3
with: { fetch-depth: 2 }
- run: |
if ./test/match_changed_files.sh '^src|examples/device-dashboard|^examples/${{ matrix.example.path }}'; then
echo GO=1 >> $GITHUB_ENV
# nothing specific to install or do
fi
- if: ${{ env.GO == 1 }}
run: make -C examples/${{ matrix.example.path }} build
device_dashboard_examples_arm:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
example:
- path: microchip/same54-xpro/device-dashboard
- path: nxp/rt1020-evk-make-baremetal-builtin
- path: nxp/rt1020-evk-make-freertos-builtin
- path: nxp/rt1060-evk-make-baremetal-builtin
- path: nxp/rt1060-evk-make-freertos-builtin
- path: rp2040/pico-rndis-dashboard
- path: rp2040/pico-w
- path: rp2040/pico-w5500
- path: stm32/nucleo-f429zi-make-baremetal-builtin
- path: stm32/nucleo-f429zi-make-freertos-builtin
- path: stm32/nucleo-f746zg-make-baremetal-builtin
- path: stm32/nucleo-f746zg-make-freertos-builtin
- path: stm32/nucleo-f746zg-make-freertos-tcp
- path: stm32/nucleo-f746zg-make-baremetal-builtin-cmsis_driver
- path: stm32/nucleo-h563zi-make-baremetal-builtin
- path: stm32/nucleo-h563zi-make-freertos-builtin
- path: stm32/nucleo-h723zg-make-freertos-builtin
- path: stm32/nucleo-h743zi-make-baremetal-builtin
- path: stm32/nucleo-h743zi-make-freertos-builtin
- path: stm32/stm32h573i-dk-make-baremetal-builtin
- path: stm32/stm32h573i-dk-make-freertos-builtin
- path: ti/ek-tm4c1294xl-make-baremetal-builtin
- path: ti/ek-tm4c1294xl-make-freertos-builtin
name: ${{ matrix.example.path }}
env:
GO: 0
steps:
- uses: actions/checkout@v3
with: { fetch-depth: 2 }
- run: |
if ./test/match_changed_files.sh '^src|examples/device-dashboard|^examples/${{ matrix.example.path }}'; then
echo GO=1 >> $GITHUB_ENV
sudo apt -y update && sudo apt -y install gcc-arm-none-eabi
fi
- if: ${{ env.GO == 1 }}
run: make -C examples/${{ matrix.example.path }} build
# mqtt_dashboard_examples:
# runs-on: ubuntu-latest
# strategy:
# fail-fast: false
# matrix:
# example:
# - path:
# name: ${{ matrix.example.path }}
# env:
# GO: 0
# steps:
# - uses: actions/checkout@v3
# with: { fetch-depth: 2 }
# - run: |
# if ./test/match_changed_files.sh '^src|examples/mqtt-dashboard/device|^examples/${{ matrix.example.path }}'; then
# echo GO=1 >> $GITHUB_ENV
# # nothing specific to install or do
# fi
# - if: ${{ env.GO == 1 }}
# run: make -C examples/${{ matrix.example.path }} build
mqtt_dashboard_examples_arm:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
example:
- path: rp2040/pico-rndis-device
name: ${{ matrix.example.path }}
env:
GO: 0
steps:
- uses: actions/checkout@v3
with: { fetch-depth: 2 }
- run: |
if ./test/match_changed_files.sh '^src|examples/mqtt-dashboard/device|^examples/${{ matrix.example.path }}'; then
echo GO=1 >> $GITHUB_ENV
sudo apt -y update && sudo apt -y install gcc-arm-none-eabi
fi
- if: ${{ env.GO == 1 }}
run: make -C examples/${{ matrix.example.path }} build
# dual_examples:
# runs-on: ubuntu-latest
# strategy:
# fail-fast: false
# matrix:
# example:
# - path:
# name: ${{ matrix.example.path }}
# env:
# GO: 0
# steps:
# - uses: actions/checkout@v3
# with: { fetch-depth: 2 }
# - run: |
# if ./test/match_changed_files.sh '^src|examples/device-dashboard|examples/mqtt-dashboard/device|^examples/${{ matrix.example.path }}'; then
# echo GO=1 >> $GITHUB_ENV
# # nothing specific to install or do
# fi
# - if: ${{ env.GO == 1 }}
# run: |
# if ./test/match_changed_files.sh '^src|examples/device-dashboard|^examples/${{ matrix.example.path }}'; then
# make -C examples/${{ matrix.example.path }} device_dashboard
# fi
# - if: ${{ env.GO == 1 }}
# run: |
# if ./test/match_changed_files.sh '^src|examples/mqtt-dashboard/device|^examples/${{ matrix.example.path }}'; then
# make -C examples/${{ matrix.example.path }} mqtt_dashboard
# fi
dual_examples_arm:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
example:
- path: stm32/nucleo-h723zg-make-baremetal-builtin
name: ${{ matrix.example.path }}
env:
GO: 0
steps:
- uses: actions/checkout@v3
with: { fetch-depth: 2 }
- run: |
if ./test/match_changed_files.sh '^src|examples/device-dashboard|examples/mqtt-dashboard/device|^examples/${{ matrix.example.path }}'; then
echo GO=1 >> $GITHUB_ENV
sudo apt -y update && sudo apt -y install gcc-arm-none-eabi
fi
- if: ${{ env.GO == 1 }}
run: |
if ./test/match_changed_files.sh '^src|examples/device-dashboard|^examples/${{ matrix.example.path }}'; then
make -C examples/${{ matrix.example.path }} device_dashboard
fi
- if: ${{ env.GO == 1 }}
run: |
if ./test/match_changed_files.sh '^src|examples/mqtt-dashboard/device|^examples/${{ matrix.example.path }}'; then
make -C examples/${{ matrix.example.path }} mqtt_dashboard
fi
cube_examples:
runs-on: ubuntu-latest
env:
GO: 0
steps:
- uses: actions/checkout@v3
with: { fetch-depth: 2 }
- run: |
if ./test/match_changed_files.sh '^src|examples/stm32/nucleo-*-cube-*'; then
echo GO=1 >> $GITHUB_ENV
# nothing specific to install or do
fi
- if: ${{ env.GO == 1 }}
run: cd test/cube && make
zephyr_examples:
runs-on: ubuntu-latest
env:
GO: 0
steps:
- uses: actions/checkout@v3
with: { fetch-depth: 2 }
- run: |
if ./test/match_changed_files.sh '^src/.*.[ch]|^examples/zephyr'; then
echo GO=1 >> $GITHUB_ENV
sudo apt -y update && sudo apt -y install gcc-arm-none-eabi
fi
- if: ${{ env.GO == 1 }}
run: make -C examples/zephyr init
- name: minify manifest
if: ${{ env.GO == 1 }}
uses: mikefarah/yq@master
with:
cmd: yq -i eval '(.manifest.defaults, .manifest.remotes, .manifest.projects[] | select(.name == "cmsis" or .name == "hal_stm32" or .name == "mbedtls" or .name == "mcuboot" or .name == "picolibc" | del(.null) ), .manifest.self) as $i ireduce({};setpath($i | path; $i)) | del(.manifest.projects.[].null) | del(..|select(length==0))' examples/zephyr/zephyrproject/zephyr/west.yml
- if: ${{ env.GO == 1 }}
run: make -C examples/zephyr update
- if: ${{ env.GO == 1 }}
run: make -C examples/zephyr/device-dashboard build
- if: ${{ env.GO == 1 }}
run: make -C examples/zephyr/http-client build
- if: ${{ env.GO == 1 }}
run: make -C examples/zephyr/http-server build
- if: ${{ env.GO == 1 }}
run: make -C examples/zephyr/mqtt-aws-client build
- if: ${{ env.GO == 1 }}
run: make -C examples/zephyr/websocket-server build
test_f7:
runs-on: ubuntu-latest
env:
GO: 0
steps:
- uses: actions/checkout@v3
with: { fetch-depth: 2 }
- name: baremetal
run: |
if ./test/match_changed_files.sh "^src|examples/device-dashboard|examples/stm32/nucleo-f7.*-make-" ; then
echo GO=1 >> $GITHUB_ENV
sudo apt -y update && sudo apt -y install gcc-arm-none-eabi
fi
- if: ${{ env.GO == 1 }}
run: |
if ./test/match_changed_files.sh '^src|examples/device-dashboard|examples/stm32/nucleo-f746zg-make-baremetal-builtin'; then
make -C examples/stm32/nucleo-f746zg-make-baremetal-builtin test VCON_API_KEY=${{secrets.VCON_API_KEY}}
fi
- if: ${{ env.GO == 1 }}
run: |
if ./test/match_changed_files.sh '^src|examples/device-dashboard|examples/stm32/nucleo-f746zg-make-freertos-builtin'; then
make -C examples/stm32/nucleo-f746zg-make-freertos-builtin test VCON_API_KEY=${{secrets.VCON_API_KEY}}
fi
- if: ${{ env.GO == 1 }}
run: |
if ./test/match_changed_files.sh '^src|examples/device-dashboard|examples/stm32/nucleo-f746zg-make-freertos-tcp'; then
make -C examples/stm32/nucleo-f746zg-make-freertos-tcp test VCON_API_KEY=${{secrets.VCON_API_KEY}}
fi
- name: Cube
run: |
echo GO=0 >> $GITHUB_ENV
if ./test/match_changed_files.sh '^src|examples/device-dashboard|examples/stm32/nucleo-f7.*-cube-'; then
echo GO=1 >> $GITHUB_ENV
# nothing specific to install or do
fi
- if: ${{ env.GO == 1 }}
run: |
if ./test/match_changed_files.sh '^src|examples/device-dashboard|examples/stm32/nucleo-f746zg-cube-baremetal-builtin'; then
make -C test/cube test PROJECTS=../../examples/stm32/nucleo-f746zg-cube-baremetal-builtin VCON_API_KEY=${{secrets.VCON_API_KEY}} DEVICE=5
fi
- if: ${{ env.GO == 1 }}
run: |
if ./test/match_changed_files.sh '^src|examples/device-dashboard|examples/stm32/nucleo-f746zg-cube-freertos-builtin'; then
make -C test/cube test PROJECTS=../../examples/stm32/nucleo-f746zg-cube-freertos-builtin VCON_API_KEY=${{secrets.VCON_API_KEY}} DEVICE=5
fi
- if: ${{ env.GO == 1 }}
run: |
if ./test/match_changed_files.sh '^src|examples/device-dashboard|examples/stm32/nucleo-f746zg-cube-freertos-lwip'; then
make -C test/cube test PROJECTS=../../examples/stm32/nucleo-f746zg-cube-freertos-lwip VCON_API_KEY=${{secrets.VCON_API_KEY}} DEVICE=5
fi
test_f4:
runs-on: ubuntu-latest
env:
GO: 0
steps:
- uses: actions/checkout@v3
with: { fetch-depth: 2 }
- name: baremetal
run: |
if ./test/match_changed_files.sh "^src|examples/device-dashboard|examples/stm32/nucleo-f4.*-make-" ; then
echo GO=1 >> $GITHUB_ENV
sudo apt -y update && sudo apt -y install gcc-arm-none-eabi
fi
- if: ${{ env.GO == 1 }}
run: |
if ./test/match_changed_files.sh '^src|examples/device-dashboard|examples/stm32/nucleo-f429zi-make-baremetal-builtin'; then
make -C examples/stm32/nucleo-f429zi-make-baremetal-builtin test VCON_API_KEY=${{secrets.VCON_API_KEY}}
fi
- if: ${{ env.GO == 1 }}
run: |
if ./test/match_changed_files.sh '^src|examples/device-dashboard|examples/stm32/nucleo-f429zi-make-freertos-builtin'; then
make -C examples/stm32/nucleo-f429zi-make-freertos-builtin test VCON_API_KEY=${{secrets.VCON_API_KEY}}
fi
- name: Cube
run: |
echo GO=0 >> $GITHUB_ENV
if ./test/match_changed_files.sh '^src|examples/device-dashboard|examples/stm32/nucleo-f4.*-cube-'; then
echo GO=1 >> $GITHUB_ENV
# nothing specific to install or do
fi
- if: ${{ env.GO == 1 }}
run: |
if ./test/match_changed_files.sh '^src|examples/device-dashboard|examples/stm32/nucleo-f429zi-cube-baremetal-builtin'; then
make -C test/cube test PROJECTS=../../examples/stm32/nucleo-f429zi-cube-baremetal-builtin VCON_API_KEY=${{secrets.VCON_API_KEY}} DEVICE=2
fi
- if: ${{ env.GO == 1 }}
run: |
if ./test/match_changed_files.sh '^src|examples/device-dashboard|examples/stm32/nucleo-f429zi-cube-freertos-builtin'; then
make -C test/cube test PROJECTS=../../examples/stm32/nucleo-f429zi-cube-freertos-builtin VCON_API_KEY=${{secrets.VCON_API_KEY}} DEVICE=2
fi
- if: ${{ env.GO == 1 }}
run: |
if ./test/match_changed_files.sh '^src|examples/device-dashboard|examples/stm32/nucleo-f429zi-cube-freertos-lwip'; then
make -C test/cube test PROJECTS=../../examples/stm32/nucleo-f429zi-cube-freertos-lwip VCON_API_KEY=${{secrets.VCON_API_KEY}} DEVICE=2
fi
test_h743:
runs-on: ubuntu-latest
env:
GO: 0
steps:
- uses: actions/checkout@v3
with: { fetch-depth: 3 }
- name: baremetal
run: |
if ./test/match_changed_files.sh "^src|examples/device-dashboard|examples/stm32/nucleo-h74.*-make-" ; then
echo GO=1 >> $GITHUB_ENV
sudo apt -y update && sudo apt -y install gcc-arm-none-eabi
fi
- if: ${{ env.GO == 1 }}
run: |
if ./test/match_changed_files.sh '^src|examples/device-dashboard|examples/stm32/nucleo-h743zi-make-baremetal-builtin'; then
make -C examples/stm32/nucleo-h743zi-make-baremetal-builtin test VCON_API_KEY=${{secrets.VCON_API_KEY}}
fi
- if: ${{ env.GO == 1 }}
run: |
if ./test/match_changed_files.sh '^src|examples/device-dashboard|examples/stm32/nucleo-h743zi-make-freertos-builtin'; then
make -C examples/stm32/nucleo-h743zi-make-freertos-builtin test VCON_API_KEY=${{secrets.VCON_API_KEY}}
fi
- name: Cube
run: |
echo GO=0 >> $GITHUB_ENV
if ./test/match_changed_files.sh '^src|examples/device-dashboard|examples/stm32/nucleo-h74.*-cube-'; then
echo GO=1 >> $GITHUB_ENV
# nothing specific to install or do
fi
- if: ${{ env.GO == 1 }}
run: |
if ./test/match_changed_files.sh '^src|examples/device-dashboard|examples/stm32/nucleo-h743zi-cube-baremetal-builtin'; then
make -C test/cube test PROJECTS=../../examples/stm32/nucleo-h743zi-cube-baremetal-builtin VCON_API_KEY=${{secrets.VCON_API_KEY}} DEVICE=6
fi
- if: ${{ env.GO == 1 }}
run: |
if ./test/match_changed_files.sh '^src|examples/device-dashboard|examples/stm32/nucleo-h743zi-cube-freertos-builtin'; then
make -C test/cube test PROJECTS=../../examples/stm32/nucleo-h743zi-cube-freertos-builtin VCON_API_KEY=${{secrets.VCON_API_KEY}} DEVICE=6
fi
test_h723:
runs-on: ubuntu-latest
env:
GO: 0
steps:
- uses: actions/checkout@v3
with: { fetch-depth: 3 }
- name: baremetal
run: |
if ./test/match_changed_files.sh "^src|examples/device-dashboard|examples/stm32/nucleo-h72.*-make-" ; then
echo GO=1 >> $GITHUB_ENV
sudo apt -y update && sudo apt -y install gcc-arm-none-eabi
fi
- if: ${{ env.GO == 1 }}
run: |
if ./test/match_changed_files.sh '^src|examples/device-dashboard|examples/stm32/nucleo-h723zg-make-baremetal-builtin'; then
make -C examples/stm32/nucleo-h723zg-make-baremetal-builtin test VCON_API_KEY=${{secrets.VCON_API_KEY}}
fi
- if: ${{ env.GO == 1 }}
run: |
if ./test/match_changed_files.sh '^src|examples/device-dashboard|examples/stm32/nucleo-h723zg-make-freertos-builtin'; then
make -C examples/stm32/nucleo-h723zg-make-freertos-builtin test VCON_API_KEY=${{secrets.VCON_API_KEY}}
fi
test_h5:
runs-on: ubuntu-latest
env:
GO: 0
steps:
- uses: actions/checkout@v3
with: { fetch-depth: 3 }
- name: baremetal
run: |
if ./test/match_changed_files.sh "^src|examples/device-dashboard|examples/stm32/nucleo-h5.*-make-" ; then
echo GO=1 >> $GITHUB_ENV
sudo apt -y update && sudo apt -y install gcc-arm-none-eabi
fi
- if: ${{ env.GO == 1 }}
run: |
if ./test/match_changed_files.sh '^src|examples/device-dashboard|examples/stm32/nucleo-h563zi-make-baremetal-builtin'; then
make -C examples/stm32/nucleo-h563zi-make-baremetal-builtin test VCON_API_KEY=${{secrets.VCON_API_KEY}}
fi
- if: ${{ env.GO == 1 }}
run: |
if ./test/match_changed_files.sh '^src|examples/device-dashboard|examples/stm32/nucleo-h563zi-make-freertos-builtin'; then
make -C examples/stm32/nucleo-h563zi-make-freertos-builtin test VCON_API_KEY=${{secrets.VCON_API_KEY}}
fi
test_rt1020:
runs-on: ubuntu-latest
env:
GO: 0
steps:
- uses: actions/checkout@v3
with: { fetch-depth: 3 }
- name: baremetal
run: |
if ./test/match_changed_files.sh "^src|examples/device-dashboard|examples/nxp/rt1020.*-make-" ; then
echo GO=1 >> $GITHUB_ENV
sudo apt -y update && sudo apt -y install gcc-arm-none-eabi
fi
- if: ${{ env.GO == 1 }}
run: |
#if ./test/match_changed_files.sh '^src|examples/device-dashboard|examples/nxp/rt1020-evk-make-baremetal-builtin'; then
if ./test/match_changed_files.sh '^src|examples/nxp/rt1020-evk-make-baremetal-builtin'; then
make -C examples/nxp/rt1020-evk-make-baremetal-builtin test VCON_API_KEY=${{secrets.VCON_API_KEY}}
fi
- if: ${{ env.GO == 1 }}
run: |
#if ./test/match_changed_files.sh '^src|examples/device-dashboard|examples/nxp/rt1020-evk-make-freertos-builtin'; then
if ./test/match_changed_files.sh '^src|examples/nxp/rt1020-evk-make-freertos-builtin'; then
make -C examples/nxp/rt1020-evk-make-freertos-builtin test VCON_API_KEY=${{secrets.VCON_API_KEY}}
fi
test_rt1060:
runs-on: ubuntu-latest
env:
GO: 0
steps:
- uses: actions/checkout@v3
with: { fetch-depth: 3 }
- name: baremetal
run: |
if ./test/match_changed_files.sh "^src|examples/device-dashboard|examples/nxp/rt1060.*-make-" ; then
echo GO=1 >> $GITHUB_ENV
sudo apt -y update && sudo apt -y install gcc-arm-none-eabi
fi
- if: ${{ env.GO == 1 }}
run: |
if ./test/match_changed_files.sh '^src|examples/device-dashboard|examples/nxp/rt1060-evk-make-baremetal-builtin'; then
make -C examples/nxp/rt1060-evk-make-baremetal-builtin test VCON_API_KEY=${{secrets.VCON_API_KEY}}
fi
- if: ${{ env.GO == 1 }}
run: |
if ./test/match_changed_files.sh '^src|examples/device-dashboard|examples/nxp/rt1060-evk-make-freertos-builtin'; then
make -C examples/nxp/rt1060-evk-make-freertos-builtin test VCON_API_KEY=${{secrets.VCON_API_KEY}}
fi
test_tm4c:
runs-on: ubuntu-latest
env:
GO: 0
steps:
- uses: actions/checkout@v3
with: { fetch-depth: 2 }
- name: baremetal
run: |
if ./test/match_changed_files.sh "^src|examples/device-dashboard|examples/ti/ek-tm4c.*-make-" ; then
echo GO=1 >> $GITHUB_ENV
sudo apt -y update && sudo apt -y install gcc-arm-none-eabi
fi
- if: ${{ env.GO == 1 }}
run: make -C examples/ti/ek-tm4c1294xl-make-baremetal-builtin test VCON_API_KEY=${{secrets.VCON_API_KEY}}
- if: ${{ env.GO == 1 }}
run: make -C examples/ti/ek-tm4c1294xl-make-freertos-builtin test VCON_API_KEY=${{secrets.VCON_API_KEY}}
test_same54:
runs-on: ubuntu-latest
env:
GO: 0
steps:
- uses: actions/checkout@v3
with: { fetch-depth: 2 }
- name: baremetal
run: |
if ./test/match_changed_files.sh "^src|examples/device-dashboard|examples/microchip/same54-xpro" ; then
echo GO=1 >> $GITHUB_ENV
sudo apt -y update && sudo apt -y install gcc-arm-none-eabi
fi
- if: ${{ env.GO == 1 }}
run: make -C examples/microchip/same54-xpro/device-dashboard test VCON_API_KEY=${{secrets.VCON_API_KEY}}
- if: ${{ env.GO == 1 }}
run: make -C examples/microchip/same54-xpro/mqtt-client test VCON_API_KEY=${{secrets.VCON_API_KEY}}
test_pico_w5500:
runs-on: ubuntu-latest
env:
GO: 0
steps:
- uses: actions/checkout@v3
with: { fetch-depth: 2 }
- name: SDK
run: |
if ./test/match_changed_files.sh "^src|examples/device-dashboard|examples/rp2040/pico-w5500" ; then
echo GO=1 >> $GITHUB_ENV
sudo apt -y update && sudo apt -y install gcc-arm-none-eabi
fi
- if: ${{ env.GO == 1 }}
run: make -C examples/rp2040/pico-w5500 test VCON_API_KEY=${{secrets.VCON_API_KEY}}
+1 -1
View File
@@ -1,5 +1,5 @@
Copyright (c) 2004-2013 Sergey Lyubka Copyright (c) 2004-2013 Sergey Lyubka
Copyright (c) 2013-2021 Cesanta Software Limited Copyright (c) 2013-2024 Cesanta Software Limited
All rights reserved All rights reserved
This software is dual-licensed: you can redistribute it and/or modify This software is dual-licensed: you can redistribute it and/or modify
-164
View File
@@ -1,164 +0,0 @@
SRCS = mongoose.c test/unit_test.c test/packed_fs.c
HDRS = $(wildcard src/*.h) $(wildcard mip/*.h)
DEFS ?= -DMG_MAX_HTTP_HEADERS=7 -DMG_ENABLE_LINES -DMG_ENABLE_PACKED_FS=1 -DMG_ENABLE_SSI=1
C_WARN ?= -Wmissing-prototypes -Wstrict-prototypes
WARN ?= -pedantic -W -Wall -Werror -Wshadow -Wdouble-promotion -fno-common -Wconversion -Wundef $(C_WARN)
OPTS ?= -O3 -g3
VALGRIND_OPTS ?= -O0 -g3
INCS ?= -Isrc -I.
SSL ?= MBEDTLS
CWD ?= $(realpath $(CURDIR))
ENV ?= -e Tmp=. -e WINEDEBUG=-all
DOCKER ?= docker run --platform linux/amd64 --rm $(ENV) -v $(CWD):$(CWD) -w $(CWD)
VCFLAGS = /nologo /W3 /O2 /MD /I. $(DEFS) $(TFLAGS)
IPV6 ?= 1
ASAN ?= -fsanitize=address,undefined -fno-sanitize-recover=all
ASAN_OPTIONS ?= detect_leaks=1
EXAMPLES := $(dir $(wildcard examples/*/Makefile)) examples/stm32/nucleo-f746zg-baremetal
PREFIX ?= /usr/local
VERSION ?= $(shell cut -d'"' -f2 src/version.h)
COMMON_CFLAGS ?= $(WARN) $(INCS) $(DEFS) -DMG_ENABLE_IPV6=$(IPV6) $(TFLAGS)
CFLAGS ?= $(OPTS) $(ASAN) $(COMMON_CFLAGS)
VALGRIND_CFLAGS ?= $(VALGRIND_OPTS) $(COMMON_CFLAGS)
VALGRIND_RUN ?= valgrind --tool=memcheck --gen-suppressions=all --leak-check=full --show-leak-kinds=all --leak-resolution=high --track-origins=yes --error-exitcode=1 --exit-on-first-error=yes
.PHONY: examples test valgrind
ifeq "$(SSL)" "MBEDTLS"
MBEDTLS ?= /usr/local
CFLAGS += -DMG_ENABLE_MBEDTLS=1 -I$(MBEDTLS)/include -I/usr/include
LDFLAGS ?= -L$(MBEDTLS)/lib -lmbedtls -lmbedcrypto -lmbedx509
endif
ifeq "$(SSL)" "OPENSSL"
OPENSSL ?= /usr/local
CFLAGS += -DMG_ENABLE_OPENSSL=1 -I$(OPENSSL)/include
LDFLAGS ?= -L$(OPENSSL)/lib -lssl -lcrypto
endif
all: mg_prefix unamalgamated unpacked test test++ arm examples vc98 vc17 vc22 mingw mingw++ linux linux++ fuzz
examples:
@for X in $(EXAMPLES); do test -f $$X/Makefile || continue; $(MAKE) -C $$X example || exit 1; done
test/packed_fs.c: Makefile src/ssi.h test/fuzz.c test/data/a.txt
$(CC) $(CFLAGS) test/pack.c -o pack
$(RUN) ./pack Makefile src/ssi.h test/fuzz.c test/data/a.txt test/data/range.txt > $@
DIR ?= test/data/
OUT ?= fs_packed.c
mkfs:
$(CC) $(CFLAGS) test/pack.c -o pack
$(RUN) ./pack -s $(DIR) `find $(DIR) -type f` > $(OUT)
# find $(DIR) -type f | sed -e s,^$(DIR),,g -e s,^/,,g
# Check that all external (exported) symbols have "mg_" prefix
mg_prefix: mongoose.c mongoose.h
$(CC) mongoose.c $(CFLAGS) -c -o /tmp/x.o && nm /tmp/x.o | grep ' T' | grep -v 'mg_' ; test $$? = 1
# C++ build
test++: test
test++: CC = g++
test++: C_WARN = -std=c++2a -Wno-vla -Wno-shadow -Wno-missing-field-initializers -Wno-deprecated
musl: test
musl: ASAN =
musl: WARN += -Wno-sign-conversion
musl: CC = $(DOCKER) mdashnet/cc1 gcc
musl: RUN = $(DOCKER) mdashnet/cc1
# Make sure we can build from an unamalgamated sources
unamalgamated: $(HDRS) Makefile test/packed_fs.c
$(CC) src/*.c test/packed_fs.c test/unit_test.c $(CFLAGS) $(LDFLAGS) -g -o unit_test
unpacked:
$(CC) -I. mongoose.c test/unit_test.c -o $@
fuzzer: mongoose.c mongoose.h Makefile test/fuzz.c
clang++ mongoose.c test/fuzz.c $(WARN) $(INCS) $(TFLAGS) -DMG_ENABLE_LINES -fsanitize=fuzzer,signed-integer-overflow,address -Wno-deprecated -Wno-vla-extension -o $@
fuzz: fuzzer
$(RUN) ./fuzzer
unit_test: Makefile mongoose.h $(SRCS)
$(CC) $(SRCS) $(CFLAGS) $(LDFLAGS) -g -o unit_test
# make CC=/usr/local/opt/llvm\@8/bin/clang ASAN_OPTIONS=detect_leaks=1
test: unit_test
ASAN_OPTIONS=$(ASAN_OPTIONS) $(RUN) ./unit_test
coverage: CFLAGS += -coverage
coverage: test
gcov -l -n *.gcno | sed '/^$$/d' | sed 'N;s/\n/ /'
gcov -t mongoose.c > mongoose.gcov
upload-coverage: coverage
curl -s https://codecov.io/bash | /bin/bash
valgrind_unit_test: Makefile mongoose.h $(SRCS)
$(CC) $(SRCS) $(VALGRIND_CFLAGS) $(LDFLAGS) -g -o valgrind_unit_test
valgrind: valgrind_unit_test
$(VALGRIND_RUN) ./valgrind_unit_test
infer:
infer run -- cc test/unit_test.c -c -W -Wall -Werror -Isrc -I. -O2 -DMG_ENABLE_MBEDTLS=1 -DMG_ENABLE_LINES -I/usr/local/Cellar/mbedtls/2.23.0/include -DMG_ENABLE_IPV6=1 -g -o /dev/null
arm: DEFS += -DMG_ENABLE_FILE=0 -DMG_ENABLE_MIP=1 -DMG_ARCH=MG_ARCH_NEWLIB
arm: mongoose.h $(SRCS)
$(DOCKER) mdashnet/armgcc arm-none-eabi-gcc -mcpu=cortex-m3 -mthumb $(SRCS) $(OPTS) $(WARN) $(INCS) $(DEFS) $(TFLAGS) -o unit_test -nostartfiles --specs nosys.specs -e 0
riscv: DEFS += -DMG_ENABLE_FILE=0 -DMG_ENABLE_MIP=1 -DMG_ARCH=MG_ARCH_NEWLIB
riscv: mongoose.h $(SRCS)
$(DOCKER) mdashnet/riscv riscv-none-elf-gcc -march=rv32imc -mabi=ilp32 $(SRCS) $(OPTS) $(WARN) $(INCS) $(DEFS) $(TFLAGS) -o unit_test
vc98: Makefile mongoose.h $(SRCS)
$(DOCKER) mdashnet/vc98 wine cl $(SRCS) $(VCFLAGS) ws2_32.lib /Fe$@.exe
$(DOCKER) mdashnet/vc98 wine $@.exe
# vc17: DEFS += -DMG_ENABLE_IPV6=1
vc17: Makefile mongoose.h $(SRCS)
$(DOCKER) mdashnet/vc17 wine64 cl $(SRCS) $(VCFLAGS) ws2_32.lib /Fe$@.exe
$(DOCKER) mdashnet/vc17 wine64 $@.exe
# vc22: DEFS += -DMG_ENABLE_IPV6=$(IPV6)
vc22: Makefile mongoose.h $(SRCS)
$(DOCKER) mdashnet/vc22 wine64 cl $(SRCS) $(VCFLAGS) ws2_32.lib /Fe$@.exe
$(DOCKER) mdashnet/vc22 wine64 $@.exe
mingw: Makefile mongoose.h $(SRCS)
$(DOCKER) mdashnet/mingw x86_64-w64-mingw32-gcc $(SRCS) -W -Wall -Werror -I. $(DEFS) -lwsock32 -o $@.exe
$(DOCKER) mdashnet/mingw wine64 $@.exe
mingw++: Makefile mongoose.h $(SRCS)
$(DOCKER) mdashnet/mingw x86_64-w64-mingw32-g++ $(SRCS) -W -Wall -Werror -I. $(DEFS) -lwsock32 -o $@.exe
linux: IPV6=0
linux: Makefile mongoose.h $(SRCS)
$(DOCKER) mdashnet/cc2 gcc $(SRCS) $(CFLAGS) $(LDFLAGS) -o unit_test_gcc
$(DOCKER) mdashnet/cc2 ./unit_test_gcc
linux++: CC = g++
linux++: WARN += -Wno-missing-field-initializers
linux++: linux
linux-libs: CFLAGS += -fPIC
linux-libs: mongoose.o
$(CC) mongoose.o $(LDFLAGS) -shared -o libmongoose.so.$(VERSION)
$(AR) rcs libmongoose.a mongoose.o
install: linux-libs
install -Dm644 libmongoose.a libmongoose.so.$(VERSION) $(DESTDIR)$(PREFIX)/lib
ln -s libmongoose.so.$(VERSION) $(DESTDIR)$(PREFIX)/lib/libmongoose.so
install -Dm644 mongoose.h $(DESTDIR)$(PREFIX)/include/mongoose.h
uninstall:
rm -rf $(DESTDIR)$(PREFIX)/lib/libmongoose.a $(DESTDIR)$(PREFIX)/lib/libmongoose.so.$(VERSION) $(DESTDIR)$(PREFIX)/include/mongoose.h $(DESTDIR)$(PREFIX)/lib/libmongoose.so
mongoose.c: Makefile $(wildcard src/*) $(wildcard mip/*.c)
(cat src/license.h; echo; echo '#include "mongoose.h"' ; (for F in src/*.c mip/*.c ; do echo; echo '#ifdef MG_ENABLE_LINES'; echo "#line 1 \"$$F\""; echo '#endif'; cat $$F | sed -e 's,#include ".*,,'; done))> $@
mongoose.h: $(HDRS) Makefile
(cat src/license.h; echo; echo '#ifndef MONGOOSE_H'; echo '#define MONGOOSE_H'; echo; cat src/version.h ; echo; echo '#ifdef __cplusplus'; echo 'extern "C" {'; echo '#endif'; cat src/arch.h src/arch_*.h src/config.h src/str.h src/fmt.h src/log.h src/timer.h src/fs.h src/util.h src/url.h src/iobuf.h src/base64.h src/md5.h src/sha1.h src/event.h src/net.h src/http.h src/ssi.h src/tls.h src/tls_mbed.h src/tls_openssl.h src/ws.h src/sntp.h src/mqtt.h src/dns.h src/json.h src/rpc.h mip/mip.h | sed -e 's,#include ".*,,' -e 's,^#pragma once,,'; echo; echo '#ifdef __cplusplus'; echo '}'; echo '#endif'; echo '#endif // MONGOOSE_H')> $@
clean:
rm -rf $(PROG) *.exe *.o *.dSYM unit_test* valgrind_unit_test* ut fuzzer *.gcov *.gcno *.gcda *.obj *.exe *.ilk *.pdb slow-unit* _CL_* infer-out data.txt crash-* test/packed_fs.c pack unpacked
@for X in $(EXAMPLES); do $(MAKE) -C $$X clean; done
+123 -18
View File
@@ -1,31 +1,136 @@
# Mongoose - Embedded Web Server / Embedded Networking Library # Mongoose - Embedded Web Server / Embedded Network Library
[![License: GPLv2/Commercial](https://img.shields.io/badge/License-GPLv2%20or%20Commercial-green.svg)](https://opensource.org/licenses/gpl-2.0.php) [![License: GPLv2/Commercial](https://img.shields.io/badge/License-GPLv2%20or%20Commercial-green.svg)](https://opensource.org/licenses/gpl-2.0.php)
[![Build Status]( https://github.com/cesanta/mongoose/workflows/build/badge.svg)](https://github.com/cesanta/mongoose/actions) [![Build Status]( https://github.com/cesanta/mongoose/workflows/build/badge.svg)](https://github.com/cesanta/mongoose/actions)
[![Code Coverage](https://codecov.io/gh/cesanta/mongoose/branch/master/graph/badge.svg)](https://codecov.io/gh/cesanta/mongoose) [![Code Coverage](https://codecov.io/gh/cesanta/mongoose/branch/master/graph/badge.svg)](https://codecov.io/gh/cesanta/mongoose)
[![Fuzzing Status](https://oss-fuzz-build-logs.storage.googleapis.com/badges/mongoose.svg)](https://bugs.chromium.org/p/oss-fuzz/issues/list?sort=-opened&can=1&q=proj:mongoose) [![Fuzzing Status](https://oss-fuzz-build-logs.storage.googleapis.com/badges/mongoose.svg)](https://bugs.chromium.org/p/oss-fuzz/issues/list?sort=-opened&can=1&q=proj:mongoose)
Mongoose is a networking library for C/C++. It implements event-driven Mongoose is a network library for C/C++. It provides event-driven non-blocking
non-blocking APIs for TCP, UDP, HTTP, WebSocket, MQTT. It is designed for APIs for TCP, UDP, HTTP, WebSocket, MQTT, and other protocols. It is designed
connecting devices and bringing them online. On the market since 2004, used by for connecting devices and bringing them online. On the market since 2004, used
vast number of open source and commercial products - it even runs on the by vast number of open source and commercial products - it even runs on the
International Space Station! Mongoose makes embedded network programming fast, International Space Station! Mongoose makes embedded network programming fast,
robust, and easy. Features include: robust, and easy. Features include:
- Cross-platform: works on Linux/UNIX, MacOS, Windows, Android, FreeRTOS, etc. - Cross-platform:
- Supported embedded architectures: ESP32, NRF52, STM32, NXP, and more - works on Linux/UNIX, MacOS, Windows, Android
- Built-in protocols: plain TCP/UDP, HTTP, MQTT, Websocket - works on STM32, NXP, ESP32, NRF52, TI, Microchip, and other
- SSL/TLS support: mbedTLS, OpenSSL or custom (via API) - write code once - and it'll work everywhere
- ideal for the unification of the network infrastructure code across company
- Built-in protocols: plain TCP/UDP, SNTP, HTTP, MQTT, Websocket, and other
- Asynchronous DNS resolver - Asynchronous DNS resolver
- Tiny static and run-time footprint - Tiny static and run-time footprint
- Source code is both ISO C and ISO C++ compliant - Source code is both ISO C and ISO C++ compliant
- Works with any network stack with socket API, like LwIP or FreeRTOS-Plus-TCP - Easy to integrate: just copy [mongoose.c](https://raw.githubusercontent.com/cesanta/mongoose/master/mongoose.c)
- Very easy to integrate: just copy `mongoose.c` and `mongoose.h` files to your build tree and [mongoose.h](https://raw.githubusercontent.com/cesanta/mongoose/master/mongoose.h) files to your source tree
- Detailed [documentation](https://mongoose.ws/documentation/) and - Built-in TCP/IP stack with drivers for bare metal or RTOS systems
[tutorials](https://mongoose.ws/tutorials/) - Available drivers: STM32F, STM32H; NXP RT1xxx; TI TM4C; Microchip SAME54; Wiznet W5500
- A complete Web device dashboard on bare metal ST Nucleo boards is only 6 files
- For comparison, a CubeIDE generated HTTP example is 400+ files
- Can run on top of an existing TCP/IP stack with BSD API, e.g. lwIP, Zephyr, Azure, etc
- Built-in TLS 1.3 ECC stack. Also can use external TLS libraries - mbedTLS, OpenSSL, or other
- Does not depend on any other software to implement networking
- Built-in firmware updates for STM32 H5, STM32 H7
See https://mongoose.ws/ for complete documentation, videos, case studies, etc.
# Commercial use ## Usage Examples
Below are quick snippets that should give an idea how simple the API is and
how easy it is to create applications with it.
Create a simple web server that serves a directory. The behavior of the
HTTP server is specified by its event handler function:
```c
#include "mongoose.h" // To build, run: cc main.c mongoose.c
// HTTP server event handler function
void ev_handler(struct mg_connection *c, int ev, void *ev_data) {
if (ev == MG_EV_HTTP_MSG) {
struct mg_http_message *hm = (struct mg_http_message *) ev_data;
struct mg_http_serve_opts opts = { .root_dir = "./web_root/" };
mg_http_serve_dir(c, hm, &opts);
}
}
int main(void) {
struct mg_mgr mgr; // Declare event manager
mg_mgr_init(&mgr); // Initialise event manager
mg_http_listen(&mgr, "http://0.0.0.0:8000", ev_handler, NULL); // Setup listener
for (;;) { // Run an infinite event loop
mg_mgr_poll(&mgr, 1000);
}
return 0;
}
```
HTTP server implements a REST API that returns current time. JSON formatting:
```c
static void ev_handler(struct mg_connection *c, int ev, void *ev_data) {
if (ev == MG_EV_HTTP_MSG) {
struct mg_http_message *hm = (struct mg_http_message *) ev_data;
if (mg_http_match_uri(hm, "/api/time/get")) {
mg_http_reply(c, 200, "", "{%m:%lu}\n", MG_ESC("time"), time(NULL));
} else {
mg_http_reply(c, 500, "", "{%m:%m}\n", MG_ESC("error"), MG_ESC("Unsupported URI"));
}
}
}
```
MQTT client that subscribes to a topic `device1/rx` and
echoes incoming messages to `device1/tx`:
```c
#include "mongoose.h"
static const char *s_mqtt_url = "mqtt://broker.hivemq.com:1883";
static struct mg_connection *s_mqtt_conn = NULL;
// MQTT connection event handler function
static void ev_handler(struct mg_connection *c, int ev, void *ev_data) {
if (ev == MG_EV_OPEN) {
MG_INFO(("%lu created, connecting to %s ...", c->id, s_mqtt_url));
} else if (ev == MG_EV_MQTT_OPEN) {
struct mg_mqtt_opts opts = {.qos = 1, .topic = mg_str("device1/rx")};
mg_mqtt_sub(c, &opts);
MG_INFO(("%lu connected, subscribing to %s", c->id, opts.topic.buf));
} else if (ev == MG_EV_MQTT_MSG) {
char response[100];
struct mg_mqtt_message *mm = (struct mg_mqtt_message *) ev_data;
struct mg_mqtt_opts opts = {.qos = 1, .topic = mg_str("device1/tx")};
mg_snprintf(response, sizeof(response), "Received [%.*s] / [%.*s]",
mm->topic.len, mm->topic.buf, mm->data.len, mm->data.buf);
opts.message = mg_str(response);
mg_mqtt_pub(c, &opts);
} else if (ev == MG_EV_CLOSE) {
MG_INFO(("%u closing", c->id));
s_mqtt_conn = NULL;
}
}
// Reconnection timer function. If we get disconnected, reconnect again
static void timer_fn(void *arg) {
struct mg_mgr *mgr = (struct mg_mgr *) arg;
if (s_mqtt_conn == NULL) {
struct mg_mqtt_opts opts = {.clean = true};
s_mqtt_conn = mg_mqtt_connect(mgr, s_mqtt_url, &opts, ev_handler, NULL);
}
}
int main() {
struct mg_mgr mgr; // Mongoose event manager. Holds all connections
mg_mgr_init(&mgr); // Initialise event manager
mg_timer_add(&mgr, 3000, MG_TIMER_REPEAT | MG_TIMER_RUN_NOW, timer_fn, &mgr);
for (;;) {
mg_mgr_poll(&mgr, 1000); // Infinite event loop
}
return 0;
}
```
## Commercial use
- Mongoose is used by hundreds of businesses, from Fortune500 giants like - Mongoose is used by hundreds of businesses, from Fortune500 giants like
Siemens, Schneider Electric, Broadcom, Bosch, Google, Samsung, Qualcomm, Caterpillar to the small businesses Siemens, Schneider Electric, Broadcom, Bosch, Google, Samsung, Qualcomm, Caterpillar to the small businesses
- Used to solve a wide range of business needs, like implementing Web UI - Used to solve a wide range of business needs, like implementing Web UI
@@ -35,11 +140,11 @@ robust, and easy. Features include:
- See [Case Studies](https://mongoose.ws/case-studies/) from our respected - See [Case Studies](https://mongoose.ws/case-studies/) from our respected
customers like [Schneider Electric](https://mongoose.ws/case-studies/schneider-electric/) (industrial automation), [Broadcom](https://mongoose.ws/case-studies/broadcom/) (semiconductors), [Pilz](https://mongoose.ws/case-studies/pilz/) (industrial automation), and others customers like [Schneider Electric](https://mongoose.ws/case-studies/schneider-electric/) (industrial automation), [Broadcom](https://mongoose.ws/case-studies/broadcom/) (semiconductors), [Pilz](https://mongoose.ws/case-studies/pilz/) (industrial automation), and others
- See [Testimonials](https://mongoose.ws/testimonials/) from engineers that integrated Mongoose in their commercial products - See [Testimonials](https://mongoose.ws/testimonials/) from engineers that integrated Mongoose in their commercial products
- We provide [Evaluation and Commercial licensing](https://mongoose.ws/licensing/), [support](https://mongoose.ws/support/), consultancy and integration - We provide [Evaluation and Commercial licensing](https://mongoose.ws/licensing/), [support](https://mongoose.ws/support/), consultancy and [integration
assistance - don't hesitate to [contact us](https://mongoose.ws/contact/) services](https://mongoose.ws/integration/) - don't hesitate to [contact us](https://mongoose.ws/contact/)
# Security ## Security
We take security seriously: We take security seriously:
1. Mongoose repository runs a 1. Mongoose repository runs a
@@ -65,7 +170,7 @@ We take security seriously:
of which we get notified and in case of any issue, act similar to (3). of which we get notified and in case of any issue, act similar to (3).
# Contributions ## Contributions
Contributions are welcome! Please follow the guidelines below: Contributions are welcome! Please follow the guidelines below:
-4188
View File
File diff suppressed because it is too large. Load diff
-97
View File
@@ -1,97 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 26.0.2, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 1034 239" style="enable-background:new 0 0 1034 239;" xml:space="preserve">
<style type="text/css">
.st0{fill:#576174;}
.st1{fill:#FFFFFF;}
.st2{font-family:'Courier-Bold';}
.st3{font-size:16.7604px;}
.st4{fill:#00983A;}
.st5{fill:none;stroke:#45CFFF;stroke-width:2.7934;stroke-linecap:round;stroke-linejoin:round;}
.st6{fill:#45CFFF;}
.st7{fill:none;stroke:#A000FF;stroke-width:2.7934;stroke-linecap:round;stroke-linejoin:round;}
.st8{fill:#A000FF;}
.st9{fill:none;stroke:#FFDE00;stroke-width:2.793;stroke-linecap:round;stroke-linejoin:round;}
.st10{fill:#FFDE00;}
.st11{fill:none;stroke:#EA5B0C;stroke-width:2.793;stroke-linecap:round;stroke-linejoin:round;}
.st12{fill:#EA5B0C;}
</style>
<g>
<path class="st0" d="M485.3,224.22H8.5c-4.7,0-8.5-3.8-8.5-8.5V27.22c0-4.7,3.8-8.5,8.5-8.5h476.8c4.7,0,8.5,3.8,8.5,8.5v188.5
C493.8,220.32,490,224.22,485.3,224.22z"/>
<g>
<g>
<g>
<text transform="matrix(1 0 0 1 21.294 60.1267)" class="st1 st2 st3">struct mg_str k,v,s = mg_str(”a=333, b=777”);</text>
</g>
</g>
<g>
<g>
<text transform="matrix(1 0 0 1 21.294 136.2499)" class="st1 st2 st3">mg_commalist(&amp;s, &amp;k, &amp;v); </text>
</g>
</g>
<g>
<g>
<text transform="matrix(1 0 0 1 21.294 197.1485)" class="st1 st2 st3">mg_commalist(&amp;s, &amp;k, &amp;v); </text>
</g>
</g>
<g>
<g>
<text transform="matrix(1 0 0 1 291.5096 140.18)" class="st4 st2 st3">// 1st call</text>
<text transform="matrix(1 0 0 1 291.5096 199.8101)" class="st4 st2 st3">// 2nd call</text>
</g>
</g>
</g>
<g>
<polyline class="st5" points="336.4,64.52 336.4,68.52 317.8,68.52 317.8,64.52 "/>
<g>
<path class="st5" d="M122.3,59.62"/>
<g>
<polyline class="st5" points="327.5,76.82 327.6,94.02 203.3,94.02 203.3,116.12 "/>
<path class="st6" d="M331,77.62c0,1.8-1.4,3.2-3.2,3.3c-1.8,0.1-3.2-1.4-3.3-3.2c0-1.8,1.4-3.2,3.2-3.3l0,0
C329.5,74.42,331,75.92,331,77.62z"/>
</g>
</g>
<path class="st6" d="M203.2,114.92c-1.8,0-3.2,1.3-3.3,3s1.4,3,3.2,3s3.2-1.3,3.3-3l0,0C206.5,116.32,205,114.92,203.2,114.92z"/>
</g>
<g>
<polyline class="st7" points="407.4,64.52 407.4,68.52 388.8,68.52 388.8,64.52 "/>
<g>
<path class="st5" d="M193.4,59.62"/>
<g>
<polyline class="st7" points="398.6,76.82 398.6,149.02 203.4,149.02 203.4,177.12 "/>
<path class="st8" d="M402,77.62c0,1.8-1.4,3.2-3.2,3.3c-1.8,0.1-3.2-1.4-3.3-3.2c0-1.8,1.4-3.2,3.2-3.3l0,0
C400.6,74.42,402,75.92,402,77.62z"/>
</g>
</g>
<path class="st8" d="M203.2,175.42c-1.8,0-3.2,1.3-3.3,3s1.4,3,3.2,3s3.2-1.3,3.3-3l0,0C206.5,176.82,205,175.42,203.2,175.42z"/>
</g>
<g>
<polyline class="st9" points="440.8,64.52 440.8,68.52 414.2,68.52 414.2,64.52 "/>
<g>
<path class="st5" d="M218.8,59.62"/>
<g>
<polyline class="st9" points="428,76.82 428,163.02 245.7,163.02 245.7,176.12 "/>
<path class="st10" d="M431.4,77.62c0,1.8-1.4,3.2-3.2,3.3c-1.8,0.1-3.2-1.4-3.3-3.2c0-1.8,1.4-3.2,3.2-3.3l0,0
C430,74.42,431.4,75.92,431.4,77.62z"/>
</g>
</g>
<path class="st10" d="M245.4,175.42c-1.8,0-3.2,1.3-3.3,3s1.4,3,3.2,3s3.2-1.3,3.3-3l0,0C248.7,176.82,247.2,175.42,245.4,175.42z
"/>
</g>
<g>
<polyline class="st11" points="372.8,64.52 372.8,68.52 343.2,68.52 343.2,64.52 "/>
<g>
<path class="st5" d="M164.7,59.62"/>
<g>
<polyline class="st11" points="358.3,76.62 358.3,104.82 245.7,105.02 245.7,116.12 "/>
<path class="st12" d="M361.4,77.62c0,1.8-1.4,3.2-3.2,3.3c-1.8,0.1-3.2-1.4-3.3-3.2c0-1.8,1.4-3.2,3.2-3.3l0,0
C359.9,74.42,361.4,75.92,361.4,77.62z"/>
</g>
</g>
<path class="st12" d="M245.7,114.92c-1.8,0-3.2,1.3-3.3,3s1.4,3,3.2,3s3.2-1.3,3.3-3l0,0C248.9,116.32,247.4,114.92,245.7,114.92z
"/>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 3.9 KiB

-48
View File
@@ -1,48 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 26.0.2, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 1034 158.07" style="enable-background:new 0 0 1034 158.07;" xml:space="preserve">
<style type="text/css">
.st0{fill:#67748A;}
.st1{fill:#FFFFFF;}
.st2{font-family:'Courier-Bold';}
.st3{font-size:16.7604px;}
.st4{fill:none;stroke:#45CFFF;stroke-width:2.793;stroke-linecap:round;stroke-linejoin:round;}
.st5{fill:#45CFFF;}
.st6{font-family:'Arial-BoldMT';}
</style>
<g>
<path class="st0" d="M516.7,39.8v56.33c0,4.17-3.8,7.54-8.5,7.54H14.6H8.5c-4.7,0-8.5-3.37-8.5-7.54V39.8c0-4.17,3.8-7.54,8.5-7.54
h499.7C512.9,32.26,516.7,35.63,516.7,39.8z"/>
<text transform="matrix(1 0 0 1 51.0379 69.3318)" class="st1 st2 st3">GET /test \n\nGET /test \n\nGET test \n\n</text>
<g>
<polyline class="st4" points="189.5,76.47 189.5,80.47 51.8,80.47 51.8,76.47 "/>
<polyline class="st4" points="331.3,76.47 331.3,80.47 195.6,80.47 195.6,76.47 "/>
<polyline class="st4" points="462.7,76.47 462.7,80.47 336.9,80.47 336.9,76.47 "/>
</g>
<g>
<text transform="matrix(1 0 0 1 78.8909 148.8896)" class="st5 st6 st3">1st request</text>
<g>
<line class="st4" x1="120.2" y1="93.57" x2="120.3" y2="129.57"/>
<path class="st5" d="M117.1,92.57c0-1.8,1.4-3.2,3.2-3.3c1.8,0,3.2,1.4,3.3,3.2c0,1.8-1.4,3.2-3.2,3.3l0,0
C118.5,95.77,117.1,94.37,117.1,92.57z"/>
</g>
</g>
<g>
<text transform="matrix(1 0 0 1 217.3594 148.8891)" class="st5 st6 st3">2nd request </text>
<g>
<line class="st4" x1="263.8" y1="93.57" x2="263.9" y2="129.57"/>
<path class="st5" d="M260.7,92.57c0-1.8,1.4-3.2,3.2-3.3c1.8,0,3.2,1.4,3.3,3.2c0,1.8-1.4,3.2-3.2,3.3l0,0
C262.1,95.77,260.7,94.37,260.7,92.57z"/>
</g>
</g>
<g>
<text transform="matrix(1 0 0 1 354.7297 148.8896)" class="st5 st6 st3">3rd request </text>
<g>
<line class="st4" x1="399.4" y1="93.57" x2="399.4" y2="129.57"/>
<path class="st5" d="M396.2,92.57c0-1.8,1.4-3.2,3.2-3.3c1.8,0,3.2,1.4,3.3,3.2c0,1.8-1.4,3.2-3.2,3.3l0,0
C397.7,95.77,396.2,94.37,396.2,92.57z"/>
</g>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 2.2 KiB

-113
View File
@@ -1,113 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 26.0.2, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 1035.4 429.9" style="enable-background:new 0 0 1035.4 429.9;" xml:space="preserve">
<style type="text/css">
.st0{fill:#576174;}
.st1{fill:#67748A;}
.st2{fill:none;stroke:#87005B;stroke-width:2.7934;stroke-linecap:round;stroke-linejoin:round;}
.st3{fill:#87005B;}
.st4{fill:#FFFFFF;}
.st5{font-family:'Courier-Bold';}
.st6{font-size:16.7604px;}
.st7{fill:none;stroke:#EA5B0C;stroke-width:2.793;stroke-linecap:round;stroke-linejoin:round;}
.st8{fill:#EA5B0C;}
.st9{fill:none;stroke:#CA70FF;stroke-width:2.7934;stroke-linecap:round;stroke-linejoin:round;}
.st10{fill:#CA70FF;}
.st11{fill:none;stroke:#FFDE00;stroke-width:2.793;stroke-linecap:round;stroke-linejoin:round;}
.st12{fill:#FFDE00;}
.st13{fill:none;stroke:#00CF4F;stroke-width:2.7934;stroke-linecap:round;stroke-linejoin:round;}
.st14{fill:#00CF4F;}
.st15{fill:none;stroke:#45CFFF;stroke-width:2.7934;stroke-linecap:round;stroke-linejoin:round;}
.st16{fill:none;stroke:#EA5B0C;stroke-width:2.7934;stroke-linecap:round;stroke-linejoin:round;}
.st17{font-family:'Arial-BoldMT';}
.st18{font-size:24px;}
.st19{fill:#45CFFF;}
</style>
<g>
<path class="st0" d="M755.8,391.8H8.5c-4.7,0-8.5-3.8-8.5-8.5v-153c0-4.7,3.8-8.5,8.5-8.5h747.3c4.7,0,8.5,3.8,8.5,8.5v153
C764.3,388,760.5,391.8,755.8,391.8z"/>
<path class="st1" d="M996.9,261.5h-427c-4.7,0-8.5-3.8-8.5-8.5V81.2c0-4.7,3.8-8.5,8.5-8.5h427c4.7,0,8.5,3.8,8.5,8.5V253
C1005.4,257.7,1001.5,261.5,996.9,261.5z"/>
<g>
<polyline class="st2" points="598.1,238.2 598.1,242.3 787.7,242.3 787.7,238.2 "/>
<g>
<line class="st2" x1="689.3" y1="342.2" x2="276.4" y2="343.3"/>
<g>
<line class="st2" x1="689.4" y1="253.3" x2="689.4" y2="342.1"/>
<path class="st3" d="M689.4,249.3c1.8,0,3.2,1.4,3.3,3.2c0,1.8-1.4,3.2-3.2,3.3c-1.8,0-3.2-1.4-3.3-3.2l0,0
C686.1,250.7,687.6,249.3,689.4,249.3z"/>
</g>
</g>
<path class="st3" d="M274.2,340.4c1.8,0,3.2,1.4,3.3,3.2s-1.4,3.2-3.2,3.3c-1.8,0-3.2-1.4-3.3-3.2l0,0
C270.9,341.8,272.4,340.4,274.2,340.4z"/>
</g>
<text transform="matrix(1 0 0 1 26.0923 262.5192)" class="st4 st5 st6">struct mg_http_message {</text>
<text transform="matrix(1 0 0 1 45.542 286.2874)" class="st4 st5 st6">struct mg_str method; uri, query, proto; </text>
<text transform="matrix(1 0 0 1 45.542 306.3874)" class="st4 st5 st6">struct mg_http_header headers[MG_MAX_HTTP_HEADERS];</text>
<text transform="matrix(1 0 0 1 45.542 326.4874)" class="st4 st5 st6">struct mg_str body;</text>
<text transform="matrix(1 0 0 1 45.542 346.5874)" class="st4 st5 st6">struct mg_str message; </text>
<g>
<g>
<polyline class="st7" points="621.1,89.6 621.1,78.6 215.4,79.7 215.3,269.4 "/>
<path class="st8" d="M624.3,90.6c0,1.8-1.4,3.2-3.2,3.3c-1.8,0-3.2-1.4-3.3-3.2c0-1.8,1.4-3.2,3.2-3.3l0,0
C622.8,87.4,624.3,88.8,624.3,90.6z"/>
</g>
<path class="st8" d="M212.3,269.4c0-1.8,1.4-3.2,3.2-3.3c1.8,0,3.2,1.4,3.3,3.2c0,1.8-1.4,3.2-3.2,3.3l0,0
C213.7,272.6,212.3,271.2,212.3,269.4z"/>
</g>
<g>
<polyline class="st9" points="597.2,183.6 593.1,183.6 593.1,127.8 597.2,127.8 "/>
<g>
<polyline class="st9" points="582.4,156.2 575.2,156.2 575,302.8 563.4,302.8 "/>
<path class="st10" d="M586.1,156.2c0-1.8-1.4-3.2-3.2-3.3c-1.8,0-3.2,1.4-3.3,3.2c0,1.8,1.4,3.2,3.2,3.3l0,0
C584.7,159.4,586.1,158,586.1,156.2z"/>
<path class="st10" d="M564.2,303c0-1.8-1.4-3.2-3.2-3.3c-1.8,0-3.2,1.4-3.3,3.2s1.4,3.2,3.2,3.3l0,0
C562.7,306.2,564.2,304.7,564.2,303z"/>
</g>
</g>
<text transform="matrix(1 0 0 1 601.1215 118.1291)" class="st4 st5 st6">POST /foo/bar/baz?aa=b&amp;cc=ddd HTTP/1.1</text>
<text transform="matrix(1 0 0 1 601.1215 138.2291)" class="st4 st5 st6">Content-Type: application/json</text>
<text transform="matrix(1 0 0 1 601.1215 158.3291)" class="st4 st5 st6">Content-Length: 19</text>
<text transform="matrix(1 0 0 1 601.1215 178.4291)" class="st4 st5 st6">Host: reqbin.com</text>
<g>
<g>
<g>
<polyline class="st11" points="712.3,90.6 712.4,67.6 277.8,67.6 279.7,269.3 "/>
<path class="st12" d="M715.6,90.8c0,1.8-1.4,3.2-3.2,3.3c-1.8,0-3.2-1.4-3.3-3.2c0-1.8,1.4-3.2,3.2-3.3l0,0
C714.1,87.6,715.6,89.1,715.6,90.8z"/>
</g>
<path class="st12" d="M276.5,269.4c0-1.8,1.4-3.2,3.2-3.3s3.2,1.4,3.3,3.2s-1.4,3.2-3.2,3.3l0,0
C278,272.6,276.5,271.2,276.5,269.4z"/>
</g>
<polyline class="st11" points="771.5,104.3 771.5,100.3 652.7,100.3 652.7,104.3 "/>
</g>
<g>
<g>
<g>
<polyline class="st13" points="836.3,90.6 836.3,56.6 342.8,56.6 344.7,268.3 "/>
<path class="st14" d="M839.5,90.6c0,1.8-1.4,3.2-3.2,3.3c-1.8,0-3.2-1.4-3.3-3.2c0-1.8,1.4-3.2,3.2-3.3l0,0
C838,87.4,839.5,88.9,839.5,90.6z"/>
</g>
<path class="st14" d="M341.4,269.3c0-1.8,1.4-3.2,3.2-3.3c1.8,0,3.2,1.4,3.3,3.2c0,1.8-1.4,3.2-3.2,3.3l0,0
C342.9,272.5,341.4,271.1,341.4,269.3z"/>
</g>
<polyline class="st15" points="981.4,104.2 981.4,100.2 902.6,100.2 902.6,104.2 "/>
</g>
<text transform="matrix(1 0 0 1 596.891 232.3658)" class="st4 st5 st6">{&quot;success&quot;: &quot;true&quot;}</text>
<polyline class="st16" points="643.1,104.4 643.1,100.4 599.3,100.4 599.3,104.4 "/>
<text transform="matrix(1 0 0 1 9.5506 207.5157)" class="st17 st18">Source Code</text>
<text transform="matrix(1 0 0 1 797.0799 32.3923)" class="st17 st18">HTTP message</text>
<text transform="matrix(1 0 0 1 26.0924 359.209)" class="st4 st5 st6">};</text>
<polyline class="st13" points="894.2,104.2 894.2,100.2 774.4,100.2 774.4,104.2 "/>
<g>
<g>
<polyline class="st15" points="941.3,90.6 941.3,45.6 412.8,45.6 414.7,268.3 "/>
<path class="st19" d="M944.5,90.6c0,1.8-1.4,3.2-3.2,3.3c-1.8,0-3.2-1.4-3.3-3.2c0-1.8,1.4-3.2,3.2-3.3l0,0
C943,87.4,944.5,88.9,944.5,90.6z"/>
</g>
<path class="st19" d="M411.4,269.3c0-1.8,1.4-3.2,3.2-3.3c1.8,0,3.2,1.4,3.3,3.2c0,1.8-1.4,3.2-3.2,3.3l0,0
C412.9,272.5,411.4,271.1,411.4,269.3z"/>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 6.0 KiB

-109
View File
@@ -1,109 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 26.0.2, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 1034 663.54" style="enable-background:new 0 0 1034 663.54;" xml:space="preserve">
<style type="text/css">
.st0{fill:none;stroke:#45CFFF;stroke-width:2.7934;stroke-linecap:round;stroke-linejoin:round;}
.st1{fill:#45CFFF;}
.st2{fill:#576174;}
.st3{fill:#FFFFFF;}
.st4{font-family:'Courier-Bold';}
.st5{font-size:16.7604px;}
.st6{font-family:'Arial-BoldMT';}
.st7{font-size:24px;}
.st8{fill:#67748A;}
.st9{fill:#8B9CBA;}
.st10{fill:none;stroke:#00CF4F;stroke-width:2.7934;stroke-linecap:round;stroke-linejoin:round;}
.st11{fill:#00CF4F;}
.st12{fill:none;stroke:#EA5B0C;stroke-width:2.793;stroke-linecap:round;stroke-linejoin:round;}
.st13{fill:#EA5B0C;}
.st14{fill:#414857;}
</style>
<g>
<g>
<polyline class="st0" points="498.5,624.21 498.5,628.21 447.9,628.21 447.9,624.21 "/>
<g>
<path class="st0" d="M491.8,844.81"/>
<g>
<path class="st1" d="M473.8,636.11c-1.8,0-3.2,1.4-3.3,3.2c0,1.8,1.4,3.2,3.2,3.3c1.8,0,3.2-1.4,3.3-3.2l0,0
C477.1,637.61,475.6,636.11,473.8,636.11z"/>
</g>
</g>
<path class="st1" d="M296.7,852.71c-1.8,0-3.2,1.3-3.3,3c0,1.7,1.4,3,3.2,3c1.8,0,3.2-1.3,3.3-3l0,0
C299.9,854.01,298.5,852.71,296.7,852.71z"/>
</g>
<g>
<path class="st2" d="M584.6,199.01H8.5c-4.7,0-8.5-3.8-8.5-8.5V60.71c0-4.7,3.8-8.5,8.5-8.5h576.1c4.7,0,8.5,3.8,8.5,8.5v129.8
C593.1,195.21,589.3,199.01,584.6,199.01z"/>
<g>
<g>
<g>
<text transform="matrix(1 0 0 1 28.7 90.8107)" class="st3 st4 st5">struct mg_http_part part;</text>
<text transform="matrix(1 0 0 1 28.7 110.9108)" class="st3 st4 st5">size_t pos = 0;</text>
<text transform="matrix(1 0 0 1 28.7 151.1107)" class="st3 st4 st5">pos = mg_http_next_multipart(&amp;hm-&gt;body, pos, &amp;part);</text>
<text transform="matrix(1 0 0 1 28.7 171.3107)" class="st3 st4 st5">pos = mg_http_next_multipart(&amp;hm-&gt;body, pos, &amp;part);</text>
</g>
</g>
</g>
<text transform="matrix(1 0 0 1 1.3738 40.559)" class="st6 st7">Source Code</text>
</g>
<g>
<g>
<path class="st8" d="M685.5,646.41H8.5c-4.7,0-8.5-3.8-8.5-8.5v-362.9c0-4.7,3.8-8.5,8.5-8.5h677c4.7,0,8.5,3.8,8.5,8.5v362.9
C694,642.61,690.2,646.41,685.5,646.41z"/>
</g>
<path class="st9" d="M640.2,629.41H26.3c-4.7,0-8.5-3.8-8.5-8.5v-106.5c0-4.7,3.8-8.5,8.5-8.5h613.9c4.7,0,8.5,3.8,8.5,8.5v106.5
C648.7,625.61,644.8,629.41,640.2,629.41z"/>
<path class="st9" d="M644,490.91H30.1c-4.7,0-8.5-3.8-8.5-8.5v-106.5c0-4.7,3.8-8.5,8.5-8.5H644c4.7,0,8.5,3.8,8.5,8.5v106.5
C652.5,487.11,648.7,490.91,644,490.91z"/>
<g>
<text transform="matrix(1 0 0 1 0.0299 253.0343)" class="st6 st7">HTTP message</text>
</g>
<g>
<text transform="matrix(1 0 0 1 28.7 302.8107)" class="st3 st4 st5">POST /upload HTTP/1.1 </text>
<text transform="matrix(1 0 0 1 28.7 322.9107)" class="st3 st4 st5">Content-Type: multipart/form-data; boundary=&quot;--xyz&quot;</text>
<text transform="matrix(1 0 0 1 28.7 363.1107)" class="st3 st4 st5">--xyz</text>
<text transform="matrix(1 0 0 1 28.7 383.3107)" class="st3 st4 st5">Content-Disposition: form-data; name=&quot;foo&quot;; filename=&quot;a.txt&quot;</text>
<text transform="matrix(1 0 0 1 28.7 403.4107)" class="st3 st4 st5">Content-Type: text/plain</text>
<text transform="matrix(1 0 0 1 28.7 443.6107)" class="st3 st4 st5">hello world</text>
<text transform="matrix(1 0 0 1 28.7 483.8107)" class="st3 st4 st5">--xyz---</text>
<text transform="matrix(1 0 0 1 28.7 524.0107)" class="st3 st4 st5">Content-Disposition: form-data; name=&quot;bar&quot;; filename=&quot;b.txt&quot;</text>
<text transform="matrix(1 0 0 1 28.7 544.2108)" class="st3 st4 st5">Content-Type: text/plain</text>
<text transform="matrix(1 0 0 1 28.7 584.4108)" class="st3 st4 st5">hello world again</text>
<text transform="matrix(1 0 0 1 28.7 624.6107)" class="st3 st4 st5">--xyz--</text>
</g>
</g>
<g>
<g>
<polyline class="st10" points="569.5,162.51 574.5,162.51 574.5,176.11 569.5,176.11 "/>
<g>
<path class="st0" d="M726.8,392.91"/>
<g>
<polyline class="st10" points="587.3,169.71 726.7,169.71 726.6,569.31 684.3,569.31 "/>
<path class="st11" d="M585,166.41c-1.8,0-3.2,1.4-3.3,3.2c0,1.8,1.4,3.2,3.2,3.3c1.8,0,3.2-1.4,3.3-3.2l0,0
C588.2,167.91,586.8,166.41,585,166.41z"/>
</g>
</g>
<path class="st11" d="M685,566.31c-1.7,0-3,1.3-3,3s1.3,3,3,3s3-1.3,3-3l0,0C688,567.61,686.6,566.31,685,566.31z"/>
</g>
<polyline class="st10" points="657.9,501.61 673.9,501.61 673.9,634.21 657.9,634.21 "/>
</g>
<g>
<g>
<polyline class="st12" points="569.5,143.21 574.5,143.21 574.5,156.81 569.5,156.81 "/>
<g>
<path class="st0" d="M726.8,254.61"/>
<g>
<polyline class="st12" points="587.3,150.41 710.7,150.41 710.6,431.01 684.3,431.01 "/>
<path class="st13" d="M585,147.11c-1.8,0-3.2,1.4-3.3,3.2s1.4,3.2,3.2,3.3c1.8,0,3.2-1.4,3.3-3.2l0,0
C588.2,148.61,586.8,147.11,585,147.11z"/>
</g>
</g>
<path class="st13" d="M685,428.01c-1.7,0-3,1.3-3,3s1.3,3,3,3s3-1.3,3-3l0,0C688,429.31,686.6,428.01,685,428.01z"/>
</g>
<polyline class="st12" points="657.9,363.31 673.9,363.31 673.9,495.91 657.9,495.91 "/>
</g>
<text transform="matrix(1 0 0 1 537.9671 462.1467)" class="st14 st6 st7">Part 1</text>
<text transform="matrix(1 0 0 1 537.9671 600.4373)" class="st14 st6 st7">Part 2</text>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 5.5 KiB

-94
View File
@@ -1,94 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 26.0.2, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 1034 480.6" style="enable-background:new 0 0 1034 480.6;" xml:space="preserve">
<style type="text/css">
.st0{fill:#67748A;}
.st1{fill:#8B9CBA;}
.st2{fill:#FFFFFF;}
.st3{font-family:'Courier-Bold';}
.st4{font-size:16.7604px;}
.st5{fill:#414857;}
.st6{font-family:'Arial-BoldMT';}
.st7{font-size:30px;}
.st8{font-size:24px;}
.st9{fill:#576174;}
.st10{fill:none;stroke:#45CFFF;stroke-width:2.7934;stroke-linecap:round;stroke-linejoin:round;}
.st11{fill:#45CFFF;}
.st12{fill:none;stroke:#EA5B0C;stroke-width:2.793;stroke-linecap:round;stroke-linejoin:round;}
.st13{fill:#EA5B0C;}
.st14{fill:none;stroke:#EA5B0C;stroke-width:2.7934;stroke-linecap:round;stroke-linejoin:round;}
.st15{fill:none;stroke:#FFDE00;stroke-width:2.793;stroke-linecap:round;stroke-linejoin:round;}
.st16{fill:#FFDE00;}
</style>
<g>
<g>
<path class="st0" d="M908.4,454.9H272c-4.7,0-8.5-3.8-8.5-8.5V216c0-4.7,3.8-8.5,8.5-8.5h636.4c4.7,0,8.5,3.8,8.5,8.5v230.4
C916.9,451.1,913.1,454.9,908.4,454.9z"/>
<g>
<path class="st1" d="M898.6,430.8H284.7c-4.7,0-8.5-3.8-8.5-8.5V315.9c0-4.7,3.8-8.5,8.5-8.5h613.9c4.7,0,8.5,3.8,8.5,8.5v106.5
C907.1,427,903.3,430.8,898.6,430.8z"/>
<text transform="matrix(1 0 0 1 295.3688 243.086)" class="st2 st3 st4">POST /upload HTTP/1.1 </text>
<text transform="matrix(1 0 0 1 295.3688 263.186)" class="st2 st3 st4">Content-Type: multipart/form-data: boundary=&quot;--xyz&quot;</text>
<text transform="matrix(1 0 0 1 295.3688 303.386)" class="st2 st3 st4">--xyz</text>
<text transform="matrix(1 0 0 1 295.3688 323.586)" class="st2 st3 st4">Content-Disposition: form-data; name=&quot;foo&quot;; filename=&quot;a.txt&quot;</text>
<text transform="matrix(1 0 0 1 295.3688 343.686)" class="st2 st3 st4">Content-Type: text/plain</text>
<text transform="matrix(1 0 0 1 295.3688 383.886)" class="st2 st3 st4">hello world</text>
<text transform="matrix(1 0 0 1 295.3688 424.086)" class="st2 st3 st4">--xyz---</text>
</g>
</g>
<text transform="matrix(1 0 0 1 739.2766 414.2906)" class="st5 st6 st7">HTTP part</text>
<text transform="matrix(1 0 0 1 739.2764 193.4305)" class="st6 st8">HTTP message</text>
<path class="st9" d="M304.9,198H8.5c-4.7,0-8.5-3.8-8.5-8.5V64.8c0-4.7,3.8-8.5,8.5-8.5H305c4.7,0,8.5,3.8,8.5,8.5v124.7
C313.4,194.2,309.6,198,304.9,198z"/>
<g>
<g>
<text transform="matrix(1 0 0 1 25.2409 91.1617)" class="st2 st3 st4">struct mg_http_part {</text>
<text transform="matrix(1 0 0 1 47.0734 113.7079)" class="st2 st3 st4">struct mg_str name;</text>
<text transform="matrix(1 0 0 1 47.0734 133.8079)" class="st2 st3 st4">strucy mg_str filename;</text>
<text transform="matrix(1 0 0 1 47.0734 153.9079)" class="st2 st3 st4">struct mg_str body;</text>
</g>
</g>
<g>
<polyline class="st10" points="237.4,159 237.4,163 185.8,163 185.8,159 "/>
<g>
<polyline class="st10" points="211.7,348.3 349.5,348.4 349.5,355.6 "/>
<g>
<line class="st10" x1="211.6" y1="174.4" x2="211.6" y2="348.1"/>
<path class="st11" d="M211.6,170.3c-1.8,0-3.2,1.4-3.3,3.2c0,1.8,1.4,3.2,3.2,3.3c1.8,0,3.2-1.4,3.3-3.2l0,0
C214.8,171.8,213.4,170.3,211.6,170.3z"/>
</g>
</g>
<path class="st11" d="M349.6,353.6c-1.8,0-3.2,1.4-3.3,3.2s1.4,3.2,3.2,3.3c1.8,0,3.2-1.4,3.3-3.2l0,0
C352.8,355.1,351.4,353.6,349.6,353.6z"/>
<polyline class="st10" points="237.4,159 237.4,163 185.8,163 185.8,159 "/>
<polyline class="st10" points="407.3,371.1 407.3,367.1 293.3,367.1 293.3,371.1 "/>
</g>
<g>
<g>
<g>
<polyline class="st12" points="693.7,291.6 693.7,277.7 280.7,278.8 280.5,109.4 248.3,109.4 "/>
<path class="st13" d="M696.9,293.6c0,1.8-1.4,3.2-3.2,3.3c-1.8,0-3.2-1.4-3.3-3.2c0-1.8,1.4-3.2,3.2-3.3l0,0
C695.4,290.4,696.9,291.9,696.9,293.6z"/>
</g>
<path class="st13" d="M243.9,109.5c0-1.8,1.4-3.2,3.2-3.3c1.8,0,3.2,1.4,3.3,3.2c0,1.8-1.4,3.2-3.2,3.3l0,0
C245.3,112.7,243.9,111.3,243.9,109.5z"/>
</g>
<polyline class="st14" points="707.6,309.2 707.6,305.2 679.9,305.2 679.9,309.2 "/>
</g>
<text transform="matrix(1 0 0 1 0.8627 37.8099)" class="st6 st8">Source Code</text>
<text transform="matrix(1 0 0 1 25.2408 177.7241)" class="st2 st3 st4">};</text>
<g>
<g>
<g>
<polyline class="st15" points="863.8,291.5 863.7,218.6 329.7,218.7 329.6,130.3 298.4,130.3 "/>
<path class="st16" d="M867.1,293.6c0,1.8-1.4,3.2-3.2,3.3c-1.8,0-3.2-1.4-3.3-3.2c0-1.8,1.4-3.2,3.2-3.3l0,0
C865.6,290.3,867.1,291.8,867.1,293.6z"/>
</g>
<path class="st16" d="M293,130.1c0-1.8,1.4-3.2,3.2-3.3c1.8,0,3.2,1.4,3.3,3.2c0,1.8-1.4,3.2-3.2,3.3l0,0
C294.4,133.3,293,131.9,293,130.1z"/>
</g>
<polyline class="st15" points="888.7,309.1 888.7,305.1 838.9,305.1 838.9,309.1 "/>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 4.9 KiB

-84
View File
@@ -1,84 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 26.0.2, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 1034 331.2" style="enable-background:new 0 0 1034 331.2;" xml:space="preserve">
<style type="text/css">
.st0{fill:#576174;}
.st1{fill:#67748A;}
.st2{fill:#FFFFFF;}
.st3{font-family:'Courier-Bold';}
.st4{font-size:16.7604px;}
.st5{font-family:'Arial-BoldMT';}
.st6{font-size:24px;}
.st7{fill:none;stroke:#45CFFF;stroke-width:2.7934;stroke-linecap:round;stroke-linejoin:round;}
.st8{fill:#45CFFF;}
.st9{fill:none;stroke:#EA5B0C;stroke-width:2.793;stroke-linecap:round;stroke-linejoin:round;}
.st10{fill:#EA5B0C;}
.st11{fill:none;stroke:#EA5B0C;stroke-width:2.7934;stroke-linecap:round;stroke-linejoin:round;}
.st12{fill:none;stroke:#00CF4F;stroke-width:2.7934;stroke-linecap:round;stroke-linejoin:round;}
.st13{fill:#00CF4F;}
</style>
<g>
<path class="st0" d="M541.43,184.2H8.53c-4.7,0-8.5-3.8-8.5-8.5V54.8c0-4.7,3.8-8.5,8.5-8.5h532.9c4.7,0,8.5,3.8,8.5,8.5v120.9
C549.93,180.4,546.13,184.2,541.43,184.2z"/>
<g>
<path class="st1" d="M829.23,315.5h-370c-4.7,0-8.5-3.8-8.5-8.5V157c0-4.7,3.8-8.5,8.5-8.5h370c4.7,0,8.5,3.8,8.5,8.5v150
C837.83,311.7,833.93,315.5,829.23,315.5z"/>
<g>
<text transform="matrix(1 0 0 1 490.6096 184.0905)" class="st2 st3 st4">HTTP/1.1 200 OK</text>
<text transform="matrix(1 0 0 1 490.6096 204.1905)" class="st2 st3 st4">Content-Length; 13</text>
<text transform="matrix(1 0 0 1 490.6096 224.2905)" class="st2 st3 st4">X-Header-1: additional value 1</text>
<text transform="matrix(1 0 0 1 490.6096 244.3905)" class="st2 st3 st4">X-Header-2: additional value 2</text>
<text transform="matrix(1 0 0 1 490.8657 293.1559)" class="st2 st3 st4">Hello, world!</text>
</g>
</g>
<text transform="matrix(1 0 0 1 660.5036 137.3383)" class="st5 st6">HTTP message</text>
<g>
<g>
<text transform="matrix(1 0 0 1 20.7331 85.1617)" class="st2 st3 st4">mg_http_reply(c, 200</text>
<text transform="matrix(1 0 0 1 159.5657 113.7079)" class="st2 st3 st4">&quot;X-Header-1: additional value 1\r\n&quot;</text>
<text transform="matrix(1 0 0 1 159.5657 133.8079)" class="st2 st3 st4">&quot;X-Header-2: additional value 2\r\n&quot;,</text>
<text transform="matrix(1 0 0 1 159.5657 153.9079)" class="st2 st3 st4">&quot;Hello, %s!&quot;, &quot;world&quot;);</text>
</g>
</g>
<g>
<polyline class="st7" points="362.93,159 362.93,163 167.33,163 167.33,159 "/>
<g>
<polyline class="st7" points="265.93,256.6 552.13,256.7 552.13,264.4 "/>
<g>
<line class="st7" x1="265.83" y1="174.4" x2="265.83" y2="256.6"/>
<path class="st8" d="M265.83,170.3c-1.8,0-3.2,1.4-3.3,3.2c0,1.8,1.4,3.2,3.2,3.3c1.8,0,3.2-1.4,3.3-3.2l0,0
C269.03,171.8,267.53,170.3,265.83,170.3z"/>
</g>
</g>
<path class="st8" d="M552.23,261.6c-1.8,0-3.2,1.4-3.3,3.2c0,1.8,1.4,3.2,3.2,3.3c1.8,0,3.2-1.4,3.3-3.2l0,0
C555.43,263.1,554.03,261.6,552.23,261.6z"/>
</g>
<g>
<g>
<g>
<polyline class="st9" points="206.33,53.6 206.43,37.6 596.43,38.7 596.53,161.3 "/>
<path class="st10" d="M203.23,54.6c0,1.8,1.4,3.2,3.2,3.3c1.8,0,3.2-1.4,3.3-3.2c0-1.8-1.4-3.2-3.2-3.3l0,0
C204.63,51.4,203.23,52.8,203.23,54.6z"/>
</g>
<path class="st10" d="M599.83,164c0-1.8-1.4-3.2-3.2-3.3c-1.8,0-3.2,1.4-3.3,3.2c0,1.8,1.4,3.2,3.2,3.3l0,0
C598.33,167.2,599.83,165.8,599.83,164z"/>
</g>
<polyline class="st11" points="192.43,69.2 192.43,65.2 220.23,65.2 220.23,69.2 "/>
</g>
<text transform="matrix(1 0 0 1 -1.917133e-04 35.0037)" class="st5 st6">Source Code</text>
<g>
<polyline class="st12" points="160.13,135.9 156.03,135.9 156.03,100.1 160.13,100.1 "/>
<g>
<line class="st12" x1="123.93" y1="231" x2="469.73" y2="231"/>
<polyline class="st12" points="144.73,117.2 123.83,117.2 123.73,230.8 "/>
<path class="st13" d="M147.83,117.2c0-1.8-1.4-3.2-3.2-3.3c-1.8,0-3.2,1.4-3.3,3.2c0,1.8,1.4,3.2,3.2,3.3l0,0
C146.33,120.4,147.83,119,147.83,117.2z"/>
<path class="st13" d="M474.83,230.8c0-1.8-1.4-3.2-3.2-3.3c-1.8,0-3.2,1.4-3.3,3.2c0,1.8,1.4,3.2,3.2,3.3l0,0
C473.43,234,474.83,232.5,474.83,230.8z"/>
</g>
</g>
<polyline class="st7" points="489.03,279.6 489.03,275.6 620.63,275.6 620.63,279.6 "/>
<polyline class="st12" points="487.63,248.3 483.63,248.3 483.63,211.5 487.63,211.5 "/>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 4.4 KiB

-124
View File
@@ -1,124 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 26.0.2, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 869.6 185.67" style="enable-background:new 0 0 869.6 185.67;" xml:space="preserve">
<style type="text/css">
.st0{font-family:'Arial-BoldMT';}
.st1{font-size:24px;}
.st2{opacity:0.2;fill:#00983A;enable-background:new ;}
.st3{fill:none;stroke:#7A8387;stroke-width:1.2;stroke-linecap:round;stroke-linejoin:round;}
.st4{fill:#00983A;}
.st5{fill:none;stroke:#576174;stroke-miterlimit:10;}
.st6{fill:#F2F3F3;stroke:#7A8387;stroke-width:1.2;stroke-linecap:round;stroke-linejoin:round;}
.st7{fill:none;stroke:#576174;stroke-width:1.2;stroke-linecap:round;stroke-linejoin:round;}
.st8{font-family:'Courier-Bold';}
.st9{font-size:16.7604px;}
.st10{fill:none;stroke:#00983A;stroke-linecap:round;stroke-linejoin:round;}
.st11{fill:#576174;}
.st12{font-family:'Courier';}
.st13{fill:none;}
.st14{fill:#7A8387;}
</style>
<g>
<text transform="matrix(1 0 0 1 1.0956 32.4549)" class="st0 st1">Memory</text>
<polyline class="st2" points="424.58,115.4 219.88,115.4 219.88,90.7 424.58,90.7 "/>
<g>
<g>
<g>
<polyline class="st3" points="458.98,115.4 218.98,115.4 218.98,90.7 458.98,90.7 "/>
<polyline class="st4" points="219.18,115.1 2.98,115.1 2.98,91.3 219.18,91.3 "/>
<line class="st3" x1="2.98" y1="69.2" x2="2.98" y2="130.4"/>
<line class="st5" x1="219.78" y1="69.2" x2="219.78" y2="130.4"/>
<line class="st5" x1="425.28" y1="69.2" x2="425.28" y2="130.4"/>
<path class="st6" d="M458.98,115.4"/>
<path class="st7" d="M33.98,114.6"/>
<path class="st7" d="M33.98,90.9"/>
<path class="st7" d="M2.98,90.7h216.8v24.9l-216.8-0.2C2.98,115.4,3.18,90.7,2.98,90.7z"/>
<line class="st3" x1="425.18" y1="90.8" x2="425.18" y2="115.3"/>
<path class="st6" d="M251.98,115.6"/>
<path class="st6" d="M251.98,91.9"/>
</g>
<g>
<text transform="matrix(1 0 0 1 -2.290726e-04 175.3858)" class="st4 st8 st9">buf</text>
</g>
<g>
<g>
<line class="st10" x1="2.68" y1="158.2" x2="2.68" y2="137.2"/>
<g>
<polygon class="st4" points="0.28,137.6 5.08,137.6 2.68,135.1 "/>
</g>
</g>
</g>
<g>
<g>
<text transform="matrix(1 0 0 1 214.6515 175.3858)" class="st4 st8 st9">len</text>
</g>
</g>
<g>
<g>
<line class="st10" x1="219.78" y1="158.2" x2="219.78" y2="137.2"/>
<g>
<polygon class="st4" points="217.38,137.6 222.18,137.6 219.78,135.1 "/>
</g>
</g>
</g>
<g>
<g>
<text transform="matrix(1 0 0 1 421.6186 175.3858)" class="st4 st8 st9">size</text>
</g>
</g>
<g>
<g>
<line class="st10" x1="425.38" y1="158.2" x2="425.38" y2="137.2"/>
<g>
<polygon class="st4" points="422.98,137.6 427.78,137.6 425.38,135.1 "/>
</g>
</g>
</g>
<g>
<g>
<text transform="matrix(1 0 0 1 93.1143 69.4458)" class="st11 st12 st9">data</text>
</g>
<g>
<g>
<text transform="matrix(1 0 0 1 273.8231 69.4458)" class="st11 st12 st9">free space</text>
</g>
</g>
<g>
<g>
<line class="st5" x1="132.98" y1="76.3" x2="13.98" y2="76.3"/>
<g>
<polygon class="st11" points="14.28,78.7 14.28,73.8 11.88,76.3 "/>
</g>
</g>
</g>
<g>
<line class="st13" x1="123.88" y1="76.3" x2="210.88" y2="76.3"/>
<g>
<line class="st5" x1="123.88" y1="76.3" x2="208.78" y2="76.3"/>
<g>
<polygon class="st11" points="208.48,73.8 208.48,78.7 210.88,76.3 "/>
</g>
</g>
</g>
<g>
<g>
<line class="st5" x1="320.38" y1="76.3" x2="414.28" y2="76.3"/>
<g>
<polygon class="st14" points="413.98,73.8 413.98,78.7 416.38,76.3 "/>
</g>
</g>
</g>
<g>
<g>
<line class="st5" x1="322.28" y1="76.3" x2="233.28" y2="76.3"/>
<g>
<polygon class="st14" points="233.68,78.7 233.68,73.8 231.18,76.3 "/>
</g>
</g>
</g>
</g>
</g>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 4.1 KiB

-52
View File
@@ -1,52 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 26.0.2, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 869 124.66" style="enable-background:new 0 0 869 124.66;" xml:space="preserve">
<style type="text/css">
.st0{fill:#F2F3F3;stroke:#7A8387;stroke-width:1.2;stroke-linecap:round;stroke-linejoin:round;}
.st1{fill:none;stroke:#7A8387;stroke-width:1.2;stroke-linecap:round;stroke-linejoin:round;}
.st2{fill:#00983A;}
.st3{font-family:'Courier-Bold';}
.st4{font-size:16.7604px;}
.st5{fill:none;stroke:#00983A;stroke-linecap:round;stroke-linejoin:round;}
.st6{fill:#7A8387;}
</style>
<g>
<g>
<g>
<polyline class="st0" points="830.92,78.4 5.52,78.4 5.52,53.7 830.92,53.6 "/>
<line class="st1" x1="5.52" y1="32.2" x2="5.52" y2="93.4"/>
<path class="st0" d="M830.92,78.4"/>
<line class="st1" x1="36.52" y1="53.9" x2="36.52" y2="77.6"/>
<line class="st1" x1="68.92" y1="53.9" x2="68.92" y2="77.6"/>
<line class="st1" x1="101.42" y1="53.9" x2="101.42" y2="77.6"/>
<line class="st1" x1="133.72" y1="53.9" x2="133.72" y2="77.6"/>
<line class="st1" x1="166.22" y1="53.9" x2="166.22" y2="77.6"/>
<line class="st1" x1="198.52" y1="54.6" x2="198.52" y2="78.3"/>
<line class="st1" x1="230.92" y1="54.6" x2="230.92" y2="78.3"/>
</g>
<g>
<text transform="matrix(1 0 0 1 59.1908 40.8585)" class="st2 st3 st4">buf=NULL, len=0, size=0 </text>
</g>
<g>
<text transform="matrix(1 0 0 1 -1.811981e-04 109.9024)" class="st2 st3 st4">0</text>
</g>
<g>
<g>
<g>
<line class="st5" x1="46.72" y1="37.7" x2="17.72" y2="37.7"/>
<g>
<polygon class="st2" points="18.12,40.1 18.12,35.2 15.62,37.7 "/>
</g>
</g>
</g>
</g>
<g>
<path class="st6" d="M511.52,66.4c0,0.9-0.7,1.6-1.6,1.6s-1.6-0.7-1.6-1.6s0.7-1.6,1.6-1.6S511.52,65.5,511.52,66.4z"/>
<path class="st6" d="M525.32,66.4c0,0.9-0.7,1.6-1.6,1.6s-1.6-0.7-1.6-1.6s0.7-1.6,1.6-1.6S525.32,65.5,525.32,66.4z"/>
<path class="st6" d="M539.02,66.4c0,0.9-0.7,1.6-1.6,1.6c-0.9,0-1.6-0.7-1.6-1.6s0.7-1.6,1.6-1.6S539.02,65.5,539.02,66.4z"/>
<path class="st6" d="M552.82,66.4c0,0.9-0.7,1.6-1.6,1.6s-1.6-0.7-1.6-1.6s0.7-1.6,1.6-1.6S552.82,65.5,552.82,66.4z"/>
</g>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 2.3 KiB

-185
View File
@@ -1,185 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 26.0.2, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 869.6 127.5" style="enable-background:new 0 0 869.6 127.5;" xml:space="preserve">
<style type="text/css">
.st0{opacity:0.2;fill:#00983A;enable-background:new ;}
.st1{fill:#F2F3F3;}
.st2{fill:none;stroke:#7A8387;stroke-width:1.2;stroke-linecap:round;stroke-linejoin:round;}
.st3{fill:#00983A;}
.st4{fill:#F2F3F3;stroke:#7A8387;stroke-width:1.2;stroke-linecap:round;stroke-linejoin:round;}
.st5{fill:none;stroke:#576174;stroke-width:1.2;stroke-linecap:round;stroke-linejoin:round;}
.st6{fill:none;stroke:#576174;stroke-width:1.2;stroke-linecap:square;stroke-linejoin:round;}
.st7{font-family:'Courier-Bold';}
.st8{font-size:16.7604px;}
.st9{fill:none;stroke:#00983A;stroke-linecap:round;stroke-linejoin:round;}
.st10{fill:#7A8387;}
.st11{fill:#576174;}
.st12{fill:none;stroke:#576174;stroke-linecap:round;stroke-linejoin:round;}
.st13{fill:none;stroke:#7A8387;stroke-linecap:round;stroke-linejoin:round;}
.st14{fill:#333A45;}
</style>
<g>
<g>
<polyline class="st0" points="577.2,72.8 282.4,72.8 282.4,48 577.2,48 "/>
<g>
<g>
<g>
<polyline class="st1" points="122.6,72.8 5.9,72.8 5.9,48 122.6,48 "/>
<polyline class="st2" points="831.51,72.8 5.5,72.8 5.5,48 831.51,48 "/>
<polyline class="st3" points="282.7,72.5 122.5,72.5 122.5,47.7 282.7,47.7 "/>
<line class="st2" x1="122.5" y1="26.6" x2="122.5" y2="87.8"/>
<line class="st2" x1="283.3" y1="26.6" x2="283.3" y2="87.8"/>
<line class="st2" x1="576.8" y1="26.6" x2="576.8" y2="87.8"/>
<path class="st4" d="M831.51,72.8"/>
<line class="st5" x1="153.5" y1="48.3" x2="153.5" y2="72"/>
<line class="st2" x1="36.5" y1="48.3" x2="36.5" y2="72"/>
<line class="st2" x1="67.6" y1="48.3" x2="67.6" y2="72"/>
<line class="st5" x1="186" y1="48.3" x2="186" y2="72"/>
<line class="st5" x1="218.4" y1="48.3" x2="218.4" y2="72"/>
<line class="st5" x1="250.9" y1="48.3" x2="250.9" y2="72"/>
<line class="st2" x1="315.9" y1="48.3" x2="315.9" y2="72"/>
<line class="st2" x1="348.4" y1="48.3" x2="348.4" y2="72"/>
<line class="st2" x1="381.2" y1="48.3" x2="381.2" y2="72"/>
<line class="st2" x1="413.8" y1="48.3" x2="413.8" y2="72"/>
<line class="st2" x1="446.3" y1="48.3" x2="446.3" y2="72"/>
<line class="st2" x1="478.9" y1="48.3" x2="478.9" y2="72"/>
<line class="st5" x1="511.51" y1="48.3" x2="511.51" y2="72"/>
<line class="st2" x1="511.51" y1="48.3" x2="511.51" y2="72"/>
<line class="st5" x1="544.01" y1="48.3" x2="544.01" y2="72"/>
<line class="st2" x1="544.1" y1="48.3" x2="544.1" y2="72"/>
<line class="st6" x1="283.3" y1="73" x2="122.5" y2="72.8"/>
<line class="st6" x1="122.5" y1="48" x2="283.3" y2="48.1"/>
<path class="st4" d="M385.5,73"/>
<path class="st4" d="M385.5,49.3"/>
</g>
<g>
<text transform="matrix(1 0 0 1 127.5176 105.8013)" class="st3 st7 st8">buf</text>
</g>
<g>
<g>
<line class="st9" x1="122.2" y1="105.6" x2="122.2" y2="94.6"/>
<g>
<polygon class="st3" points="119.8,94.9 124.6,94.9 122.2,92.5 "/>
</g>
</g>
</g>
<g>
<text transform="matrix(1 0 0 1 286.6495 105.8008)" class="st3 st7 st8">len=5</text>
</g>
<g>
<g>
<line class="st9" x1="283.3" y1="105.6" x2="283.3" y2="94.6"/>
<g>
<polygon class="st3" points="280.9,94.9 285.8,94.9 283.3,92.5 "/>
</g>
</g>
</g>
<g>
<text transform="matrix(1 0 0 1 581.4624 105.8013)" class="st3 st7 st8">size=16</text>
</g>
<g>
<g>
<line class="st9" x1="576.9" y1="105.6" x2="576.9" y2="94.6"/>
<g>
<polygon class="st3" points="574.51,94.9 579.4,94.9 576.9,92.5 "/>
</g>
</g>
</g>
<g>
<path class="st10" d="M687.51,60.7c0,0.9-0.7,1.6-1.6,1.6s-1.6-0.7-1.6-1.6c0-0.9,0.7-1.6,1.6-1.6S687.51,59.9,687.51,60.7z"/>
<path class="st10" d="M701.2,60.7c0,0.9-0.7,1.6-1.6,1.6s-1.6-0.7-1.6-1.6c0-0.9,0.7-1.6,1.6-1.6S701.2,59.9,701.2,60.7z"/>
<path class="st10" d="M714.9,60.7c0,0.9-0.7,1.6-1.6,1.6c-0.9,0-1.6-0.7-1.6-1.6c0-0.9,0.7-1.6,1.6-1.6
C714.2,59.1,714.9,59.9,714.9,60.7z"/>
<path class="st10" d="M728.7,60.7c0,0.9-0.7,1.6-1.6,1.6s-1.6-0.7-1.6-1.6c0-0.9,0.7-1.6,1.6-1.6
C728.01,59.1,728.7,59.9,728.7,60.7z"/>
</g>
<g>
<path class="st10" d="M82.8,60.7c0,0.9-0.7,1.6-1.6,1.6s-1.6-0.7-1.6-1.6c0-0.9,0.7-1.6,1.6-1.6S82.8,59.9,82.8,60.7z"/>
<path class="st10" d="M96.5,60.7c0,0.9-0.7,1.6-1.6,1.6s-1.6-0.7-1.6-1.6c0-0.9,0.7-1.6,1.6-1.6C95.8,59.1,96.5,59.9,96.5,60.7
z"/>
<path class="st10" d="M110.2,60.7c0,0.9-0.7,1.6-1.6,1.6s-1.6-0.7-1.6-1.6c0-0.9,0.7-1.6,1.6-1.6S110.2,59.9,110.2,60.7z"/>
</g>
<g>
<g>
<text transform="matrix(1 0 0 1 180.6541 26.8123)" class="st11 st7 st8">data</text>
</g>
<g>
<text transform="matrix(1 0 0 1 387.363 26.8123)" class="st10 st7 st8">free space</text>
</g>
<g>
<g>
<line class="st12" x1="272.2" y1="33.6" x2="133.5" y2="33.6"/>
<g>
<polygon class="st11" points="271.9,36.2 273.5,33.6 271.9,31.1 271.8,31.1 271.8,36.2 "/>
</g>
<g>
<polygon class="st11" points="133.8,36.1 133.8,31.2 131.4,33.6 "/>
</g>
</g>
</g>
<g>
<g>
<line class="st13" x1="563.7" y1="33.6" x2="295.9" y2="33.6"/>
<g>
<polygon class="st10" points="563.4,36.1 563.4,31.2 565.8,33.6 "/>
</g>
<g>
<polygon class="st10" points="296.2,36.1 296.2,31.2 293.7,33.6 "/>
</g>
</g>
</g>
<g>
<text transform="matrix(1 0 0 1 615.4679 25.1898)" class="st10 st7 st8">non-allocated space</text>
</g>
<g>
<g>
<line class="st13" x1="593.7" y1="33.6" x2="829.7" y2="33.6"/>
<g>
<polygon class="st10" points="829.4,31.2 829.4,36.1 831.8,33.6 "/>
</g>
</g>
</g>
<g>
<g>
<line class="st13" x1="678.7" y1="33.6" x2="589.7" y2="33.6"/>
<g>
<polygon class="st10" points="590.01,36.1 590.01,31.2 587.6,33.6 "/>
</g>
</g>
</g>
</g>
<g>
<g>
<text transform="matrix(1 0 0 1 133.1212 64.9593)" class="st14 st7 st8">h</text>
</g>
</g>
<g>
<g>
<text transform="matrix(1 0 0 1 165.1564 64.9593)" class="st14 st7 st8">e</text>
</g>
</g>
<g>
<g>
<text transform="matrix(1 0 0 1 196.8744 64.9593)" class="st14 st7 st8">l</text>
</g>
</g>
<g>
<g>
<text transform="matrix(1 0 0 1 229.8611 64.9593)" class="st14 st7 st8">l</text>
</g>
</g>
<g>
<g>
<text transform="matrix(1 0 0 1 262.2135 64.9593)" class="st14 st7 st8">o</text>
</g>
</g>
</g>
</g>
</g>
<g>
<text transform="matrix(1 0 0 1 1.811981e-04 105.8011)" class="st3 st7 st8">0</text>
</g>
<line class="st2" x1="5.5" y1="26.4" x2="5.5" y2="87.6"/>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 7.1 KiB

-347
View File
@@ -1,347 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 26.0.2, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 869.6 247.73" style="enable-background:new 0 0 869.6 247.73;" xml:space="preserve">
<style type="text/css">
.st0{opacity:0.2;fill:#00983A;enable-background:new ;}
.st1{fill:#00983A;}
.st2{fill:#FF80A4;}
.st3{fill:#F2F3F3;}
.st4{fill:none;stroke:#7A8387;stroke-width:1.2;stroke-linecap:round;stroke-linejoin:round;}
.st5{fill:#F2F3F3;stroke:#7A8387;stroke-width:1.2;stroke-linecap:round;stroke-linejoin:round;}
.st6{fill:none;stroke:#576174;stroke-width:1.2;stroke-linecap:round;stroke-linejoin:round;}
.st7{fill:none;stroke:#576174;stroke-width:1.2;stroke-linejoin:round;}
.st8{fill:none;stroke:#576174;stroke-width:1.2;stroke-linecap:square;stroke-linejoin:round;}
.st9{font-family:'Courier-Bold';}
.st10{font-size:16.7604px;}
.st11{fill:none;stroke:#00983A;stroke-linecap:round;stroke-linejoin:round;}
.st12{fill:#7A8387;}
.st13{fill:#576174;}
.st14{fill:none;stroke:#576174;stroke-linecap:round;stroke-linejoin:round;}
.st15{fill:none;stroke:#7A8387;stroke-linecap:round;stroke-linejoin:round;}
.st16{fill:#333A45;}
</style>
<g>
<g>
<polyline class="st0" points="577.2,72.8 282.4,72.8 282.4,48 577.2,48 "/>
<g>
<g>
<g>
<rect x="250.9" y="47.7" class="st1" width="32.4" height="24.8"/>
<rect x="153.5" y="47.7" class="st2" width="97.3" height="24.8"/>
<polyline class="st3" points="122.6,72.8 5.9,72.8 5.9,48 122.6,48 "/>
<polyline class="st4" points="831.51,72.8 5.5,72.8 5.5,48 831.51,48 "/>
<rect x="122.5" y="47.7" class="st1" width="31" height="24.8"/>
<line class="st4" x1="122.5" y1="26.6" x2="122.5" y2="87.8"/>
<line class="st4" x1="576.8" y1="26.6" x2="576.8" y2="87.8"/>
<path class="st5" d="M831.51,72.8"/>
<line class="st6" x1="153.5" y1="48.3" x2="153.5" y2="72"/>
<line class="st4" x1="36.5" y1="48.3" x2="36.5" y2="72"/>
<line class="st4" x1="67.6" y1="48.3" x2="67.6" y2="72"/>
<line class="st6" x1="186" y1="48.3" x2="186" y2="72"/>
<line class="st6" x1="218.4" y1="48.3" x2="218.4" y2="72"/>
<line class="st7" x1="250.9" y1="73" x2="250.81" y2="47.7"/>
<line class="st4" x1="315.9" y1="48.3" x2="315.9" y2="72"/>
<line class="st4" x1="348.4" y1="48.3" x2="348.4" y2="72"/>
<line class="st4" x1="381.2" y1="48.3" x2="381.2" y2="72"/>
<line class="st4" x1="413.8" y1="48.3" x2="413.8" y2="72"/>
<line class="st4" x1="446.3" y1="48.3" x2="446.3" y2="72"/>
<line class="st4" x1="478.9" y1="48.3" x2="478.9" y2="72"/>
<line class="st6" x1="511.51" y1="48.3" x2="511.51" y2="72"/>
<line class="st4" x1="511.51" y1="48.3" x2="511.51" y2="72"/>
<line class="st6" x1="544.01" y1="48.3" x2="544.01" y2="72"/>
<line class="st4" x1="544.1" y1="48.3" x2="544.1" y2="72"/>
<line class="st8" x1="283.3" y1="73" x2="122.5" y2="72.8"/>
<line class="st8" x1="122.5" y1="48" x2="283.3" y2="48.1"/>
<path class="st5" d="M385.5,73"/>
<path class="st5" d="M385.5,49.3"/>
<line class="st4" x1="283.3" y1="26.6" x2="283.3" y2="87.8"/>
</g>
<g>
<text transform="matrix(1 0 0 1 127.5176 105.8013)" class="st1 st9 st10">buf</text>
</g>
<g>
<g>
<line class="st11" x1="122.2" y1="105.6" x2="122.2" y2="94.6"/>
<g>
<polygon class="st1" points="119.8,94.9 124.6,94.9 122.2,92.5 "/>
</g>
</g>
</g>
<g>
<text transform="matrix(1 0 0 1 286.6495 105.8008)" class="st1 st9 st10">len=5</text>
</g>
<g>
<g>
<line class="st11" x1="283.3" y1="105.6" x2="283.3" y2="94.6"/>
<g>
<polygon class="st1" points="280.9,94.9 285.8,94.9 283.3,92.5 "/>
</g>
</g>
</g>
<g>
<text transform="matrix(1 0 0 1 581.4624 105.8013)" class="st1 st9 st10">size=16</text>
</g>
<g>
<g>
<line class="st11" x1="576.9" y1="105.6" x2="576.9" y2="94.6"/>
<g>
<polygon class="st1" points="574.51,94.9 579.4,94.9 576.9,92.5 "/>
</g>
</g>
</g>
<g>
<path class="st12" d="M687.51,60.7c0,0.9-0.7,1.6-1.6,1.6s-1.6-0.7-1.6-1.6c0-0.9,0.7-1.6,1.6-1.6S687.51,59.9,687.51,60.7z"/>
<path class="st12" d="M701.2,60.7c0,0.9-0.7,1.6-1.6,1.6s-1.6-0.7-1.6-1.6c0-0.9,0.7-1.6,1.6-1.6S701.2,59.9,701.2,60.7z"/>
<path class="st12" d="M714.9,60.7c0,0.9-0.7,1.6-1.6,1.6c-0.9,0-1.6-0.7-1.6-1.6c0-0.9,0.7-1.6,1.6-1.6
C714.2,59.1,714.9,59.9,714.9,60.7z"/>
<path class="st12" d="M728.7,60.7c0,0.9-0.7,1.6-1.6,1.6s-1.6-0.7-1.6-1.6c0-0.9,0.7-1.6,1.6-1.6
C728.01,59.1,728.7,59.9,728.7,60.7z"/>
</g>
<g>
<path class="st12" d="M82.8,60.7c0,0.9-0.7,1.6-1.6,1.6s-1.6-0.7-1.6-1.6c0-0.9,0.7-1.6,1.6-1.6S82.8,59.9,82.8,60.7z"/>
<path class="st12" d="M96.5,60.7c0,0.9-0.7,1.6-1.6,1.6s-1.6-0.7-1.6-1.6c0-0.9,0.7-1.6,1.6-1.6C95.8,59.1,96.5,59.9,96.5,60.7
z"/>
<path class="st12" d="M110.2,60.7c0,0.9-0.7,1.6-1.6,1.6s-1.6-0.7-1.6-1.6c0-0.9,0.7-1.6,1.6-1.6S110.2,59.9,110.2,60.7z"/>
</g>
<g>
<g>
<text transform="matrix(1 0 0 1 180.6541 26.8123)" class="st13 st9 st10">data</text>
</g>
<g>
<text transform="matrix(1 0 0 1 387.363 26.8123)" class="st12 st9 st10">free space</text>
</g>
<g>
<g>
<line class="st14" x1="272.2" y1="33.6" x2="133.5" y2="33.6"/>
<g>
<polygon class="st13" points="271.9,36.2 273.5,33.6 271.9,31.1 271.8,31.1 271.8,36.2 "/>
</g>
<g>
<polygon class="st13" points="133.8,36.1 133.8,31.2 131.4,33.6 "/>
</g>
</g>
</g>
<g>
<g>
<line class="st15" x1="563.7" y1="33.6" x2="295.9" y2="33.6"/>
<g>
<polygon class="st12" points="563.4,36.1 563.4,31.2 565.8,33.6 "/>
</g>
<g>
<polygon class="st12" points="296.2,36.1 296.2,31.2 293.7,33.6 "/>
</g>
</g>
</g>
<g>
<text transform="matrix(1 0 0 1 615.4679 25.1898)" class="st12 st9 st10">non-allocated space</text>
</g>
<g>
<g>
<line class="st15" x1="593.7" y1="33.6" x2="829.7" y2="33.6"/>
<g>
<polygon class="st12" points="829.4,31.2 829.4,36.1 831.8,33.6 "/>
</g>
</g>
</g>
<g>
<g>
<line class="st15" x1="678.7" y1="33.6" x2="589.7" y2="33.6"/>
<g>
<polygon class="st12" points="590.01,36.1 590.01,31.2 587.6,33.6 "/>
</g>
</g>
</g>
</g>
<g>
<g>
<text transform="matrix(1 0 0 1 133.1212 64.9593)" class="st16 st9 st10">h</text>
</g>
</g>
<g>
<g>
<g>
<text transform="matrix(1 0 0 1 165.1564 64.9593)" class="st16 st9 st10">e</text>
</g>
</g>
</g>
<g>
<g>
<g>
<text transform="matrix(1 0 0 1 196.8744 64.9593)" class="st16 st9 st10">l</text>
</g>
</g>
</g>
<g>
<g>
<g>
<text transform="matrix(1 0 0 1 229.8611 64.9593)" class="st16 st9 st10">l</text>
</g>
</g>
</g>
<g>
<g>
<text transform="matrix(1 0 0 1 262.2135 64.9593)" class="st16 st9 st10">o</text>
</g>
</g>
</g>
</g>
</g>
<g>
<text transform="matrix(1 0 0 1 1.811981e-04 105.8011)" class="st1 st9 st10">0</text>
</g>
<line class="st4" x1="5.5" y1="26.4" x2="5.5" y2="87.6"/>
</g>
<g>
<g>
<polyline class="st0" points="577.2,207.99 186.3,207.99 186.3,183.19 577.2,183.19 "/>
<g>
<g>
<g>
<polyline class="st3" points="122.6,207.99 5.9,207.99 5.9,183.19 122.6,183.19 "/>
<polyline class="st4" points="831.51,207.99 5.5,207.99 5.5,183.19 831.51,183.19 "/>
<polyline class="st1" points="186.3,207.69 122.5,207.69 122.5,182.89 186.3,182.89 "/>
<line class="st4" x1="122.5" y1="161.79" x2="122.5" y2="222.99"/>
<line class="st4" x1="186" y1="161.79" x2="186" y2="222.99"/>
<line class="st4" x1="576.8" y1="161.79" x2="576.8" y2="222.99"/>
<path class="st5" d="M831.51,207.99"/>
<line class="st6" x1="153.5" y1="183.49" x2="153.5" y2="207.19"/>
<line class="st4" x1="36.5" y1="183.49" x2="36.5" y2="207.19"/>
<line class="st4" x1="67.6" y1="183.49" x2="67.6" y2="207.19"/>
<line class="st6" x1="186" y1="183.49" x2="186" y2="207.99"/>
<line class="st4" x1="218.4" y1="183.49" x2="218.4" y2="207.19"/>
<line class="st4" x1="250.9" y1="183.49" x2="250.9" y2="207.19"/>
<line class="st4" x1="283.3" y1="183.49" x2="283.3" y2="207.19"/>
<line class="st4" x1="315.9" y1="183.49" x2="315.9" y2="207.19"/>
<line class="st4" x1="348.4" y1="183.49" x2="348.4" y2="207.19"/>
<line class="st4" x1="381.2" y1="183.49" x2="381.2" y2="207.19"/>
<line class="st4" x1="413.8" y1="183.49" x2="413.8" y2="207.19"/>
<line class="st4" x1="446.3" y1="183.49" x2="446.3" y2="207.19"/>
<line class="st4" x1="478.9" y1="183.49" x2="478.9" y2="207.19"/>
<line class="st6" x1="511.51" y1="183.49" x2="511.51" y2="207.19"/>
<line class="st4" x1="511.51" y1="183.49" x2="511.51" y2="207.19"/>
<line class="st6" x1="544.01" y1="183.49" x2="544.01" y2="207.19"/>
<line class="st4" x1="544.1" y1="183.49" x2="544.1" y2="207.19"/>
<line class="st8" x1="186" y1="208.19" x2="122.5" y2="207.99"/>
<line class="st8" x1="122.5" y1="183.19" x2="186" y2="183.29"/>
<path class="st5" d="M385.5,208.19"/>
<path class="st5" d="M385.5,184.49"/>
</g>
<g>
<text transform="matrix(1 0 0 1 127.5176 240.9952)" class="st1 st9 st10">buf</text>
</g>
<g>
<g>
<line class="st11" x1="122.2" y1="240.79" x2="122.2" y2="229.79"/>
<g>
<polygon class="st1" points="119.8,230.09 124.6,230.09 122.2,227.69 "/>
</g>
</g>
</g>
<g>
<text transform="matrix(1 0 0 1 189.2273 240.9947)" class="st1 st9 st10">len=2</text>
</g>
<g>
<g>
<line class="st11" x1="185.88" y1="240.79" x2="185.88" y2="229.79"/>
<g>
<polygon class="st1" points="183.48,230.09 188.38,230.09 185.88,227.69 "/>
</g>
</g>
</g>
<g>
<text transform="matrix(1 0 0 1 581.4624 240.9952)" class="st1 st9 st10">size=16</text>
</g>
<g>
<g>
<line class="st11" x1="576.9" y1="240.79" x2="576.9" y2="229.79"/>
<g>
<polygon class="st1" points="574.51,230.09 579.4,230.09 576.9,227.69 "/>
</g>
</g>
</g>
<g>
<path class="st12" d="M687.51,195.89c0,0.9-0.7,1.6-1.6,1.6s-1.6-0.7-1.6-1.6c0-0.9,0.7-1.6,1.6-1.6
S687.51,195.09,687.51,195.89z"/>
<path class="st12" d="M701.2,195.89c0,0.9-0.7,1.6-1.6,1.6s-1.6-0.7-1.6-1.6c0-0.9,0.7-1.6,1.6-1.6S701.2,195.09,701.2,195.89z
"/>
<path class="st12" d="M714.9,195.89c0,0.9-0.7,1.6-1.6,1.6c-0.9,0-1.6-0.7-1.6-1.6c0-0.9,0.7-1.6,1.6-1.6
S714.9,195.09,714.9,195.89z"/>
<path class="st12" d="M728.7,195.89c0,0.9-0.7,1.6-1.6,1.6s-1.6-0.7-1.6-1.6c0-0.9,0.7-1.6,1.6-1.6
C728.01,194.29,728.7,195.09,728.7,195.89z"/>
</g>
<g>
<path class="st12" d="M82.8,195.89c0,0.9-0.7,1.6-1.6,1.6s-1.6-0.7-1.6-1.6c0-0.9,0.7-1.6,1.6-1.6S82.8,195.09,82.8,195.89z"/>
<path class="st12" d="M96.5,195.89c0,0.9-0.7,1.6-1.6,1.6s-1.6-0.7-1.6-1.6c0-0.9,0.7-1.6,1.6-1.6
C95.8,194.29,96.5,195.09,96.5,195.89z"/>
<path class="st12" d="M110.2,195.89c0,0.9-0.7,1.6-1.6,1.6s-1.6-0.7-1.6-1.6c0-0.9,0.7-1.6,1.6-1.6S110.2,195.09,110.2,195.89z
"/>
</g>
<g>
<g>
<text transform="matrix(1 0 0 1 133.6541 162.0062)" class="st13 st9 st10">data</text>
</g>
<g>
<text transform="matrix(1 0 0 1 327.363 162.0062)" class="st12 st9 st10">free space</text>
</g>
<g>
<g>
<line class="st14" x1="175.2" y1="168.79" x2="133.5" y2="168.79"/>
<g>
<polygon class="st13" points="174.9,171.39 176.5,168.79 174.9,166.29 174.8,166.29 174.8,171.39 "/>
</g>
<g>
<polygon class="st13" points="133.8,171.29 133.8,166.39 131.4,168.79 "/>
</g>
</g>
</g>
<g>
<g>
<line class="st15" x1="563.7" y1="168.79" x2="197.49" y2="168.79"/>
<g>
<polygon class="st12" points="563.4,171.29 563.4,166.39 565.8,168.79 "/>
</g>
<g>
<polygon class="st12" points="197.79,171.29 197.79,166.39 195.29,168.79 "/>
</g>
</g>
</g>
<g>
<text transform="matrix(1 0 0 1 615.4679 160.3837)" class="st12 st9 st10">non-allocated space</text>
</g>
<g>
<g>
<line class="st15" x1="593.7" y1="168.79" x2="829.7" y2="168.79"/>
<g>
<polygon class="st12" points="829.4,166.39 829.4,171.29 831.8,168.79 "/>
</g>
</g>
</g>
<g>
<g>
<line class="st15" x1="678.7" y1="168.79" x2="589.7" y2="168.79"/>
<g>
<polygon class="st12" points="590.01,171.29 590.01,166.39 587.6,168.79 "/>
</g>
</g>
</g>
</g>
<g>
<g>
<text transform="matrix(1 0 0 1 133.1212 200.1532)" class="st16 st9 st10">h</text>
</g>
</g>
<g>
<g>
<text transform="matrix(1 0 0 1 165.1565 200.1532)" class="st16 st9 st10">o</text>
</g>
</g>
</g>
</g>
</g>
<g>
<text transform="matrix(1 0 0 1 1.811981e-04 240.995)" class="st1 st9 st10">0</text>
</g>
<line class="st4" x1="5.5" y1="161.59" x2="5.5" y2="222.79"/>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 13 KiB

-384
View File
@@ -1,384 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 25.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 858.5 424.3" style="enable-background:new 0 0 858.5 424.3;" xml:space="preserve">
<style type="text/css">
.st0{fill:#9E9B83;}
.st1{fill:#9E8900;}
.st2{font-family:Arial;font-weight:bold;}
.st3{font-size:11px;}
.st4{display:none;fill:#576174;}
.st5{fill:#1F5F75;}
.st6{clip-path:url(#SVGID_3_);fill:#FFFFFF;fill-opacity:0.1;}
.st7{fill:#277691;}
.st8{fill:#FFFFFF;}
.st9{font-family:Arial;font-weight:bold;}
.st10{fill:#004219;}
.st11{clip-path:url(#SVGID_6_);fill:#FFFFFF;fill-opacity:0.1;}
.st12{fill:#005721;}
.st13{fill:url(#SVGID_7_);}
.st14{clip-path:url(#XMLID_13_);fill:#FFFFFF;fill-opacity:0.1;}
.st15{fill:#752E06;}
.st16{fill:#963B08;}
.st17{fill:#59008F;}
.st18{clip-path:url(#XMLID_15_);fill:#FFFFFF;fill-opacity:0.1;}
.st19{fill:#7300B8;}
.st20{fill:#FFDE00;}
.st21{fill:#576174;}
.st22{font-size:13px;}
.st23{fill:#8A8C8E;}
.st24{font-size:12px;}
.st25{opacity:0.69;}
.st26{fill:#B3B1B3;}
.st27{clip-path:url(#XMLID_17_);fill:#FFFFFF;fill-opacity:0.1;}
.st28{fill:#919091;}
.st29{fill:#BFBEBF;}
.st30{fill:#454445;}
.st31{font-size:9px;}
.st32{clip-path:url(#XMLID_19_);fill:#FFFFFF;fill-opacity:0.1;}
.st33{fill:#8695B3;}
.st34{fill:url(#SVGID_8_);}
.st35{font-size:18px;}
.st36{clip-path:url(#XMLID_20_);fill:#610041;fill-opacity:0.1;}
.st37{fill:#610041;}
.st38{clip-path:url(#XMLID_22_);fill:url(#SVGID_9_);fill-opacity:0.1;}
.st39{fill:none;stroke:#86005B;stroke-width:0.5;stroke-linecap:round;stroke-miterlimit:10;}
.st40{fill:none;stroke:#86005B;stroke-width:0.75;stroke-linecap:round;stroke-miterlimit:10;}
.st41{fill:url(#SVGID_10_);}
.st42{fill:url(#SVGID_11_);}
.st43{fill:#610042;}
.st44{fill:url(#SVGID_12_);}
</style>
<g>
<g>
<path class="st0" d="M457.9,111.2l0.1,87.3c0,1.4-1.1,2.6-2.5,2.6h-76.3c-4.4-0.2-7.3-3.9-7.3-5.3l4.7-101.8
c0-1.4,0.8-7.4,2.2-7.4l54-0.1L457.9,111.2z"/>
</g>
<g>
<text transform="matrix(1 0 0 1 383.2604 149.9447)" class="st1 st2 st3">packed_fs.c</text>
</g>
</g>
<rect x="84" y="25" class="st4" width="727.7" height="429.8"/>
<g>
<g>
<path class="st5" d="M207.5,104.6v87.4c0,1.4-1.1,2.6-2.5,2.6h-78.3c-1.4,0-2.5-1.1-2.5-2.6V84.5c0-1.4,1.1-2.5,2.5-2.5h58
L207.5,104.6z"/>
<g>
<defs>
<path id="SVGID_1_" d="M205.5,102.6v87.4c0,1.4-1.1,2.6-2.5,2.6h-78.3c-1.4,0-2.5-1.1-2.5-2.6v-57.5V82.5c0-1.4,1.1-2.5,2.5-2.5
h58L205.5,102.6z"/>
</defs>
<linearGradient id="SVGID_2_" gradientUnits="userSpaceOnUse" x1="122.1091" y1="136.2824" x2="205.5191" y2="136.2824">
<stop offset="0" style="stop-color:#45CFFF"/>
<stop offset="1" style="stop-color:#85DDFA"/>
</linearGradient>
<use xlink:href="#SVGID_1_" style="overflow:visible;fill:url(#SVGID_2_);"/>
<clipPath id="SVGID_3_">
<use xlink:href="#SVGID_1_" style="overflow:visible;"/>
</clipPath>
<path class="st6" d="M121.4,101.4c9.4,0.7,36.6,1.5,53.2,14.7c25,20,31.2,47.1,31.2,47.1l0.4,35.3l-84.8,0.2V101.4z"/>
</g>
<path class="st5" d="M205.9,104.4l-20.6,0c-1.4,0-2.6-1.2-2.6-2.6l0-21.8l22.9,22.7L205.9,104.4z"/>
<path class="st7" d="M205.7,102.8h-20.5c-1.4,0-2.5-1.1-2.5-2.5V79.9l0,0l22.9,22.7L205.7,102.8z"/>
<g>
<text transform="matrix(1 0 0 1 129.0689 92.8531)" class="st8 st9 st3">filex.y</text>
</g>
</g>
<g>
<path class="st10" d="M191.4,121.6V209c0,1.4-1.1,2.6-2.5,2.6h-78.3c-1.4,0-2.5-1.1-2.5-2.6V101.4c0-1.4,1.1-2.5,2.5-2.5h58
L191.4,121.6z"/>
<g>
<defs>
<path id="SVGID_4_" d="M189.4,119.6V207c0,1.4-1.1,2.6-2.5,2.6h-78.3c-1.4,0-2.5-1.1-2.5-2.6v-57.5V99.4c0-1.4,1.1-2.5,2.5-2.5
h58L189.4,119.6z"/>
</defs>
<linearGradient id="SVGID_5_" gradientUnits="userSpaceOnUse" x1="106.0386" y1="153.2384" x2="189.4486" y2="153.2384">
<stop offset="0" style="stop-color:#00983A"/>
<stop offset="1" style="stop-color:#3A985D"/>
</linearGradient>
<use xlink:href="#SVGID_4_" style="overflow:visible;fill:url(#SVGID_5_);"/>
<clipPath id="SVGID_6_">
<use xlink:href="#SVGID_4_" style="overflow:visible;"/>
</clipPath>
<path class="st11" d="M105.3,118.3c9.4,0.7,36.6,1.5,53.2,14.7c25,20,31.2,47.1,31.2,47.1l0.4,35.3l-84.8,0.2V118.3z"/>
</g>
<path class="st10" d="M189.8,121.3l-20.6,0c-1.4,0-2.6-1.2-2.6-2.6l0-21.8l22.9,22.7L189.8,121.3z"/>
<path class="st12" d="M189.6,119.7h-20.5c-1.4,0-2.5-1.1-2.5-2.5V96.9l0,0l22.9,22.7L189.6,119.7z"/>
<g>
<text transform="matrix(1 0 0 1 113.9984 109.809)" class="st8 st9 st3">main.js</text>
</g>
</g>
<g>
<linearGradient id="SVGID_7_" gradientUnits="userSpaceOnUse" x1="93.2369" y1="173.2516" x2="176.6469" y2="173.2516">
<stop offset="0" style="stop-color:#EA5B0C"/>
<stop offset="1" style="stop-color:#EA671E"/>
</linearGradient>
<path class="st13" d="M176.6,139.6V227c0,1.4-1.1,2.6-2.5,2.6H95.8c-1.4,0-2.5-1.1-2.5-2.6V119.5c0-1.4,1.1-2.5,2.5-2.5h58
L176.6,139.6z"/>
<g>
<defs>
<path id="XMLID_2_" d="M174.6,137.6V225c0,1.4-1.1,2.6-2.5,2.6H93.8c-1.4,0-2.5-1.1-2.5-2.6v-57.5v-50.1c0-1.4,1.1-2.5,2.5-2.5
h58L174.6,137.6z"/>
</defs>
<linearGradient id="XMLID_12_" gradientUnits="userSpaceOnUse" x1="91.2369" y1="171.2516" x2="174.6469" y2="171.2516">
<stop offset="0" style="stop-color:#EA5B0C"/>
<stop offset="1" style="stop-color:#EA7B3D"/>
</linearGradient>
<use xlink:href="#XMLID_2_" style="overflow:visible;fill:url(#XMLID_12_);"/>
<clipPath id="XMLID_13_">
<use xlink:href="#XMLID_2_" style="overflow:visible;"/>
</clipPath>
<path class="st14" d="M90.5,136.3c9.4,0.7,36.6,1.5,53.2,14.7c25,20,31.2,47.1,31.2,47.1l0.4,35.3l-84.8,0.2V136.3z"/>
</g>
<path class="st15" d="M175,139.3l-20.6,0c-1.4,0-2.6-1.2-2.6-2.6l0-21.8l22.9,22.7L175,139.3z"/>
<path class="st16" d="M174.8,137.7h-20.5c-1.4,0-2.5-1.1-2.5-2.5v-20.3l0,0l22.9,22.7L174.8,137.7z"/>
<g>
<text transform="matrix(1 0 0 1 97.1967 127.8222)" class="st8 st9 st3">style.css</text>
</g>
</g>
<g>
<path class="st17" d="M164.6,157.7v87.4c0,1.4-1.1,2.6-2.5,2.6H83.8c-1.4,0-2.5-1.1-2.5-2.6V137.5c0-1.4,1.1-2.5,2.5-2.5h58
L164.6,157.7z"/>
<g>
<defs>
<path id="XMLID_1_" d="M162.6,155.7v87.4c0,1.4-1.1,2.6-2.5,2.6H81.8c-1.4,0-2.5-1.1-2.5-2.6v-57.5v-50.1c0-1.4,1.1-2.5,2.5-2.5
h58L162.6,155.7z"/>
</defs>
<linearGradient id="XMLID_14_" gradientUnits="userSpaceOnUse" x1="79.2009" y1="189.3131" x2="162.6108" y2="189.3131">
<stop offset="0" style="stop-color:#A000FF"/>
<stop offset="1" style="stop-color:#C96EFF"/>
</linearGradient>
<use xlink:href="#XMLID_1_" style="overflow:visible;fill:url(#XMLID_14_);"/>
<clipPath id="XMLID_15_">
<use xlink:href="#XMLID_1_" style="overflow:visible;"/>
</clipPath>
<path class="st18" d="M78.5,154.4c9.4,0.7,36.6,1.5,53.2,14.7c25,20,31.2,47.1,31.2,47.1l0.4,35.3l-84.8,0.2V154.4z"/>
</g>
<path class="st17" d="M163,157.4l-20.6,0c-1.4,0-2.6-1.2-2.6-2.6l0-21.8l22.9,22.7L163,157.4z"/>
<path class="st19" d="M162.8,155.8h-20.5c-1.4,0-2.5-1.1-2.5-2.5V133l0,0l22.9,22.7L162.8,155.8z"/>
<g>
<text transform="matrix(1 0 0 1 83.1607 145.8838)" class="st8 st9 st3">index.html</text>
</g>
</g>
</g>
<g>
<g>
<path class="st20" d="M455.2,108.2v87.4c0,1.4-1.1,2.6-2.5,2.6h-78.3c-1.4,0-2.5-1.1-2.5-2.6V88.1c0-1.4,1.1-2.5,2.5-2.5h58
L455.2,108.2z"/>
<path class="st0" d="M455.3,110.3l-18.4,0c-1.4,0-2.5-1.1-2.5-2.5V87.5l0,0l20.9,20.7L455.3,110.3z"/>
<polygon class="st0" points="435.2,109.7 432.9,107.3 436.3,106.9 "/>
<path class="st1" d="M455.4,108.3h-20.5c-1.4,0-2.5-1.1-2.5-2.5V85.5l0,0l22.9,22.7L455.4,108.3z"/>
</g>
<g>
<text transform="matrix(1 0 0 1 379.2604 144.9447)" class="st21 st9 st22">packed_fs.c</text>
</g>
</g>
<g>
<polygon class="st23" points="483.6,195.4 397.3,195.4 394.3,193.4 397.3,162.8 481.5,159.7 483.6,162.8 "/>
<rect x="394.3" y="159.8" class="st21" width="87.3" height="33.7"/>
<g>
<g>
<text transform="matrix(1 0 0 1 400.0845 171.7588)" class="st8 st9 st24">mg_unpack()</text>
</g>
<g>
<text transform="matrix(1 0 0 1 400.0845 186.935)" class="st8 st9 st24">mg_unlist()</text>
</g>
</g>
</g>
<g class="st25">
<g>
<path class="st26" d="M467.7,256.6V344c0,1.4-1.1,2.6-2.5,2.6h-78.3c-1.4,0-2.5-1.1-2.5-2.6V236.4c0-1.4,1.1-2.5,2.5-2.5h58
L467.7,256.6z"/>
<g>
<defs>
<path id="XMLID_9_" d="M465.7,254.6V342c0,1.4-1.1,2.6-2.5,2.6h-78.3c-1.4,0-2.5-1.1-2.5-2.6v-57.5v-50.1c0-1.4,1.1-2.5,2.5-2.5
h58L465.7,254.6z"/>
</defs>
<linearGradient id="XMLID_16_" gradientUnits="userSpaceOnUse" x1="382.3115" y1="288.2073" x2="465.7215" y2="288.2073">
<stop offset="0" style="stop-color:#D6D4D6"/>
<stop offset="1" style="stop-color:#FFFDFE"/>
</linearGradient>
<use xlink:href="#XMLID_9_" style="overflow:visible;fill:url(#XMLID_16_);"/>
<clipPath id="XMLID_17_">
<use xlink:href="#XMLID_9_" style="overflow:visible;"/>
</clipPath>
<path class="st27" d="M381.6,253.3c9.4,0.7,36.6,1.5,53.2,14.7c25,20,31.2,47.1,31.2,47.1l0.4,35.3l-84.8,0.2V253.3z"/>
</g>
<path class="st28" d="M466.1,256.3l-20.6,0c-1.4,0-2.6-1.2-2.6-2.6l0-21.8l22.9,22.7L466.1,256.3z"/>
<path class="st29" d="M465.9,254.7h-20.5c-1.4,0-2.5-1.1-2.5-2.5v-20.3l0,0l22.9,22.7L465.9,254.7z"/>
<text transform="matrix(1 0 0 1 386.2713 244.7779)" class="st30 st9 st31">mongoose.c</text>
</g>
<g>
<path class="st26" d="M455.7,276.6v87.4c0,1.4-1.1,2.6-2.5,2.6h-78.3c-1.4,0-2.5-1.1-2.5-2.6V256.5c0-1.4,1.1-2.5,2.5-2.5h58
L455.7,276.6z"/>
<g>
<defs>
<path id="XMLID_8_" d="M453.7,274.6v87.4c0,1.4-1.1,2.6-2.5,2.6h-78.3c-1.4,0-2.5-1.1-2.5-2.6v-57.5v-50.1
c0-1.4,1.1-2.5,2.5-2.5h58L453.7,274.6z"/>
</defs>
<linearGradient id="XMLID_18_" gradientUnits="userSpaceOnUse" x1="370.2755" y1="308.2689" x2="453.6855" y2="308.2689">
<stop offset="0" style="stop-color:#D6D4D6"/>
<stop offset="1" style="stop-color:#FFFDFE"/>
</linearGradient>
<use xlink:href="#XMLID_8_" style="overflow:visible;fill:url(#XMLID_18_);"/>
<clipPath id="XMLID_19_">
<use xlink:href="#XMLID_8_" style="overflow:visible;"/>
</clipPath>
<path class="st32" d="M369.6,273.3c9.4,0.7,36.6,1.5,53.2,14.7c25,20,31.2,47.1,31.2,47.1l0.4,35.3l-84.8,0.2V273.3z"/>
<use xlink:href="#XMLID_8_" style="overflow:visible;fill:none;stroke:#FFFDFE;stroke-width:0.25;stroke-miterlimit:10;"/>
</g>
<path class="st28" d="M454,276.4l-20.6,0c-1.4,0-2.6-1.2-2.6-2.6l0-21.8l22.9,22.7L454,276.4z"/>
<path class="st29" d="M453.8,274.8h-20.5c-1.4,0-2.5-1.1-2.5-2.5v-20.3l0,0l22.9,22.7L453.8,274.8z"/>
<text transform="matrix(1 0 0 1 379.2353 264.8395)" class="st30 st9 st31">app.c</text>
</g>
</g>
<g>
<polygon class="st33" points="342.3,123.3 351.1,141.7 342.3,160.7 234.8,160.9 234.8,122.6 "/>
<path class="st23" d="M347.4,145.4"/>
<linearGradient id="SVGID_8_" gradientUnits="userSpaceOnUse" x1="233.6667" y1="139.4088" x2="350.0318" y2="139.4088">
<stop offset="0" style="stop-color:#C1D5FF"/>
<stop offset="0.1995" style="stop-color:#BACDF6"/>
<stop offset="0.6001" style="stop-color:#B0C3EA"/>
<stop offset="1" style="stop-color:#ADC0E6"/>
</linearGradient>
<polygon class="st34" points="341.2,120.9 350,139.3 341.2,158.3 233.7,158.5 233.7,120.3 "/>
<text transform="matrix(1 0 0 1 262.9869 146.2633)" class="st8 st9 st35">PACK</text>
<polygon class="st33" points="234.8,160.9 233.7,158.5 238,158.7 "/>
</g>
<g>
<path class="st23" d="M634.9,144.6L634.9,144.6z"/>
</g>
<g>
<polygon class="st33" points="619.6,139.3 619.6,139.3 618.7,137.4 618.7,137.4 "/>
<path class="st23" d="M623.1,168.2L623.1,168.2z"/>
</g>
<g>
<polygon class="st33" points="619.6,288.1 618.7,290 618.7,290 619.6,288.1 "/>
<path class="st23" d="M623.1,259.2L623.1,259.2z"/>
</g>
<g>
<path class="st23" d="M617,282L617,282z"/>
</g>
<g>
<g>
<g>
<defs>
<path id="XMLID_10_" d="M722.7,276.5h-71.2c-11.6,0-21.1-9.4-21.1-21.1v-71.2c0-11.6,9.4-21.1,21.1-21.1h71.2
c11.6,0,21.1,9.4,21.1,21.1v71.2C743.8,267,734.4,276.5,722.7,276.5z"/>
</defs>
<use xlink:href="#XMLID_10_" style="overflow:visible;fill:#610041;"/>
<clipPath id="XMLID_20_">
<use xlink:href="#XMLID_10_" style="overflow:visible;"/>
</clipPath>
<path class="st36" d="M754.3,172.5c-2.7,8-17.3,30.9-65.8,30.8c-24.5,0-48.4-7.4-65.7-24.7l-12.1-12l69.3-64.6L754.3,172.5z"/>
</g>
<polygon class="st37" points="637.6,271.2 632.5,266.1 640.3,269.4 "/>
<polygon class="st37" points="738.3,169.9 734.6,166.2 736.4,171 "/>
<g>
<defs>
<path id="XMLID_5_" d="M719.7,273.5h-71.2c-11.6,0-21.1-9.4-21.1-21.1v-71.2c0-11.6,9.4-21.1,21.1-21.1h71.2
c11.6,0,21.1,9.4,21.1,21.1v71.2C740.8,264,731.4,273.5,719.7,273.5z"/>
</defs>
<radialGradient id="XMLID_21_" cx="684.119" cy="216.7761" r="56.6929" gradientUnits="userSpaceOnUse">
<stop offset="0" style="stop-color:#8B005D;stop-opacity:0.7"/>
<stop offset="1" style="stop-color:#8B005D"/>
</radialGradient>
<use xlink:href="#XMLID_5_" style="overflow:visible;fill:url(#XMLID_21_);"/>
<clipPath id="XMLID_22_">
<use xlink:href="#XMLID_5_" style="overflow:visible;"/>
</clipPath>
<radialGradient id="SVGID_9_" cx="678.486" cy="148.5836" r="90.2195" gradientUnits="userSpaceOnUse">
<stop offset="0" style="stop-color:#8B005D"/>
<stop offset="1" style="stop-color:#FFFFFF"/>
</radialGradient>
<path class="st38" d="M750.3,168.5c-2.7,8-17.3,30.9-65.8,30.8c-24.5,0-48.4-7.4-65.7-24.7l-12.1-12L676,97.9L750.3,168.5z"/>
</g>
<g>
<g>
<g>
<g>
<text transform="matrix(1 0 0 1 646.3768 216.49)" class="st8 st9 st35">APP.EXE</text>
</g>
</g>
</g>
</g>
</g>
<g>
<g>
<g>
<path class="st8" d="M732,240.1c-0.3-1.4-0.8-2.7-1.4-3.9l1.7-2.3c-0.3-0.5-0.6-0.9-1-1.4c-0.3-0.5-0.7-0.9-1.1-1.3l-2.7,1
c-1-1-2.2-1.8-3.4-2.4l0-2.9c-1-0.4-2.1-0.8-3.2-1l-1.5,2.4c-1.4-0.2-2.8-0.2-4.1,0l-1.7-2.4c-1.1,0.2-2.1,0.6-3.1,1.1l0.2,2.9
c-0.6,0.3-1.2,0.7-1.7,1.1c-0.6,0.4-1.1,0.9-1.5,1.4l-2.7-0.9l-1.9,2.7l1.8,2.3c-0.6,1.3-1,2.6-1.1,4l-2.7,0.9
c-0.1,1.1,0,2.2,0.1,3.3l2.8,0.8c0.3,1.3,0.8,2.7,1.4,3.9l-1.7,2.3c0.3,0.5,0.6,0.9,1,1.4c0.3,0.4,0.7,0.9,1.1,1.3l2.7-1
c1,1,2.2,1.8,3.4,2.4l0,2.9c1,0.4,2.1,0.8,3.2,1l1.5-2.4c1.4,0.2,2.8,0.2,4.1,0l1.7,2.4c1.1-0.3,2.1-0.6,3.1-1.1l-0.2-2.9
c0.6-0.3,1.2-0.7,1.7-1.1c0.6-0.4,1.1-0.9,1.5-1.4l2.8,0.9c0.7-0.8,1.3-1.8,1.9-2.7L731,249c0.6-1.3,1-2.6,1.1-4l2.7-0.9
c0.1-1.1,0-2.2-0.1-3.3L732,240.1z M724,251c-4.6,3.5-11.1,2.6-14.6-2c-3.5-4.6-2.6-11.1,2-14.6s11.1-2.6,14.6,2
C729.5,241,728.6,247.5,724,251z"/>
</g>
</g>
<g>
<g>
<path class="st8" d="M700.5,249.3c-0.2-0.8-0.5-1.6-0.8-2.4l1-1.4c-0.2-0.3-0.4-0.6-0.6-0.8c-0.2-0.3-0.4-0.5-0.7-0.8l-1.6,0.6
c-0.6-0.6-1.3-1.1-2.1-1.4l0-1.7c-0.6-0.3-1.3-0.5-1.9-0.6l-0.9,1.4c-0.8-0.1-1.7-0.1-2.5,0l-1-1.4c-0.6,0.1-1.3,0.4-1.9,0.6
l0.1,1.7c-0.4,0.2-0.7,0.4-1,0.7c-0.3,0.3-0.6,0.5-0.9,0.8l-1.6-0.6l-1.1,1.6l1.1,1.4c-0.3,0.8-0.6,1.6-0.7,2.4l-1.6,0.5
c0,0.7,0,1.3,0.1,2l1.7,0.5c0.2,0.8,0.4,1.6,0.9,2.4l-1,1.4c0.2,0.3,0.4,0.6,0.6,0.8c0.2,0.3,0.4,0.5,0.7,0.8l1.6-0.6
c0.6,0.6,1.3,1.1,2.1,1.4l0,1.7c0.6,0.3,1.3,0.5,1.9,0.6l0.9-1.4c0.8,0.1,1.7,0.1,2.5,0l1,1.4c0.6-0.2,1.3-0.4,1.9-0.6l-0.1-1.7
c0.4-0.2,0.7-0.4,1-0.7c0.3-0.3,0.6-0.5,0.9-0.8l1.6,0.6c0.4-0.5,0.8-1.1,1.1-1.6l-1.1-1.4c0.3-0.8,0.6-1.6,0.7-2.4l1.6-0.5
c0-0.7,0-1.3-0.1-2L700.5,249.3z M694.5,254.2c-1.8,1.4-4.5,1-5.9-0.8c-1.4-1.8-1-4.5,0.8-5.9c1.8-1.4,4.5-1,5.9,0.8
C696.8,250.2,696.4,252.8,694.5,254.2z"/>
</g>
</g>
<path class="st39" d="M708.9,234.5"/>
<path class="st39" d="M706.7,237.9"/>
<path class="st40" d="M705.7,242.7c0-1.7,0.4-3.4,1-4.9"/>
<path class="st40" d="M708.9,234.5c2.2-2.4,5.3-3.8,8.8-3.8"/>
<path class="st40" d="M687.4,247.3c1.1-1.4,2.7-2.2,4.6-2.2"/>
<path class="st39" d="M686.4,249.5"/>
<path class="st40" d="M686.2,250.9c0-0.5,0.1-1,0.2-1.4"/>
<path class="st39" d="M686.7,253.2"/>
</g>
</g>
<g>
<path class="st33" d="M611.7,174.2l-23,3.3l-13.1-9.6c-6.3-4.6-13.9-7.1-21.7-7l-55.5,0.1l-1.1-2.4h1.1l64.2-0.2h0.1l3.9,0h0.1
l3.2,2.4l19.2,14l0.2,0.2l23.4-3.3L611.7,174.2z"/>
<path class="st23" d="M595.9,145.5L595.9,145.5z"/>
<linearGradient id="SVGID_10_" gradientUnits="userSpaceOnUse" x1="497.2089" y1="147.636" x2="612.739" y2="147.636">
<stop offset="0" style="stop-color:#C1D5FF"/>
<stop offset="0.1995" style="stop-color:#BACDF6"/>
<stop offset="0.6001" style="stop-color:#B0C3EA"/>
<stop offset="1" style="stop-color:#ADC0E6"/>
</linearGradient>
<path class="st41" d="M612.7,171.7l-3,0.4l-20.3,2.8l-0.2-0.1l-13.6-9.9l0,0c-3.7-2.7-8.7-4.4-12.9-5.4c-2.9-0.7-6-1-9-1l-35.5,0.1
l-19.8,0.1h-1.1v-38.3l13.5,0.2l4,0l42.6,0.2l7.9,0c7,0,14,1.6,20.2,4.9c0,0,0,0,0,0c0.8,0.5,1.6,0.9,2.4,1.5l7.5,5.6l0.1,0.1l0,0
l15.4,11.3v0l0.1,3.2L612.7,171.7z"/>
<linearGradient id="SVGID_11_" gradientUnits="userSpaceOnUse" x1="597.6228" y1="138.4046" x2="598.5728" y2="138.4046">
<stop offset="0" style="stop-color:#C1D5FF"/>
<stop offset="0.1995" style="stop-color:#BACDF6"/>
<stop offset="0.6001" style="stop-color:#B0C3EA"/>
<stop offset="1" style="stop-color:#ADC0E6"/>
</linearGradient>
<polygon class="st42" points="598.6,139.3 598.6,139.4 597.6,137.4 597.7,137.5 "/>
<text transform="matrix(1 0 0 1 513.7678 146.3103)" class="st8 st9 st35">BUILD</text>
</g>
<g>
<path class="st33" d="M612.7,258.8l-0.1,2.2l-1.8-0.2l-20.3-2.8l-0.2,0.1l-13.6,9.9l0-0.1c-3.7,2.7-8.7,4.4-12.9,5.4
c-2.9,0.7-6,1-9,1l-35.5-0.1l-19.8-0.1h-1.1v35.4l-1.1,0.4l1.1,2.4l13.5-0.2l4,0l42.6-0.2l7.9-0.1c7,0,14-1.6,20.2-4.9c0,0,0,0,0,0
c0.8-0.5,1.6-0.9,2.4-1.5l7.5-5.6l0.1-0.1l0,0l15.4-11.3l1-0.9l1.9-26.7L612.7,258.8z"/>
<path class="st43" d="M593.5,272.5"/>
<g>
<path class="st23" d="M598.5,285L598.5,285z"/>
<linearGradient id="SVGID_12_" gradientUnits="userSpaceOnUse" x1="497.2089" y1="451.0054" x2="612.739" y2="451.0054" gradientTransform="matrix(1 0 0 -1 0 733.8616)">
<stop offset="0" style="stop-color:#C1D5FF"/>
<stop offset="0.1995" style="stop-color:#BACDF6"/>
<stop offset="0.6001" style="stop-color:#B0C3EA"/>
<stop offset="1" style="stop-color:#ADC0E6"/>
</linearGradient>
<path class="st44" d="M612.7,258.8l-3-0.4l-20.3-2.8l-0.2,0.1l-13.6,9.9l0,0c-3.7,2.7-8.7,4.4-12.9,5.4c-2.9,0.7-6,1-9,1
l-35.5-0.1l-19.8-0.1h-1.1v38.3l13.5-0.2l4,0l42.6-0.2l7.9,0c7,0,14-1.6,20.2-4.9c0,0,0,0,0,0c0.8-0.5,1.6-0.9,2.4-1.5l7.5-5.6
l0.1-0.1l0,0l15.4-11.3v0l0.1-3.2L612.7,258.8z"/>
<text transform="matrix(1 0 0 1 513.7682 298.0848)" class="st8 st9 st35">BUILD</text>
</g>
</g>
<path class="st33" d="M619.9,149.1"/>
</svg>

Before

Width:  |  Height:  |  Size: 18 KiB

+24
View File
@@ -0,0 +1,24 @@
# Mongoose Network Library Examples
In order to build and run any of the existing examples, please follow:
https://mongoose.ws/documentation/#how-to-build-and-run-examples
## Contributing
Rules for creating a new example:
- Makefile golden reference for desktop/server example: [http-server](http-server)
- Makefile golden reference for the embedded example:
[stm32/nucleo-f746zg-baremetal](stm32/nucleo-f746zg-baremetal)
- An example must build on Windows, Mac and Ubuntu Linux systems
- Assume that user installed tools according to https://mongoose.ws/tutorials/tools/
- Makefile must not include any other make files
- Use `CFLAGS` for system-specific compilation options
- Use `CFLAGS_MONGOOSE` for mongoose-specific compilation options
- Use `$(CFLAGS) $(CFLAGS_MONGOOSE) $(CFLAGS_EXTRA)` to compile
- If external repository is required, download it on demand using git
shallow clone. See embedded example golden reference
- Keep Makefile as short as possible, but verbose to understand it easily
- Symlink files when required, like `mongoose.c`, `ca.pem`, etc. Make no copies
- Example's README.md should contain only the title and the link to mongoose.ws
tutorial page
+28
View File
@@ -0,0 +1,28 @@
all:
example:
true
arduino: ENV = -v $(CWD):/root
arduino:
curl -sL http://downloads.arduino.cc/arduino-1.8.19-linux64.tar.xz | unxz | tar -xf -
mv arduino-* $@
arduino-xiao-board:
./arduino/arduino --pref "boardsmanager.additional.urls=https://files.seeedstudio.com/arduino/package_seeeduino_boards_index.json" --save-prefs
./arduino/arduino --pref "compiler.warning_level=all" --save-prefs
./arduino/arduino --install-boards Seeeduino:samd
arduino-xiao: arduino arduino-xiao-board
cd w5500-http && ../arduino/arduino --verbose --verify --board Seeeduino:samd:seeed_XIAO_m0 w5500-http.ino
cd w5500-mqtt && ../arduino/arduino --verbose --verify --board Seeeduino:samd:seeed_XIAO_m0 w5500-mqtt.ino
arduino-nano: arduino
cd w5500-http && ../arduino/arduino --pref compiler.cpp.extra_flags=-DMG_ENABLE_LOG=0 --verbose --verify --board arduino:avr:nano w5500-http.ino
cd w5500-mqtt && ../arduino/arduino --pref compiler.cpp.extra_flags=-DMG_ENABLE_LOG=0 --verbose --verify --board arduino:avr:nano w5500-mqtt.ino
clean:
rm -rf arduino
cleanall: clean #otherwise some parts of xiao-board installation will fail as already installed
rm -rf ~/.arduino15 ~/.oracle_jre_usage
+1
View File
@@ -0,0 +1 @@
../../../mongoose.c
+1
View File
@@ -0,0 +1 @@
../../../mongoose.h
@@ -0,0 +1,11 @@
#pragma once
#define MG_ARCH MG_ARCH_NEWLIB // Use ARM toolchain
#define MG_ENABLE_TCPIP 1 // Enable built-in network stack
#define MG_ENABLE_DRIVER_IMXRT 1 // Enable RTxx driver
#define MG_ENABLE_CUSTOM_MILLIS 1 // Let user implement mg_millis()
#define MG_ENABLE_POSIX_FS 0 // Disable POSIX filesystem
#define MG_ENABLE_PACKED_FS 1 // Enable packed filesystem
#define HTTP_URL "http://0.0.0.0"
#define HTTPS_URL "https://0.0.0.0"
+1
View File
@@ -0,0 +1 @@
../../device-dashboard/net.c
+1
View File
@@ -0,0 +1 @@
../../device-dashboard/net.h
+1
View File
@@ -0,0 +1 @@
../../device-dashboard/packed_fs.c
@@ -0,0 +1,149 @@
#include "mongoose.h"
#include "net.h"
void ethernet_init(void);
struct mg_mgr mgr;
struct mg_tcpip_driver_imxrt_data data = {.mdc_cr = 24, .phy_addr = 0};
struct mg_tcpip_if mif = {
// Construct MAC address from the unique chip ID
.mac = {2, (uint8_t) (HW_OCOTP_CFG0 & 255),
(uint8_t) ((HW_OCOTP_CFG0 >> 10) & 255),
(uint8_t) (((HW_OCOTP_CFG0 >> 19) ^ (HW_OCOTP_CFG1 >> 19)) & 255),
(uint8_t) ((HW_OCOTP_CFG1 >> 10) & 255),
(uint8_t) (HW_OCOTP_CFG1 & 255)},
// The default is DHCP. Uncomment 3 lines below for static IP config:
// .ip = mg_htonl(MG_U32(192, 168, 0, 223)),
// .mask = mg_htonl(MG_U32(255, 255, 255, 0)),
// .gw = mg_htonl(MG_U32(192, 168, 0, 1)),
.driver = &mg_tcpip_driver_imxrt,
.driver_data = &data};
uint64_t mg_millis(void) { // Let Mongoose use our uptime function
return millis();
}
// Simple HTTP server that runs on port 8000
// Mongoose event handler function, gets called by the mg_mgr_poll()
// See https://mongoose.ws/documentation/#2-minute-integration-guide
static void simple_http_listener(struct mg_connection *c, int ev, void *ev_data) {
if (ev == MG_EV_HTTP_MSG) {
// The MG_EV_HTTP_MSG event means HTTP request. `hm` holds parsed request,
// see https://mongoose.ws/documentation/#struct-mg_http_message
struct mg_http_message *hm = (struct mg_http_message *) ev_data;
// If the requested URI is "/api/hi", send a simple JSON response back
if (mg_match(hm->uri, mg_str("/api/hi"), NULL)) {
// Use mg_http_reply() API function to generate JSON response. It adds a
// Content-Length header automatically. In the response, we show
// the requested URI and HTTP body:
mg_http_reply(c, 200, "", "{%m:%m,%m:%m}\n", // See mg_snprintf doc
MG_ESC("uri"), mg_print_esc, hm->uri.len, hm->uri.buf,
MG_ESC("body"), mg_print_esc, hm->body.len, hm->body.buf);
} else {
// For all other URIs, serve some static content
mg_http_reply(c, 200, "", "<html>millis: %lu</html>", millis());
}
}
}
void setup() {
pinMode(LED_BUILTIN, OUTPUT);
Serial.begin(115200);
while (!Serial) delay(50);
mg_mgr_init(&mgr); // Initialise Mongoose event manager
mg_log_set(MG_LL_DEBUG); // Set log level and log function
mg_log_set_fn([](char ch, void *) { Serial.print(ch); }, NULL);
MG_INFO(("CPU %g MHz. Starting TCP/IP stack", (double) F_CPU / 1000000));
ethernet_init();
mg_tcpip_init(&mgr, &mif); // Initialise built-in TCP/IP stack
MG_INFO(("Waiting for IP..."));
while (mif.state != MG_TCPIP_STATE_READY) mg_mgr_poll(&mgr, 1);
// We start two HTTP listeners: one is a simple one on port 8000,
// with event handler function defined above - simple_http_listener
// See https://mongoose.ws/documentation/#2-minute-integration-guide
// Another listener is for a more sophisticated Web device dashboard
MG_INFO(("Starting web dashboard"));
mg_http_listen(&mgr, "http://0.0.0.0:8000", simple_http_listener, NULL);
web_init(&mgr); // Sophisticated Web UI, see net.c :: fn()
}
void loop() {
static uint64_t timer;
if (mg_timer_expired(&timer, 500, mg_millis())) { // Every 500ms
digitalWrite(LED_BUILTIN, !digitalRead(LED_BUILTIN)); // blink an LED
}
mg_mgr_poll(&mgr, 1); // Process network events
}
extern "C" void ENET_IRQHandler(void);
#define CLRSET(reg, clear, set) ((reg) = ((reg) & ~(clear)) | (set))
#define RMII_PAD_INPUT_PULLDOWN 0x30E9
#define RMII_PAD_INPUT_PULLUP 0xB0E9
#define RMII_PAD_CLOCK 0x0031
// initialize the ethernet hardware
void ethernet_init(void) {
CCM_CCGR1 |= CCM_CCGR1_ENET(CCM_CCGR_ON);
// configure PLL6 for 50 MHz, pg 1173
CCM_ANALOG_PLL_ENET_CLR =
CCM_ANALOG_PLL_ENET_POWERDOWN | CCM_ANALOG_PLL_ENET_BYPASS | 0x0F;
CCM_ANALOG_PLL_ENET_SET = CCM_ANALOG_PLL_ENET_ENABLE |
CCM_ANALOG_PLL_ENET_BYPASS
/*| CCM_ANALOG_PLL_ENET_ENET2_REF_EN*/
| CCM_ANALOG_PLL_ENET_ENET_25M_REF_EN
/*| CCM_ANALOG_PLL_ENET_ENET2_DIV_SELECT(1)*/
| CCM_ANALOG_PLL_ENET_DIV_SELECT(1);
while (!(CCM_ANALOG_PLL_ENET & CCM_ANALOG_PLL_ENET_LOCK))
; // wait for PLL lock
CCM_ANALOG_PLL_ENET_CLR = CCM_ANALOG_PLL_ENET_BYPASS;
// configure REFCLK to be driven as output by PLL6, pg 326
CLRSET(IOMUXC_GPR_GPR1,
IOMUXC_GPR_GPR1_ENET1_CLK_SEL | IOMUXC_GPR_GPR1_ENET_IPG_CLK_S_EN,
IOMUXC_GPR_GPR1_ENET1_TX_CLK_DIR);
// Configure pins
IOMUXC_SW_MUX_CTL_PAD_GPIO_B0_14 = 5; // Reset B0_14 Alt5 GPIO7.15
IOMUXC_SW_MUX_CTL_PAD_GPIO_B0_15 = 5; // Power B0_15 Alt5 GPIO7.14
GPIO7_GDIR |= (1 << 14) | (1 << 15);
GPIO7_DR_SET = (1 << 15); // Power on
GPIO7_DR_CLEAR = (1 << 14); // Reset PHY chip
IOMUXC_SW_PAD_CTL_PAD_GPIO_B1_04 = RMII_PAD_INPUT_PULLDOWN; // PhyAdd[0] = 0
IOMUXC_SW_PAD_CTL_PAD_GPIO_B1_06 = RMII_PAD_INPUT_PULLDOWN; // PhyAdd[1] = 1
IOMUXC_SW_PAD_CTL_PAD_GPIO_B1_05 = RMII_PAD_INPUT_PULLUP; // Slave mode
IOMUXC_SW_PAD_CTL_PAD_GPIO_B1_11 = RMII_PAD_INPUT_PULLDOWN; // Auto MDIX
IOMUXC_SW_PAD_CTL_PAD_GPIO_B1_07 = RMII_PAD_INPUT_PULLUP;
IOMUXC_SW_PAD_CTL_PAD_GPIO_B1_08 = RMII_PAD_INPUT_PULLUP;
IOMUXC_SW_PAD_CTL_PAD_GPIO_B1_09 = RMII_PAD_INPUT_PULLUP;
IOMUXC_SW_PAD_CTL_PAD_GPIO_B1_10 = RMII_PAD_CLOCK;
IOMUXC_SW_MUX_CTL_PAD_GPIO_B1_05 = 3; // RXD1 B1_05 Alt3, pg 525
IOMUXC_SW_MUX_CTL_PAD_GPIO_B1_04 = 3; // RXD0 B1_04 Alt3, pg 524
IOMUXC_SW_MUX_CTL_PAD_GPIO_B1_10 = 6 | 0x10; // REFCLK B1_10 Alt6, pg 530
IOMUXC_SW_MUX_CTL_PAD_GPIO_B1_11 = 3; // RXER B1_11 Alt3, pg 531
IOMUXC_SW_MUX_CTL_PAD_GPIO_B1_06 = 3; // RXEN B1_06 Alt3, pg 526
IOMUXC_SW_MUX_CTL_PAD_GPIO_B1_09 = 3; // TXEN B1_09 Alt3, pg 529
IOMUXC_SW_MUX_CTL_PAD_GPIO_B1_07 = 3; // TXD0 B1_07 Alt3, pg 527
IOMUXC_SW_MUX_CTL_PAD_GPIO_B1_08 = 3; // TXD1 B1_08 Alt3, pg 528
IOMUXC_SW_MUX_CTL_PAD_GPIO_B1_15 = 0; // MDIO B1_15 Alt0, pg 535
IOMUXC_SW_MUX_CTL_PAD_GPIO_B1_14 = 0; // MDC B1_14 Alt0, pg 534
IOMUXC_ENET_MDIO_SELECT_INPUT = 2; // GPIO_B1_15_ALT0, pg 792
IOMUXC_ENET0_RXDATA_SELECT_INPUT = 1; // GPIO_B1_04_ALT3, pg 792
IOMUXC_ENET1_RXDATA_SELECT_INPUT = 1; // GPIO_B1_05_ALT3, pg 793
IOMUXC_ENET_RXEN_SELECT_INPUT = 1; // GPIO_B1_06_ALT3, pg 794
IOMUXC_ENET_RXERR_SELECT_INPUT = 1; // GPIO_B1_11_ALT3, pg 795
IOMUXC_ENET_IPG_CLK_RMII_SELECT_INPUT = 1; // GPIO_B1_10_ALT6, pg 791
delay(1);
GPIO7_DR_SET = (1 << 14); // Start PHY chip
// ENET_MSCR = ENET_MSCR_MII_SPEED(9);
delay(1);
// Setup IRQ handler
attachInterruptVector(IRQ_ENET, ENET_IRQHandler);
NVIC_ENABLE_IRQ(IRQ_ENET);
}
+1
View File
@@ -0,0 +1 @@
../../../mongoose.c
+1
View File
@@ -0,0 +1 @@
../../../mongoose.h
@@ -0,0 +1,16 @@
#pragma once
#include "Arduino.h"
#include <errno.h>
#include <stdarg.h>
#include <stdio.h>
#include <time.h>
#define MG_ARCH MG_ARCH_CUSTOM
#define MG_ENABLE_SOCKET 0
#define MG_ENABLE_TCPIP 1
#define MG_ENABLE_DRIVER_W5500 1
#define mkdir(a, b) (-1)
#define MG_IO_SIZE 128
//#define MG_ENABLE_LOG 0
@@ -0,0 +1,49 @@
#include <SPI.h>
#include "mongoose.h"
#define SS_PIN 3 // Slave select pin
struct mg_mgr mgr; // Mongoose event manager
struct mg_tcpip_spi spi = {
NULL, // SPI data
[](void *) { digitalWrite(SS_PIN, LOW); }, // begin transation
[](void *) { digitalWrite(SS_PIN, HIGH); }, // end transaction
[](void *, uint8_t c) { return SPI.transfer(c); }, // execute transaction
};
struct mg_tcpip_if mif = {.mac = {2, 0, 1, 2, 3, 5}}; // network interface
void setup() {
Serial.begin(115200);
pinMode(SS_PIN, OUTPUT);
SPI.begin();
// Set logging function to a serial print
mg_log_set_fn([](char ch, void *) { Serial.print(ch); }, NULL);
mg_mgr_init(&mgr);
delay(3000);
MG_INFO(("Starting TCP/IP stack..."));
mif.driver = &mg_tcpip_driver_w5500;
mif.driver_data = &spi;
mg_tcpip_init(&mgr, &mif);
// Start a 5 sec timer, print status message periodically
mg_timer_add(
&mgr, 5000, MG_TIMER_REPEAT,
[](void *) {
MG_INFO(("ethernet: %s", mg_tcpip_driver_w5500.up(&mif) ? "up" : "down"));
},
NULL);
// Setup HTTP listener. Respond "ok" on any HTTP request
mg_http_listen(
&mgr, "http://0.0.0.0",
[](struct mg_connection *c, int ev, void *ev_data) {
if (ev == MG_EV_HTTP_MSG) mg_http_reply(c, 200, "", "ok\n");
},
&mgr);
}
void loop() {
mg_mgr_poll(&mgr, 1);
}
+1
View File
@@ -0,0 +1 @@
../../../mongoose.c
+1
View File
@@ -0,0 +1 @@
../../../mongoose.h
@@ -0,0 +1,16 @@
#pragma once
#include "Arduino.h"
#include <errno.h>
#include <stdarg.h>
#include <stdio.h>
#include <time.h>
#define MG_ARCH MG_ARCH_CUSTOM
#define MG_ENABLE_SOCKET 0
#define MG_ENABLE_TCPIP 1
#define MG_ENABLE_DRIVER_W5500 1
#define mkdir(a, b) (-1)
#define MG_IO_SIZE 512
//#define MG_ENABLE_LOG 0
+58
View File
@@ -0,0 +1,58 @@
#include "net.h"
#define MQTT_SERVER "mqtt://broker.hivemq.com:1883"
struct mg_connection *mqtt_connection;
const char *mqtt_subscribe_topic = "mg/rx";
const char *mqtt_publish_topic = "mg/tx";
struct mg_mgr mgr; // Mongoose event manager
struct mg_tcpip_if mif = {.mac = {2, 0, 1, 2, 3, 5}}; // network interface
void mqtt_publish(const char *message) {
struct mg_mqtt_opts opts = {};
opts.topic = mg_str(mqtt_publish_topic);
opts.message = mg_str(message);
if (mqtt_connection) mg_mqtt_pub(mqtt_connection, &opts);
}
static void fn(struct mg_connection *c, int ev, void *ev_data) {
if (ev == MG_EV_MQTT_OPEN) {
MG_INFO(("%lu CONNECTED to %s", c->id, MQTT_SERVER));
struct mg_mqtt_opts opts = {};
opts.topic = mg_str(mqtt_subscribe_topic);
mg_mqtt_sub(c, &opts);
MG_INFO(("%lu SUBSCRIBED to %s", c->id, mqtt_subscribe_topic));
} else if (ev == MG_EV_MQTT_MSG) {
// Received MQTT message
struct mg_mqtt_message *mm = (struct mg_mqtt_message *) ev_data;
MG_INFO(("%lu RECEIVED %.*s <- %.*s", c->id, (int) mm->data.len,
mm->data.buf, (int) mm->topic.len, mm->topic.buf));
exec_command(mm->data.buf, mm->data.len);
} else if (ev == MG_EV_CLOSE) {
MG_INFO(("%lu CLOSED", c->id));
mqtt_connection = NULL;
}
}
static void timer_fn(void *arg) {
struct mg_mgr *mgr = (struct mg_mgr *) arg;
struct mg_mqtt_opts opts;
memset(&opts, 0, sizeof(opts));
opts.clean = true;
if (mif.state == MG_TCPIP_STATE_READY && mqtt_connection == NULL) {
mqtt_connection = mg_mqtt_connect(mgr, MQTT_SERVER, &opts, fn, NULL);
}
// MG_INFO(("Eth: %d, MQTT: %p", mif.state, mqtt_connection));
}
void net_init(void) {
// Set Mongoose logging function to a serial print
mg_mgr_init(&mgr);
mif.driver = &mg_tcpip_driver_w5500;
mif.driver_data = &spi;
mg_tcpip_init(&mgr, &mif);
// Start a timer that keeps MQTT connection alive
mg_timer_add(&mgr, 3000, MG_TIMER_REPEAT, timer_fn, &mgr);
}
+16
View File
@@ -0,0 +1,16 @@
#pragma once
#include "mongoose.h"
#ifdef __cplusplus
extern "C" {
#endif
extern struct mg_tcpip_spi spi;
extern struct mg_mgr mgr;
void mqtt_publish(const char *message);
void net_init(void);
void exec_command(const char *req, size_t req_len);
#ifdef __cplusplus
}
#endif
@@ -0,0 +1,51 @@
#include <SPI.h>
#include "net.h"
#define SS_PIN 17 // Slave select pin
struct mg_tcpip_spi spi = {
NULL, // SPI data
[](void *) { digitalWrite(SS_PIN, LOW); }, // Begin transaction
[](void *) { digitalWrite(SS_PIN, HIGH); }, // End transaction
[](void *, uint8_t c) { return SPI.transfer(c); }, // Execute transaction
};
void exec_command(const char *req, size_t req_len) {
char res[100];
if (req_len == 2 && strncmp(req, "on", req_len) == 0) {
digitalWrite(LED_BUILTIN, true);
snprintf(res, sizeof(res), "LED on");
} else if (req_len == 3 && strncmp(req, "off", req_len) == 0) {
digitalWrite(LED_BUILTIN, false);
snprintf(res, sizeof(res), "LED off");
} else {
snprintf(res, sizeof(res), "Unknown command: [%.*s]", (int) req_len, req);
}
Serial.println(res);
mqtt_publish(res);
}
static void process_input(char c) {
static char buf[100];
static size_t len = 0;
char response[100];
if (c != '\n' && c != '\0') buf[len++] = c; // Append to the buffer
if (len >= sizeof(buf)) len = 0; // On overflow, reset
if (c == '\n' && len > 0) {
exec_command(buf, len);
len = 0;
}
}
void setup() {
Serial.begin(115200);
SPI.begin();
pinMode(SS_PIN, OUTPUT);
pinMode(LED_BUILTIN, OUTPUT);
mg_log_set_fn([](char ch, void *) { Serial.print(ch); }, NULL);
net_init();
}
void loop() {
if (Serial.available()) process_input(Serial.read());
mg_mgr_poll(&mgr, 1);
}
-11
View File
@@ -1,11 +0,0 @@
PROG ?= example
CFLAGS ?= -DMG_IO_SIZE=8192 -DMG_ENABLE_LINES
all: $(PROG)
$(DEBUGGER) ./$(PROG) $(ARGS)
$(PROG): main.c
$(CC) ../../mongoose.c -I../.. -W -Wall $(CFLAGS) -o $(PROG) main.c
clean:
rm -rf $(PROG) *.o *.dSYM *.gcov *.gcno *.gcda *.obj *.exe *.ilk *.pdb
-1
View File
@@ -1 +0,0 @@
See detailed tutorial at https://mongoose.ws/tutorials/captive-dns-portal/
+45 -29
View File
@@ -1,40 +1,56 @@
PROG ?= example PROG ?= ./example # Program we are building
SOURCES ?= ../../mongoose.c main.c net.c packed_fs.c PACK ?= ./pack # Packing executable
CFLAGS ?= -I../.. -DMG_ENABLE_PACKED_FS=1 -DMG_ENABLE_LINES=1 $(EXTRA) DELETE = rm -rf # Command to remove files
FILES_TO_EMBED ?= $(wildcard web_root/*) GZIP ?= gzip # For compressing files in web_root/
ROOT ?= $(realpath $(CURDIR)/../../..) OUT ?= -o $(PROG) # Compiler argument for output file
DOCKER ?= docker run --rm -e Tmp=. -e WINEDEBUG=-all -v $(ROOT):$(ROOT) -w $(CURDIR) SOURCES = main.c mongoose.c net.c packed_fs.c # Source code files
VC98 ?= $(DOCKER) mdashnet/vc98 wine CFLAGS = -W -Wall -Wextra -g -I. # Build options
MINGW ?= $(DOCKER) mdashnet/mingw NPX ?= npx
ifeq "$(SSL)" "MBEDTLS" # Mongoose build options. See https://mongoose.ws/documentation/#build-options
CFLAGS += -DMG_ENABLE_MBEDTLS=1 -I$(MBEDTLS)/include -L$(MBEDTLS)/lib -lmbedtls -lmbedcrypto -lmbedx509 CFLAGS_MONGOOSE += -DMG_ENABLE_PACKED_FS=1
endif
ifeq "$(SSL)" "OPENSSL" ifeq ($(OS),Windows_NT) # Windows settings. Assume MinGW compiler. To use VC: make CC=cl CFLAGS=/MD OUT=/Feprog.exe
CFLAGS += -DMG_ENABLE_OPENSSL=1 -I$(OPENSSL)/include -L$(OPENSSL)/lib -lssl -lcrypto PROG = example.exe # Use .exe suffix for the binary
PACK = pack.exe # Packing executable
CC = gcc # Use MinGW gcc compiler
CFLAGS += -lws2_32 # Link against Winsock library
DELETE = cmd /C del /Q /F /S # Command prompt command to delete files
GZIP = echo # No gzip on Windows
endif endif
# Default target. Build and run program
all: $(PROG) all: $(PROG)
$(RUN) ./$(PROG) $(RUN) $(PROG) $(ARGS)
$(PROG): $(SOURCES) $(FILES_TO_EMBED) # Build program from sources
$(CC) ../../test/pack.c -o pack $(PROG): $(SOURCES)
./pack $(FILES_TO_EMBED) > packed_fs.c $(CC) $(SOURCES) $(CFLAGS) $(CFLAGS_MONGOOSE) $(CFLAGS_EXTRA) $(OUT)
$(CC) -W -Wall -Wextra -O0 -g3 $(CFLAGS) -o $(PROG) $(SOURCES)
# Bundle JS libraries (preact, preact-router, ...) into a single file
web_root/bundle.js:
curl -s https://npm.reversehttp.com/preact,preact/hooks,htm/preact,preact-router -o $@
mingw: $(SOURCES) $(FILES_TO_EMBED) # Create optimised CSS. Prerequisite: npm -g i tailwindcss tailwindcss-font-inter
$(MINGW) i686-w64-mingw32-gcc $(CFLAGS) ../../test/pack.c -o pack.exe web_root/main.css: web_root/index.html $(wildcard web_root/*.js)
$(MINGW) wine cmd /c 'pack.exe $(FILES_TO_EMBED) > packed_fs.c' $(NPX) tailwindcss -o $@ --minify
$(MINGW) i686-w64-mingw32-gcc $(CFLAGS) $(SOURCES) -lws2_32 -o $(PROG).exe
$(MINGW) wine $(PROG).exe
vc98: $(SOURCES) $(FILES_TO_EMBED) # Generate packed filesystem for serving Web UI
$(VC98) cl.exe /nologo $(CFLAGS) ../../test/pack.c /Fepack.exe packed_fs.c: $(wildcard web_root/*) $(wildcard certs/*) Makefile web_root/main.css web_root/bundle.js
$(VC98) cmd /c 'pack.exe $(FILES_TO_EMBED) > packed_fs.c' $(GZIP) web_root/*
$(VC98) cl.exe /nologo /O2 $(CFLAGS) $(SOURCES) /Fe$(PROG).exe $(CC) ../../test/pack.c -o $(PACK)
$(VC98) $(PROG).exe $(PACK) web_root/* certs/* > $@
$(GZIP) -d web_root/*
mbedtls:
git clone --depth 1 -b v2.28.2 https://github.com/mbed-tls/mbedtls $@
ifeq ($(TLS), mbedtls)
CFLAGS += -DMG_TLS=MG_TLS_MBED -Wno-conversion -Imbedtls/include
CFLAGS += -DMBEDTLS_CONFIG_FILE=\"mbedtls_config.h\" mbedtls/library/*.c
$(PROG): mbedtls
endif
# Cleanup. Delete built program and all build artifacts
clean: clean:
rm -rf $(PROG) *.o *.dSYM *.gcov *.gcno *.gcda *.obj *.exe *.ilk *.pdb log.txt pack $(DELETE) $(PROG) $(PACK) *.o *.obj *.exe *.dSYM mbedtls
+5 -19
View File
@@ -5,23 +5,9 @@ into an embedded device and provide a complete device dashboard with the
following features: following features:
- Authentication: login-protected dashboard - Authentication: login-protected dashboard
- Multiple logins with different permissions (admin and user) - Multiple logins (with possibly different permissions)
- Web UI is fully embedded into the server/firmware binary, and does not - The Web UI can be fully embedded into the firmware binary, then not
need a filesystem to serve it. UI is resilient to FS problems needing a filesystem to serve it; so being resilient to FS problems
- Administrators can change server settings - All changes are propagated to all connected clients
- All changes are propagates to all connected clients
- A device is connected to the external MQTT server
- Logged in clients can send/receive messages to a device which get
forwarded to MQTT
# Screenshots See a detailed tutorial at https://mongoose.ws/tutorials/device-dashboard/
This is a login screen that prompts for user/password
![](screenshots/login.png)
# Main dashboard
A main dashboard page shows and interactive MQTT console
![](screenshots/dashboard.png)
-1
View File
@@ -1 +0,0 @@
../../test/data/ca.pem
@@ -0,0 +1,8 @@
-----BEGIN CERTIFICATE-----
MIIBCTCBsAIJAK9wbIDkHnAoMAoGCCqGSM49BAMCMA0xCzAJBgNVBAYTAklFMB4X
DTIzMDEyOTIxMjEzOFoXDTMzMDEyNjIxMjEzOFowDTELMAkGA1UEBhMCSUUwWTAT
BgcqhkjOPQIBBggqhkjOPQMBBwNCAARzSQS5OHd17lUeNI+6kp9WYu0cxuEIi/JT
jphbCmdJD1cUvhmzM9/phvJT9ka10Z9toZhgnBq0o0xfTQ4jC1vwMAoGCCqGSM49
BAMCA0gAMEUCIQCe0T2E0GOiVe9KwvIEPeX1J1J0T7TNacgR0Ya33HV9VgIgNvdn
aEWiBp1xshs4iz6WbpxrS1IHucrqkZuJLfNZGZI=
-----END CERTIFICATE-----
@@ -0,0 +1,5 @@
-----BEGIN EC PRIVATE KEY-----
MHcCAQEEICBz3HOkQLPBDtdknqC7k1PNsWj6HfhyNB5MenfjmqiooAoGCCqGSM49
AwEHoUQDQgAEc0kEuTh3de5VHjSPupKfVmLtHMbhCIvyU46YWwpnSQ9XFL4ZszPf
6YbyU/ZGtdGfbaGYYJwatKNMX00OIwtb8A==
-----END EC PRIVATE KEY-----
+20 -6
View File
@@ -1,18 +1,32 @@
// Copyright (c) 2020-2022 Cesanta Software Limited // Copyright (c) 2020-2023 Cesanta Software Limited
// All rights reserved // All rights reserved
#include "mongoose.h" #include "mongoose.h"
const char *s_listening_url = "http://0.0.0.0:8000"; #include "net.h"
void device_dashboard_fn(struct mg_connection *, int, void *, void *); static int s_sig_num;
static void signal_handler(int sig_num) {
signal(sig_num, signal_handler);
s_sig_num = sig_num;
}
int main(void) { int main(void) {
struct mg_mgr mgr; struct mg_mgr mgr;
signal(SIGPIPE, SIG_IGN);
signal(SIGINT, signal_handler);
signal(SIGTERM, signal_handler);
mg_log_set(MG_LL_DEBUG); // Set debug log level mg_log_set(MG_LL_DEBUG); // Set debug log level
mg_mgr_init(&mgr); mg_mgr_init(&mgr);
mg_http_listen(&mgr, s_listening_url, device_dashboard_fn, &mgr);
MG_INFO(("Listening on %s", s_listening_url)); web_init(&mgr);
while (mgr.conns != NULL) mg_mgr_poll(&mgr, 500); while (s_sig_num == 0) {
mg_mgr_poll(&mgr, 50);
}
mg_mgr_free(&mgr); mg_mgr_free(&mgr);
MG_INFO(("Exiting on signal %d", s_sig_num));
return 0; return 0;
} }
@@ -0,0 +1,64 @@
/* Workaround for some mbedtls source files using INT_MAX without including limits.h */
#include <limits.h>
#define MBEDTLS_NO_PLATFORM_ENTROPY
//#define MBEDTLS_ENTROPY_HARDWARE_ALT
#define MBEDTLS_SSL_OUT_CONTENT_LEN 2048
#define MBEDTLS_ALLOW_PRIVATE_ACCESS
#define MBEDTLS_HAVE_TIME
#define MBEDTLS_SSL_SESSION_TICKETS
#define MBEDTLS_CIPHER_MODE_CBC
#define MBEDTLS_ECP_DP_SECP192R1_ENABLED
#define MBEDTLS_ECP_DP_SECP224R1_ENABLED
#define MBEDTLS_ECP_DP_SECP256R1_ENABLED
#define MBEDTLS_ECP_DP_SECP384R1_ENABLED
#define MBEDTLS_ECP_DP_SECP521R1_ENABLED
#define MBEDTLS_ECP_DP_SECP192K1_ENABLED
#define MBEDTLS_ECP_DP_SECP224K1_ENABLED
#define MBEDTLS_ECP_DP_SECP256K1_ENABLED
#define MBEDTLS_ECP_DP_BP256R1_ENABLED
#define MBEDTLS_ECP_DP_BP384R1_ENABLED
#define MBEDTLS_ECP_DP_BP512R1_ENABLED
#define MBEDTLS_ECP_DP_CURVE25519_ENABLED
#define MBEDTLS_KEY_EXCHANGE_RSA_ENABLED
#define MBEDTLS_PKCS1_V15
#define MBEDTLS_SHA256_SMALLER
#define MBEDTLS_SSL_SERVER_NAME_INDICATION
#define MBEDTLS_AES_C
#define MBEDTLS_ASN1_PARSE_C
#define MBEDTLS_BIGNUM_C
#define MBEDTLS_CIPHER_C
#define MBEDTLS_CTR_DRBG_C
#define MBEDTLS_ENTROPY_C
#define MBEDTLS_ERROR_C
#define MBEDTLS_MD_C
#define MBEDTLS_MD5_C
#define MBEDTLS_OID_C
#define MBEDTLS_PKCS5_C
#define MBEDTLS_PK_C
#define MBEDTLS_PK_PARSE_C
#define MBEDTLS_PLATFORM_C
#define MBEDTLS_RSA_C
#define MBEDTLS_SHA1_C
#define MBEDTLS_SHA224_C
#define MBEDTLS_SHA256_C
#define MBEDTLS_SHA512_C
#define MBEDTLS_SSL_CLI_C
#define MBEDTLS_SSL_SRV_C
#define MBEDTLS_SSL_TLS_C
#define MBEDTLS_X509_CRT_PARSE_C
#define MBEDTLS_X509_USE_C
#define MBEDTLS_AES_FEWER_TABLES
#define MBEDTLS_PEM_PARSE_C
#define MBEDTLS_BASE64_C
#define MBEDTLS_SSL_TICKET_C
#define MBEDTLS_SSL_PROTO_TLS1_3
#define MBEDTLS_SSL_PROTO_TLS1_2
#define MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED
#define MBEDTLS_GCM_C
#define MBEDTLS_ECDH_C
#define MBEDTLS_ECP_C
#define MBEDTLS_ECDSA_C
#define MBEDTLS_ASN1_WRITE_C
+1
View File
@@ -0,0 +1 @@
../../mongoose.c
+1
View File
@@ -0,0 +1 @@
../../mongoose.h
+289 -179
View File
@@ -1,217 +1,327 @@
// Copyright (c) 2020-2022 Cesanta Software Limited // Copyright (c) 2023 Cesanta Software Limited
// All rights reserved // All rights reserved
#include "mongoose.h" #include "net.h"
#define MQTT_SERVER "mqtt://broker.hivemq.com:1883"
#define MQTT_PUBLISH_TOPIC "mg/my_device"
#define MQTT_SUBSCRIBE_TOPIC "mg/#"
static time_t s_boot_timestamp = 0; // Updated by SNTP
static struct mg_connection *s_sntp_conn = NULL; // SNTP connection
// Define system time()
time_t time(time_t *tp) {
time_t t = s_boot_timestamp + (time_t) (mg_millis() / 1000);
if (tp != NULL) *tp = t;
return t;
}
// Authenticated user. // Authenticated user.
// A user can be authenticated by: // A user can be authenticated by:
// - a name:pass pair // - a name:pass pair, passed in a header Authorization: Basic .....
// - a token // - an access_token, passed in a header Cookie: access_token=....
// When a user is shown a login screen, she enters a user:pass. If successful, // When a user is shown a login screen, she enters a user:pass. If successful,
// a server returns user info which includes token. From that point on, // a server responds with a http-only access_token cookie set.
// client can use token for authentication. Tokens could be refreshed/changed
// on a server side, forcing clients to re-login.
struct user { struct user {
const char *name, *pass, *token; const char *name, *pass, *access_token;
}; };
// This is a configuration structure we're going to show on a dashboard // Settings
static struct config { struct settings {
char *url, *pub, *sub; // MQTT settings bool log_enabled;
} s_config; int log_level;
long brightness;
char *device_name;
};
static struct mg_connection *s_mqtt = NULL; // MQTT connection static struct settings s_settings = {true, 1, 57, NULL};
static bool s_connected = false; // MQTT connection established
// Try to update a single configuration value static const char *s_json_header =
static void update_config(struct mg_str *body, const char *name, char **value) { "Content-Type: application/json\r\n"
char buf[256]; "Cache-Control: no-cache\r\n";
if (mg_http_get_var(body, name, buf, sizeof(buf)) > 0) { static uint64_t s_boot_timestamp = 0; // Updated by SNTP
free(*value);
*value = strdup(buf); // This is for newlib and TLS (mbedTLS)
} uint64_t mg_now(void) {
return mg_millis() + s_boot_timestamp;
} }
// Parse HTTP requests, return authenticated user or NULL int ui_event_next(int no, struct ui_event *e) {
static struct user *getuser(struct mg_http_message *hm) { if (no < 0 || no >= MAX_EVENTS_NO) return 0;
// In production, make passwords strong and tokens randomly generated
// In this example, user list is kept in RAM. In production, it can
// be backed by file, database, or some other method.
static struct user users[] = {
{"admin", "pass0", "admin_token"},
{"user1", "pass1", "user1_token"},
{"user2", "pass2", "user2_token"},
{NULL, NULL, NULL},
};
char user[256], pass[256];
struct user *u;
mg_http_creds(hm, user, sizeof(user), pass, sizeof(pass));
if (user[0] != '\0' && pass[0] != '\0') {
// Both user and password is set, search by user/password
for (u = users; u->name != NULL; u++)
if (strcmp(user, u->name) == 0 && strcmp(pass, u->pass) == 0) return u;
} else if (user[0] == '\0') {
// Only password is set, search by token
for (u = users; u->name != NULL; u++)
if (strcmp(pass, u->token) == 0) return u;
}
return NULL;
}
// Notify all config watchers about the config change srand((unsigned) no);
static void send_notification(struct mg_mgr *mgr, const char *fmt, ...) { e->type = (uint8_t) rand() % 4;
struct mg_connection *c; e->prio = (uint8_t) rand() % 3;
for (c = mgr->conns; c != NULL; c = c->next) { e->timestamp =
if (c->label[0] == 'W') { (unsigned long) ((int64_t) mg_now() - 86400 * 1000 /* one day back */ +
va_list ap; no * 300 * 1000 /* 5 mins between alerts */ +
va_start(ap, fmt); 1000 * (rand() % 300) /* randomize event time */) /
mg_ws_vprintf(c, WEBSOCKET_OP_TEXT, fmt, &ap); 1000UL;
va_end(ap);
}
}
}
// Send simulated metrics data to the dashboard, for chart rendering mg_snprintf(e->text, MAX_EVENT_TEXT_SIZE, "event#%d", no);
static void timer_metrics_fn(void *param) { return no + 1;
send_notification(param, "{%Q:%Q,%Q:[%lu, %d]}", "name", "metrics", "data",
(unsigned long) time(NULL),
10 + (int) ((double) rand() * 10 / RAND_MAX));
}
// MQTT event handler function
static void mqtt_fn(struct mg_connection *c, int ev, void *ev_data, void *fnd) {
if (ev == MG_EV_CONNECT && mg_url_is_ssl(s_config.url)) {
struct mg_tls_opts opts = {.ca = "ca.pem",
.srvname = mg_url_host(s_config.url)};
mg_tls_init(c, &opts);
} else if (ev == MG_EV_MQTT_OPEN) {
s_connected = true;
c->is_hexdumping = 1;
mg_mqtt_sub(s_mqtt, mg_str(s_config.sub), 2);
send_notification(c->mgr, "{%Q:%Q,%Q:null}", "name", "config", "data");
} else if (ev == MG_EV_MQTT_MSG) {
struct mg_mqtt_message *mm = ev_data;
send_notification(c->mgr, "{%Q:%Q,%Q:{%Q: %.*Q, %Q: %.*Q, %Q: %d}}", "name",
"message", "data", "topic", (int) mm->topic.len,
mm->topic.ptr, "data", (int) mm->data.len, mm->data.ptr,
"qos", (int) mm->qos);
} else if (ev == MG_EV_MQTT_CMD) {
struct mg_mqtt_message *mm = (struct mg_mqtt_message *) ev_data;
MG_DEBUG(("cmd %d qos %d", mm->cmd, mm->qos));
} else if (ev == MG_EV_CLOSE) {
s_mqtt = NULL;
if (s_connected) {
s_connected = false;
send_notification(c->mgr, "{%Q:%Q,%Q:null}", "name", "config", "data");
}
}
(void) fnd;
}
// Keep MQTT connection open - reconnect if closed
static void timer_mqtt_fn(void *param) {
struct mg_mgr *mgr = (struct mg_mgr *) param;
if (s_mqtt == NULL) {
struct mg_mqtt_opts opts = {0};
s_mqtt = mg_mqtt_connect(mgr, s_config.url, &opts, mqtt_fn, NULL);
}
} }
// SNTP connection event handler. When we get a response from an SNTP server, // SNTP connection event handler. When we get a response from an SNTP server,
// adjust s_boot_timestamp. We'll get a valid time from that point on // adjust s_boot_timestamp. We'll get a valid time from that point on
static void sfn(struct mg_connection *c, int ev, void *ev_data, void *fn_data) { static void sfn(struct mg_connection *c, int ev, void *ev_data) {
if (ev == MG_EV_SNTP_TIME) { uint64_t *expiration_time = (uint64_t *) c->data;
if (ev == MG_EV_OPEN) {
*expiration_time = mg_millis() + 3000; // Store expiration time in 3s
} else if (ev == MG_EV_SNTP_TIME) {
uint64_t t = *(uint64_t *) ev_data; uint64_t t = *(uint64_t *) ev_data;
MG_INFO(("%lu SNTP: %lld ms from epoch", c->id, t)); s_boot_timestamp = t - mg_millis();
s_boot_timestamp = (time_t) ((t - mg_millis()) / 1000);
c->is_closing = 1; c->is_closing = 1;
} else if (ev == MG_EV_CLOSE) { } else if (ev == MG_EV_POLL) {
s_sntp_conn = NULL; if (mg_millis() > *expiration_time) c->is_closing = 1;
} }
(void) fn_data;
} }
static void timer_sntp_fn(void *param) { // SNTP timer function. Sync up time static void timer_sntp_fn(void *param) { // SNTP timer function. Sync up time
struct mg_mgr *mgr = (struct mg_mgr *) param; mg_sntp_connect(param, "udp://time.google.com:123", sfn, NULL);
if (s_sntp_conn == NULL && s_boot_timestamp == 0) { }
s_sntp_conn = mg_sntp_connect(mgr, NULL, sfn, NULL);
// Parse HTTP requests, return authenticated user or NULL
static struct user *authenticate(struct mg_http_message *hm) {
// In production, make passwords strong and tokens randomly generated
// In this example, user list is kept in RAM. In production, it can
// be backed by file, database, or some other method.
static struct user users[] = {
{"admin", "admin", "admin_token"},
{"user1", "user1", "user1_token"},
{"user2", "user2", "user2_token"},
{NULL, NULL, NULL},
};
char user[64], pass[64];
struct user *u, *result = NULL;
mg_http_creds(hm, user, sizeof(user), pass, sizeof(pass));
MG_VERBOSE(("user [%s] pass [%s]", user, pass));
if (user[0] != '\0' && pass[0] != '\0') {
// Both user and password is set, search by user/password
for (u = users; result == NULL && u->name != NULL; u++)
if (strcmp(user, u->name) == 0 && strcmp(pass, u->pass) == 0) result = u;
} else if (user[0] == '\0') {
// Only password is set, search by token
for (u = users; result == NULL && u->name != NULL; u++)
if (strcmp(pass, u->access_token) == 0) result = u;
}
return result;
}
static void handle_login(struct mg_connection *c, struct user *u) {
char cookie[256];
mg_snprintf(cookie, sizeof(cookie),
"Set-Cookie: access_token=%s; Path=/; "
"%sHttpOnly; SameSite=Lax; Max-Age=%d\r\n",
u->access_token, c->is_tls ? "Secure; " : "", 3600 * 24);
mg_http_reply(c, 200, cookie, "{%m:%m}", MG_ESC("user"), MG_ESC(u->name));
}
static void handle_logout(struct mg_connection *c) {
char cookie[256];
mg_snprintf(cookie, sizeof(cookie),
"Set-Cookie: access_token=; Path=/; "
"Expires=Thu, 01 Jan 1970 00:00:00 UTC; "
"%sHttpOnly; Max-Age=0; \r\n",
c->is_tls ? "Secure; " : "");
mg_http_reply(c, 200, cookie, "true\n");
}
static void handle_debug(struct mg_connection *c, struct mg_http_message *hm) {
int level = mg_json_get_long(hm->body, "$.level", MG_LL_DEBUG);
mg_log_set(level);
mg_http_reply(c, 200, "", "Debug level set to %d\n", level);
}
static size_t print_int_arr(void (*out)(char, void *), void *ptr, va_list *ap) {
size_t i, len = 0, num = va_arg(*ap, size_t); // Number of items in the array
int *arr = va_arg(*ap, int *); // Array ptr
for (i = 0; i < num; i++) {
len += mg_xprintf(out, ptr, "%s%d", i == 0 ? "" : ",", arr[i]);
}
return len;
}
static void handle_stats_get(struct mg_connection *c) {
int points[] = {21, 22, 22, 19, 18, 20, 23, 23, 22, 22, 22, 23, 22};
mg_http_reply(c, 200, s_json_header, "{%m:%d,%m:%d,%m:[%M]}\n",
MG_ESC("temperature"), 21, //
MG_ESC("humidity"), 67, //
MG_ESC("points"), print_int_arr,
sizeof(points) / sizeof(points[0]), points);
}
static size_t print_events(void (*out)(char, void *), void *ptr, va_list *ap) {
size_t len = 0;
struct ui_event ev;
int pageno = va_arg(*ap, int);
int no = (pageno - 1) * EVENTS_PER_PAGE;
int end = no + EVENTS_PER_PAGE;
while ((no = ui_event_next(no, &ev)) != 0 && no <= end) {
len += mg_xprintf(out, ptr, "%s{%m:%lu,%m:%d,%m:%d,%m:%m}\n", //
len == 0 ? "" : ",", //
MG_ESC("time"), ev.timestamp, //
MG_ESC("type"), ev.type, //
MG_ESC("prio"), ev.prio, //
MG_ESC("text"), MG_ESC(ev.text));
}
return len;
}
static void handle_events_get(struct mg_connection *c,
struct mg_http_message *hm) {
int pageno = mg_json_get_long(hm->body, "$.page", 1);
mg_http_reply(c, 200, s_json_header, "{%m:[%M], %m:%d}\n", MG_ESC("arr"),
print_events, pageno, MG_ESC("totalCount"), MAX_EVENTS_NO);
}
static void handle_settings_set(struct mg_connection *c, struct mg_str body) {
struct settings settings;
char *s = mg_json_get_str(body, "$.device_name");
bool ok = true;
memset(&settings, 0, sizeof(settings));
mg_json_get_bool(body, "$.log_enabled", &settings.log_enabled);
settings.log_level = mg_json_get_long(body, "$.log_level", 0);
settings.brightness = mg_json_get_long(body, "$.brightness", 0);
if (s && strlen(s) < MAX_DEVICE_NAME) {
free(settings.device_name);
settings.device_name = s;
} else {
free(s);
}
s_settings = settings; // Save to the device flash
mg_http_reply(c, 200, s_json_header,
"{%m:%s,%m:%m}", //
MG_ESC("status"), ok ? "true" : "false", //
MG_ESC("message"), MG_ESC(ok ? "Success" : "Failed"));
}
static void handle_settings_get(struct mg_connection *c) {
mg_http_reply(c, 200, s_json_header, "{%m:%s,%m:%hhu,%m:%hhu,%m:%m}\n", //
MG_ESC("log_enabled"),
s_settings.log_enabled ? "true" : "false", //
MG_ESC("log_level"), s_settings.log_level, //
MG_ESC("brightness"), s_settings.brightness, //
MG_ESC("device_name"), MG_ESC(s_settings.device_name));
}
static void handle_firmware_upload(struct mg_connection *c,
struct mg_http_message *hm) {
char name[64], offset[20], total[20];
struct mg_str data = hm->body;
long ofs = -1, tot = -1;
name[0] = offset[0] = '\0';
mg_http_get_var(&hm->query, "name", name, sizeof(name));
mg_http_get_var(&hm->query, "offset", offset, sizeof(offset));
mg_http_get_var(&hm->query, "total", total, sizeof(total));
MG_INFO(("File %s, offset %s, len %lu", name, offset, data.len));
if ((ofs = mg_json_get_long(mg_str(offset), "$", -1)) < 0 ||
(tot = mg_json_get_long(mg_str(total), "$", -1)) < 0) {
mg_http_reply(c, 500, "", "offset and total not set\n");
} else if (ofs == 0 && mg_ota_begin((size_t) tot) == false) {
mg_http_reply(c, 500, "", "mg_ota_begin(%ld) failed\n", tot);
} else if (data.len > 0 && mg_ota_write(data.buf, data.len) == false) {
mg_http_reply(c, 500, "", "mg_ota_write(%lu) @%ld failed\n", data.len, ofs);
mg_ota_end();
} else if (data.len == 0 && mg_ota_end() == false) {
mg_http_reply(c, 500, "", "mg_ota_end() failed\n", tot);
} else {
mg_http_reply(c, 200, s_json_header, "true\n");
if (data.len == 0) {
// Successful mg_ota_end() called, schedule device reboot
mg_timer_add(c->mgr, 500, 0, (void (*)(void *)) mg_device_reset, NULL);
}
} }
} }
static void handle_firmware_commit(struct mg_connection *c) {
mg_http_reply(c, 200, s_json_header, "%s\n",
mg_ota_commit() ? "true" : "false");
}
static void handle_firmware_rollback(struct mg_connection *c) {
mg_http_reply(c, 200, s_json_header, "%s\n",
mg_ota_rollback() ? "true" : "false");
}
static size_t print_status(void (*out)(char, void *), void *ptr, va_list *ap) {
int fw = va_arg(*ap, int);
return mg_xprintf(out, ptr, "{%m:%d,%m:%c%lx%c,%m:%u,%m:%u}\n",
MG_ESC("status"), mg_ota_status(fw), MG_ESC("crc32"), '"',
mg_ota_crc32(fw), '"', MG_ESC("size"), mg_ota_size(fw),
MG_ESC("timestamp"), mg_ota_timestamp(fw));
}
static void handle_firmware_status(struct mg_connection *c) {
mg_http_reply(c, 200, s_json_header, "[%M,%M]\n", print_status,
MG_FIRMWARE_CURRENT, print_status, MG_FIRMWARE_PREVIOUS);
}
static void handle_device_reset(struct mg_connection *c) {
mg_http_reply(c, 200, s_json_header, "true\n");
mg_timer_add(c->mgr, 500, 0, (void (*)(void *)) mg_device_reset, NULL);
}
static void handle_device_eraselast(struct mg_connection *c) {
size_t ss = mg_flash_sector_size(), size = mg_flash_size();
char *base = (char *) mg_flash_start(), *last = base + size - ss;
if (mg_flash_bank() == 2) last -= size / 2;
mg_flash_erase(last);
mg_http_reply(c, 200, s_json_header, "true\n");
}
// HTTP request handler function // HTTP request handler function
void device_dashboard_fn(struct mg_connection *c, int ev, void *ev_data, static void fn(struct mg_connection *c, int ev, void *ev_data) {
void *fn_data) { if (ev == MG_EV_ACCEPT) {
if (ev == MG_EV_OPEN && c->is_listening) { if (c->fn_data != NULL) { // TLS listener!
mg_timer_add(c->mgr, 1000, MG_TIMER_REPEAT, timer_metrics_fn, c->mgr); struct mg_tls_opts opts = {0};
mg_timer_add(c->mgr, 1000, MG_TIMER_REPEAT, timer_mqtt_fn, c->mgr); opts.cert = mg_unpacked("/certs/server_cert.pem");
mg_timer_add(c->mgr, 1000, MG_TIMER_REPEAT, timer_sntp_fn, c->mgr); opts.key = mg_unpacked("/certs/server_key.pem");
s_config.url = strdup(MQTT_SERVER); mg_tls_init(c, &opts);
s_config.pub = strdup(MQTT_PUBLISH_TOPIC); }
s_config.sub = strdup(MQTT_SUBSCRIBE_TOPIC);
} else if (ev == MG_EV_HTTP_MSG) { } else if (ev == MG_EV_HTTP_MSG) {
struct mg_http_message *hm = (struct mg_http_message *) ev_data; struct mg_http_message *hm = (struct mg_http_message *) ev_data;
struct user *u = getuser(hm); struct user *u = authenticate(hm);
// MG_INFO(("%p [%.*s] auth %s", c->fd, (int) hm->uri.len, hm->uri.ptr,
// u ? u->name : "NULL")); if (mg_match(hm->uri, mg_str("/api/#"), NULL) && u == NULL) {
if (mg_http_match_uri(hm, "/api/hi")) { mg_http_reply(c, 403, "", "Not Authorised\n");
mg_http_reply(c, 200, "", "hi\n"); // Testing endpoint } else if (mg_match(hm->uri, mg_str("/api/login"), NULL)) {
} else if (u == NULL && mg_http_match_uri(hm, "/api/#")) { handle_login(c, u);
// All URIs starting with /api/ must be authenticated } else if (mg_match(hm->uri, mg_str("/api/logout"), NULL)) {
mg_http_reply(c, 403, "", "Denied\n"); handle_logout(c);
} else if (mg_http_match_uri(hm, "/api/config/get")) { } else if (mg_match(hm->uri, mg_str("/api/debug"), NULL)) {
mg_http_reply(c, 200, NULL, "{%Q:%Q,%Q:%Q,%Q:%Q,%Q:%s}\n", "url", handle_debug(c, hm);
s_config.url, "pub", s_config.pub, "sub", s_config.sub, } else if (mg_match(hm->uri, mg_str("/api/stats/get"), NULL)) {
"connected", s_connected ? "true" : "false"); handle_stats_get(c);
} else if (mg_http_match_uri(hm, "/api/config/set")) { } else if (mg_match(hm->uri, mg_str("/api/events/get"), NULL)) {
// Admins only handle_events_get(c, hm);
if (strcmp(u->name, "admin") == 0) { } else if (mg_match(hm->uri, mg_str("/api/settings/get"), NULL)) {
update_config(&hm->body, "url", &s_config.url); handle_settings_get(c);
update_config(&hm->body, "pub", &s_config.pub); } else if (mg_match(hm->uri, mg_str("/api/settings/set"), NULL)) {
update_config(&hm->body, "sub", &s_config.sub); handle_settings_set(c, hm->body);
if (s_mqtt) s_mqtt->is_closing = 1; // Ask to disconnect from MQTT } else if (mg_match(hm->uri, mg_str("/api/firmware/upload"), NULL)) {
send_notification(fn_data, "{%Q:%Q,%Q:null}", "name", "config", "data"); handle_firmware_upload(c, hm);
mg_http_reply(c, 200, "", "ok\n"); } else if (mg_match(hm->uri, mg_str("/api/firmware/commit"), NULL)) {
} else { handle_firmware_commit(c);
mg_http_reply(c, 403, "", "Denied\n"); } else if (mg_match(hm->uri, mg_str("/api/firmware/rollback"), NULL)) {
} handle_firmware_rollback(c);
} else if (mg_http_match_uri(hm, "/api/message/send")) { } else if (mg_match(hm->uri, mg_str("/api/firmware/status"), NULL)) {
char buf[256]; handle_firmware_status(c);
if (s_connected && } else if (mg_match(hm->uri, mg_str("/api/device/reset"), NULL)) {
mg_http_get_var(&hm->body, "message", buf, sizeof(buf)) > 0) { handle_device_reset(c);
mg_mqtt_pub(s_mqtt, mg_str(s_config.pub), mg_str(buf), 1, false); } else if (mg_match(hm->uri, mg_str("/api/device/eraselast"), NULL)) {
} handle_device_eraselast(c);
mg_http_reply(c, 200, "", "ok\n");
} else if (mg_http_match_uri(hm, "/api/watch")) {
c->label[0] = 'W'; // Mark ourselves as a event listener
mg_ws_upgrade(c, hm, NULL);
} else if (mg_http_match_uri(hm, "/api/login")) {
mg_http_reply(c, 200, NULL, "{%Q:%Q,%Q:%Q}\n", "user", u->name, "token",
u->token);
} else { } else {
struct mg_http_serve_opts opts = {0}; struct mg_http_serve_opts opts;
#if 1 memset(&opts, 0, sizeof(opts));
opts.root_dir = "/web_root"; #if MG_ARCH == MG_ARCH_UNIX || MG_ARCH == MG_ARCH_WIN32
opts.fs = &mg_fs_packed; opts.root_dir = "web_root"; // On workstations, use filesystem
#else #else
opts.root_dir = "web_root"; opts.root_dir = "/web_root"; // On embedded, use packed files
opts.fs = &mg_fs_packed;
#endif #endif
mg_http_serve_dir(c, ev_data, &opts); mg_http_serve_dir(c, ev_data, &opts);
} }
MG_DEBUG(("%.*s %.*s -> %.*s", (int) hm->method.len, hm->method.ptr, MG_DEBUG(("%lu %.*s %.*s -> %.*s", c->id, (int) hm->method.len,
(int) hm->uri.len, hm->uri.ptr, (int) 3, &c->send.buf[9])); hm->method.buf, (int) hm->uri.len, hm->uri.buf, (int) 3,
&c->send.buf[9]));
} }
} }
void web_init(struct mg_mgr *mgr) {
s_settings.device_name = strdup("My Device");
mg_http_listen(mgr, HTTP_URL, fn, NULL);
mg_http_listen(mgr, HTTPS_URL, fn, (void *) 1);
mg_timer_add(mgr, 3600 * 1000, MG_TIMER_RUN_NOW | MG_TIMER_REPEAT,
timer_sntp_fn, mgr);
}
+35
View File
@@ -0,0 +1,35 @@
// Copyright (c) 2023 Cesanta Software Limited
// All rights reserved
#pragma once
#include "mongoose.h"
#ifdef __cplusplus
extern "C" {
#endif
#if !defined(HTTP_URL)
#define HTTP_URL "http://0.0.0.0:8000"
#endif
#if !defined(HTTPS_URL)
#define HTTPS_URL "https://0.0.0.0:8443"
#endif
#define MAX_DEVICE_NAME 40
#define MAX_EVENTS_NO 400
#define MAX_EVENT_TEXT_SIZE 10
#define EVENTS_PER_PAGE 20
// Event log entry
struct ui_event {
uint8_t type, prio;
unsigned long timestamp;
char text[10];
};
void web_init(struct mg_mgr *mgr);
#ifdef __cplusplus
}
#endif
File diff suppressed because it is too large. Load diff
Binary file not shown.

Before

Width:  |  Height:  |  Size: 283 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 65 KiB

@@ -0,0 +1,17 @@
module.exports = {
content: ['./web_root/*.{html,js}'],
xplugins: [ 'tailwindcss', 'xautoprefixer' ],
corePlugins: {outline: false},
theme: {
extend: {},
fontFamily: {
sans:
[
"Inter var, Helvetica, sans-serif", {
fontFeatureSettings: '"cv11", "ss01"',
fontVariationSettings: '"opsz" 32',
}
]
}
}
}
@@ -0,0 +1 @@
var n,t,e,_,r,o,i,u,l,c={},a=[],s=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function f(n,t){for(var e in t)n[e]=t[e];return n}function p(n){var t=n.parentNode;t&&t.removeChild(n)}function h(t,e,_){var r,o,i,u={};for(i in e)"key"==i?r=e[i]:"ref"==i?o=e[i]:u[i]=e[i];if(arguments.length>2&&(u.children=arguments.length>3?n.call(arguments,2):_),"function"==typeof t&&null!=t.defaultProps)for(i in t.defaultProps)void 0===u[i]&&(u[i]=t.defaultProps[i]);return d(t,u,r,o,null)}function d(n,_,r,o,i){var u={type:n,props:_,key:r,ref:o,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==i?++e:i};return null==i&&null!=t.vnode&&t.vnode(u),u}function v(){return{current:null}}function m(n){return n.children}function y(n,t){this.props=n,this.context=t}function g(n,t){if(null==t)return n.__?g(n.__,n.__.__k.indexOf(n)+1):null;for(var e;t<n.__k.length;t++)if(null!=(e=n.__k[t])&&null!=e.__e)return e.__e;return"function"==typeof n.type?g(n):null}function b(n){var t,e;if(null!=(n=n.__)&&null!=n.__c){for(n.__e=n.__c.base=null,t=0;t<n.__k.length;t++)if(null!=(e=n.__k[t])&&null!=e.__e){n.__e=n.__c.base=e.__e;break}return b(n)}}function k(n){(!n.__d&&(n.__d=!0)&&r.push(n)&&!C.__r++||o!==t.debounceRendering)&&((o=t.debounceRendering)||i)(C)}function C(){var n,t,e,_,o,i,l,c;for(r.sort(u);n=r.shift();)n.__d&&(t=r.length,_=void 0,o=void 0,l=(i=(e=n).__v).__e,(c=e.__P)&&(_=[],(o=f({},i)).__v=i.__v+1,T(c,i,o,e.__n,void 0!==c.ownerSVGElement,null!=i.__h?[l]:null,_,null==l?g(i):l,i.__h),R(_,i),i.__e!=l&&b(i)),r.length>t&&r.sort(u));C.__r=0}function x(n,t,e,_,r,o,i,u,l,s){var f,p,h,v,y,b,k,C=_&&_.__k||a,x=C.length;for(e.__k=[],f=0;f<t.length;f++)if(null!=(v=e.__k[f]=null==(v=t[f])||"boolean"==typeof v||"function"==typeof v?null:"string"==typeof v||"number"==typeof v||"bigint"==typeof v?d(null,v,null,null,v):Array.isArray(v)?d(m,{children:v},null,null,null):v.__b>0?d(v.type,v.props,v.key,v.ref?v.ref:null,v.__v):v)){if(v.__=e,v.__b=e.__b+1,null===(h=C[f])||h&&v.key==h.key&&v.type===h.type)C[f]=void 0;else for(p=0;p<x;p++){if((h=C[p])&&v.key==h.key&&v.type===h.type){C[p]=void 0;break}h=null}T(n,v,h=h||c,r,o,i,u,l,s),y=v.__e,(p=v.ref)&&h.ref!=p&&(k||(k=[]),h.ref&&k.push(h.ref,null,v),k.push(p,v.__c||y,v)),null!=y?(null==b&&(b=y),"function"==typeof v.type&&v.__k===h.__k?v.__d=l=E(v,l,n):l=U(n,v,h,C,y,l),"function"==typeof e.type&&(e.__d=l)):l&&h.__e==l&&l.parentNode!=n&&(l=g(h))}for(e.__e=b,f=x;f--;)null!=C[f]&&("function"==typeof e.type&&null!=C[f].__e&&C[f].__e==e.__d&&(e.__d=A(_).nextSibling),W(C[f],C[f]));if(k)for(f=0;f<k.length;f++)M(k[f],k[++f],k[++f])}function E(n,t,e){for(var _,r=n.__k,o=0;r&&o<r.length;o++)(_=r[o])&&(_.__=n,t="function"==typeof _.type?E(_,t,e):U(e,_,_,r,_.__e,t));return t}function H(n,t){return t=t||[],null==n||"boolean"==typeof n||(Array.isArray(n)?n.some((function(n){H(n,t)})):t.push(n)),t}function U(n,t,e,_,r,o){var i,u,l;if(void 0!==t.__d)i=t.__d,t.__d=void 0;else if(null==e||r!=o||null==r.parentNode)n:if(null==o||o.parentNode!==n)n.appendChild(r),i=null;else{for(u=o,l=0;(u=u.nextSibling)&&l<_.length;l+=1)if(u==r)break n;n.insertBefore(r,o),i=o}return void 0!==i?i:r.nextSibling}function A(n){var t,e,_;if(null==n.type||"string"==typeof n.type)return n.__e;if(n.__k)for(t=n.__k.length-1;t>=0;t--)if((e=n.__k[t])&&(_=A(e)))return _;return null}function P(n,t,e,_,r){var o;for(o in e)"children"===o||"key"===o||o in t||N(n,o,null,e[o],_);for(o in t)r&&"function"!=typeof t[o]||"children"===o||"key"===o||"value"===o||"checked"===o||e[o]===t[o]||N(n,o,t[o],e[o],_)}function S(n,t,e){"-"===t[0]?n.setProperty(t,null==e?"":e):n[t]=null==e?"":"number"!=typeof e||s.test(t)?e:e+"px"}function N(n,t,e,_,r){var o;n:if("style"===t)if("string"==typeof e)n.style.cssText=e;else{if("string"==typeof _&&(n.style.cssText=_=""),_)for(t in _)e&&t in e||S(n.style,t,"");if(e)for(t in e)_&&e[t]===_[t]||S(n.style,t,e[t])}else if("o"===t[0]&&"n"===t[1])o=t!==(t=t.replace(/Capture$/,"")),t=t.toLowerCase()in n?t.toLowerCase().slice(2):t.slice(2),n.l||(n.l={}),n.l[t+o]=e,e?_||n.addEventListener(t,o?D:w,o):n.removeEventListener(t,o?D:w,o);else if("dangerouslySetInnerHTML"!==t){if(r)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!==t&&"height"!==t&&"href"!==t&&"list"!==t&&"form"!==t&&"tabIndex"!==t&&"download"!==t&&t in n)try{n[t]=null==e?"":e;break n}catch(n){}"function"==typeof e||(null==e||!1===e&&"-"!==t[4]?n.removeAttribute(t):n.setAttribute(t,e))}}function w(n){return this.l[n.type+!1](t.event?t.event(n):n)}function D(n){return this.l[n.type+!0](t.event?t.event(n):n)}function T(n,e,_,r,o,i,u,l,c){var a,s,p,h,d,v,g,b,k,C,E,H,U,A,P,S=e.type;if(void 0!==e.constructor)return null;null!=_.__h&&(c=_.__h,l=e.__e=_.__e,e.__h=null,i=[l]),(a=t.__b)&&a(e);try{n:if("function"==typeof S){if(b=e.props,k=(a=S.contextType)&&r[a.__c],C=a?k?k.props.value:a.__:r,_.__c?g=(s=e.__c=_.__c).__=s.__E:("prototype"in S&&S.prototype.render?e.__c=s=new S(b,C):(e.__c=s=new y(b,C),s.constructor=S,s.rLine truncated
@@ -0,0 +1,356 @@
'use strict';
import { h, render, useState, useEffect, useRef, html, Router } from './bundle.js';
// Helper function that returns a promise that resolves after delay
const Delay = (ms, val) => new Promise(resolve => setTimeout(resolve, ms, val));
export const Icons = {
heart: props => html`<svg class=${props.class} xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4.318 6.318a4.5 4.5 0 000 6.364L12 20.364l7.682-7.682a4.5 4.5 0 00-6.364-6.364L12 7.636l-1.318-1.318a4.5 4.5 0 00-6.364 0z"></path></svg>`,
downArrowBox: props => html`<svg class=${props.class} xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"> <path stroke-linecap="round" stroke-linejoin="round" d="M9 8.25H7.5a2.25 2.25 0 00-2.25 2.25v9a2.25 2.25 0 002.25 2.25h9a2.25 2.25 0 002.25-2.25v-9a2.25 2.25 0 00-2.25-2.25H15M9 12l3 3m0 0l3-3m-3 3V2.25" /> </svg>`,
upArrowBox: props => html`<svg class=${props.class} xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"> <path stroke-linecap="round" stroke-linejoin="round" d="M9 8.25H7.5a2.25 2.25 0 00-2.25 2.25v9a2.25 2.25 0 002.25 2.25h9a2.25 2.25 0 002.25-2.25v-9a2.25 2.25 0 00-2.25-2.25H15m0-3l-3-3m0 0l-3 3m3-3V15" /> </svg>`,
cog: props => html`<svg class=${props.class} xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"> <path stroke-linecap="round" stroke-linejoin="round" d="M9.594 3.94c.09-.542.56-.94 1.11-.94h2.593c.55 0 1.02.398 1.11.94l.213 1.281c.063.374.313.686.645.87.074.04.147.083.22.127.324.196.72.257 1.075.124l1.217-.456a1.125 1.125 0 011.37.49l1.296 2.247a1.125 1.125 0 01-.26 1.431l-1.003.827c-.293.24-.438.613-.431.992a6.759 6.759 0 010 .255c-.007.378.138.75.43.99l1.005.828c.424.35.534.954.26 1.43l-1.298 2.247a1.125 1.125 0 01-1.369.491l-1.217-.456c-.355-.133-.75-.072-1.076.124a6.57 6.57 0 01-.22.128c-.331.183-.581.495-.644.869l-.213 1.28c-.09.543-.56.941-1.11.941h-2.594c-.55 0-1.02-.398-1.11-.94l-.213-1.281c-.062-.374-.312-.686-.644-.87a6.52 6.52 0 01-.22-.127c-.325-.196-.72-.257-1.076-.124l-1.217.456a1.125 1.125 0 01-1.369-.49l-1.297-2.247a1.125 1.125 0 01.26-1.431l1.004-.827c.292-.24.437-.613.43-.992a6.932 6.932 0 010-.255c.007-.378-.138-.75-.43-.99l-1.004-.828a1.125 1.125 0 01-.26-1.43l1.297-2.247a1.125 1.125 0 011.37-.491l1.216.456c.356.133.751.072 1.076-.124.072-.044.146-.087.22-.128.332-.183.582-.495.644-.869l.214-1.281z" /> <path stroke-linecap="round" stroke-linejoin="round" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z" /> </svg>`,
settingsH: props => html`<svg class=${props.class} xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"> <path stroke-linecap="round" stroke-linejoin="round" d="M10.5 6h9.75M10.5 6a1.5 1.5 0 11-3 0m3 0a1.5 1.5 0 10-3 0M3.75 6H7.5m3 12h9.75m-9.75 0a1.5 1.5 0 01-3 0m3 0a1.5 1.5 0 00-3 0m-3.75 0H7.5m9-6h3.75m-3.75 0a1.5 1.5 0 01-3 0m3 0a1.5 1.5 0 00-3 0m-9.75 0h9.75" /> </svg>`,
settingsV: props => html`<svg class=${props.class} xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"> <path stroke-linecap="round" stroke-linejoin="round" d="M6 13.5V3.75m0 9.75a1.5 1.5 0 010 3m0-3a1.5 1.5 0 000 3m0 3.75V16.5m12-3V3.75m0 9.75a1.5 1.5 0 010 3m0-3a1.5 1.5 0 000 3m0 3.75V16.5m-6-9V3.75m0 3.75a1.5 1.5 0 010 3m0-3a1.5 1.5 0 000 3m0 9.75V10.5" /> </svg>`,
scan: props => html`<svg class=${props.class} xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"> <path stroke-linecap="round" stroke-linejoin="round" d="M7.5 3.75H6A2.25 2.25 0 003.75 6v1.5M16.5 3.75H18A2.25 2.25 0 0120.25 6v1.5m0 9V18A2.25 2.25 0 0118 20.25h-1.5m-9 0H6A2.25 2.25 0 013.75 18v-1.5M15 12a3 3 0 11-6 0 3 3 0 016 0z" /> </svg> `,
desktop: props => html`<svg class=${props.class} xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"> <path stroke-linecap="round" stroke-linejoin="round" d="M9 17.25v1.007a3 3 0 01-.879 2.122L7.5 21h9l-.621-.621A3 3 0 0115 18.257V17.25m6-12V15a2.25 2.25 0 01-2.25 2.25H5.25A2.25 2.25 0 013 15V5.25m18 0A2.25 2.25 0 0018.75 3H5.25A2.25 2.25 0 003 5.25m18 0V12a2.25 2.25 0 01-2.25 2.25H5.25A2.25 2.25 0 013 12V5.25" /> </svg>`,
alert: props => html`<svg class=${props.class} xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"> <path stroke-linecap="round" stroke-linejoin="round" d="M14.857 17.082a23.848 23.848 0 005.454-1.31A8.967 8.967 0 0118 9.75v-.7V9A6 6 0 006 9v.75a8.967 8.967 0 01-2.312 6.022c1.733.64 3.56 1.085 5.455 1.31m5.714 0a24.255 24.255 0 01-5.714 0m5.714 0a3 3 0 11-5.714 0M3.124 7.5A8.969 8.969 0 015.292 3m13.416 0a8.969 8.969 0 012.168 4.5" /> </svg>`,
bell: props => html`<svg class=${props.class} xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"> <path stroke-linecap="round" stroke-linejoin="round" d="M14.857 17.082a23.848 23.848 0 005.454-1.31A8.967 8.967 0 0118 9.75v-.7V9A6 6 0 006 9v.75a8.967 8.967 0 01-2.312 6.022c1.733.64 3.56 1.085 5.455 1.31m5.714 0a24.255 24.255 0 01-5.714 0m5.714 0a3 3 0 11-5.714 0M3.124 7.5A8.969 8.969 0 015.292 3m13.416 0a8.969 8.969 0 012.168 4.5" /> </svg>`,
refresh: props => html`<svg class=${props.class} xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"> <path stroke-linecap="round" stroke-linejoin="round" d="M16.023 9.348h4.992v-.001M2.985 19.644v-4.992m0 0h4.992m-4.993 0l3.181 3.183a8.25 8.25 0 0013.803-3.7M4.031 9.865a8.25 8.25 0 0113.803-3.7l3.181 3.182m0-4.991v4.99" /> </svg> `,
bars4: props => html`<svg class=${props.class} xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"> <path stroke-linecap="round" stroke-linejoin="round" d="M3.75 5.25h16.5m-16.5 4.5h16.5m-16.5 4.5h16.5m-16.5 4.5h16.5" /> </svg>`,
bars3: props => html`<svg class=${props.class} xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"> <path stroke-linecap="round" stroke-linejoin="round" d="M3.75 6.75h16.5M3.75 12h16.5m-16.5 5.25h16.5" /> </svg>`,
logout: props => html`<svg class=${props.class} xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"> <path stroke-linecap="round" stroke-linejoin="round" d="M12.75 15l3-3m0 0l-3-3m3 3h-7.5M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /> </svg>`,
save: props => html`<svg class=${props.class} xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"> <path stroke-linecap="round" stroke-linejoin="round" d="M16.5 3.75V16.5L12 14.25 7.5 16.5V3.75m9 0H18A2.25 2.25 0 0120.25 6v12A2.25 2.25 0 0118 20.25H6A2.25 2.25 0 013.75 18V6A2.25 2.25 0 016 3.75h1.5m9 0h-9" /> </svg>`,
email: props => html`<svg class=${props.class} xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"> <path stroke-linecap="round" stroke-linejoin="round" d="M21.75 6.75v10.5a2.25 2.25 0 01-2.25 2.25h-15a2.25 2.25 0 01-2.25-2.25V6.75m19.5 0A2.25 2.25 0 0019.5 4.5h-15a2.25 2.25 0 00-2.25 2.25m19.5 0v.243a2.25 2.25 0 01-1.07 1.916l-7.5 4.615a2.25 2.25 0 01-2.36 0L3.32 8.91a2.25 2.25 0 01-1.07-1.916V6.75" /> </svg>`,
expand: props => html`<svg class=${props.class} xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"> <path stroke-linecap="round" stroke-linejoin="round" d="M3.75 3.75v4.5m0-4.5h4.5m-4.5 0L9 9M3.75 20.25v-4.5m0 4.5h4.5m-4.5 0L9 15M20.25 3.75h-4.5m4.5 0v4.5m0-4.5L15 9m5.25 11.25h-4.5m4.5 0v-4.5m0 4.5L15 15" /> </svg>`,
shrink: props => html`<svg class=${props.class} xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"> <path stroke-linecap="round" stroke-linejoin="round" d="M9 9V4.5M9 9H4.5M9 9L3.75 3.75M9 15v4.5M9 15H4.5M9 15l-5.25 5.25M15 9h4.5M15 9V4.5M15 9l5.25-5.25M15 15h4.5M15 15v4.5m0-4.5l5.25 5.25" /> </svg>`,
ok: props => html`<svg class=${props.class} fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" aria-hidden="true"> <path stroke-linecap="round" stroke-linejoin="round" d="M9 12.75L11.25 15 15 9.75M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /> </svg>`,
fail: props => html`<svg class=${props.class} xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"> <path stroke-linecap="round" stroke-linejoin="round" d="M9.75 9.75l4.5 4.5m0-4.5l-4.5 4.5M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /> </svg>`,
upload: props => html`<svg class=${props.class} xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"> <path stroke-linecap="round" stroke-linejoin="round" d="M3 16.5v2.25A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75V16.5m-13.5-9L12 3m0 0l4.5 4.5M12 3v13.5" /> </svg> `,
download: props => html`<svg class=${props.class} xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"> <path stroke-linecap="round" stroke-linejoin="round" d="M3 16.5v2.25A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75V16.5M16.5 12L12 16.5m0 0L7.5 12m4.5 4.5V3" /> </svg> `,
bolt: props => html`<svg class=${props.class} xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"> <path stroke-linecap="round" stroke-linejoin="round" d="M3.75 13.5l10.5-11.25L12 10.5h8.25L9.75 21.75 12 13.5H3.75z" /> </svg>`,
home: props => html`<svg class=${props.class} xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"> <path stroke-linecap="round" stroke-linejoin="round" d="M2.25 12l8.954-8.955c.44-.439 1.152-.439 1.591 0L21.75 12M4.5 9.75v10.125c0 .621.504 1.125 1.125 1.125H9.75v-4.875c0-.621.504-1.125 1.125-1.125h2.25c.621 0 1.125.504 1.125 1.125V21h4.125c.621 0 1.125-.504 1.125-1.125V9.75M8.25 21h8.25" /> </svg> `,
link: props => html`<svg class=${props.class} xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"> <path stroke-linecap="round" stroke-linejoin="round" d="M13.19 8.688a4.5 4.5 0 011.242 7.244l-4.5 4.5a4.5 4.5 0 01-6.364-6.364l1.757-1.757m13.35-.622l1.757-1.757a4.5 4.5 0 00-6.364-6.364l-4.5 4.5a4.5 4.5 0 001.242 7.244" /> </svg> `,
shield: props => html`<svg class=${props.class} xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"> <path stroke-linecap="round" stroke-linejoin="round" d="M9 12.75L11.25 15 15 9.75m-3-7.036A11.959 11.959 0 013.598 6 11.99 11.99 0 003 9.749c0 5.592 3.824 10.29 9 11.623 5.176-1.332 9-6.03 9-11.622 0-1.31-.21-2.571-.598-3.751h-.152c-3.196 0-6.1-1.248-8.25-3.285z" /> </svg> `,
barsdown: props => html`<svg class=${props.class} xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"> <path stroke-linecap="round" stroke-linejoin="round" d="M3 4.5h14.25M3 9h9.75M3 13.5h9.75m4.5-4.5v12m0 0l-3.75-3.75M17.25 21L21 17.25" /> </svg> `,
arrowdown: props => html`<svg class=${props.class} xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"> <path stroke-linecap="round" stroke-linejoin="round" d="M12 4.5v15m0 0l6.75-6.75M12 19.5l-6.75-6.75" /> </svg> `,
arrowup: props => html`<svg class=${props.class} xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"> <path stroke-linecap="round" stroke-linejoin="round" d="M12 19.5v-15m0 0l-6.75 6.75M12 4.5l6.75 6.75" /> </svg>`,
warn: props => html`<svg class=${props.class} xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"> <path stroke-linecap="round" stroke-linejoin="round" d="M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126zM12 15.75h.007v.008H12v-.008z" /> </svg>`,
info: props => html`<svg class=${props.class} xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"> <path stroke-linecap="round" stroke-linejoin="round" d="M11.25 11.25l.041-.02a.75.75 0 011.063.852l-.708 2.836a.75.75 0 001.063.853l.041-.021M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-9-3.75h.008v.008H12V8.25z" /> </svg>`,
exclamationTriangle: props => html`<svg class=${props.class} xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"> <path stroke-linecap="round" stroke-linejoin="round" d="M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126zM12 15.75h.007v.008H12v-.008z" /> </svg>`,
thumbUp: props => html`<svg class=${props.class} xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"> <path stroke-linecap="round" stroke-linejoin="round" d="M6.633 10.5c.806 0 1.533-.446 2.031-1.08a9.041 9.041 0 012.861-2.4c.723-.384 1.35-.956 1.653-1.715a4.498 4.498 0 00.322-1.672V3a.75.75 0 01.75-.75A2.25 2.25 0 0116.5 4.5c0 1.152-.26 2.243-.723 3.218-.266.558.107 1.282.725 1.282h3.126c1.026 0 1.945.694 2.054 1.715.045.422.068.85.068 1.285a11.95 11.95 0 01-2.649 7.521c-.388.482-.987.729-1.605.729H13.48c-.483 0-.964-.078-1.423-.23l-3.114-1.04a4.501 4.501 0 00-1.423-.23H5.904M14.25 9h2.25M5.904 18.75c.083.205.173.405.27.602.197.4-.078.898-.523.898h-.908c-.889 0-1.713-.518-1.972-1.368a12 12 0 01-.521-3.507c0-1.553.295-3.036.831-4.398C3.387 10.203 4.167 9.75 5 9.75h1.053c.472 0 .745.556.5.96a8.958 8.958 0 00-1.302 4.665c0 1.194.232 2.333.654 3.375z" /> </svg>`,
backward: props => html`<svg class=${props.class} xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"> <path stroke-linecap="round" stroke-linejoin="round" d="M21 16.811c0 .864-.933 1.405-1.683.977l-7.108-4.062a1.125 1.125 0 010-1.953l7.108-4.062A1.125 1.125 0 0121 8.688v8.123zM11.25 16.811c0 .864-.933 1.405-1.683.977l-7.108-4.062a1.125 1.125 0 010-1.953L9.567 7.71a1.125 1.125 0 011.683.977v8.123z" /> </svg>`,
chip: props => html`<svg class=${props.class} xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"> <path stroke-linecap="round" stroke-linejoin="round" d="M8.25 3v1.5M4.5 8.25H3m18 0h-1.5M4.5 12H3m18 0h-1.5m-15 3.75H3m18 0h-1.5M8.25 19.5V21M12 3v1.5m0 15V21m3.75-18v1.5m0 15V21m-9-1.5h10.5a2.25 2.25 0 002.25-2.25V6.75a2.25 2.25 0 00-2.25-2.25H6.75A2.25 2.25 0 004.5 6.75v10.5a2.25 2.25 0 002.25 2.25zm.75-12h9v9h-9v-9z" /> </svg>`,
camera: props => html`<svg class=${props.class} xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"> <path stroke-linecap="round" stroke-linejoin="round" d="M6.827 6.175A2.31 2.31 0 015.186 7.23c-.38.054-.757.112-1.134.175C2.999 7.58 2.25 8.507 2.25 9.574V18a2.25 2.25 0 002.25 2.25h15A2.25 2.25 0 0021.75 18V9.574c0-1.067-.75-1.994-1.802-2.169a47.865 47.865 0 00-1.134-.175 2.31 2.31 0 01-1.64-1.055l-.822-1.316a2.192 2.192 0 00-1.736-1.039 48.774 48.774 0 00-5.232 0 2.192 2.192 0 00-1.736 1.039l-.821 1.316z" /> <path stroke-linecap="round" stroke-linejoin="round" d="M16.5 12.75a4.5 4.5 0 11-9 0 4.5 4.5 0 019 0zM18.75 10.5h.008v.008h-.008V10.5z" /> </svg>`,
arrows: props => html`<svg class=${props.class} xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"> <path stroke-linecap="round" stroke-linejoin="round" d="M7.5 21L3 16.5m0 0L7.5 12M3 16.5h13.5m0-13.5L21 7.5m0 0L16.5 12M21 7.5H7.5" /> </svg>`,
doc: props => html`<svg class=${props.class} xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"> <path stroke-linecap="round" stroke-linejoin="round" d="M19.5 14.25v-2.625a3.375 3.375 0 00-3.375-3.375h-1.5A1.125 1.125 0 0113.5 7.125v-1.5a3.375 3.375 0 00-3.375-3.375H8.25m2.25 0H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 00-9-9z" /></svg>`,
};
export const tipColors = {
green: 'bg-green-100 text-green-900 ring-green-300',
yellow: 'bg-yellow-100 text-yellow-900 ring-yellow-300',
red: 'bg-red-100 text-red-900 ring-red-300',
};
export function Button({title, onclick, disabled, cls, icon, ref, colors, hovercolor, disabledcolor}) {
const [spin, setSpin] = useState(false);
const cb = function(ev) {
const res = onclick ? onclick() : null;
if (res && typeof (res.catch) === 'function') {
setSpin(true);
res.catch(() => false).then(() => setSpin(false));
}
};
if (!colors) colors = 'bg-blue-600 hover:bg-blue-500 disabled:bg-blue-400';
return html`
<button type="button" class="inline-flex justify-center items-center gap-2 rounded px-2.5 py-1.5 text-sm font-semibold text-white shadow-sm ${colors} ${cls}"
ref=${ref} onclick=${cb} disabled=${disabled || spin} >
${title}
<${spin ? Icons.refresh : icon} class="w-4 ${spin ? 'animate-spin' : ''}" />
<//>`
};
export function Notification({ok, text, close}) {
const closebtn = useRef(null);
const from = 'translate-y-2 opacity-0 sm:translate-y-0 sm:translate-x-2';
const to = 'translate-y-0 opacity-100 sm:translate-x-0';
const [tr, setTr] = useState(from);
useEffect(function() {
setTr(to);
setTimeout(ev => closebtn && closebtn.current.click && closebtn.current.click(), 1500);
}, []);
const onclose = ev => { setTr(from); setTimeout(close, 300); };
return html`
<div aria-live="assertive" class="z-10 pointer-events-none absolute inset-0 flex items-end px-4 py-6 sm:items-start sm:p-6">
<div class="flex w-full flex-col items-center space-y-4 sm:items-end">
<div class="pointer-events-auto w-full max-w-sm overflow-hidden rounded-lg bg-white shadow-lg ring-1 ring-black ring-opacity-5 transform ease-out duration-300 transition ${tr}">
<div class="p-4">
<div class="flex items-start">
<div class="flex-shrink-0">
<${ok ? Icons.ok : Icons.fail} class="h-6 w-6 ${ok ? 'text-green-400' : 'text-red-400'}" />
<//>
<div class="ml-3 w-0 flex-1 pt-0.5">
<p class="text-sm font-medium text-gray-900">${text}</p>
<p class="hidden mt-1 text-sm text-gray-500">Anyone with a link can now view this file.</p>
<//>
<div class="ml-4 flex flex-shrink-0">
<button type="button" ref=${closebtn} onclick=${onclose} class="inline-flex rounded-md bg-white text-gray-400 hover:text-gray-500 focus:outline-none">
<span class="sr-only">Close</span>
<svg class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
<path d="M6.28 5.22a.75.75 0 00-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 101.06 1.06L10 11.06l3.72 3.72a.75.75 0 101.06-1.06L11.06 10l3.72-3.72a.75.75 0 00-1.06-1.06L10 8.94 6.28 5.22z" />
<//>
<//>
<//>
<//>
<//>
<//>
<//>
<//>`;
};
export function Login({loginFn, logoIcon, title, tipText}) {
const [user, setUser] = useState('');
const [pass, setPass] = useState('');
const onsubmit = function(ev) {
const authhdr = 'Basic ' + btoa(user + ':' + pass);
const headers = {Authorization: authhdr};
return fetch('api/login', {headers}).then(loginFn).finally(r => setPass(''));
};
return html`
<div class="h-full flex items-center justify-center bg-slate-200">
<div class="border rounded bg-white w-96 p-5">
<div class="my-5 py-2 flex items-center justify-center gap-x-4">
<${logoIcon} class="h-12 stroke-cyan-600 stroke-1" />
<h1 class="font-bold text-xl">${title || 'Login'}<//>
<//>
<div class="my-3">
<label class="block text-sm mb-1 dark:text-white">Username</label>
<input type="text" autocomplete="current-user" required
class="font-normal bg-white rounded border border-gray-300 w-full
flex-1 py-0.5 px-2 text-gray-900 placeholder:text-gray-400
focus:outline-none sm:text-sm sm:leading-6 disabled:cursor-not-allowed
disabled:bg-gray-100 disabled:text-gray-500"
oninput=${ev => setUser(ev.target.value)} value=${user} />
<//>
<div class="my-3">
<label class="block text-sm mb-1 dark:text-white">Password</label>
<input type="password" autocomplete="current-password" required
class="font-normal bg-white rounded border border-gray-300 w-full flex-1 py-0.5 px-2 text-gray-900 placeholder:text-gray-400 focus:outline-none sm:text-sm sm:leading-6 disabled:cursor-not-allowed disabled:bg-gray-100 disabled:text-gray-500"
oninput=${ev => setPass(ev.target.value)}
value=${pass} onchange=${onsubmit} />
<//>
<div class="mt-7">
<${Button} title="Sign In" icon=${Icons.logout} onclick=${onsubmit} cls="flex w-full justify-center" />
<//>
<div class="mt-5 text-slate-400 text-xs">${tipText}<//>
<//>
<//>`;
};
export function Colored({icon, text, colors}) {
colors ||= 'bg-slate-100 text-slate-900';
return html`
<span class="inline-flex items-center gap-1.5 py-0.5">
${icon && html`<${icon} class="w-5 h-5" />`}
<span class="inline-block font-medium rounded-md px-2 py-1 text-xs ring-1 ring-inset ${colors}">${text}<//>
<//>`;
};
export function Stat({title, text, tipText, tipIcon, tipColors, colors}) {
return html`
<div class="flex flex-col bg-white border shadow-sm rounded-xl dark:bg-slate-900 dark:border-gray-800">
<div class="overflow-auto rounded-lg bg-white px-4 py-2 ">
<div class="flex items-center gap-x-2">
<p class="text-sm truncate text-gray-500 font-medium"> ${title} </p>
<//>
<div class="mt-1 flex items-center gap-x-2">
<h3 class="text-xl truncate font-semibold tracking-tight ${colors || 'text-gray-800 dark:text-gray-200'}">
${text}
<//>
<span class="flex items-center ${tipText || 'hidden'}">
<${Colored} text=${tipText} icon=${tipIcon} colors=${tipColors} />
<//>
<//>
<//>
<//>`;
};
export function TextValue({value, setfn, disabled, placeholder, type, addonRight, addonLeft, attr, min, max, step, mult}) {
const [bg, setBg] = useState('bg-white');
useEffect(() => { if (type == 'number') checkval(+min, +max, +value); }, []);
step ||= '1', mult ||= 1;
const checkval = function(min, max, v) {
setBg('bg-white');
if (min && v < min) setBg('bg-red-100 border-red-200');
if (max && v > max) setBg('bg-red-100 border-red-200');
};
const m = step.match(/^.+\.(.+)/);
const digits = m ? m[1].length : 0;
const onchange = ev => {
let v = ev.target.value;
if (type == 'number') {
checkval(+min, +max, +v);
v = +(parseFloat(v) / mult).toFixed(digits);
}
setfn(v);
};
if (type == 'number') value = +(value * mult).toFixed(digits);
return html`
<div class="flex w-full items-center rounded border shadow-sm ${bg}">
${addonLeft && html`<span class="inline-flex font-normal truncate py-1 border-r bg-slate-100 items-center border-gray-300 px-2 text-gray-500 text-xs">${addonLeft}<//>` }
<input type=${type || 'text'} disabled=${disabled} value=${value}
step=${step} min=${min} max=${max}
onchange=${onchange} ...${attr}
class="${bg} font-normal text-sm rounded w-full flex-1 py-0.5 px-2 text-gray-700 placeholder:text-gray-400 focus:outline-none disabled:cursor-not-allowed disabled:bg-gray-100 disabled:text-gray-500" placeholder=${placeholder} />
${addonRight && html`<span class="inline-flex font-normal truncate py-1 border-l bg-slate-100 items-center border-gray-300 px-2 text-gray-500 text-xs overflow-scroll" style="min-width: 50%;">${addonRight}<//>` }
<//>`;
};
export function SelectValue({value, setfn, options, disabled}) {
const toInt = x => x == parseInt(x) ? parseInt(x) : x;
const onchange = ev => setfn(toInt(ev.target.value));
return html`
<select onchange=${onchange} class="w-full rounded font-normal border py-0.5 px-1 text-gray-600 focus:outline-none text-sm disabled:cursor-not-allowed" disabled=${disabled}>
${options.map(v => html`<option value=${v[0]} selected=${v[0] == value}>${v[1]}<//>`) }
<//>`;
};
export function SwitchValue({value, setfn}) {
const onclick = ev => setfn(!value);
const bg = !!value ? 'bg-blue-600' : 'bg-gray-200';
const tr = !!value ? 'translate-x-5' : 'translate-x-0';
return html`
<button type="button" onclick=${onclick} class="${bg} inline-flex h-6 w-11 flex-shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus:outline-none focus:ring-0 ring-0" role="switch" aria-checked=${!!value}>
<span aria-hidden="true" class="${tr} pointer-events-none inline-block h-5 w-5 transform rounded-full bg-white shadow ring-0 focus:ring-0 transition duration-200 ease-in-out"></span>
</button>`;
};
export function Setting(props) {
let input = TextValue;
if (props.type == 'switch') input = SwitchValue;
if (props.type == 'select') input = SelectValue;
return html`
<div class=${props.cls || 'grid grid-cols-2 gap-2 my-1'}>
<label class="flex items-center text-sm text-gray-700 mr-2 font-medium ${props.title || 'hidden'}">${props.title}<//>
<div class="flex items-center">${h(input, props)}<//>
<//>`;
};
export function Pagination({ totalItems, itemsPerPage, currentPage, setPageFn, colors }) {
const totalPages = Math.ceil(totalItems / itemsPerPage);
const maxPageRange = 2;
const lessThanSymbol = "<";
const greaterThanSymbol = ">";
const whiteSpace = " ";
const itemcls = 'relative inline-flex items-center px-3 py-1 text-sm focus:z-20 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-0 focus-visible:outline-blue-600';
colors ||= 'bg-blue-600';
const PageItem = ({ page, isActive }) => (
html`<a
onClick=${() => setPageFn(page)}
class="${itemcls} ${isActive ? `${colors} text-white` : 'cursor-pointer text-gray-700 ring-1 ring-inset ring-gray-300 hover:bg-gray-50'}"
>
${page}
</a>`
);
return html`
<div class="flex items-center justify-between bg-white px-3 py-2">
<div class="sm:flex sm:flex-1 sm:items-center sm:justify-between space-x-4 whitespace-nowrap select-none">
<p class="text-sm text-slate-500 font-medium">
showing <span class="font-bold text-slate-700">${(currentPage - 1) * itemsPerPage + 1}</span> - <span class="font-medium">${Math.min(currentPage * itemsPerPage, totalItems)}</span> of ${whiteSpace}
<span class="font-bold text-slate-700">${totalItems}</span> results
</p>
<div>
<nav class="isolate inline-flex -space-x-px rounded-md" aria-label="Pagination">
<a
onClick=${() => setPageFn(Math.max(currentPage - 1, 1))}
class="relative inline-flex px-3 items-center text-gray-400 ring-1 ring-inset ring-gray-300 hover:bg-gray-50 ${currentPage != 1 ? 'cursor-pointer' : ''} focus:z-20 focus:outline-offset-0">
${lessThanSymbol}
</a>
<${PageItem} page=${1} isActive=${currentPage === 1} />
${currentPage > maxPageRange + 2 ? html`<span class="${itemcls} ring-1 ring-inset ring-gray-300 text-slate-300">...</span>` : ''}
${Array.from({length: Math.min(totalPages, maxPageRange * 2 + 1)}, (_, i) => Math.max(2, currentPage - maxPageRange) + i).map(page => page > 1 && page < totalPages && html`<${PageItem} page=${page} isActive=${currentPage === page} />`)}
${currentPage < totalPages - (maxPageRange + 1) ? html`<span class="${itemcls} ring-1 ring-inset ring-gray-300 text-slate-300">...</span>` : ''}
${totalPages > 1 ? html`<${PageItem} page=${totalPages} isActive=${currentPage === totalPages} />` : ''}
<a
onClick=${() => setPageFn(Math.min(currentPage + 1, totalPages))}
class="relative inline-flex px-3 items-center text-gray-400 ring-1 ring-inset ring-gray-300 hover:bg-gray-50 ${currentPage != totalPages ? 'cursor-pointer' : ''} focus:z-20 focus:outline-offset-0">
${greaterThanSymbol}
</a>
</nav>
</div>
</div>
</div>`;
};
export function UploadFileButton(props) {
const [upload, setUpload] = useState(null); // Upload promise
const [status, setStatus] = useState(''); // Current upload status
const btn = useRef(null);
const input = useRef(null);
// Send a large file chunk by chunk
const sendFileData = function(url, fileName, fileData, chunkSize) {
return new Promise(function(resolve, reject) {
const finish = ok => {
setUpload(null);
const res = props.onupload ? props.onupload(ok, fileName, fileData.length) : null;
if (res && typeof (res.catch) === 'function') {
res.catch(() => false).then(() => ok ? resolve() : reject());
} else {
ok ? resolve() : reject();
}
};
const sendChunk = function(offset) {
var chunk = fileData.subarray(offset, offset + chunkSize) || '';
var opts = {method: 'POST', body: chunk};
var fullUrl = url + '?offset=' + offset +
'&total=' + fileData.length +
'&name=' + encodeURIComponent(fileName);
var ok;
setStatus('Uploading ' + fileName + ', bytes ' + offset + '..' +
(offset + chunk.length) + ' of ' + fileData.length);
fetch(fullUrl, opts)
.then(function(res) {
if (res.ok && chunk.length > 0) sendChunk(offset + chunk.length);
ok = res.ok;
return res.text();
})
.then(function(text) {
if (!ok) setStatus('Error: ' + text), finish(ok); // Fail
if (chunk.length > 0) return; // More chunks to send
setStatus(x => x + '. Done, resetting device...');
finish(ok); // All chunks sent
});
};
sendChunk(0);
});
};
const onchange = function(ev) {
if (!ev.target.files[0]) return;
let r = new FileReader(), f = ev.target.files[0];
r.readAsArrayBuffer(f);
r.onload = function() {
setUpload(sendFileData(props.url, f.name, new Uint8Array(r.result), 2048));
ev.target.value = '';
ev.preventDefault();
btn && btn.current.base.click();
};
};
const onclick = function(ev) {
let fn; setUpload(x => fn = x);
if (!fn) input.current.click(); // No upload in progress, show file dialog
return fn;
};
return html`
<div class="inline-flex flex-col ${props.class}">
<input class="hidden" type="file" ref=${input} onchange=${onchange} accept=${props.accept} />
<${Button} title=${props.title} icon=${Icons.download} onclick=${onclick} ref=${btn} colors=${props.colors} />
<div class="pt-2 text-sm text-slate-400 ${status || 'hidden'}">${status}<//>
<//>`;
};
+1
View File
@@ -0,0 +1 @@
!function(t,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?exports.History=n():t.History=n()}(this,function(){return function(t){function n(o){if(e[o])return e[o].exports;var r=e[o]={exports:{},id:o,loaded:!1};return t[o].call(r.exports,r,r.exports,n),r.loaded=!0,r.exports}var e={};return n.m=t,n.c=e,n.p="",n(0)}([function(t,n,e){"use strict";function o(t){return t&&t.__esModule?t:{default:t}}n.__esModule=!0,n.createPath=n.parsePath=n.locationsAreEqual=n.createLocation=n.createMemoryHistory=n.createHashHistory=n.createBrowserHistory=void 0;var r=e(2);Object.defineProperty(n,"createLocation",{enumerable:!0,get:function(){return r.createLocation}}),Object.defineProperty(n,"locationsAreEqual",{enumerable:!0,get:function(){return r.locationsAreEqual}});var i=e(1);Object.defineProperty(n,"parsePath",{enumerable:!0,get:function(){return i.parsePath}}),Object.defineProperty(n,"createPath",{enumerable:!0,get:function(){return i.createPath}});var a=e(7),c=o(a),u=e(8),s=o(u),f=e(9),l=o(f);n.createBrowserHistory=c.default,n.createHashHistory=s.default,n.createMemoryHistory=l.default},function(t,n){"use strict";n.__esModule=!0;n.addLeadingSlash=function(t){return"/"===t.charAt(0)?t:"/"+t},n.stripLeadingSlash=function(t){return"/"===t.charAt(0)?t.substr(1):t},n.stripPrefix=function(t,n){return 0===t.indexOf(n)?t.substr(n.length):t},n.stripTrailingSlash=function(t){return"/"===t.charAt(t.length-1)?t.slice(0,-1):t},n.parsePath=function(t){var n=t||"/",e="",o="",r=n.indexOf("#");r!==-1&&(o=n.substr(r),n=n.substr(0,r));var i=n.indexOf("?");return i!==-1&&(e=n.substr(i),n=n.substr(0,i)),n=decodeURI(n),{pathname:n,search:"?"===e?"":e,hash:"#"===o?"":o}},n.createPath=function(t){var n=t.pathname,e=t.search,o=t.hash,r=encodeURI(n||"/");return e&&"?"!==e&&(r+="?"===e.charAt(0)?e:"?"+e),o&&"#"!==o&&(r+="#"===o.charAt(0)?o:"#"+o),r}},function(t,n,e){"use strict";function o(t){return t&&t.__esModule?t:{default:t}}n.__esModule=!0,n.locationsAreEqual=n.createLocation=void 0;var r=Object.assign||function(t){for(var n=1;n<arguments.length;n++){var e=arguments[n];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])}return t},i=e(10),a=o(i),c=e(11),u=o(c),s=e(1);n.createLocation=function(t,n,e,o){var i=void 0;return"string"==typeof t?(i=(0,s.parsePath)(t),i.state=n):(i=r({},t),void 0===i.pathname&&(i.pathname=""),i.search?"?"!==i.search.charAt(0)&&(i.search="?"+i.search):i.search="",i.hash?"#"!==i.hash.charAt(0)&&(i.hash="#"+i.hash):i.hash="",void 0!==n&&void 0===i.state&&(i.state=n)),i.key=e,o&&(i.pathname?"/"!==i.pathname.charAt(0)&&(i.pathname=(0,a.default)(i.pathname,o.pathname)):i.pathname=o.pathname),i},n.locationsAreEqual=function(t,n){return t.pathname===n.pathname&&t.search===n.search&&t.hash===n.hash&&t.key===n.key&&(0,u.default)(t.state,n.state)}},function(t,n,e){"use strict";var o=function(){};t.exports=o},function(t,n,e){"use strict";function o(t){return t&&t.__esModule?t:{default:t}}n.__esModule=!0;var r=e(3),i=(o(r),function(){var t=null,n=function(n){return t=n,function(){t===n&&(t=null)}},e=function(n,e,o,r){if(null!=t){var i="function"==typeof t?t(n,e):t;"string"==typeof i?"function"==typeof o?o(i,r):r(!0):r(i!==!1)}else r(!0)},o=[],r=function(t){var n=!0,e=function(){n&&t.apply(void 0,arguments)};return o.push(e),function(){n=!1,o=o.filter(function(t){return t!==e})}},i=function(){for(var t=arguments.length,n=Array(t),e=0;e<t;e++)n[e]=arguments[e];o.forEach(function(t){return t.apply(void 0,n)})};return{setPrompt:n,confirmTransitionTo:e,appendListener:r,notifyListeners:i}});n.default=i},function(t,n){"use strict";n.__esModule=!0;n.canUseDOM=!("undefined"==typeof window||!window.document||!window.document.createElement),n.addEventListener=function(t,n,e){return t.addEventListener?t.addEventListener(n,e,!1):t.attachEvent("on"+n,e)},n.removeEventListener=function(t,n,e){return t.removeEventListener?t.removeEventListener(n,e,!1):t.detachEvent("on"+n,e)},n.getConfirmation=function(t,n){return n(window.confirm(t))},n.supportsHistory=function(){var t=window.navigator.userAgent;return(t.indexOf("Android 2.")===-1&&t.indexOf("Android 4.0")===-1||t.indexOf("Mobile Safari")===-1||t.indexOf("Chrome")!==-1||t.indexOf("Windows Phone")!==-1)&&(window.history&&"pushState"in window.history)},n.supportsPopStateOnHashChange=function(){return window.navigator.userAgent.indexOf("Trident")===-1},n.supportsGoWithoutReloadUsingHash=function(){return window.navigator.userAgent.indexOf("Firefox")===-1},n.isExtraneousPopstateEvent=function(t){return void 0===t.state&&navigator.userAgent.indexOf("CriOS")===-1}},function(t,n,e){"use strict";var o=function(t,n,e,o,r,i,a,c){if(!t){var u;if(void 0===n)u=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var s=[e,o,r,i,a,c],f=0;u=new Error(n.replace(/%s/g,function(){return s[f++]})),u.name="InLine truncated
@@ -1,12 +1,15 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en" class="h-full bg-white">
<head> <head>
<title>Device Dashboard</title> <title></title>
<meta charset="utf-8" /> <meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="style.css" /> <link rel="icon" type="image/svg+xml" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='1.5' stroke='currentColor'> <path stroke-linecap='round' stroke-linejoin='round' d='M14.857 17.082a23.848 23.848 0 005.454-1.31A8.967 8.967 0 0118 9.75v-.7V9A6 6 0 006 9v.75a8.967 8.967 0 01-2.312 6.022c1.733.64 3.56 1.085 5.455 1.31m5.714 0a24.255 24.255 0 01-5.714 0m5.714 0a3 3 0 11-5.714 0' /> </svg>" />
<link href="main.css" rel="stylesheet" />
<link href="https://rsms.me/inter/inter.css" rel="stylesheet" />
</head> </head>
<body></body> <body class="h-full"></body>
<script src="history.min.js"></script>
<script type="module" src="main.js"></script> <script type="module" src="main.js"></script>
</html> </html>
@@ -0,0 +1 @@
/*! tailwindcss v3.3.2 | MIT License | https://tailwindcss.com*/*,:after,:before{box-sizing:border-box;border:0 solid #e5e7eb}:after,:before{--tw-content:""}html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:Inter var,Helvetica,sans-serif;font-feature-settings:"cv11","ss01";font-variation-settings:"opsz" 32}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:initial}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button;background-color:initial;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:initial}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}*,::backdrop,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:#3b82f680;--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.pointer-events-none{pointer-events:none}.pointer-events-auto{pointer-events:auto}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.inset-0{inset:0}.bottom-0{bottom:0}.left-0{left:0}.right-auto{right:auto}.top-0{top:0}.isolate{isolation:isolate}.z-10{z-index:10}.z-\[48\]{z-index:48}.z-\[60\]{z-index:60}.col-span-2{grid-column:span 2/span 2}.m-4{margin:1rem}.mx-auto{margin-left:auto;margin-right:auto}.my-0{margin-top:0;margin-bottom:0}.my-1{margin-top:.25rem;margin-bottom:.25rem}.my-2{margin-top:.5rem;margin-bottom:.5rem}.my-3{margin-top:.75rem;margin-bottom:.75rem}.my-4{margin-top:1rem;margin-bottom:1rem}.my-5{margin-top:1.25rem;margin-bottom:1.25rem}.mb-1{margin-bottom:.25rem}.ml-3{margin-left:.75rem}.ml-4{margin-left:1rem}.mr-2{margin-right:.5rem}.mr-4{margin-right:1rem}.mt-1{margin-top:.25rem}.mt-3{margin-top:.75rem}.mt-5{margin-top:1.25rem}.mt-7{margin-top:1.75rem}.block{display:block}.inline-block{display:inline-block}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.grid{display:grid}.hidden{display:none}.h-10{height:2.5rem}.h-12{height:3rem}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-full{height:100%}.min-h-screen{min-height:100vh}.w-0{width:0}.w-11{width:2.75rem}.w-4{width:1rem}.w-5{width:1.25rem}.w-6{width:1.5rem}.w-72{width:18rem}.w-96{width:24rem}.w-full{width:100%}.min-w-full{min-width:100%}.max-w-sm{max-width:24rem}.flex-1{flex:1 1 0%}.flex-shrink-0{flex-shrink:0}.shrink{flex-shrink:1}.shrink-0{flex-shrink:0}.grow{flex-grow:1}.grow-0{flex-grow:0}.basis-\[30px\]{flex-basis:30px}.border-separate{border-collapse:initial}.border-spacing-0Line truncated
+355 -357
View File
@@ -1,378 +1,376 @@
// NOTE: API calls must start with 'api/' in order to serve the app at any URI
'use strict'; 'use strict';
import {Component, h, html, render, useEffect, useState, useRef} from './preact.min.js'; import { h, render, useState, useEffect, useRef, html, Router } from './bundle.js';
import { Icons, Login, Setting, Button, Stat, tipColors, Colored, Notification, Pagination, UploadFileButton } from './components.js';
const MaxMetricsDataPoints = 50; const Logo = props => html`<svg class=${props.class} xmlns="http://www.w3.org/2000/svg" viewBox="0 0 12.87 12.85"><defs><style>.ll-cls-1{fill:none;stroke:#000;stroke-miterlimit:10;stroke-width:0.5px;}</style></defs><g id="Layer_2" data-name="Layer 2"><g id="Layer_1-2" data-name="Layer 1"><path class="ll-cls-1" d="M12.62,1.82V8.91A1.58,1.58,0,0,1,11,10.48H4a1.44,1.44,0,0,1-1-.37A.69.69,0,0,1,2.84,10l-.1-.12a.81.81,0,0,1-.15-.48V5.57a.87.87,0,0,1,.86-.86H4.73V7.28a.86.86,0,0,0,.86.85H9.42a.85.85,0,0,0,.85-.85V3.45A.86.86,0,0,0,10.13,3,.76.76,0,0,0,10,2.84a.29.29,0,0,0-.12-.1,1.49,1.49,0,0,0-1-.37H2.39V1.82A1.57,1.57,0,0,1,4,.25H11A1.57,1.57,0,0,1,12.62,1.82Z"/><path class="ll-cls-1" d="M10.48,10.48V11A1.58,1.58,0,0,1,8.9,12.6H1.82A1.57,1.57,0,0,1,.25,11V3.94A1.57,1.57,0,0,1,1.82,2.37H8.9a1.49,1.49,0,0,1,1,.37l.12.1a.76.76,0,0,1,.11.14.86.86,0,0,1,.14.47V7.28a.85.85,0,0,1-.85.85H8.13V5.57a.86.86,0,0,0-.85-.86H3.45a.87.87,0,0,0-.86.86V9.4a.81.81,0,0,0,.15.48l.1.12a.69.69,0,0,0,.13.11,1.44,1.44,0,0,0,1,.37Z"/></g></g></svg>`;
// This simple publish/subscribe is used to pass notifications that were function Header({logout, user, setShowSidebar, showSidebar}) {
// received from the server, to all child components of the app.
var PubSub = (function() {
var handlers = {}, id = 0;
return {
subscribe: function(fn) {
handlers[id++] = fn;
},
unsubscribe: function(id) {
delete handlers[id];
},
publish: function(data) {
for (var k in handlers) handlers[k](data);
}
};
})();
const Nav = props => html`
<div style="background: #333; padding: 0.5em; color: #fff;">
<div class="container d-flex">
<div style="flex: 1 1 auto; display: flex; align-items: center;">
<b>Your Product</b>
</div>
<div style="display: flex; align-items: center; flex: 0 0 auto; ">
<span>Logged in as:</span>
<span style="padding: 0 0.5em;"><img src="user.png" height="22" /></span>
<span>${props.user}</span>
<a class="btn" onclick=${props.logout}
style="margin-left: 1em; font-size: 0.8em; background: #8aa;">logout</a>
</div>
</div>
</div>`;
const Hero = props => html`
<div class="section">
<div style="margin-top: 1em; background: #eee; padding: 1em; border-radius: 0.5em; color: #777; ">
<h1 style="margin: 0.2em 0;">Interactive Device Dashboard</h1>
<p>
This device dashboard is developed using the modern and compact Preact framework,
in order to fit on very small devices. This is
a <a href="https://mongoose.ws/tutorials/http-server/">hybrid server</a> which
provides both static and dynamic content. Static files, like CSS/JS/HTML
or images, are compiled into the server binary.
This UI uses the REST API implemented by the device, which you can examine
using <code>curl</code> command-line utility:
</p>
<div><code>curl -u admin:pass0 localhost:8000/api/config/get</code> </div>
<div><code>curl -u admin:pass0 localhost:8000/api/config/set -d 'pub=mg/topic'</code> </div>
<div><code>curl -u admin:pass0 localhost:8000/api/message/send -d 'message=hello'</code> </div>
<p>
The device can send notifications to this dashboard at anytime. Notifications
are sent over WebSocket at URI <code>/api/watch</code> as JSON strings: <code>{"name": "..", "data": ...}</code>
<div>Try <code>wscat --auth user1:pass1 --connect ws://localhost:8000/api/watch</code></div>
</p>
</div>
</div>`;
const Login = function(props) {
const [user, setUser] = useState('');
const [pass, setPass] = useState('');
const login = ev =>
fetch(
'/api/login',
{headers: {Authorization: 'Basic ' + btoa(user + ':' + pass)}})
.then(r => r.json())
.then(r => r && props.login(r))
.catch(err => err);
return html` return html`
<div class="rounded border" style="max-width: 480px; margin: 0 auto; margin-top: 5em; background: #eee; "> <div class="bg-white sticky top-0 z-[48] xw-full border-b py-2 ${showSidebar && 'pl-72'} transition-all duration-300 transform">
<div style="padding: 2em; "> <div class="px-2 w-full py-0 my-0 flex items-center">
<h1 style="color: #666;">Device Dashboard Login </h1> <button type="button" onclick=${ev => setShowSidebar(v => !v)} class="text-slate-400">
<div style="margin: 0.5em 0;"> <${Icons.bars3} class="h-6" />
<input type='text' placeholder='Name' style="width: 100%;" <//>
oninput=${ev => setUser(ev.target.value)} value=${user} /> <div class="flex flex-1 gap-x-4 self-stretch lg:gap-x-6">
</div> <div class="relative flex flex-1"><//>
<div style="margin: 0.5em 0;"> <div class="flex items-center gap-x-4 lg:gap-x-6">
<input type="password" placeholder="Password" style="width: 100%;" <span class="text-sm text-slate-400">logged in as: ${user}<//>
oninput=${ev => setPass(ev.target.value)} value=${pass} <div class="hidden lg:block lg:h-4 lg:w-px lg:bg-gray-200" aria-hidden="true"><//>
onchange=${login} /> <${Button} title="Logout" icon=${Icons.logout} onclick=${logout} />
</div> <//>
<div style="margin: 1em 0;"> <//>
<button class="btn" style="width: 100%; background: #8aa;" <//>
disabled=${!user || !pass} onclick=${login}> Login </button> <//>`;
</div>
<div style="color: #777; margin-top: 2em;">
Valid logins: admin:pass0, user1:pass1, user2:pass2
</div>
</div>
</div>`;
}; };
function Sidebar({url, show}) {
const Configuration = function(props) { const NavLink = ({title, icon, href, url}) => html`
const [url, setUrl] = useState(props.config.url || '');
const [pub, setPub] = useState(props.config.pub || '');
const [sub, setSub] = useState(props.config.sub || '');
useEffect(() => {
setUrl(props.config.url);
setPub(props.config.pub);
setSub(props.config.sub);
}, [props.config]);
const update = (name, val) => fetch('/api/config/set', {
method: 'post',
body: `${name}=${encodeURIComponent(val)}`
}).catch(err => err);
const updateurl = ev => update('url', url);
const updatepub = ev => update('pub', pub);
const updatesub = ev => update('sub', sub);
// console.log(props, [url, pub, sub]);
return html`
<div class="section">
<h3 style="background: #c03434; color: #fff; padding: 0.4em;">
Device Configuration</h3>
<div style="margin: 0.5em 0; display: flex;">
<span class="addon nowrap">MQTT server:</span>
<input type="text" style="flex: 1 100%;"
value=${url} onchange=${updateurl}
oninput=${ev => setUrl(ev.target.value)} />
<button class="btn" disabled=${!url} onclick=${updateurl}
style="margin-left: 1em; background: #8aa;">Update</button>
</div>
<div style="margin: 0.5em 0; display: flex; ">
<span class="addon nowrap">Subscribe topic:</span>
<input type="text" style="flex: 1 100%;"
value=${sub} onchange=${updatesub}
oninput=${ev => setSub(ev.target.value)} />
<button class="btn" disabled=${!sub} onclick=${updatesub}
style="margin-left: 1em; background: #8aa;">Update</button>
</div>
<div style="margin: 0.5em 0; display: flex;">
<span class="addon nowrap">Publish topic:</span>
<input type="text" style="flex: 1 100%;"
value=${pub} onchange=${updatepub}
oninput=${ev => setPub(ev.target.value)} />
<button class="btn" disabled=${!pub} onclick=${updatepub}
style="margin-left: 1em; background: #8aa;">Update</button>
</div>
<div> <div>
You can use <a href="http://www.hivemq.com/demos/websocket-client/"> <a href="#${href}" class="${href == url ? 'bg-slate-50 text-blue-600 group' : 'text-gray-700 hover:text-blue-600 hover:bg-gray-50 group'} flex gap-x-3 rounded-md p-2 text-sm leading-6 font-semibold">
HiveMQ Websocket web client</a> to send messages to this console. <${icon} class="w-6 h-6"/>
</div> ${title}
<div class="msg"> <///>
The device keeps a persistent connection to the configured MQTT server. <//>`;
Changes to this configuration are propagated to all dashboards: try return html`
changing them in this dashboard and observe changes in other opened <div class="bg-violet-100 hs-overlay hs-overlay-open:translate-x-0
dashboards. -translate-x-full transition-all duration-300 transform
</div><div class="msg"> fixed top-0 left-0 bottom-0 z-[60] w-72 bg-white border-r
Note: administrators can see this section and can change device border-gray-200 overflow-y-auto scrollbar-y
configuration, whilst users cannot. ${show && 'translate-x-0'} right-auto bottom-0">
</div> <div class="flex flex-col m-4 gap-y-6">
</div>`; <div class="flex h-10 shrink-0 items-center gap-x-4 font-bold text-xl text-slate-500">
<${Logo} class="h-full"/> Your Brand
<//>
<div class="flex flex-1 flex-col">
<${NavLink} title="Dashboard" icon=${Icons.home} href="/" url=${url} />
<${NavLink} title="Settings" icon=${Icons.cog} href="/settings" url=${url} />
<${NavLink} title="Firmware Update" icon=${Icons.download} href="/update" url=${url} />
<${NavLink} title="Events" icon=${Icons.alert} href="/events" url=${url} />
<//>
<//>
<//>`;
}; };
function Events({}) {
const [events, setEvents] = useState([]);
const [page, setPage] = useState(1);
const Message = m => html`<div style="margin: 0.5em 0;"> const refresh = () =>
<span class="qos">qos: ${m.message.qos} </span> fetch('api/events/get', {
<span class="topic">topic: ${m.message.topic} </span> method: 'POST', body: JSON.stringify({page: page}),
<span class="data">data: ${m.message.data}</span> }).then(r => r.json())
</div>`; .then(r => setEvents(r));
const Messages = function(props) { useEffect(refresh, [page]);
const [messages, setMessages] = useState([]);
const [txt, setTxt] = useState('');
useEffect(() => { useEffect(() => {
const id = PubSub.subscribe(function(msg) { setPage(JSON.parse(localStorage.getItem('page')));
if (msg.name == 'message') setMessages(x => x.concat([msg.data])); }, []);
});
return PubSub.unsubscribe(id);
}, []);
const sendmessage = ev => fetch('/api/message/send', {
method: 'post',
body: `message=${encodeURIComponent(txt)}`
}).then(r => setTxt(''));
const connstatus = props.config.connected ? 'connected' : 'disconnected';
return html`
<div class="section">
<h3 style="background: #30c040; color: #fff; padding: 0.4em;">MQTT messages</h3>
<div>
MQTT server status: <b>${connstatus}</b>
</div>
<div style="height: 10em; overflow: auto; padding: 0.5em; " class="border">
${messages.map(message => h(Message, {message}))}
</div>
<div style="margin: 0.5em 0; display: flex">
<span class="addon nowrap">Publish message:</span>
<input placeholder="type and press enter..." style="flex: 1 100%;"
value=${txt} onchange=${sendmessage}
oninput=${ev => setTxt(ev.target.value)} />
</div>
<div class="msg">
The message gets passed to the device via REST. Then the device sends it to
the MQTT server over MQTT. All MQTT messages on a subscribed topic
received by the device, are propagated to this dashboard via /api/watch.
</div>
</div>`;
};
// Expected arguments:
// data: timeseries, e.g. [ [1654361352, 19], [1654361353, 18], ... ]
// width, height, yticks, xticks, ymin, ymax, xmin, xmax
const SVG = function(props) {
// w
// +---------------------+
// | h1 |
// | +-----------+ |
// | | | | h
// | w1 | | w2 |
// | +-----------+ |
// | h2 |
// +---------------------+
//
let w = props.width, h = props.height, w1 = 30, w2 = 0, h1 = 8, h2 = 18;
let yticks = props.yticks || 4, xticks = props.xticks || 5;
let data = props.data || [];
let ymin = props.ymin || 0;
let ymax = props.ymax || Math.max.apply(null, data.map(p => p[1]));
let xmin = props.xmin || Math.min.apply(null, data.map(p => p[0]));
let xmax = props.xmax || Math.max.apply(null, data.map(p => p[0]));
// Y-axis tick lines and labels
let yta = (new Array(yticks + 1)).fill(0).map((_, i) => i); // indices
let yti = i => h - h2 - (h - h1 - h2) * i / yticks; // index's Y
let ytv = i => (ymax - ymin) * i / yticks;
let ytl = y => html`<line x1=${w1} y1=${y} x2=${w} y2=${y} class="tick"/>`;
let ytt = (y, v) => html`<text x=0 y=${y + 5} class="label">${v}</text>`;
// X-axis tick lines and labels
let datefmt = unix => (new Date(unix * 1000)).toISOString().substr(14, 5);
let xta = (new Array(xticks + 1)).fill(0).map((_, i) => i); // indices
let xti = i => w1 + (w - w1 - w2) * i / xticks; // index's X
let xtv = i => datefmt(xmin + (xmax - xmin) * i / xticks);
let xtl = x => html`<path d="M ${x},${h1} L ${x},${h - h2}" class="tick"/>`;
let xtt = (x, v) =>
html`<text x=${x - 15} y=${h - 2} class="label">${v}</text>`;
// Transform data points array into coordinate
let dx = v => w1 + (v - xmin) / ((xmax - xmin) || 1) * (w - w1 - w2);
let dy = v => h - h2 - (v - ymin) / ((ymax - ymin) || 1) * (h - h1 - h2);
let dd = data.map(p => [Math.round(dx(p[0])), Math.round(dy(p[1]))]);
let ddl = dd.length;
// And plot the data as <path> element
let begin0 = ddl ? `M ${dd[0][0]},${dd[0][1]}` : `M 0,0`;
let begin = `M ${w1},${h - h2}`; // Initial point
let end = ddl ? `L ${dd[ddl - 1][0]},${h - h2}` : `L ${w1},${h - h2}`;
let series = ddl ? dd.map(p => `L ${p[0]} ${p[1]}`) : [];
return html`
<svg viewBox="0 0 ${w} ${h}">
<style>
.axis { stroke: #aaa; fill: none; }
.label { stroke: #aaa; font-size: 13px; }
.tick { stroke: #ccc; fill: none; stroke-dasharray: 5; }
.seriesbg { stroke: none; fill: rgba(200,225,255, 0.25)}
.series { stroke: #25a; fill: none; }
</style>
${yta.map(i => ytl(yti(i)))}
${yta.map(i => ytt(yti(i), ytv(i)))}
${xta.map(i => xtl(xti(i)))}
${data.length ? xta.map(i => xtt(xti(i), xtv(i))) : ''}
<path d="${begin} ${series.join(' ')} ${end}" class="seriesbg" />
<path d="${begin0} ${series.join(' ')}" class="series" />
</svg>`;
};
const Chart = function(props) {
const [data, setData] = useState([]);
useEffect(() => {
const id = PubSub.subscribe(function(msg) {
if (msg.name != 'metrics') return;
setData(x => x.concat([msg.data]).splice(-MaxMetricsDataPoints));
});
return PubSub.unsubscribe(id);
}, []);
let xmax = 0, missing = MaxMetricsDataPoints - data.length;
if (missing > 0) xmax = Math.round(Date.now() / 1000) + missing;
return html`
<div class="section">
<h3 style="background: #ec3; color: #fff; padding: 0.4em;">Data Chart</h3>
<div style="overflow: auto; padding: 0.5em;" class="">
<${SVG} height=240 width=600 ymin=0 ymax=20 xmax=${xmax} data=${data} />
</div>
<div class="msg">
This chart plots live sensor data, sent by the device via /api/watch.
</div>
</div>`;
};
const App = function(props) {
const [user, setUser] = useState('');
const [config, setConfig] = useState({});
const getconfig = () =>
fetch('/api/config/get', {headers: {Authorization: ''}})
.then(r => r.json())
.then(r => setConfig(r))
.catch(err => console.log(err));
// Watch for notifications. As soon as a notification arrives, pass it on
// to all subscribed components
const watch = function() {
var l = window.location, proto = l.protocol.replace('http', 'ws');
var tid, wsURI = proto + '//' + l.host + '/api/watch'
var reconnect = function() {
var ws = new WebSocket(wsURI);
// ws.onopen = () => console.log('ws connected');
ws.onmessage = function(ev) {
try {
var msg = JSON.parse(ev.data);
PubSub.publish(msg);
// if (msg.name != 'metrics') console.log('ws->', msg);
} catch (e) {
console.log('Invalid ws frame:', ev.data); // eslint-disable-line
}
};
ws.onclose = function() {
clearTimeout(tid);
tid = setTimeout(reconnect, 1000);
console.log('ws disconnected');
};
};
reconnect();
};
const login = function(u) {
document.cookie = `access_token=${u.token}; Secure, HttpOnly; SameSite=Lax; path=/; max-age=3600`;
setUser(u.user);
watch();
return getconfig();
};
const logout = ev => {
document.cookie = `access_token=; Secure, HttpOnly; SameSite=Lax; path=/; max-age=0`;
setUser('');
};
useEffect(() => { useEffect(() => {
// Called once at init time localStorage.setItem('page', page.toString());
PubSub.subscribe(msg => msg.name == 'config' && getconfig()); }, [page]);
fetch('/api/login', {headers: {Authorization: ''}})
.then(r => r.json())
.then(r => login(r))
.catch(err => setUser(''));
}, []);
if (!user) return html`<${Login} login=${login} />`; const Th = props => html`<th scope="col" class="sticky top-0 z-10 border-b border-slate-300 bg-white bg-opacity-75 py-1.5 px-4 text-left text-sm font-semibold text-slate-900 backdrop-blur backdrop-filter">${props.title}</th>`;
const Td = props => html`<td class="whitespace-nowrap border-b border-slate-200 py-2 px-4 pr-3 text-sm text-slate-900">${props.text}</td>`;
const Prio = ({prio}) => {
const text = ['high', 'medium', 'low'][prio];
const colors = [tipColors.red, tipColors.yellow, tipColors.green][prio];
return html`<${Colored} colors=${colors} text=${text} />`;
};
return html` const Event = ({e}) => html`
<${Nav} user=${user} logout=${logout} /> <tr>
<div class="container"> <${Td} text=${['power', 'hardware', 'tier3', 'tier4'][e.type]} />
<div class="row"> <${Td} text=${html`<${Prio} prio=${e.prio}/>`} />
<div class="col col-6"><${Hero} /></div> <${Td} text=${e.time ? (new Date(e.time * 1000)).toLocaleString() : '1970-01-01'} />
<div class="col col-6"><${Chart} /></div> <${Td} text=${e.text} />
<div class="col col-6"> <//>`;
${user == 'admin' && h(Configuration, {config})}
return html`
<div class="m-4 divide-y divide-gray-200 overflow-auto rounded bg-white">
<div class="font-semibold flex items-center text-gray-600 px-3 justify-between whitespace-nowrap">
<div class="font-semibold flex items-center text-gray-600">
<div class="mr-4">EVENT LOG</div>
</div> </div>
<div class="col col-6"><${Messages} config=${config} /></div> <${Pagination} currentPage=${page} setPageFn=${setPage} totalItems=400 itemsPerPage=20 />
</div> <//>
</div>`; <div class="inline-block min-w-full align-middle" style="max-height: 82vh; overflow: auto;">
<table class="min-w-full border-separate border-spacing-0">
<thead>
<tr>
<${Th} title="Type" />
<${Th} title="Prio" />
<${Th} title="Time" />
<${Th} title="Description" />
</tr>
</thead>
<tbody>
${(events.arr ? events.arr : []).map(e => h(Event, {e}))}
</tbody>
</table>
<//>
<//>`;
};
function Chart({data}) {
const n = data.length /* entries */, w = 20 /* entry width */, ls = 15/* left space */;
const h = 100 /* graph height */, yticks = 5 /* Y axis ticks */, bs = 10 /* bottom space */;
const ymax = 25;
const yt = i => (h - bs) / yticks * (i + 1);
const bh = p => (h - bs) * p / 100; // Bar height
const by = p => (h - bs) - bh(p);
const range = (start, size, step) => Array.from({length: size}, (_, i) => i * (step || 1) + start);
// console.log(ds);
return html`
<div class="my-4 divide-y divide-gray-200 overflow-auto rounded bg-white">
<div class="font-light uppercase flex items-center text-gray-600 px-4 py-2">
Temperature, last 24h
<//>
<div class="relative">
<svg class="bg-yellow-x50 w-full p-4" viewBox="0 0 ${n*w+ls} ${h}">
${range(0, yticks).map(i => html`
<line x1=0 y1=${yt(i)} x2=${ls+n*w} y2=${yt(i)} stroke-width=0.3 class="stroke-slate-300" stroke-dasharray="1,1" />
<text x=0 y=${yt(i)-2} class="text-[6px] fill-slate-400">${ymax-ymax/yticks*(i+1)}<//>
`)}
${range(0, n).map(x => html`
<rect x=${ls+x*w} y=${by(data[x]*100/ymax)} width=12 height=${bh(data[x]*100/ymax)} rx=2 class="fill-cyan-500" />
<text x=${ls+x*w} y=100 class="text-[6px] fill-slate-400">${x*2}:00<//>
`)}
<//>
<//>
<//>`;
};
function DeveloperNote({text, children}) {
return html`
<div class="flex p-4 gap-2">
<div class="text-sm text-slate-500">
<div class="flex items-center">
<${Icons.info} class="self-start basis-[30px] grow-0 shrink-0 text-green-600 mr-2" />
<div class="font-semibold">Developer Note<//>
<//>
${(text || '').split('.').map(v => html` <p class="my-2 ">${v}<//>`)}
${children}
<//>
<//>`;
};
function Main({}) {
const [stats, setStats] = useState(null);
const refresh = () => fetch('api/stats/get').then(r => r.json()).then(r => setStats(r));
useEffect(refresh, []);
if (!stats) return '';
return html`
<div class="p-2">
<div class="p-4 sm:p-2 mx-auto grid grid-cols-2 lg:grid-cols-4 gap-4">
<${Stat} title="Temperature" text="${stats.temperature} °C" tipText="good" tipIcon=${Icons.ok} tipColors=${tipColors.green} />
<${Stat} title="Humidity" text="${stats.humidity} %" tipText="warn" tipIcon=${Icons.warn} tipColors=${tipColors.yellow} />
<div class="bg-white col-span-2 border rounded-md shadow-lg" role="alert">
<${DeveloperNote} text="Stats data is received from the Mongoose backend" />
<//>
<//>
<div class="p-4 sm:p-2 mx-auto grid grid-cols-1 lg:grid-cols-2 gap-4">
<${Chart} data=${stats.points} />
<div class="my-4 hx-24 bg-white border rounded-md shadow-lg" role="alert">
<${DeveloperNote}
text="This chart is an SVG image, generated on the fly from the
data returned by the api/stats/get API call" />
<//>
<//>
<//>`;
};
function FirmwareStatus({title, info, children}) {
const state = ['UNAVAILABLE', 'FIRST_BOOT', 'NOT_COMMITTED', 'COMMITTED'][(info.status || 0) % 4];
const valid = info.status > 0;
return html`
<div class="bg-white py-1 divide-y border rounded">
<div class="font-light uppercase flex items-center text-gray-600 px-4 py-2">
${title}
<//>
<div class="px-4 py-2 relative">
<div class="my-1">Status: ${state}<//>
<div class="my-1">CRC32: ${valid ? info.crc32.toString(16) : 'n/a'}<//>
<div class="my-1">Size: ${valid ? info.size : 'n/a'}<//>
<div class="my-1">Flashed at: ${valid ? new Date(info.timestamp * 1000).toLocaleString() : 'n/a'}<//>
${children}
<//>
<//>`;
};
function FirmwareUpdate({}) {
const [info, setInfo] = useState([{}, {}]);
const refresh = () => fetch('api/firmware/status').then(r => r.json()).then(r => setInfo(r));
useEffect(refresh, []);
const oncommit = ev => fetch('api/firmware/commit')
.then(r => r.json())
.then(refresh);
const onreboot = ev => fetch('api/device/reset')
.then(r => r.json())
.then(r => new Promise(r => setTimeout(ev => { refresh(); r(); }, 3000)));
const onrollback = ev => fetch('api/firmware/rollback')
.then(onreboot);
const onerase = ev => fetch('api/device/eraselast').then(refresh);
const onupload = function(ok, name, size) {
if (!ok) return false;
return new Promise(r => setTimeout(ev => { refresh(); r(); }, 3000));
};
return html`
<div class="m-4 gap-4 grid grid-cols-1 lg:grid-cols-3">
<${FirmwareStatus} title="Current firmware image" info=${info[0]}>
<div class="flex flex-wrap gap-2">
<${Button} title="Commit this firmware" onclick=${oncommit}
icon=${Icons.thumbUp} disabled=${info[0].status == 3} cls="w-full" />
<//>
<//>
<${FirmwareStatus} title="Previous firmware image" info=${info[1]}>
<${Button} title="Rollback to this firmware" onclick=${onrollback}
icon=${Icons.backward} disabled=${info[1].status == 0} cls="w-full" />
<//>
<div class="bg-white xm-4 divide-y border rounded flex flex-col">
<div class="font-light uppercase flex items-center text-gray-600 px-4 py-2">
Device control
<//>
<div class="px-4 py-3 flex flex-col gap-2 grow">
<${UploadFileButton}
title="Upload new firmware .bin file" onupload=${onupload}
url="api/firmware/upload" accept=".bin,.uf2" />
<div class="grow"><//>
<${Button} title="Reboot device" onclick=${onreboot} icon=${Icons.refresh} cls="w-full" />
<${Button} title="Erase last sector" onclick=${onerase} icon=${Icons.doc} cls="w-full hidden" />
<//>
<//>
<//>
<div class="m-4 gap-4 grid grid-cols-1 lg:grid-cols-2">
<div class="bg-white border shadow-lg">
<${DeveloperNote}>
<div class="my-2">
Firmware status and other information is stored in the last sector
of flash
<//>
<div class="my-2">
Firmware status can be FIRST_BOOT, UNCOMMITTED or COMMITTED. If no
information is available, it is UNAVAILABLE.
<//>
<div class="my-2">
This GUI loads a firmware file and sends it chunk by chunk to the
device, passing current chunk offset, total firmware size and a file name:
api/firmware/upload?offset=X&total=Y&name=Z
<//>
<//>
<//>
<div class="bg-white border shadow-lg">
<${DeveloperNote}>
<div>
Firmware update mechanism defines 3 API functions that the target
device must implement: mg_ota_begin(), mg_ota_write() and mg_ota_end()
<//>
<div class="my-2">
RESTful API handlers use ota_xxx() API to save firmware to flash.
The last 0-length chunk triggers ota_end() which performs firmware
update using saved firmware image
<//>
<div class="my-2">
<a class="link text-blue-600 underline"
href="https://mongoose.ws/webinars/">Join our free webinar</a> to
get detailed explanations about possible firmware updates strategies
and implementation demo
<//>
<//>
<//>
<//>`;
};
function Settings({}) {
const [settings, setSettings] = useState(null);
const [saveResult, setSaveResult] = useState(null);
const refresh = () => fetch('api/settings/get')
.then(r => r.json())
.then(r => setSettings(r));
useEffect(refresh, []);
const mksetfn = k => (v => setSettings(x => Object.assign({}, x, {[k]: v})));
const onsave = ev => fetch('api/settings/set', {
method: 'post', body: JSON.stringify(settings)
}).then(r => r.json())
.then(r => setSaveResult(r))
.then(refresh);
if (!settings) return '';
const logOptions = [[0, 'Disable'], [1, 'Error'], [2, 'Info'], [3, 'Debug']];
return html`
<div class="m-4 grid grid-cols-1 gap-4 md:grid-cols-2">
<div class="py-1 divide-y border rounded bg-white flex flex-col">
<div class="font-light uppercase flex items-center text-gray-600 px-4 py-2">
Device Settings
<//>
<div class="py-2 px-5 flex-1 flex flex-col relative">
${saveResult && html`<${Notification} ok=${saveResult.status}
text=${saveResult.message} close=${() => setSaveResult(null)} />`}
<${Setting} title="Enable Logs" value=${settings.log_enabled} setfn=${mksetfn('log_enabled')} type="switch" />
<${Setting} title="Log Level" value=${settings.log_level} setfn=${mksetfn('log_level')} type="select" addonLeft="0-3" disabled=${!settings.log_enabled} options=${logOptions}/>
<${Setting} title="Brightness" value=${settings.brightness} setfn=${mksetfn('brightness')} type="number" addonRight="%" />
<${Setting} title="Device Name" value=${settings.device_name} setfn=${mksetfn('device_name')} type="" />
<div class="mb-1 mt-3 flex place-content-end"><${Button} icon=${Icons.save} onclick=${onsave} title="Save Settings" /><//>
<//>
<//>
<div class="bg-white border rounded-md text-ellipsis overflow-auto" role="alert">
<${DeveloperNote}
text="A variety of controls are pre-defined to ease the development:
toggle button, dropdown select, input field with left and right
addons. Device settings are received by calling
api/settings/get API call, which returns settings JSON object.
Clicking on the save button calls api/settings/set
API call" />
<//>
<//>`;
};
const App = function({}) {
const [loading, setLoading] = useState(true);
const [url, setUrl] = useState('/');
const [user, setUser] = useState('');
const [showSidebar, setShowSidebar] = useState(true);
const logout = () => fetch('api/logout').then(r => setUser(''));
const login = r => !r.ok ? setLoading(false) && setUser(null) : r.json()
.then(r => setUser(r.user))
.finally(r => setLoading(false));
useEffect(() => fetch('api/login').then(login), []);
if (loading) return ''; // Show blank page on initial load
if (!user) return html`<${Login} loginFn=${login} logoIcon=${Logo}
title="Device Dashboard Login"
tipText="To login, use: admin/admin, user1/user1, user2/user2" />`; // If not logged in, show login screen
return html`
<div class="min-h-screen bg-slate-100">
<${Sidebar} url=${url} show=${showSidebar} />
<${Header} logout=${logout} user=${user} showSidebar=${showSidebar} setShowSidebar=${setShowSidebar} />
<div class="${showSidebar && 'pl-72'} transition-all duration-300 transform">
<${Router} onChange=${ev => setUrl(ev.url)} history=${History.createHashHistory()} >
<${Main} default=${true} />
<${Settings} path="settings" />
<${FirmwareUpdate} path="update" />
<${Events} path="events" />
<//>
<//>
<//>`;
}; };
window.onload = () => render(h(App), document.body); window.onload = () => render(h(App), document.body);
-51
View File
@@ -1,51 +0,0 @@
PROG ?= example
SOURCES ?= ../../mongoose.c main.c packed_fs.c
CFLAGS ?= -I../.. -DMG_ENABLE_PACKED_FS=1 -DMG_ENABLE_LINES=1 $(EXTRA)
FILES_TO_EMBED ?= $(wildcard web_root/*)
ROOT ?= $(realpath $(CURDIR)/../../..)
DOCKER ?= docker run --rm -e Tmp=. -e WINEDEBUG=-all -v $(ROOT):$(ROOT) -w $(CURDIR)
VC98 ?= $(DOCKER) mdashnet/vc98 wine
MINGW ?= $(DOCKER) mdashnet/mingw
all: $(PROG)
$(RUN) ./$(PROG)
$(PROG): $(SOURCES) $(FILES_TO_EMBED)
$(CC) ../../test/pack.c -o pack
./pack $(FILES_TO_EMBED) > packed_fs.c
$(CC) -W -Wall -Wextra -O0 -g3 $(CFLAGS) -o $(PROG) $(SOURCES)
mingw: $(SOURCES) $(FILES_TO_EMBED)
$(MINGW) i686-w64-mingw32-gcc $(CFLAGS) ../../test/pack.c -o pack.exe
$(MINGW) wine cmd /c 'pack.exe $(FILES_TO_EMBED) > packed_fs.c'
$(MINGW) i686-w64-mingw32-gcc $(CFLAGS) $(SOURCES) -lws2_32 -o $(PROG).exe
$(MINGW) wine $(PROG).exe
vc98: $(SOURCES) $(FILES_TO_EMBED)
$(VC98) cl.exe /nologo $(CFLAGS) ../../test/pack.c /Fepack.exe
$(VC98) cmd /c 'pack.exe $(FILES_TO_EMBED) > packed_fs.c'
$(VC98) cl.exe /nologo /O2 $(CFLAGS) $(SOURCES) /Fe$(PROG).exe
$(VC98) $(PROG).exe
clean:
rm -rf $(PROG) *.o *.dSYM *.gcov *.gcno *.gcda *.obj *.exe *.ilk *.pdb log.txt pack
.PHONY: compress expand gzipped plain all
gzipped: compress
$(MAKE) all
plain: expand
$(MAKE) all
compress:
for file in $(FILES_TO_EMBED) ; do \
gzip -q $$file ; \
done
expand:
for file in $(FILES_TO_EMBED) ; do \
gunzip -q $$file ; \
done
+1 -1
View File
@@ -35,4 +35,4 @@ flash3:
cd build && $(ESPTOOL) --chip esp32 -p $(PORT) -b 460800 --before=default_reset --after=hard_reset write_flash --flash_mode dio --flash_freq 40m --flash_size 2MB 0x8000 partition_table/partition-table.bin 0x1000 bootloader/bootloader.bin 0x100000 mongoose-esp32-example.bin cd build && $(ESPTOOL) --chip esp32 -p $(PORT) -b 460800 --before=default_reset --after=hard_reset write_flash --flash_mode dio --flash_freq 40m --flash_size 2MB 0x8000 partition_table/partition-table.bin 0x1000 bootloader/bootloader.bin 0x100000 mongoose-esp32-example.bin
clean: clean:
$(DOCKER) rm -rf build sdkconfig test -d build && $(DOCKER) rm -rf build sdkconfig || true
@@ -3,5 +3,5 @@ idf_component_register(SRCS "main.c"
"net.c" "net.c"
"packed_fs.c" "packed_fs.c"
"mongoose.c") "mongoose.c")
component_compile_options(-DMG_ENABLE_LINES) component_compile_options(-DHTTP_URL="http://0.0.0.0:80")
component_compile_options(-DMG_ENABLE_PACKED_FS) component_compile_options(-DHTTPS_URL="https://0.0.0.0:443")
+245 -15
View File
@@ -1,25 +1,13 @@
// Copyright (c) 2020 Cesanta Software Limited // Copyright (c) 2020 Cesanta Software Limited
// All rights reserved // All rights reserved
#include "esp_spiffs.h"
//#include "freertos/FreeRTOS.h"
#include "mongoose.h" #include "mongoose.h"
#include "net.h"
const char *s_listening_url = "http://0.0.0.0:80";
void device_dashboard_fn(struct mg_connection *, int, void *, void *);
#define WIFI_SSID "YOUR_WIFI_NETWORK_NAME" // SET THIS! #define WIFI_SSID "YOUR_WIFI_NETWORK_NAME" // SET THIS!
#define WIFI_PASS "YOUR_WIFI_PASSWORD" // SET THIS! #define WIFI_PASS "YOUR_WIFI_PASSWORD" // SET THIS!
#define FS_ROOT "/spiffs"
void app_main(void) { void app_main(void) {
// Mount filesystem
esp_vfs_spiffs_conf_t conf = {
.base_path = FS_ROOT, .max_files = 20, .format_if_mount_failed = true};
int res = esp_vfs_spiffs_register(&conf);
MG_INFO(("FS %s, %d", conf.base_path, res));
mg_file_printf(&mg_fs_posix, FS_ROOT "/hello.txt", "%s", "hello from ESP");
// Setup wifi. This function is implemented in wifi.c // Setup wifi. This function is implemented in wifi.c
// It blocks until connected to the configured WiFi network // It blocks until connected to the configured WiFi network
void wifi_init(const char *ssid, const char *pass); void wifi_init(const char *ssid, const char *pass);
@@ -29,7 +17,249 @@ void app_main(void) {
struct mg_mgr mgr; struct mg_mgr mgr;
mg_log_set(MG_LL_DEBUG); // Set log level mg_log_set(MG_LL_DEBUG); // Set log level
mg_mgr_init(&mgr); mg_mgr_init(&mgr);
MG_INFO(("Mongoose v%s on %s", MG_VERSION, s_listening_url)); MG_INFO(("Mongoose version : v%s", MG_VERSION));
mg_http_listen(&mgr, s_listening_url, device_dashboard_fn, &mgr); MG_INFO(("Listening on : %s", HTTP_URL));
#if MG_ENABLE_MBEDTLS
MG_INFO(("Listening on : %s", HTTPS_URL));
#endif
web_init(&mgr);
for (;;) mg_mgr_poll(&mgr, 1000); // Infinite event loop for (;;) mg_mgr_poll(&mgr, 1000); // Infinite event loop
} }
#if MG_DEVICE == MG_DEVICE_CUSTOM
void *mg_flash_start(void) {
return NULL;
}
size_t mg_flash_size(void) {
return 0;
}
size_t mg_flash_sector_size(void) {
return 0;
}
size_t mg_flash_write_align(void) {
return 0;
}
int mg_flash_bank(void) {
return 0;
}
bool mg_flash_erase(void *location) {
(void) location;
return false;
}
bool mg_flash_swap_bank(void) {
return true;
}
bool mg_flash_write(void *addr, const void *buf, size_t len) {
(void) addr, (void) buf, (void) len;
return false;
}
void mg_device_reset(void) {
esp_restart();
}
#endif
#if MG_OTA == MG_OTA_CUSTOM
#include "esp_app_format.h"
#include "esp_ota_ops.h"
static size_t s_size = 0; // Firmware size to flash. In-progress indicator
static bool rx_checked = false; // Whether firmware being received has been checked as valid
const esp_partition_t * update_partition = NULL; // The partition the update is being applied to
esp_ota_handle_t update_handle = 0; // Handle of the current update process
const esp_partition_t * get_partition_from_fw(int fw) {
if (MG_FIRMWARE_CURRENT == fw) {
return esp_ota_get_running_partition();
}
const esp_partition_t * p = esp_ota_get_last_invalid_partition();
if (NULL == p) {
p = esp_ota_get_next_update_partition(NULL);
}
return p;
}
// Returns true if the data buffer contains the header of a valid firmware
const size_t fw_size_required = sizeof(esp_image_header_t) + sizeof(esp_image_segment_header_t) + sizeof(esp_app_desc_t);
bool check_fw_header(const void* buf, size_t len) {
// Ensure we have received enough data to do the check
if (len < fw_size_required) {
MG_ERROR(("Insufficient data to check firmware header - %d bytes, require %d bytes", len, fw_size_required));
return false;
}
// Check the magic word of the received firmare
esp_app_desc_t* rx_app_info = (esp_app_desc_t*)(((char*)buf) + sizeof(esp_image_header_t) + sizeof(esp_image_segment_header_t));
if (ESP_APP_DESC_MAGIC_WORD != rx_app_info->magic_word) {
MG_ERROR(("Invalid app - invalid magic word"));
return false;
}
MG_INFO(("Received firmware: %s %s", rx_app_info->project_name, rx_app_info->version));
// Get the name/version of the running firmware
const esp_partition_t *current = esp_ota_get_running_partition();
esp_app_desc_t curr_app_info;
esp_err_t res = esp_ota_get_partition_description(current, &curr_app_info);
if (ESP_OK != res) {
MG_ERROR(("Unable to get name/version of running firmware"));
return false;
}
MG_INFO(("Running firmware: %s %s", curr_app_info.project_name, curr_app_info.version));
// Check the name of the new firmware is the same as the old firmware
if (memcmp(curr_app_info.project_name, rx_app_info->project_name, sizeof(curr_app_info.project_name)) != 0) {
MG_ERROR(("Firmware name is different. Wrong firmware uploaded! Current %s Uploaded %s", curr_app_info.project_name, rx_app_info->project_name));
return false;
}
// Check the version of the new firmware is different from the old firmware
if (memcmp(curr_app_info.version, rx_app_info->version, sizeof(curr_app_info.version)) == 0) {
MG_ERROR(("Firmware version is the same. Wrong firmware uploaded! Current %s, Uploaded %s", curr_app_info.version, rx_app_info->version));
//return false;
}
return true;
}
bool mg_ota_begin(size_t new_firmware_size) {
rx_checked = false;
if (s_size) {
MG_ERROR(("OTA already in progress. Call mg_ota_end()"));
return false;
}
int partition_size = mg_ota_size(MG_FIRMWARE_PREVIOUS);
if (new_firmware_size > partition_size) {
MG_ERROR(("Firmware %lu bytes, max %lu", new_firmware_size, partition_size));
return false;
}
update_partition = esp_ota_get_next_update_partition(NULL);
if (NULL == update_partition) {
MG_ERROR(("esp_ota_get_next_update_partition returned NULL"));
return false;
}
esp_err_t res = esp_ota_begin(update_partition, OTA_WITH_SEQUENTIAL_WRITES, &update_handle);
if (res != ESP_OK) {
esp_ota_abort(update_handle);
MG_ERROR(("esp_ota_begin failed (%s)", esp_err_to_name(res)));
return false;
}
s_size = new_firmware_size;
MG_INFO(("Starting OTA, firmware size %lu", s_size));
return true;
}
bool mg_ota_write(const void *buf, size_t len) {
if (s_size == 0) {
MG_ERROR(("OTA is not started, call mg_ota_begin()"));
return false;
}
if (!rx_checked) {
if (!check_fw_header(buf, len)) {
return false;
}
rx_checked = true;
}
esp_err_t res = esp_ota_write(update_handle, buf, len);
if (res != ESP_OK) {
esp_ota_abort(update_handle);
MG_ERROR(("esp_ota_write FAILED (%s)", esp_err_to_name(res)));
return false;
}
return true;
}
bool mg_ota_end(void) {
if (0 == s_size) {
MG_INFO(("Finishing OTA: fail"));
return false;
}
s_size = 0;
esp_err_t err = esp_ota_end(update_handle);
if (err != ESP_OK) {
MG_ERROR(("esp_ota_end failed (%s)!", esp_err_to_name(err)));
return false;
}
err = esp_ota_set_boot_partition(update_partition);
if (err != ESP_OK) {
MG_ERROR(("esp_ota_set_boot_partition failed (%s)!", esp_err_to_name(err)));
return false;
}
return true;
}
bool mg_ota_commit(void) {
esp_ota_mark_app_valid_cancel_rollback();
return true;
}
bool mg_ota_rollback(void) {
if(esp_ota_check_rollback_is_possible()) {
esp_ota_mark_app_invalid_rollback_and_reboot();
return true;
}
MG_ERROR(("Rollback NOT possible"));
return false;
}
int mg_ota_status(int fw) {
const esp_partition_t *p = get_partition_from_fw(fw);
if (NULL == p) {
return 0;
}
int status = MG_OTA_UNAVAILABLE;
esp_ota_img_states_t img_state = ESP_OTA_IMG_UNDEFINED;
esp_err_t res = esp_ota_get_state_partition(p, &img_state);
if (ESP_OK == res) {
if (ESP_OTA_IMG_VALID == img_state) {
status = MG_OTA_COMMITTED;
} else if (ESP_OTA_IMG_UNDEFINED == img_state) {
status = MG_OTA_UNCOMMITTED;
} else if (ESP_OTA_IMG_INVALID == img_state) {
status = MG_OTA_UNAVAILABLE;
} else if (ESP_OTA_IMG_ABORTED == img_state) {
status = MG_OTA_UNAVAILABLE;
} else if (ESP_OTA_IMG_NEW == img_state) {
status = MG_OTA_FIRST_BOOT;
} else if (ESP_OTA_IMG_PENDING_VERIFY == img_state) {
status = MG_OTA_UNCOMMITTED;
}
}
return status;
}
uint32_t mg_ota_crc32(int fw) {
(void) fw;
return 0;
}
uint32_t mg_ota_timestamp(int fw) {
const esp_partition_t *p = get_partition_from_fw(fw);
esp_app_desc_t app;
esp_err_t res = esp_ota_get_partition_description(p, &app);
if (ESP_OK != res)
{
return 0;
}
struct tm datetime = {};
if (NULL == strptime(app.date, "%b %d %Y", &datetime))
{
return 0;
}
if (NULL == strptime(app.time, "%H:%M:%S", &datetime))
{
return 0;
}
return mktime(&datetime);
}
size_t mg_ota_size(int fw) {
const esp_partition_t *p = get_partition_from_fw(fw);
if (NULL == p) {
return 0;
}
return p->size;
}
#endif
@@ -0,0 +1,6 @@
#define MG_ARCH MG_ARCH_ESP32
#define MG_ENABLE_PACKED_FS 1
#define MG_TLS MG_TLS_NONE // change to 'MG_TLS_MBED' to enable TLS
#define MG_OTA MG_OTA_CUSTOM
#define MG_DEVICE MG_DEVICE_CUSTOM
+1
View File
@@ -0,0 +1 @@
../../../device-dashboard/net.h
+1 -1
View File
@@ -32,7 +32,7 @@ static void event_handler(void *arg, esp_event_base_t event_base,
esp_wifi_connect(); esp_wifi_connect();
} else if (event_base == WIFI_EVENT && } else if (event_base == WIFI_EVENT &&
event_id == WIFI_EVENT_STA_DISCONNECTED) { event_id == WIFI_EVENT_STA_DISCONNECTED) {
if (s_retry_num < 3) { if (s_retry_num < 10) {
esp_wifi_connect(); esp_wifi_connect();
s_retry_num++; s_retry_num++;
MG_INFO(("retry to connect to the AP")); MG_INFO(("retry to connect to the AP"));
@@ -1,5 +1,6 @@
# Name, Type, SubType, Offset, Size, Flags # Name, Type, SubType, Offset, Size, Flags
nvs, data, nvs, 0x9000, 0x6000, nvs, data, nvs, , 0x6000
phy_init, data, phy, 0xf000, 0x1000, otadata, data, ota, , 0x2000,
storage, data, spiffs, 0x10000, 0x10000, phy_init, data, phy, , 0x1000,
factory, app, factory, 0x100000, 1M, ota_0, app, ota_0, , 948K,
ota_1, app, ota_1, , 948K,
1 # Name # Name, Type, SubType, Offset, Size, Flags Type SubType Offset Size Flags
2 nvs nvs, data, nvs, , 0x6000 data nvs 0x9000 0x6000
3 phy_init otadata, data, ota, , 0x2000, data phy 0xf000 0x1000
4 storage phy_init, data, phy, , 0x1000, data spiffs 0x10000 0x10000
5 factory ota_0, app, ota_0, , 948K, app factory 0x100000 1M
6 ota_1, app, ota_1, , 948K,
@@ -1,4 +1,5 @@
CONFIG_PARTITION_TABLE_CUSTOM=y CONFIG_PARTITION_TABLE_CUSTOM=y
CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv" CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv"
CONFIG_PARTITION_TABLE_FILENAME="partitions.csv" CONFIG_PARTITION_TABLE_FILENAME="partitions.csv"
CONFIG_BOOTLOADER_APP_ROLLBACK_ENABLE=y
#CONFIG_ESP_MAIN_TASK_STACK_SIZE=8192 #CONFIG_ESP_MAIN_TASK_STACK_SIZE=8192
+26
View File
@@ -0,0 +1,26 @@
THISDIR = $(realpath $(CURDIR))
ROOTDIR = $(realpath $(CURDIR)/../../..)
PORT ?= /dev/ttyUSB0
DOCKER ?= docker run --rm $(DA) -v $(ROOTDIR):$(ROOTDIR) -w $(THISDIR) espressif/idf:v5.0.4
# Note that the esp32 port needs the extra .. for relative paths due to the location of its main CMakeLists.txt file
CMD ?= bash -c '$(MAKE) -C micropython/ports/esp32 submodules && $(MAKE) -C micropython/ports/esp32 USER_C_MODULES=../../../../mongoose/micropython.cmake'
all: example
example:
true
build: micropython
$(DOCKER) $(CMD)
micropython:
$(DOCKER) git clone --depth 1 -b v1.22.2 https://github.com/micropython/micropython.git
clean:
test -d micropython && $(DOCKER) rm -rf micropython || true
flash:
flash: DA = --device $(PORT)
flash: CMD = bash -c '$(MAKE) -C micropython/ports/esp32 erase deploy'
flash: build
+23
View File
@@ -0,0 +1,23 @@
# Mongoose as a MicroPython user module on the ESP32
The most basic usage is:
```python
import network
import mongoose
sta_if = network.WLAN(network.STA_IF)
sta_if.active(True)
sta_if.connect("<SSID>", "<PASSWORD>")
while not sta_if.isconnected():
pass
mongoose.init()
while True:
mongoose.poll(1000)
```
Check [_thread](https://docs.micropython.org/en/latest/library/_thread.html) support for more advanced usage
https://docs.micropython.org/en/latest/develop/cmodules.html
@@ -0,0 +1,28 @@
// Copyright (c) 2022 Cesanta Software Limited
// All rights reserved
#include "mongoose.h"
static void t_fn(void *arg) { // Tick periodically
MG_INFO(("tick"));
(void) arg;
}
static void fn(struct mg_connection *c, int ev, void *ev_data) {
if (ev == MG_EV_HTTP_MSG) mg_http_reply(c, 200, "", "hi\n");
(void) ev_data;
}
static struct mg_mgr mgr;
void mgmp_init(void) {
mg_mgr_init(&mgr); // Mongoose event manager
mg_log_set(MG_LL_DEBUG); // Set log level
mg_timer_add(&mgr, 1000, MG_TIMER_REPEAT, t_fn, &mgr);
mg_http_listen(&mgr, "http://0.0.0.0:80", fn, &mgr);
}
void mgmp_poll(int t) {
mg_mgr_poll(&mgr, t);
}
@@ -0,0 +1 @@
../../../micropython/mongoose/micropython.cmake
+1
View File
@@ -0,0 +1 @@
../../../micropython/mongoose/micropython.mk
+1
View File
@@ -0,0 +1 @@
../../../micropython/mongoose/module.c
+1
View File
@@ -0,0 +1 @@
../../../../mongoose.h
@@ -0,0 +1 @@
#define MG_ARCH MG_ARCH_ESP32
+2 -22
View File
@@ -1,30 +1,10 @@
# A UART to network bridge for ESP32 # A UART to network bridge for ESP32
This example is a demonstration of how Mongoose Library could be integrated
into an embedded device and provide a UART-to-Network bridge capability:
- A device opens listening TCP port and Websocket port and waits for connections
- When a client connects, data is exchanged with the device's UART
- Everything that client send, is sent to the UART
- Everything that is read from the UART, gets sent to the client
- Multiple clients are allowed
- Live UART console allows to talk to the UART from the web page
- Web UI is hardcoded into the binary and does not need a filesystem
# Screenshots
![](../../uart-bridge/screenshots/dashboard.png) ![](../../uart-bridge/screenshots/dashboard.png)
# Build and flash - See detailed tutorial at https://mongoose.ws/tutorials/esp32/uart-bridge/
Build requires Docker installed, and uses Espressif's ESP-IDF docker image: ## Flash pre-built firmware
```sh
make build
make flash PORT=/dev/YOURSERIAL
```
# Flash pre-built firmware
You can flash a pre-built firmware to the ESP32 device using the following You can flash a pre-built firmware to the ESP32 device using the following
instructions: instructions:
@@ -5,6 +5,4 @@ idf_component_register(SRCS "main.c"
"net.c" "net.c"
"packed_fs.c" "packed_fs.c"
"mongoose.c") "mongoose.c")
component_compile_options(-DMG_ENABLE_LINES=1)
component_compile_options(-DMG_ENABLE_PACKED_FS=1)
component_compile_options(-DUART_API_IMPLEMENTED=1) component_compile_options(-DUART_API_IMPLEMENTED=1)
+3 -2
View File
@@ -2,8 +2,9 @@
static void cli_wifi(const char *ssid, const char *pass) { static void cli_wifi(const char *ssid, const char *pass) {
if (wifi_init(ssid, pass)) { if (wifi_init(ssid, pass)) {
mg_file_printf(&mg_fs_posix, WIFI_FILE, "{%Q:%Q,%Q:%Q}\n", "ssid", ssid, mg_file_printf(&mg_fs_posix, WIFI_FILE, "{%m:%m,%m:%m}\n", mg_print_esc, 0,
"pass", pass); "ssid", mg_print_esc, 0, ssid, mg_print_esc, 0, "pass",
mg_print_esc, 0, pass);
MG_INFO(("Reboot now")); MG_INFO(("Reboot now"));
} }
} }
+9 -9
View File
@@ -5,12 +5,12 @@
const char *s_listening_url = "http://0.0.0.0:80"; const char *s_listening_url = "http://0.0.0.0:80";
char *config_read(void) { struct mg_str config_read(void) {
return mg_file_read(&mg_fs_posix, FS_ROOT "/config.json", NULL); return mg_file_read(&mg_fs_posix, FS_ROOT "/config.json");
} }
void config_write(struct mg_str config) { void config_write(struct mg_str config) {
mg_file_write(&mg_fs_posix, FS_ROOT "/config.json", config.ptr, config.len); mg_file_write(&mg_fs_posix, FS_ROOT "/config.json", config.buf, config.len);
} }
void app_main(void) { void app_main(void) {
@@ -21,14 +21,14 @@ void app_main(void) {
MG_INFO(("FS at %s initialised, status: %d", conf.base_path, res)); MG_INFO(("FS at %s initialised, status: %d", conf.base_path, res));
// Try to connect to wifi by using saved WiFi credentials // Try to connect to wifi by using saved WiFi credentials
char *json = mg_file_read(&mg_fs_posix, WIFI_FILE, NULL); struct mg_str json = mg_file_read(&mg_fs_posix, WIFI_FILE);
if (json != NULL) { if (json.buf != NULL) {
char *ssid = mg_json_get_str(mg_str(json), "$.ssid"); char *ssid = mg_json_get_str(json, "$.ssid");
char *pass = mg_json_get_str(mg_str(json), "$.pass"); char *pass = mg_json_get_str(json, "$.pass");
while (!wifi_init(ssid, pass)) (void) 0; while (!wifi_init(ssid, pass)) (void) 0;
free(ssid); free(ssid);
free(pass); free(pass);
free(json); free((void *) json.buf);
} else { } else {
// If WiFi is not configured, run CLI until configured // If WiFi is not configured, run CLI until configured
MG_INFO(("WiFi is not configured, running CLI. Press enter")); MG_INFO(("WiFi is not configured, running CLI. Press enter"));
@@ -45,6 +45,6 @@ void app_main(void) {
mg_mgr_init(&mgr); mg_mgr_init(&mgr);
mg_log_set(MG_LL_DEBUG); // Set log level mg_log_set(MG_LL_DEBUG); // Set log level
MG_INFO(("Mongoose v%s on %s", MG_VERSION, s_listening_url)); MG_INFO(("Mongoose v%s on %s", MG_VERSION, s_listening_url));
mg_http_listen(&mgr, s_listening_url, uart_bridge_fn, &mgr); mg_http_listen(&mgr, s_listening_url, uart_bridge_fn, NULL);
for (;;) mg_mgr_poll(&mgr, 10); // Infinite event loop for (;;) mg_mgr_poll(&mgr, 10); // Infinite event loop
} }
+1 -1
View File
@@ -11,7 +11,7 @@
#define WIFI_FILE FS_ROOT "/wifi.json" #define WIFI_FILE FS_ROOT "/wifi.json"
#define UART_NO 1 #define UART_NO 1
void uart_bridge_fn(struct mg_connection *, int, void *, void *); void uart_bridge_fn(struct mg_connection *, int, void *);
int uart_read(void *buf, size_t len); int uart_read(void *buf, size_t len);
bool wifi_init(const char *ssid, const char *pass); bool wifi_init(const char *ssid, const char *pass);
void cli(uint8_t ch); void cli(uint8_t ch);
@@ -0,0 +1,3 @@
#define MG_ARCH MG_ARCH_ESP32
#define MG_ENABLE_PACKED_FS 1
-22
View File
@@ -1,22 +0,0 @@
# An example ESP8266 application
To build this application, follow these steps:
1. Make sure you have Docker installed
2. Clone whole mongoose repository on your machine:
```sh
git clone https://github.com/cesanta/mongoose.git
```
3. Start command line or terminal, and go into the example's directory:
```sh
cd mongoose/examples/esp8266
```
4. Run `make`. This invokes a Docker-based build. A firmware will be built
in the `src/build/` directory:
```sh
make build
```
5. Flash your ESP8266. If you have esptool.py installed, the build process will end telling you the command to flash your device. You can just run `make` again to use Docker:
```sh
make flash PORT=/your/serial
```
@@ -1,5 +1,5 @@
THISDIR = $(realpath $(CURDIR)) THISDIR = $(realpath $(CURDIR))
ROOTDIR = $(realpath $(CURDIR)/../..) ROOTDIR = $(realpath $(CURDIR)/../../..)
DOCKER ?= docker run --rm $(DA) -v $(ROOTDIR):$(ROOTDIR) -w $(THISDIR) docker.io/mdashnet/8266 DOCKER ?= docker run --rm $(DA) -v $(ROOTDIR):$(ROOTDIR) -w $(THISDIR) docker.io/mdashnet/8266
CMD ?= make -C src defconfig app CMD ?= make -C src defconfig app
PORT ?= /dev/ttyUSB0 PORT ?= /dev/ttyUSB0
@@ -41,6 +41,5 @@ monitor: build
.PHONY: build .PHONY: build
clean: clean:
clean: CMD = rm -rf src/build test -d src/build && $(DOCKER) rm -rf src/build || true
clean: build
@@ -0,0 +1 @@
See detailed tutorial at https://mongoose.ws/tutorials/esp8266/http-client-server/
@@ -7,4 +7,3 @@
# please read the ESP-IDF documents if you need to do this. # please read the ESP-IDF documents if you need to do this.
# #
COMPONENT_INCLUDES += ../../../../..
@@ -9,8 +9,8 @@
#define SERVER_URL "http://0.0.0.0:80" #define SERVER_URL "http://0.0.0.0:80"
#define CLIENT_URL "http://info.cern.ch" #define CLIENT_URL "http://info.cern.ch"
// Event handler for an server (accepted) connection // Event handler for a server (accepted) connection
static void cb(struct mg_connection *c, int ev, void *ev_data, void *fn_data) { static void cb(struct mg_connection *c, int ev, void *ev_data) {
if (ev == MG_EV_HTTP_MSG) { if (ev == MG_EV_HTTP_MSG) {
mg_http_reply(c, 200, "", "Hello from ESP!\n"); mg_http_reply(c, 200, "", "Hello from ESP!\n");
} }
@@ -20,14 +20,14 @@ static void cb(struct mg_connection *c, int ev, void *ev_data, void *fn_data) {
// To enable TLS for HTTP, // To enable TLS for HTTP,
// 1. Copy "ca.pem" file to the ESP8266 flash FS // 1. Copy "ca.pem" file to the ESP8266 flash FS
// 2. Add TLS init snippet for the connection, see examples/http-client // 2. Add TLS init snippet for the connection, see examples/http-client
static void cb2(struct mg_connection *c, int ev, void *ev_data, void *fn_data) { static void cb2(struct mg_connection *c, int ev, void *ev_data) {
if (ev == MG_EV_CONNECT) { if (ev == MG_EV_CONNECT) {
struct mg_str s = mg_url_host(CLIENT_URL); struct mg_str s = mg_url_host(CLIENT_URL);
mg_printf(c, "GET / HTTP/1.0\r\nHost: %.*s\r\n\r\n", (int) s.len, s.ptr); mg_printf(c, "GET / HTTP/1.0\r\nHost: %.*s\r\n\r\n", (int) s.len, s.buf);
} else if (ev == MG_EV_HTTP_MSG) { } else if (ev == MG_EV_HTTP_MSG) {
struct mg_http_message *hm = ev_data; // Print HTTP response struct mg_http_message *hm = ev_data; // Print HTTP response
MG_INFO(("Fetched:\n%.*s", (int) hm->message.len, hm->message.ptr)); MG_INFO(("Fetched:\n%.*s", (int) hm->message.len, hm->message.buf));
c->is_closing = 1; c->is_draining = 1;
} }
} }
@@ -0,0 +1 @@
../../../../../mongoose.c
@@ -0,0 +1 @@
../../../../../mongoose.h
@@ -0,0 +1,2 @@
#define MG_ARCH MG_ARCH_ESP8266
@@ -0,0 +1,524 @@
#
# Automatically generated file. DO NOT EDIT.
# Espressif IoT Development Framework (ESP-IDF) Project Configuration
#
CONFIG_IDF_TARGET_ESP8266=y
CONFIG_IDF_TARGET="esp8266"
#
# SDK tool configuration
#
CONFIG_SDK_TOOLPREFIX="xtensa-lx106-elf-"
CONFIG_SDK_PYTHON="python"
# CONFIG_SDK_MAKE_WARN_UNDEFINED_VARIABLES is not set
CONFIG_BOOTLOADER_INIT_SPI_FLASH=y
# CONFIG_BOOTLOADER_DISABLE_JTAG_IO is not set
# CONFIG_BOOTLOADER_FAST_BOOT is not set
# CONFIG_LOG_BOOTLOADER_LEVEL_NONE is not set
# CONFIG_LOG_BOOTLOADER_LEVEL_ERROR is not set
# CONFIG_LOG_BOOTLOADER_LEVEL_WARN is not set
CONFIG_LOG_BOOTLOADER_LEVEL_INFO=y
# CONFIG_LOG_BOOTLOADER_LEVEL_DEBUG is not set
# CONFIG_LOG_BOOTLOADER_LEVEL_VERBOSE is not set
CONFIG_LOG_BOOTLOADER_LEVEL=3
# CONFIG_BOOTLOADER_APP_TEST is not set
CONFIG_BOOTLOADER_STORE_OFFSET=0x0
CONFIG_ESPTOOLPY_PORT="/dev/ttyACM0"
CONFIG_ESPTOOLPY_BAUD_115200B=y
# CONFIG_ESPTOOLPY_BAUD_230400B is not set
# CONFIG_ESPTOOLPY_BAUD_921600B is not set
# CONFIG_ESPTOOLPY_BAUD_2MB is not set
# CONFIG_ESPTOOLPY_BAUD_OTHER is not set
CONFIG_ESPTOOLPY_BAUD_OTHER_VAL=115200
CONFIG_ESPTOOLPY_BAUD=115200
CONFIG_ESPTOOLPY_COMPRESSED=y
CONFIG_ESPTOOLPY_FLASHMODE_QIO=y
# CONFIG_ESPTOOLPY_FLASHMODE_QOUT is not set
# CONFIG_ESPTOOLPY_FLASHMODE_DIO is not set
# CONFIG_ESPTOOLPY_FLASHMODE_DOUT is not set
CONFIG_ESPTOOLPY_FLASHMODE="dio"
CONFIG_SPI_FLASH_MODE=0x0
# CONFIG_ESPTOOLPY_FLASHFREQ_80M is not set
CONFIG_ESPTOOLPY_FLASHFREQ_40M=y
# CONFIG_ESPTOOLPY_FLASHFREQ_26M is not set
# CONFIG_ESPTOOLPY_FLASHFREQ_20M is not set
CONFIG_ESPTOOLPY_FLASHFREQ="40m"
CONFIG_SPI_FLASH_FREQ=0x0
# CONFIG_ESPTOOLPY_FLASHSIZE_1MB is not set
# CONFIG_ESPTOOLPY_FLASHSIZE_2MB is not set
CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y
# CONFIG_ESPTOOLPY_FLASHSIZE_8MB is not set
# CONFIG_ESPTOOLPY_FLASHSIZE_16MB is not set
CONFIG_ESPTOOLPY_FLASHSIZE="4MB"
CONFIG_SPI_FLASH_SIZE=0x400000
CONFIG_ESPTOOLPY_BEFORE_RESET=y
# CONFIG_ESPTOOLPY_BEFORE_NORESET is not set
CONFIG_ESPTOOLPY_BEFORE="default_reset"
CONFIG_ESPTOOLPY_AFTER_HARD_RESET=y
# CONFIG_ESPTOOLPY_AFTER_SOFT_RESET is not set
# CONFIG_ESPTOOLPY_AFTER_NORESET is not set
CONFIG_ESPTOOLPY_AFTER="hard_reset"
# CONFIG_ESPTOOLPY_MONITOR_BAUD_9600B is not set
# CONFIG_ESPTOOLPY_MONITOR_BAUD_57600B is not set
# CONFIG_ESPTOOLPY_MONITOR_BAUD_74880B is not set
CONFIG_ESPTOOLPY_MONITOR_BAUD_115200B=y
# CONFIG_ESPTOOLPY_MONITOR_BAUD_230400B is not set
# CONFIG_ESPTOOLPY_MONITOR_BAUD_921600B is not set
# CONFIG_ESPTOOLPY_MONITOR_BAUD_2MB is not set
# CONFIG_ESPTOOLPY_MONITOR_BAUD_OTHER is not set
CONFIG_ESPTOOLPY_MONITOR_BAUD_OTHER_VAL=74880
CONFIG_ESPTOOLPY_MONITOR_BAUD=115200
CONFIG_PARTITION_TABLE_SINGLE_APP=y
# CONFIG_PARTITION_TABLE_TWO_OTA is not set
# CONFIG_PARTITION_TABLE_CUSTOM is not set
CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv"
CONFIG_PARTITION_TABLE_OFFSET=0x8000
CONFIG_PARTITION_TABLE_FILENAME="partitions_singleapp.csv"
CONFIG_COMPILER_OPTIMIZATION_LEVEL_DEBUG=y
# CONFIG_COMPILER_OPTIMIZATION_LEVEL_RELEASE is not set
CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_ENABLE=y
# CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_SILENT is not set
# CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_DISABLE is not set
# CONFIG_COMPILER_CXX_EXCEPTIONS is not set
CONFIG_COMPILER_STACK_CHECK_MODE_NONE=y
# CONFIG_COMPILER_STACK_CHECK_MODE_NORM is not set
# CONFIG_COMPILER_STACK_CHECK_MODE_STRONG is not set
# CONFIG_COMPILER_STACK_CHECK_MODE_ALL is not set
# CONFIG_COMPILER_STACK_CHECK is not set
# CONFIG_COMPILER_WARN_WRITE_STRINGS is not set
CONFIG_APP_UPDATE_CHECK_APP_SUM=y
# CONFIG_APP_UPDATE_CHECK_APP_HASH is not set
CONFIG_APP_COMPILE_TIME_DATE=y
# CONFIG_APP_EXCLUDE_PROJECT_VER_VAR is not set
# CONFIG_APP_EXCLUDE_PROJECT_NAME_VAR is not set
# CONFIG_APP_PROJECT_VER_FROM_CONFIG is not set
# CONFIG_ENABLE_COAP is not set
CONFIG_ESP_TLS_USING_MBEDTLS=y
# CONFIG_ESP_TLS_USING_WOLFSSL is not set
# CONFIG_ESP_TLS_SERVER is not set
# CONFIG_ESP_TLS_PSK_VERIFICATION is not set
# CONFIG_ESP_WOLFSSL_INTERNAL is not set
# CONFIG_WOLFSSL_DEBUG is not set
CONFIG_ESP8266_NMI_WDT=y
# CONFIG_ESP8266_XTAL_FREQ_40 is not set
CONFIG_ESP8266_XTAL_FREQ_26=y
CONFIG_ESP8266_XTAL_FREQ=26
# CONFIG_ESP8266_DEFAULT_CPU_FREQ_80 is not set
CONFIG_ESP8266_DEFAULT_CPU_FREQ_160=y
CONFIG_ESP8266_DEFAULT_CPU_FREQ_MHZ=160
CONFIG_ESP_FILENAME_MACRO_NO_PATH=y
# CONFIG_ESP_FILENAME_MACRO_RAW is not set
# CONFIG_ESP_FILENAME_MACRO_NULL is not set
CONFIG_USING_NEW_ETS_VPRINTF=y
# CONFIG_LINK_ETS_PRINTF_TO_IRAM is not set
CONFIG_ETS_PRINTF_EXIT_WHEN_FLASH_RW=y
# CONFIG_SOC_FULL_ICACHE is not set
CONFIG_SOC_IRAM_SIZE=0xC000
# CONFIG_DISABLE_ROM_UART_PRINT is not set
# CONFIG_ESP_PANIC_PRINT_HALT is not set
CONFIG_ESP_PANIC_PRINT_REBOOT=y
# CONFIG_ESP_PANIC_SILENT_REBOOT is not set
# CONFIG_ESP_PANIC_GDBSTUB is not set
CONFIG_RESET_REASON=y
CONFIG_WIFI_PPT_TASKSTACK_SIZE=5120
CONFIG_ESP8266_CORE_GLOBAL_DATA_LINK_IRAM=y
# CONFIG_ESP8266_OTA_FROM_OLD is not set
# CONFIG_ESP8266_BOOT_COPY_APP is not set
CONFIG_ESP8266_TIME_SYSCALL_USE_FRC1=y
# CONFIG_ESP8266_TIME_SYSCALL_USE_NONE is not set
# CONFIG_PM_ENABLE is not set
CONFIG_SCAN_AP_MAX=99
CONFIG_WIFI_TX_RATE_SEQUENCE_FROM_HIGH=y
# CONFIG_ESP8266_WIFI_QOS_ENABLED is not set
# CONFIG_ESP8266_WIFI_AMPDU_RX_ENABLED is not set
# CONFIG_ESP8266_WIFI_AMSDU_ENABLED is not set
CONFIG_ESP8266_WIFI_RX_BUFFER_NUM=16
CONFIG_ESP8266_WIFI_LEFT_CONTINUOUS_RX_BUFFER_NUM=16
CONFIG_ESP8266_WIFI_RX_PKT_NUM=7
CONFIG_ESP8266_WIFI_TX_PKT_NUM=6
CONFIG_ESP8266_WIFI_NVS_ENABLED=y
CONFIG_ESP8266_WIFI_CONNECT_OPEN_ROUTER_WHEN_PWD_IS_SET=y
CONFIG_ESP8266_WIFI_ENABLE_WPA3_SAE=y
# CONFIG_ESP8266_WIFI_DEBUG_LOG_ENABLE is not set
CONFIG_ESP_PHY_CALIBRATION_AND_DATA_STORAGE=y
# CONFIG_ESP_PHY_INIT_DATA_IN_PARTITION is not set
CONFIG_ESP_PHY_INIT_DATA_VDD33_CONST=33
CONFIG_ESP8266_PHY_MAX_WIFI_TX_POWER=20
# CONFIG_ESP8266_HSPI_HIGH_THROUGHPUT is not set
CONFIG_ESP_ERR_TO_NAME_LOOKUP=y
CONFIG_ESP_SYSTEM_EVENT_QUEUE_SIZE=32
CONFIG_ESP_SYSTEM_EVENT_TASK_STACK_SIZE=2048
CONFIG_ESP_MAIN_TASK_STACK_SIZE=3584
CONFIG_ESP_TIMER_TASK_STACK_SIZE=3584
CONFIG_ESP_CONSOLE_UART_DEFAULT=y
# CONFIG_ESP_CONSOLE_UART_CUSTOM is not set
# CONFIG_ESP_CONSOLE_UART_NONE is not set
CONFIG_ESP_CONSOLE_UART_NUM=0
CONFIG_ESP_CONSOLE_UART_BAUDRATE=74880
# CONFIG_ESP_UART0_SWAP_IO is not set
CONFIG_ESP_TASK_WDT=y
CONFIG_ESP_TASK_WDT_PANIC=y
# CONFIG_ESP_TASK_WDT_TIMEOUT_13N is not set
# CONFIG_ESP_TASK_WDT_TIMEOUT_14N is not set
CONFIG_ESP_TASK_WDT_TIMEOUT_15N=y
CONFIG_ESP_TASK_WDT_TIMEOUT_S=15
# CONFIG_ESP_EVENT_LOOP_PROFILING is not set
CONFIG_ESP_EVENT_POST_FROM_ISR=y
CONFIG_ESP_HTTP_CLIENT_ENABLE_HTTPS=y
# CONFIG_ESP_HTTP_CLIENT_ENABLE_BASIC_AUTH is not set
CONFIG_HTTP_BUF_SIZE=512
CONFIG_HTTPD_MAX_REQ_HDR_LEN=512
CONFIG_HTTPD_MAX_URI_LEN=512
CONFIG_OTA_BUF_SIZE=256
# CONFIG_OTA_ALLOW_HTTP is not set
# CONFIG_FATFS_CODEPAGE_DYNAMIC is not set
CONFIG_FATFS_CODEPAGE_437=y
# CONFIG_FATFS_CODEPAGE_720 is not set
# CONFIG_FATFS_CODEPAGE_737 is not set
# CONFIG_FATFS_CODEPAGE_771 is not set
# CONFIG_FATFS_CODEPAGE_775 is not set
# CONFIG_FATFS_CODEPAGE_850 is not set
# CONFIG_FATFS_CODEPAGE_852 is not set
# CONFIG_FATFS_CODEPAGE_855 is not set
# CONFIG_FATFS_CODEPAGE_857 is not set
# CONFIG_FATFS_CODEPAGE_860 is not set
# CONFIG_FATFS_CODEPAGE_861 is not set
# CONFIG_FATFS_CODEPAGE_862 is not set
# CONFIG_FATFS_CODEPAGE_863 is not set
# CONFIG_FATFS_CODEPAGE_864 is not set
# CONFIG_FATFS_CODEPAGE_865 is not set
# CONFIG_FATFS_CODEPAGE_866 is not set
# CONFIG_FATFS_CODEPAGE_869 is not set
# CONFIG_FATFS_CODEPAGE_932 is not set
# CONFIG_FATFS_CODEPAGE_936 is not set
# CONFIG_FATFS_CODEPAGE_949 is not set
# CONFIG_FATFS_CODEPAGE_950 is not set
CONFIG_FATFS_CODEPAGE=437
CONFIG_FATFS_LFN_NONE=y
# CONFIG_FATFS_LFN_HEAP is not set
# CONFIG_FATFS_LFN_STACK is not set
CONFIG_FATFS_FS_LOCK=0
CONFIG_FATFS_TIMEOUT_MS=10000
CONFIG_FATFS_PER_FILE_CACHE=y
CONFIG_FMB_COMM_MODE_TCP_EN=y
CONFIG_FMB_TCP_PORT_DEFAULT=502
CONFIG_FMB_TCP_PORT_MAX_CONN=5
CONFIG_FMB_TCP_CONNECTION_TOUT_SEC=20
CONFIG_FMB_MASTER_TIMEOUT_MS_RESPOND=150
CONFIG_FMB_MASTER_DELAY_MS_CONVERT=200
CONFIG_FMB_QUEUE_LENGTH=20
CONFIG_FMB_PORT_TASK_STACK_SIZE=4096
CONFIG_FMB_SERIAL_BUF_SIZE=256
CONFIG_FMB_PORT_TASK_PRIO=10
CONFIG_FMB_CONTROLLER_SLAVE_ID_SUPPORT=y
CONFIG_FMB_CONTROLLER_SLAVE_ID=0x00112233
CONFIG_FMB_CONTROLLER_NOTIFY_TIMEOUT=20
CONFIG_FMB_CONTROLLER_NOTIFY_QUEUE_SIZE=20
CONFIG_FMB_CONTROLLER_STACK_SIZE=4096
CONFIG_FMB_EVENT_QUEUE_TIMEOUT=20
CONFIG_FMB_TIMER_GROUP=0
CONFIG_FMB_TIMER_INDEX=0
# CONFIG_FMB_TIMER_ISR_IN_IRAM is not set
# CONFIG_DISABLE_FREERTOS is not set
CONFIG_FREERTOS_UNICORE=y
# CONFIG_FREERTOS_ENABLE_REENT is not set
CONFIG_FREERTOS_NO_AFFINITY=0x7FFFFFFF
CONFIG_FREERTOS_HZ=100
CONFIG_FREERTOS_MAX_HOOK=2
CONFIG_FREERTOS_IDLE_TASK_STACKSIZE=1024
CONFIG_FREERTOS_ISR_STACKSIZE=512
# CONFIG_FREERTOS_EXTENED_HOOKS is not set
CONFIG_FREERTOS_GLOBAL_DATA_LINK_IRAM=y
# CONFIG_FREERTOS_CODE_LINK_TO_IRAM is not set
CONFIG_FREERTOS_TIMER_STACKSIZE=2048
CONFIG_TASK_SWITCH_FASTER=y
# CONFIG_USE_QUEUE_SETS is not set
# CONFIG_ENABLE_FREERTOS_SLEEP is not set
# CONFIG_FREERTOS_USE_TRACE_FACILITY is not set
# CONFIG_FREERTOS_GENERATE_RUN_TIME_STATS is not set
CONFIG_FREERTOS_WATCHPOINT_END_OF_STACK=y
# CONFIG_HEAP_DISABLE_IRAM is not set
# CONFIG_HEAP_TRACING is not set
CONFIG_LIBSODIUM_USE_MBEDTLS_SHA=y
# CONFIG_LOG_DEFAULT_LEVEL_NONE is not set
# CONFIG_LOG_DEFAULT_LEVEL_ERROR is not set
# CONFIG_LOG_DEFAULT_LEVEL_WARN is not set
CONFIG_LOG_DEFAULT_LEVEL_INFO=y
# CONFIG_LOG_DEFAULT_LEVEL_DEBUG is not set
# CONFIG_LOG_DEFAULT_LEVEL_VERBOSE is not set
CONFIG_LOG_DEFAULT_LEVEL=3
CONFIG_LOG_COLORS=y
# CONFIG_LOG_SET_LEVEL is not set
CONFIG_LWIP_LOCAL_HOSTNAME="espressif"
CONFIG_LWIP_DNS_SUPPORT_MDNS_QUERIES=y
# CONFIG_LWIP_L2_TO_L3_COPY is not set
# CONFIG_LWIP_IRAM_OPTIMIZATION is not set
CONFIG_LWIP_TIMERS_ONDEMAND=y
CONFIG_LWIP_MAX_SOCKETS=10
# CONFIG_LWIP_USE_ONLY_LWIP_SELECT is not set
# CONFIG_LWIP_SO_LINGER is not set
CONFIG_LWIP_SO_REUSE=y
CONFIG_LWIP_SO_REUSE_RXTOALL=y
# CONFIG_LWIP_SO_RCVBUF is not set
# CONFIG_LWIP_NETBUF_RECVINFO is not set
CONFIG_LWIP_IP4_FRAG=y
CONFIG_LWIP_IP6_FRAG=y
# CONFIG_LWIP_IP4_REASSEMBLY is not set
# CONFIG_LWIP_IP6_REASSEMBLY is not set
# CONFIG_LWIP_IP_FORWARD is not set
# CONFIG_LWIP_STATS is not set
# CONFIG_LWIP_ETHARP_TRUST_IP_MAC is not set
CONFIG_LWIP_ESP_GRATUITOUS_ARP=y
CONFIG_LWIP_GARP_TMR_INTERVAL=60
CONFIG_LWIP_TCPIP_RECVMBOX_SIZE=32
CONFIG_LWIP_DHCP_DOES_ARP_CHECK=y
# CONFIG_LWIP_DHCP_RESTORE_LAST_IP is not set
CONFIG_LWIP_DHCPS_LEASE_UNIT=60
CONFIG_LWIP_DHCPS_MAX_STATION_NUM=8
# CONFIG_LWIP_AUTOIP is not set
# CONFIG_LWIP_IPV6_AUTOCONFIG is not set
CONFIG_LWIP_NETIF_LOOPBACK=y
CONFIG_LWIP_LOOPBACK_MAX_PBUFS=8
CONFIG_LWIP_MAX_ACTIVE_TCP=16
CONFIG_LWIP_MAX_LISTENING_TCP=16
CONFIG_LWIP_TCP_MAXRTX=12
CONFIG_LWIP_TCP_SYNMAXRTX=6
CONFIG_LWIP_TCP_MSS=1440
CONFIG_LWIP_TCP_TMR_INTERVAL=250
CONFIG_LWIP_TCP_MSL=60000
CONFIG_LWIP_TCP_SND_BUF_DEFAULT=2880
CONFIG_LWIP_TCP_WND_DEFAULT=5760
CONFIG_LWIP_TCP_RECVMBOX_SIZE=6
CONFIG_LWIP_TCP_QUEUE_OOSEQ=y
# CONFIG_LWIP_TCP_SACK_OUT is not set
# CONFIG_LWIP_TCP_KEEP_CONNECTION_WHEN_IP_CHANGES is not set
CONFIG_LWIP_TCP_OVERSIZE_MSS=y
# CONFIG_LWIP_TCP_OVERSIZE_QUARTER_MSS is not set
# CONFIG_LWIP_TCP_OVERSIZE_DISABLE is not set
CONFIG_LWIP_TCP_RTO_TIME=3000
CONFIG_LWIP_MAX_UDP_PCBS=16
CONFIG_LWIP_UDP_RECVMBOX_SIZE=6
CONFIG_LWIP_TCPIP_TASK_STACK_SIZE=2048
CONFIG_LWIP_TCPIP_TASK_AFFINITY_NO_AFFINITY=y
# CONFIG_LWIP_TCPIP_TASK_AFFINITY_CPU0 is not set
CONFIG_LWIP_TCPIP_TASK_AFFINITY=0x7FFFFFFF
# CONFIG_LWIP_PPP_SUPPORT is not set
CONFIG_LWIP_IPV6_MEMP_NUM_ND6_QUEUE=3
CONFIG_LWIP_IPV6_ND6_NUM_NEIGHBORS=5
# CONFIG_LWIP_MULTICAST_PING is not set
# CONFIG_LWIP_BROADCAST_PING is not set
CONFIG_LWIP_MAX_RAW_PCBS=16
# CONFIG_LWIP_IPV6 is not set
CONFIG_LWIP_DHCP_MAX_NTP_SERVERS=1
CONFIG_LWIP_SNTP_UPDATE_DELAY=3600000
CONFIG_LWIP_ESP_LWIP_ASSERT=y
# CONFIG_LWIP_DEBUG is not set
CONFIG_MBEDTLS_INTERNAL_MEM_ALLOC=y
# CONFIG_MBEDTLS_DEFAULT_MEM_ALLOC is not set
# CONFIG_MBEDTLS_CUSTOM_MEM_ALLOC is not set
CONFIG_MBEDTLS_ASYMMETRIC_CONTENT_LEN=y
CONFIG_MBEDTLS_SSL_IN_CONTENT_LEN=16384
CONFIG_MBEDTLS_SSL_OUT_CONTENT_LEN=4096
# CONFIG_MBEDTLS_DYNAMIC_BUFFER is not set
# CONFIG_MBEDTLS_DEBUG is not set
CONFIG_MBEDTLS_HAVE_TIME=y
# CONFIG_MBEDTLS_HAVE_TIME_DATE is not set
CONFIG_MBEDTLS_TLS_SERVER_AND_CLIENT=y
# CONFIG_MBEDTLS_TLS_SERVER_ONLY is not set
# CONFIG_MBEDTLS_TLS_CLIENT_ONLY is not set
# CONFIG_MBEDTLS_TLS_DISABLED is not set
CONFIG_MBEDTLS_TLS_SERVER=y
CONFIG_MBEDTLS_TLS_CLIENT=y
CONFIG_MBEDTLS_TLS_ENABLED=y
# CONFIG_MBEDTLS_PSK_MODES is not set
CONFIG_MBEDTLS_KEY_EXCHANGE_RSA=y
CONFIG_MBEDTLS_KEY_EXCHANGE_DHE_RSA=y
CONFIG_MBEDTLS_KEY_EXCHANGE_ELLIPTIC_CURVE=y
CONFIG_MBEDTLS_KEY_EXCHANGE_ECDHE_RSA=y
CONFIG_MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA=y
CONFIG_MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA=y
CONFIG_MBEDTLS_KEY_EXCHANGE_ECDH_RSA=y
CONFIG_MBEDTLS_SSL_RENEGOTIATION=y
# CONFIG_MBEDTLS_SSL_PROTO_SSL3 is not set
CONFIG_MBEDTLS_SSL_PROTO_TLS1=y
CONFIG_MBEDTLS_SSL_PROTO_TLS1_1=y
CONFIG_MBEDTLS_SSL_PROTO_TLS1_2=y
# CONFIG_MBEDTLS_SSL_PROTO_DTLS is not set
CONFIG_MBEDTLS_SSL_ALPN=y
CONFIG_MBEDTLS_CLIENT_SSL_SESSION_TICKETS=y
CONFIG_MBEDTLS_SERVER_SSL_SESSION_TICKETS=y
CONFIG_MBEDTLS_AES_C=y
# CONFIG_MBEDTLS_CAMELLIA_C is not set
# CONFIG_MBEDTLS_DES_C is not set
CONFIG_MBEDTLS_RC4_DISABLED=y
# CONFIG_MBEDTLS_RC4_ENABLED_NO_DEFAULT is not set
# CONFIG_MBEDTLS_RC4_ENABLED is not set
# CONFIG_MBEDTLS_BLOWFISH_C is not set
# CONFIG_MBEDTLS_XTEA_C is not set
CONFIG_MBEDTLS_CCM_C=y
CONFIG_MBEDTLS_GCM_C=y
# CONFIG_MBEDTLS_RIPEMD160_C is not set
CONFIG_MBEDTLS_PEM_PARSE_C=y
CONFIG_MBEDTLS_PEM_WRITE_C=y
CONFIG_MBEDTLS_X509_CRL_PARSE_C=y
CONFIG_MBEDTLS_X509_CSR_PARSE_C=y
CONFIG_MBEDTLS_ECP_C=y
CONFIG_MBEDTLS_ECDH_C=y
CONFIG_MBEDTLS_ECDSA_C=y
CONFIG_MBEDTLS_ECP_DP_SECP192R1_ENABLED=y
CONFIG_MBEDTLS_ECP_DP_SECP224R1_ENABLED=y
CONFIG_MBEDTLS_ECP_DP_SECP256R1_ENABLED=y
CONFIG_MBEDTLS_ECP_DP_SECP384R1_ENABLED=y
CONFIG_MBEDTLS_ECP_DP_SECP521R1_ENABLED=y
CONFIG_MBEDTLS_ECP_DP_SECP192K1_ENABLED=y
CONFIG_MBEDTLS_ECP_DP_SECP224K1_ENABLED=y
CONFIG_MBEDTLS_ECP_DP_SECP256K1_ENABLED=y
CONFIG_MBEDTLS_ECP_DP_BP256R1_ENABLED=y
CONFIG_MBEDTLS_ECP_DP_BP384R1_ENABLED=y
CONFIG_MBEDTLS_ECP_DP_BP512R1_ENABLED=y
CONFIG_MBEDTLS_ECP_DP_CURVE25519_ENABLED=y
CONFIG_MBEDTLS_ECP_NIST_OPTIM=y
# CONFIG_util_assert is not set
# CONFIG_ESP_SHA is not set
CONFIG_ESP_AES=y
CONFIG_ESP_MD5=y
CONFIG_ESP_ARC4=y
# CONFIG_ENABLE_MDNS is not set
CONFIG_MQTT_PROTOCOL_311=y
CONFIG_MQTT_TRANSPORT_SSL=y
CONFIG_MQTT_TRANSPORT_WEBSOCKET=y
CONFIG_MQTT_TRANSPORT_WEBSOCKET_SECURE=y
# CONFIG_MQTT_USE_CUSTOM_CONFIG is not set
# CONFIG_MQTT_TASK_CORE_SELECTION_ENABLED is not set
# CONFIG_MQTT_CUSTOM_OUTBOX is not set
CONFIG_NEWLIB_STDOUT_LINE_ENDING_CRLF=y
# CONFIG_NEWLIB_STDOUT_LINE_ENDING_LF is not set
# CONFIG_NEWLIB_STDOUT_LINE_ENDING_CR is not set
CONFIG_NEWLIB_NANO_FORMAT=y
# CONFIG_OPENSSL_DEBUG is not set
CONFIG_OPENSSL_ASSERT_DO_NOTHING=y
# CONFIG_OPENSSL_ASSERT_EXIT is not set
CONFIG_PTHREAD_TASK_PRIO_DEFAULT=5
CONFIG_PTHREAD_TASK_STACK_SIZE_DEFAULT=3072
CONFIG_PTHREAD_STACK_MIN=768
CONFIG_PTHREAD_TASK_NAME_DEFAULT="pthread"
CONFIG_SPIFFS_MAX_PARTITIONS=3
CONFIG_SPIFFS_CACHE=y
CONFIG_SPIFFS_CACHE_WR=y
# CONFIG_SPIFFS_CACHE_STATS is not set
CONFIG_SPIFFS_PAGE_CHECK=y
CONFIG_SPIFFS_GC_MAX_RUNS=10
# CONFIG_SPIFFS_GC_STATS is not set
CONFIG_SPIFFS_PAGE_SIZE=256
CONFIG_SPIFFS_OBJ_NAME_LEN=32
CONFIG_SPIFFS_USE_MAGIC=y
CONFIG_SPIFFS_USE_MAGIC_LENGTH=y
CONFIG_SPIFFS_META_LENGTH=4
CONFIG_SPIFFS_USE_MTIME=y
# CONFIG_SPIFFS_DBG is not set
# CONFIG_SPIFFS_API_DBG is not set
# CONFIG_SPIFFS_GC_DBG is not set
# CONFIG_SPIFFS_CACHE_DBG is not set
# CONFIG_SPIFFS_CHECK_DBG is not set
# CONFIG_SPIFFS_TEST_VISUALISATION is not set
CONFIG_IP_LOST_TIMER_INTERVAL=120
CONFIG_TCPIP_ADAPTER_GLOBAL_DATA_LINK_IRAM=y
CONFIG_VFS_SUPPRESS_SELECT_DEBUG_OUTPUT=y
CONFIG_VFS_SUPPORT_TERMIOS=y
CONFIG_SEMIHOSTFS_MAX_MOUNT_POINTS=1
CONFIG_SEMIHOSTFS_HOST_PATH_MAX_LEN=128
# CONFIG_WL_SECTOR_SIZE_512 is not set
CONFIG_WL_SECTOR_SIZE_4096=y
CONFIG_WL_SECTOR_SIZE=4096
# CONFIG_ENABLE_UNIFIED_PROVISIONING is not set
CONFIG_LTM_FAST=y
CONFIG_WPA_MBEDTLS_CRYPTO=y
# CONFIG_WPA_DEBUG_PRINT is not set
# CONFIG_WPA_TESTING_OPTIONS is not set
# CONFIG_WPA_WPS_WARS is not set
# CONFIG_WPA_11KV_SUPPORT is not set
# Deprecated options for backward compatibility
CONFIG_TARGET_PLATFORM="esp8266"
CONFIG_TOOLPREFIX="xtensa-lx106-elf-"
# CONFIG_MAKE_WARN_UNDEFINED_VARIABLES is not set
CONFIG_FLASHMODE_QIO=y
# CONFIG_FLASHMODE_QOUT is not set
# CONFIG_FLASHMODE_DIO is not set
# CONFIG_FLASHMODE_DOUT is not set
# CONFIG_MONITOR_BAUD_9600B is not set
# CONFIG_MONITOR_BAUD_57600B is not set
# CONFIG_MONITOR_BAUD_74880B is not set
CONFIG_MONITOR_BAUD_115200B=y
# CONFIG_MONITOR_BAUD_230400B is not set
# CONFIG_MONITOR_BAUD_921600B is not set
# CONFIG_MONITOR_BAUD_2MB is not set
# CONFIG_MONITOR_BAUD_OTHER is not set
CONFIG_MONITOR_BAUD_OTHER_VAL=74880
CONFIG_MONITOR_BAUD=115200
CONFIG_OPTIMIZATION_LEVEL_DEBUG=y
# CONFIG_OPTIMIZATION_LEVEL_RELEASE is not set
CONFIG_OPTIMIZATION_ASSERTIONS_ENABLED=y
# CONFIG_OPTIMIZATION_ASSERTIONS_SILENT is not set
# CONFIG_OPTIMIZATION_ASSERTIONS_DISABLED is not set
# CONFIG_CXX_EXCEPTIONS is not set
CONFIG_STACK_CHECK_NONE=y
# CONFIG_STACK_CHECK_NORM is not set
# CONFIG_STACK_CHECK_STRONG is not set
# CONFIG_STACK_CHECK_ALL is not set
# CONFIG_STACK_CHECK is not set
# CONFIG_WARN_WRITE_STRINGS is not set
CONFIG_MAIN_TASK_STACK_SIZE=3584
CONFIG_CONSOLE_UART_DEFAULT=y
# CONFIG_CONSOLE_UART_CUSTOM is not set
# CONFIG_CONSOLE_UART_NONE is not set
CONFIG_CONSOLE_UART_NUM=0
CONFIG_CONSOLE_UART_BAUDRATE=74880
# CONFIG_UART0_SWAP_IO is not set
CONFIG_TASK_WDT=y
CONFIG_TASK_WDT_PANIC=y
CONFIG_TASK_WDT_TIMEOUT_S=15
CONFIG_MB_MASTER_TIMEOUT_MS_RESPOND=150
CONFIG_MB_MASTER_DELAY_MS_CONVERT=200
CONFIG_MB_QUEUE_LENGTH=20
CONFIG_MB_SERIAL_TASK_STACK_SIZE=4096
CONFIG_MB_SERIAL_BUF_SIZE=256
CONFIG_MB_SERIAL_TASK_PRIO=10
CONFIG_MB_CONTROLLER_SLAVE_ID_SUPPORT=y
CONFIG_MB_CONTROLLER_SLAVE_ID=0x00112233
CONFIG_MB_CONTROLLER_NOTIFY_TIMEOUT=20
CONFIG_MB_CONTROLLER_NOTIFY_QUEUE_SIZE=20
CONFIG_MB_CONTROLLER_STACK_SIZE=4096
CONFIG_MB_EVENT_QUEUE_TIMEOUT=20
CONFIG_MB_TIMER_GROUP=0
CONFIG_MB_TIMER_INDEX=0
# CONFIG_L2_TO_L3_COPY is not set
# CONFIG_USE_ONLY_LWIP_SELECT is not set
CONFIG_ESP_GRATUITOUS_ARP=y
CONFIG_GARP_TMR_INTERVAL=60
CONFIG_TCPIP_RECVMBOX_SIZE=32
CONFIG_TCP_MAXRTX=12
CONFIG_TCP_SYNMAXRTX=6
CONFIG_TCP_MSS=1440
CONFIG_TCP_MSL=60000
CONFIG_TCP_SND_BUF_DEFAULT=2880
CONFIG_TCP_WND_DEFAULT=5760
CONFIG_TCP_RECVMBOX_SIZE=6
CONFIG_TCP_QUEUE_OOSEQ=y
# CONFIG_ESP_TCP_KEEP_CONNECTION_WHEN_IP_CHANGES is not set
CONFIG_TCP_OVERSIZE_MSS=y
# CONFIG_TCP_OVERSIZE_QUARTER_MSS is not set
# CONFIG_TCP_OVERSIZE_DISABLE is not set
CONFIG_UDP_RECVMBOX_SIZE=6
CONFIG_TCPIP_TASK_STACK_SIZE=2048
CONFIG_TCPIP_TASK_AFFINITY_NO_AFFINITY=y
# CONFIG_TCPIP_TASK_AFFINITY_CPU0 is not set
CONFIG_TCPIP_TASK_AFFINITY=0x7FFFFFFF
# CONFIG_PPP_SUPPORT is not set
CONFIG_ESP32_PTHREAD_TASK_PRIO_DEFAULT=5
CONFIG_ESP32_PTHREAD_TASK_STACK_SIZE_DEFAULT=3072
CONFIG_ESP32_PTHREAD_STACK_MIN=768
CONFIG_ESP32_PTHREAD_TASK_NAME_DEFAULT="pthread"
CONFIG_SUPPRESS_SELECT_DEBUG_OUTPUT=y
CONFIG_SUPPORT_TERMIOS=y
# End of deprecated options
+35
View File
@@ -0,0 +1,35 @@
SPROG ?= server # Program we are building
CPROG ?= client # Program we are building
DELETE = rm -rf # Command to remove files
SOUT ?= -o $(SPROG) # Compiler argument for output file
COUT ?= -o $(CPROG) # Compiler argument for output file
SSOURCES = server.c mongoose.c # Source code files
CSOURCES = client.c mongoose.c # Source code files
CFLAGS = -W -Wall -Wextra -g -I. # Build options
# Mongoose build options. See https://mongoose.ws/documentation/#build-options
#CFLAGS_MONGOOSE += -DMG_ENABLE_LINES
ifeq ($(OS),Windows_NT) # Windows settings. Assume MinGW compiler. To use VC: make CC=cl CFLAGS=/MD OUT=/Feprog.exe
SPROG ?= server.exe # Use .exe suffix for the binary
CPROG ?= client.exe # Use .exe suffix for the binary
CC = gcc # Use MinGW gcc compiler
CFLAGS += -lws2_32 # Link against Winsock library
DELETE = cmd /C del /Q /F /S # Command prompt command to delete files
SOUT ?= -o $(SPROG) # Build output
COUT ?= -o $(CPROG) # Build output
endif
all: example # Default target. Build all and run server
$(RUN) ./$(SPROG) $(SARGS)
example: $(SPROG) $(CPROG)
$(SPROG): $(SSOURCES) # Build program from sources
$(CC) $(SSOURCES) $(CFLAGS) $(CFLAGS_MONGOOSE) $(CFLAGS_EXTRA) $(SOUT)
$(CPROG): $(CSOURCES) # Build program from sources
$(CC) $(CSOURCES) $(CFLAGS) $(CFLAGS_MONGOOSE) $(CFLAGS_EXTRA) $(COUT)
clean: # Cleanup. Delete built program and all build artifacts
$(DELETE) $(SPROG) $(CPROG) *.o *.obj *.exe *.dSYM
+47
View File
@@ -0,0 +1,47 @@
# File Transfer
This example contains minimal HTTP client and server.
The client uploads a file to the server in a single POST, shaping traffic to send small data chunks.
The server manually processes requests in order to be able to write as soon as data arrives, to avoid buffering a whole (possibly huge) file not fitting in RAM.
Uploads are authenticated using Basic Auth. Both client and server have a default user/pass and can be configured using the command line. Only authenticated users can upload a file.
The server can also accept regular uploads from any HTTP client, for example curl:
```sh
curl -su user:pass http://localhost:8090/upload/foo.txt --data-binary @Makefile
```
- Follow the [Build Tools](../tools/) tutorial to setup your development environment.
- Start a terminal in this project directory; and build the example:
```sh
cd mongoose/examples/file-transfer
make clean all
```
- Manually start the server, either in background (to reuse the same terminal window) or in foreground; in which case you'll need another terminal to run the client. The server will listen at all interfaces in port 8090
```sh
./server
6332b7 2 server.c:157:main Mongoose version : v7.12
6332b7 2 server.c:158:main Listening on : http://0.0.0.0:8090
6332b7 2 server.c:159:main Web root : [/home/mongoose/examples/file-transfer/web_root]
6332b7 2 server.c:160:main Uploading to : [/home/mongoose/examples/file-transfer/upload]
```
- Manually run the client to send a file, default is to send it as "foo.txt" to the server in localhost at port 8090
```sh
./client -f Makefile
ok
```
Default operation is to assume hardcoded username and password. Call both server and client with no arguments to see usage instructions
See detailed tutorials at
https://mongoose.ws/tutorials/file-uploads/
https://mongoose.ws/tutorials/http-server/
https://mongoose.ws/tutorials/http-client/
Loaded 100 of 3397 files, more files were not shown because too many files have changed in this diff. Show more