Compare commits

...

1462 Commits

Author SHA1 Message Date
85a8dac42d Merge pull request #750 from david-cermak/bump/ws_client
[websocket]:  Bump 1.3.0 -> 1.4.0
2025-01-30 08:48:45 +01:00
39866116f5 bump(websocket): 1.3.0 -> 1.4.0
1.4.0
Features
- Support DS peripheral for mutual TLS (55385ec3)
Bug Fixes
- wait for task on destroy (42674b49)
- Fix pytest to verify client correctly (9046af8f)
- propagate error type (eeeb9006)
- fix example buffer leak (5219c39d)
Updated
- chore(websocket): align structure members (beb6e57e)
- chore(websocket): remove unused client variable (15d3a01e)
2025-01-30 07:16:24 +01:00
7740b591b6 Merge pull request #749 from david-cermak/fix/ws_client_test
[websocket]: Fix pytest to verify client correctly
2025-01-30 07:09:34 +01:00
b57979d967 Merge pull request #751 from johanstokking/fix/await-task-on-destroy
fix(websocket): wait for task on destroy (IDFGH-14533)
2025-01-29 15:27:38 +01:00
42674b49f9 fix(websocket): wait for task on destroy 2025-01-29 14:30:32 +01:00
e069ae7762 Merge pull request #520 from johanstokking/feature/websocket/client_ds_data
feat(websocket): Support DS peripheral for mutual TLS (IDFGH-12285)
2025-01-28 16:59:34 +01:00
44d476fc50 docs(websocket): fix minor readability issues 2025-01-28 14:59:24 +01:00
55385ec312 feat(websocket): Support DS peripheral for mutual TLS 2025-01-28 14:58:54 +01:00
a3c2bbed9e Merge pull request #748 from david-cermak/fix/mdns_coverity
[mdns]: Bump v1.5.2
2025-01-28 10:23:24 +01:00
84c47c37f1 bump(mdns): 1.5.1 -> 1.5.2
1.5.2
Bug Fixes
- Fix potential NULL deref when sending sub-buy (e7273c46)
- Fix _mdns_append_fqdn excessive stack usage (bd23c233)
2025-01-28 09:54:54 +01:00
e7273c46ec fix(mdns): Fix potential NULL deref when sending sub-buy
Closes coverity reported issue: 473829 Dereference null return value
2025-01-28 09:54:16 +01:00
2e7d240abd Merge pull request #744 from andrew-lifx/fix/mdns_append_fqdn
fix(mdns): Fix _mdns_append_fqdn excessive stack usage (IDFGH-14506)
2025-01-28 07:28:00 +01:00
d4a004b5b4 Merge pull request #694 from johanstokking/fix/websocket-esp-tls-errors
fix(websocket): propagate error type (IDFGH-14518)
2025-01-27 15:50:32 +01:00
9046af8f8d fix(websocket): Fix pytest to verify client correctly 2025-01-27 15:34:49 +01:00
eeeb9006eb fix(websocket): propagate error type 2025-01-25 21:52:06 +01:00
b167aa315f Merge pull request #747 from david-cermak/fix/publish_asio_1.32
bump(asio): Publish 1.32.0 to component manager
2025-01-24 15:53:54 +01:00
72ba24470d bump(asio): Publish 1.32.0 to component manager
Related to the bump-commit: ac6a388cdd
but missed to update idf_component.yml
This publishes ASIO-1.32-0~0
2025-01-24 14:32:20 +01:00
7dc87d28b2 Merge pull request #717 from david-cermak/feat/asio_sync_upstream
[asio]: Drop esp-asio patches in favor of sock-utils
2025-01-24 13:49:53 +01:00
ac6a388cdd bump(asio): 1.28.0 -> 1.32.0
1.32.0
Features
- Upgrade asio to 1.32 (9bdd429c)
- Drop esp/asio patches in favor of sock-utils (27435b7f)
Bug Fixes
- Fix chat example to print only the message body (76aaea08)
- Make asio enable if_nametoindex to fix linking (5db32cce)
- Re-applie refs to common comps idf_component.yml (9fe44a45)
- Reference common component from IDF (74fc228c)
- Revert referencing protocol_examples_common from IDF (f9e0281a)
- reference protocol_examples_common from IDF (09abb18b)
- specify override_path in example manifest files (1d8923cf)
Updated
- docs(asio): Updates asio docs (ce9337d3)
2025-01-24 12:40:45 +01:00
76aaea08d2 fix(asio): Fix chat example to print only the message body 2025-01-24 12:37:39 +01:00
5db32cce30 fix(asio): Make asio enable if_nametoindex to fix linking 2025-01-24 12:37:39 +01:00
9bdd429c7c feat(asio): Upgrade asio to 1.32 2025-01-24 10:47:54 +01:00
6f7c52cc3f fix(asio): Add tests for IDF-v5.4 2025-01-24 10:47:54 +01:00
27435b7f34 feat(asio): Drop esp/asio patches in favor of sock-utils 2025-01-24 10:47:54 +01:00
813331f003 Merge pull request #743 from david-cermak/fix/modem_ci
[modem]: Fix deprecated CI download action
2025-01-24 08:27:37 +01:00
bd23c233a4 fix(mdns): Fix _mdns_append_fqdn excessive stack usage
Move "mdns_name_t name" declaration inside loop to move it out of scope and reclain stack space before recursion call.
2025-01-24 17:39:04 +10:30
4eda7d472f fix(modem): Fix deprecated download action 2025-01-23 19:15:28 +01:00
163029c0b6 Merge pull request #742 from david-cermak/bump/mdns_1.5.1
[mdns]: Bump 1.5.0 -> 1.5.1
2025-01-23 15:32:49 +01:00
96eae25096 bump(mdns): 1.5.0 -> 1.5.1
1.5.1
Bug Fixes
- Fix incorrect memory free for mdns browse (4451a8c5)
2025-01-23 09:00:01 +01:00
ebec8eff63 Merge pull request #740 from gytxxsy/fix/fix_wrong_mem_free_of_mdns_browse
[mdns]: fix incorrect memory free for mdns browse
2025-01-23 08:58:05 +01:00
4451a8c5ad fix(mdns): Fix incorrect memory free for mdns browse 2025-01-23 09:08:25 +08:00
6d19aabb02 Merge pull request #721 from david-cermak/feat/mosq_target_tests
[mosq]: Add IDF MQTT stress tests to mosquitto CI
2025-01-21 12:55:49 +01:00
9162de1150 fix(mosq): Remove temp modification of IDF files 2025-01-21 12:27:09 +01:00
dbd164dd91 fix(mosq): Add a note about stack size 2025-01-21 12:27:09 +01:00
90d663ad01 feat(mosq): Add IDF MQTT stress tests to mosquitto CI 2025-01-21 12:27:09 +01:00
a83f1b6787 Merge pull request #736 from david-cermak/bump/mdns_1.4.4
[mdns]: Bump 1.4.3 -> 1.5.0
2025-01-21 10:56:48 +01:00
84caca465d bump(mdns): 1.4.3 -> 1.5.0
1.5.0
Features
- supported removal of subtype when updating service (4ad88e29)
Bug Fixes
- Fix zero-sized VLA clang-tidy warnings (196198ec)
- Remove dead store to arg variable shared (e838bf03)
- Fix name mangling not to use strcpy() (99b54ac3)
- Fix potential null derefernce in _mdns_execute_action() (f5be2f41)
- Fix AFL test mock per espressif/esp-idf@a5bc08fb55 (3d8835cf)
- Fixed potential out-of-bound interface error (24f55ce9)
- Fixed incorrect error conversion (8f8516cc)
- Fixed potential overflow when allocating txt data (75a8e864)
- Move MDNS_NAME_BUF_LEN to public headers (907087c0, #724)
- Cleanup includes in mdns.c (68a9e148, #725)
- Allow advertizing service with port==0 (827ea65f)
- Fixed complier warning if MDNS_MAX_SERVICES==0 (95377216, #611)
2025-01-20 17:57:07 +01:00
8f81478fff Merge pull request #735 from david-cermak/fix/docs_build
[common]: Fix esp-docs dependencies
2025-01-20 14:50:32 +01:00
ae5a8ceeda fix(mosq): Run mosquitto version check only on labeled job or push 2025-01-20 12:56:02 +01:00
774bab22ea fix(common): Update esp-docs dependencies to fix docs-build job 2025-01-20 12:52:52 +01:00
265e38d684 Merge pull request #731 from tanyanquan/feat/update_subtype_removal
feat(mdns): supported removal of subtype when updating service (IDFGH-14413)
2025-01-20 09:48:27 +01:00
93f772171c Merge pull request #732 from david-cermak/fix/mdns_clangtiy_warns
[mdns]: Fixes clang-tidy warnings
2025-01-20 09:47:56 +01:00
4ad88e297f feat(mdns): supported removal of subtype when updating service 2025-01-16 10:56:54 +08:00
196198ecc9 fix(mdns): Fix zero-sized VLA clang-tidy warnings
and some minor leaks in creation of browse results
2025-01-15 14:23:34 +01:00
e838bf03f4 fix(mdns): Remove dead store to arg variable shared
Fixing: warning: Value stored to 'shared' is never read [clang-analyzer-deadcode.DeadStores]
2025-01-15 14:23:34 +01:00
99b54ac384 fix(mdns): Fix name mangling not to use strcpy()
Since it was flagged by clang-tidy as insecture API
2025-01-15 14:23:34 +01:00
f5be2f4115 fix(mdns): Fix potential null derefernce in _mdns_execute_action()
We did check for null-deref before checking 'a->type', but contol
continues and passes potential null-ptr to the processing function
_mdns_execute_action()
Fixed by asserting action != NULL, since it is an invalid state which
should never happen.
2025-01-15 14:21:59 +01:00
9b74256b51 Merge pull request #730 from david-cermak/fix/mdns_minor
[mdns]: Fixed some minor bugs
2025-01-15 12:27:05 +01:00
3d8835cfb9 fix(mdns): Fix AFL test mock per espressif/esp-idf@a5bc08fb55 2025-01-15 11:42:34 +01:00
24f55ce9b4 fix(mdns): Fixed potential out-of-bound interface error
invalid mdns_if was handled for enabling/announcing pcbs,
but not for the consequent browsing

Closes coverity isssue: 470162 Out-of-bounds access
2025-01-15 10:46:15 +01:00
8f8516cc3f fix(mdns): Fixed incorrect error conversion
Mixing esp_err_t (int) with err_t (uint8_t) from lwip.

Closes coverity isssue: 470139 Overflowed return value
2025-01-15 10:46:15 +01:00
75a8e8640a fix(mdns): Fixed potential overflow when allocating txt data
Closes coverity warning: 470092 Overflowed integer argument
2025-01-15 10:46:15 +01:00
907087c09b fix(mdns): Move MDNS_NAME_BUF_LEN to public headers
Since it's used by public API as maximum length of user buffer

Closes https://github.com/espressif/esp-protocols/issues/724
2025-01-15 10:46:10 +01:00
68a9e14898 fix(mdns): Cleanup includes in mdns.c
Closes https://github.com/espressif/esp-protocols/issues/725
2025-01-15 10:44:12 +01:00
827ea65fd5 fix(mdns): Allow advertizing service with port==0
Closes https://github.com/espressif/esp-idf/issues/14335
2025-01-15 10:44:12 +01:00
9537721600 fix(mdns): Fixed complier warning if MDNS_MAX_SERVICES==0
Closes https://github.com/espressif/esp-protocols/issues/611
2025-01-15 10:44:07 +01:00
4394f845fc Merge pull request #728 from david-cermak/bump/mdns_1.4.3
[mdns]: bump: 1.4.2 -> 1.4.3
2025-01-08 10:24:01 +01:00
9b0ba6060f bump(mdns): 1.4.2 -> 1.4.3
1.4.3
Features
- support zero item when update subtype (5bd82c01)
2025-01-08 09:42:38 +01:00
7c6a3098af Merge pull request #726 from zwx1995esp/feature/support_update_zero_item_of_subtype_for_mdns
feat(mdns): support zero item when update subtype (IDFGH-14369)
2025-01-07 18:40:25 +01:00
f3f3e23bec Merge pull request #727 from david-cermak/fix/sockutls_gai_error
fix(sockutls): Fix gai_strerror() impl to return const string
2025-01-07 15:59:24 +01:00
9ed835ba3f bump(sockutls): 0.2.1 -> 0.2.2
0.2.2
Bug Fixes
- Fix gai_strerror() impl to return const string (f12a2056)
2025-01-07 14:06:42 +01:00
f12a205657 fix(sockutls): Fix gai_strerror() impl to return const string
Previous gai_strerror() returned numeric representation of the code,
but used TLS storage, which might cause issues with stack sizes on all
tasks in the system. Alternatively we can leave the storage to static
only (which wouldn't be thread-safe) or we could one-time allocate and
never free (which is wrong).
This option uses hardcoded strings for common error codes used in lwip.
The disadvantage is that we might need to update the impl in the future
when lwip adds more codes.
2025-01-07 14:06:00 +01:00
zwx
5bd82c01a5 feat(mdns): support zero item when update subtype 2025-01-07 10:28:02 +08:00
b4cb8f8a66 Merge pull request #720 from david-cermak/fix/sock_utils_define_conflict
[sock-utils] Fix potential macro conflict
2024-12-20 16:36:08 +01:00
0499ed93df bump(sockutls): 0.2.0 -> 0.2.1
0.2.1
Bug Fixes
- Fix potential macro colission including standard headers (ade9448c)
2024-12-20 15:41:10 +01:00
ade9448c01 fix(sockutls): Fix potential macro colission including standard headers 2024-12-20 15:40:54 +01:00
4745fc8fe1 Merge pull request #719 from david-cermak/bump/mosq_2.2.0_1
[mosq]:  Bump: v2.0.20 -> 2.0.20~1
2024-12-20 15:31:13 +01:00
73e523e736 bump(mosq): 2.0.20 -> 2.0.20~1
2.0.20~1
Bug Fixes
- Use sock_utils instead of func stubs (3cd0ed37)
- Update API docs adding on-message callback (5dcc3330)
2024-12-20 15:09:41 +01:00
3cd0ed377b fix(mosq): Use sock_utils instead of func stubs 2024-12-20 15:07:42 +01:00
95294f5f89 fix(mosq): Add consistency check for api docs and versions 2024-12-20 15:07:37 +01:00
5dcc33300f fix(mosq): Update API docs adding on-message callback 2024-12-20 12:09:48 +01:00
840a561de4 Merge pull request #710 from david-cermak/feat/mosq_p2p_example
[mosq]: Add serverless broker example
2024-12-19 17:11:13 +01:00
e6fb8aa078 bump(mosq): 2.0.18~0 -> 2.0.20~0
2.0.20~0
Features
- Upgrade to mosquitto v2.0.20 (3b2c614d)
- Add support for on-message callback (cdeab8f5)
- Add example with two brokers synced on P2P (d57b8c5b)
Bug Fixes
- Fix dependency issues moving esp-tls to public deps (6cce87e4)
2024-12-19 16:51:49 +01:00
3b2c614d86 feat(mosq): Upgrade to mosquitto v2.0.20
Used tagged version v2.0.20
2024-12-19 16:41:37 +01:00
cdeab8f517 feat(mosq): Add support for on-message callback 2024-12-19 16:41:37 +01:00
6cce87e465 fix(mosq): Fix dependency issues moving esp-tls to public deps
Since esp-tls structs are using in public header files
2024-12-19 16:41:37 +01:00
d57b8c5b29 feat(mosq): Add example with two brokers synced on P2P
Broker-less two chip example which virtual private IoT
networks on MQTT protocol.
2024-12-19 16:40:02 +01:00
9c11003449 Merge pull request #713 from david-cermak/feat/sock_utiis_0.2
[sock-utils]: Bump 0.1 -> 0.2
2024-12-19 11:13:59 +01:00
85a7fc772c bump(sockutls): 0.1.0 -> 0.2.0
0.2.0
Features
- Declare socketpair and gai_strerror via standard headers (b090a3cb)
- Add support for gethostname() (f7c0b756)
2024-12-19 10:57:36 +01:00
b090a3cb69 feat(sockutls): Declare socketpair and gai_strerror via standard headers
Adding a reverse dependency to lwip and define macros, which
enable declarations of socketpair() and gai_strerror() in standard
heders (sys/socket.h and netdb.h)
2024-12-19 10:54:56 +01:00
42cde46c97 Merge pull request #714 from bryghtlabs-richard/chore/websocketTidying
Chore(websocket) tidy up two small issues
2024-12-17 11:35:57 +01:00
beb6e57e5e chore(websocket): align structure members 2024-12-16 16:20:21 -06:00
15d3a01e11 chore(websocket): remove unused client variable 2024-12-16 15:46:43 -06:00
e12ecb8e89 Merge pull request #707 from david-cermak/bugfix/sckutls_gethostname
[sock-utils]: Add support for gethostname()
2024-12-16 16:36:32 +01:00
54271a1b96 Merge pull request #709 from david-cermak/bump/modem_1.3
[modem]: bump 1.2.1 -> 1.3.0
2024-12-12 09:46:27 +01:00
886215032f bump(modem): 1.2.1 -> 1.3.0
1.3.0
Features
- Add mode detection to the example (18f196fa)
- Support for pausing network in C-API (1db83cd1)
- Add support for pausing netif (247f1681, #699)
Bug Fixes
- Minor cleanup of pppos example (5e929902)
- Fix PPP mode detection to accept LCP/conf (c989c6ad)
- Refine mode switch data->command (8b6ea331, #692)
- Detect serial ports properly (0cb59ff8)
- Fix CMUX enter to ignore URC before transition (1284f66d, #669)
2024-12-10 12:48:09 +01:00
269351f41c Merge pull request #700 from david-cermak/feat/modem_pause_network
[modem]: Add support for pausing netif
2024-12-10 12:14:10 +01:00
5e929902c7 fix(modem): Minor cleanup of pppos example
* Use CONFIG_EXAMPLE_DETECT_MODE_BEFORE_CONNECT to demonstrate mode
detect
* Use disconnection flag to indicate conneciton issue and gracefully
degrade to command mode
* Remove IDF-verion < v5.0 code
2024-12-10 11:36:10 +01:00
f7c0b7564a feat(sockutls): Add support for gethostname()
Closes https://github.com/espressif/esp-idf/issues/14849
2024-12-09 17:16:59 +01:00
c989c6adae fix(modem): Fix PPP mode detection to accept LCP/conf 2024-12-06 10:12:25 +01:00
18f196fa1e feat(modem): Add mode detection to the example 2024-12-06 09:48:00 +01:00
1db83cd1ca feat(modem): Support for pausing network in C-API
also adds a demo of this feature to pppos client example
2024-12-05 20:16:45 +01:00
247f1681e8 feat(modem): Add support for pausing netif
Closes https://github.com/espressif/esp-protocols/issues/699
2024-12-05 20:16:41 +01:00
32387f7e39 Merge pull request #702 from david-cermak/fix/modem_data_cmd_mode_refine
[modem]: Refine data -> command transition
2024-12-04 15:42:43 +01:00
dbc3ea6809 fix(common): Export IDF environment in bash shell
To avoid issues with IDF_PATH/export with the latest tools
2024-12-04 14:44:43 +01:00
8b6ea3311a fix(modem): Refine mode switch data->command
* netif.stop() moved after setting the transition callback
* send PPP escape sequence if enabled before waiting for transition to
complete
* add newline character before sync() command (after the "+++")

Closes https://github.com/espressif/esp-protocols/issues/692
2024-12-04 14:39:01 +01:00
8e55b93b59 Merge pull request #703 from david-cermak/fix/modem_cmux_data_before_switch
[modem]: CMUX: ignore URC before entering CMUX
2024-12-04 08:18:54 +01:00
0cb59ff80d fix(modem): Detect serial ports properly 2024-11-29 18:27:26 +01:00
1284f66d58 fix(modem): Fix CMUX enter to ignore URC before transition
Closes https://github.com/espressif/esp-protocols/issues/669
2024-11-29 17:32:35 +01:00
c5b49de2db Merge pull request #502 from espressif-abhikroy/component/console_cmd_mqtt
feat(console): Added component with mqtt command
2024-11-29 21:53:01 +11:00
2e9bb6ee45 bump(console): First version [1.0.0]
1.0.0
Features
- Added component with mqtt command (1fcc5b1d)
2024-11-29 21:48:50 +11:00
1fcc5b1d56 feat(console): Added component with mqtt command 2024-11-29 00:59:27 +11:00
849fe7b6cb Merge pull request #698 from david-cermak/fix/modem_minor_fixes_on_1.2
[modem]: Support for URC handler in C-API -> v1.2.1
2024-11-20 16:28:39 +01:00
5eadf1edee bump(modem): 1.2.0 -> 1.2.1
1.2.1
Bug Fixes
- Use higher GPIO range to support new chips (428fdbbd, #558)
- Remove tests and support for IDFv4.4, added IDFv5.4 (433a033f)
- Fix typo GENETIC -> GENERIC in mode types (090b1ff8, #667)
- Add support for URC handler into C-API (295d99df, #180)
2024-11-20 15:47:03 +01:00
428fdbbd80 fix(modem): Use higher GPIO range to support new chips
We can use IDF's Kconfig.env_caps in future, but that's not available on v5.0.

Closes https://github.com/espressif/esp-protocols/issues/558
2024-11-20 11:36:00 +01:00
433a033fcc fix(modem): Remove tests and support for IDFv4.4, added IDFv5.4 2024-11-20 11:35:33 +01:00
090b1ff845 fix(modem): Fix typo GENETIC -> GENERIC in mode types
Closes https://github.com/espressif/esp-protocols/issues/667
2024-11-20 10:25:20 +01:00
295d99df96 fix(modem): Add support for URC handler into C-API
Closes https://github.com/espressif/esp-protocols/issues/180
2024-11-20 10:15:22 +01:00
b65cff3a0b Merge pull request #696 from david-cermak/bump/mdsn_1.4.2
[mdns]: Bump to v1.4.2
2024-11-14 15:31:45 +01:00
e711f26670 bump(mdns): 1.4.1 -> 1.4.2
1.4.2
Features
- support update subtype (062b8dca)
Updated
- chore(mdns): Add more info to idf_component.yml (4a1cb65c)
2024-11-14 12:04:25 +01:00
4a1cb65c67 chore(mdns): Add more info to idf_component.yml
Fixing component manager warnings:
WARNING: A component description has not been provided in the manifest file. Please update your  file and include a brief description of the component.This will help other developers understand the purpose and functionality of your component. Documentation: https://***/projects/idf-component-manager/en/latest/guides/packaging_components.html#create-idf-component-yml
WARNING: A homepage URL has not been provided in the manifest file. Please update your  file and include the URL to the component's homepage. Documentation: https://***/projects/idf-component-manager/en/latest/guides/packaging_components.html#create-idf-component-yml
2024-11-14 12:03:56 +01:00
6c61dd39cf Merge pull request #693 from zwx1995esp/feat/support_add_remove_subtype
feat(mdns): support update subtype (IDFGH-14068)
2024-11-14 10:36:22 +01:00
8821ea3a99 Merge pull request #695 from david-cermak/bump/mdns_1.4.1
bump(mdns): 1.4.0 -> 1.4.1
2024-11-14 10:32:22 +01:00
zwx
062b8dcacc feat(mdns): support update subtype 2024-11-14 11:07:43 +08:00
7de57bb412 bump(mdns): 1.4.0 -> 1.4.1
1.4.1
Features
- Send PTR query for mdns browse when interface is ready (010a404a)
Bug Fixes
- Prevent deadlock when deleting a browse request (3f48f9ea)
- Fix use after free reported by coverity (25b3d5fd)
- Fixed dead-code reported by coverity (11846c7d)
2024-11-13 17:47:19 +01:00
67191f3bb5 Merge pull request #671 from david-cermak/feat/sock_utils
[sock-utils]: Add initial support for socket helpers
2024-11-11 18:29:45 +01:00
6d94ad646d bump(sockutls): Initial version 0.1.0
0.1.0
Features
- Add initial support for socket helpers (31f57ad0)
2024-11-11 16:47:57 +01:00
685d47cd2f fix(common): Disable clang-check for unsecure/deprecated APIs 2024-11-11 16:47:18 +01:00
31f57ad067 feat(sockutls): Add initial support for socket helpers 2024-11-11 16:47:13 +01:00
32ac21b03c Merge pull request #688 from david-cermak/fix/modem_docs_limitations
[modem]: bump: 1.1.0 -> 1.2.0
2024-11-11 16:26:41 +01:00
5b06a3b319 bump(modem): 1.1.0 -> 1.2.0
1.2.0
Features
- Add support for guessing mode (52598e5f)
- Delete CMUX internal implementation even if terminal exit fails (0e0cbd6b)
- Add support for handling URC (1b6a3b3b, #180)
- add ability to change ESP_MODEM_C_API_STR_MAX from Kconfig (17909892)
- Added target test config with CHAP authentication (f8ae7def)
- example add esp32p4 usb support (adafeae5)
- Publish mbedtls component (0140455f)
- host test support of the latest ESP-IDF release (3f74b4e8)
Bug Fixes
- Fix console example to use urc/detect features (1a9eaf3e)
- Update target test builds to use external Catch2 (554f022c)
- Fix arguments names when spawn esp_modem_xxx declarations (b6792c52)
- Remove catch dependency (c3480768)
- Examples: use local configs for MQTT topic/data (f5c13b92)
- Fixed clang-tidy warnings (70fa3af7)
- Fix CI build per IDFv5.3 (d0c17ef0)
- Fixed UART task to check for buffered data periodically (4bdd90cc, #536)
- Cleanup unused configs from PPPoS example (08a62ccc)
- Update CMUX example with SIM7070_gnss cleaned-up (56fe5327)
- Update console example with SIM7070_gnss format comments (5baaf542)
- Fix remaining print format warnings (3b80181d)
Updated
- docs(modem): Fix esp_modem_at_raw() description (C-API) (492a6a00)
- ci(common): updated github actions(checkout, upload, download) v3 to 4, Ubuntu 20.04 to v22.04 (a23a0027)
2024-11-07 12:42:11 +01:00
cc2741d4ad fix(modem): Document CMUX compatibility issue with CAVLI C16QS
Closes https://github.com/espressif/esp-protocols/issues/507
2024-11-07 12:41:47 +01:00
c5653ff204 Merge pull request #677 from david-cermak/fix/docs_links
[asio]: Fix links in documentation
2024-11-06 14:40:23 +01:00
77731c9b36 Merge pull request #678 from david-cermak/fix/modem_docs
[modem]: Fix docs to link tests correctly
2024-11-06 14:40:05 +01:00
2442f6b553 Merge pull request #612 from david-cermak/feat/modem_mode_detect
[modem]: Add support for guessing mode
2024-11-06 14:39:37 +01:00
0b5e362a7b Merge pull request #686 from bryghtlabs-richard/fix/wsExampleLeak
fix(websocket): fix example buffer leak
2024-11-05 17:11:35 +01:00
5219c39d09 fix(websocket): fix example buffer leak 2024-11-04 08:39:13 -06:00
1a9eaf3e98 fix(modem): Fix console example to use urc/detect features 2024-11-01 15:31:39 +01:00
52598e5f03 feat(modem): Add support for guessing mode 2024-11-01 13:49:52 +01:00
542547d38b Merge pull request #684 from david-cermak/fix/ws_disconnect_deadlock
[websocket]: Prevent crash on network disconnect during send
2024-10-31 15:56:20 +01:00
2bcfa45d30 bump(websocket): 1.2.3 -> 1.3.0
1.3.0
Features
- add events for begin/end thread (d7fa24bc)
- Make example to use certificate bundle (aecf6f80)
- propagate esp_tls stack error and cert verify flags (234f579b)
- Add option to set and use cert_common_name in Websocket client (3a6720de)
- adding support for `if_name` when using WSS transport (333a6893)
- allow updating reconnect timeout for retry backoffs (bd9f0627)
- allow using external tcp transport handle (83ea2876)
- adding support for `keep_alive_enable` when using WSS transport (c728eae5)
Bug Fixes
- Prevent crash on network disconnect during send (a453ca1f)
- use proper interface to delete semaphore (991ac40d)
- Move client to different state when disconnecting (0d8f2a6d)
- fix of websocket host example (5ccc018a)
- don't get transport from the list if external transport is used (9d4d5d2d)
- Fix locking issues of `esp_websocket_client_send_with_exact_opcode` API (6393fcd7)
2024-10-31 11:34:02 +01:00
a453ca1f38 fix(websocket): Prevent crash on network disconnect during send
When WiFi disconnects, `esp_websocket_client_task` continues polling
`esp_transport_poll_read()` with a default 1-second timeout.
If a timeout triggers `esp_websocket_client_abort_connection`,
certain resources are released.
However, if `esp_websocket_client_send_with_exact_opcode`
is still blocked at this point, it will cause a crash
when it times out and accesses the released handle.
This fix prevents potential crashes by ensuring proper
synchronization between abort and send functions.

Merges: https://github.com/espressif/esp-protocols/pull/629
2024-10-31 11:33:26 +01:00
72f4f7c7a3 Merge pull request #683 from bryghtlabs-richard/fix/ws-mutex-delete
fix(websocket): use proper interface to delete semaphore
2024-10-31 10:25:25 +01:00
a353702e04 Merge pull request #626 from euripedesrocha/websocket/fix_race_aborting_connection
Fix race condition when client set to not reconnect
2024-10-31 08:21:52 +01:00
991ac40d75 fix(websocket): use proper interface to delete semaphore
On most implementations, including ESP-IDF FreeRTOS, vSemaphoreDelete()
is a macro that calls vQueueDelete(). But since the client semaphore is
created with xSemaphoreCreateRecursiveMutex(), delete it as a semaphore with vSemaphoreDelete().
2024-10-30 16:54:45 -05:00
fbd296f8dd Merge pull request #661 from gytxxsy/feat/monitor_interface_status_for_browsing
[mdns]: send PTR query for mdns browse when interface is ready (IDFGH-13841)
2024-10-25 17:58:40 +02:00
a5b0b9d6ea Merge pull request #676 from arex-ebee/deadlock-on-mdns_browse_delete-call
[mdns]: Prevent deadlock when deleting a browse request (IDFGH-13947)
2024-10-25 16:48:42 +02:00
2d9759265b fix(modem): Fix docs to link tests correctly
Closes https://github.com/espressif/esp-protocols/issues/664
2024-10-25 12:56:08 +02:00
8f1f935858 fix(asio): Fix docs to link examples correctly 2024-10-25 12:43:19 +02:00
3f48f9ea7e fix(mdns): Prevent deadlock when deleting a browse request 2024-10-25 12:00:36 +02:00
8520245657 Merge pull request #672 from david-cermak/fix/publish_mosquitto
[mosquitto]: Fix incorrect link to the component url
2024-10-11 14:29:05 +02:00
185247d220 fix(mosq): Fix incorrent link to the component url 2024-10-11 11:14:07 +02:00
73b3293b86 Merge pull request #610 from david-cermak/feat/mosq_tls
[mosq]: Added TLS transport to mosquitto port
2024-10-11 10:57:05 +02:00
f613c70e00 bump(mosq): Initial version v2.0.28~0
2.0.28~0
Features
- Added support for TLS transport using ESP-TLS (1af4bbe1)
- Add API docs, memory consideration and tests (a20c0c9d)
- Add target tests with localhost broker-client (5c850cda)
- Initial moquitto v2.0.18 port (TCP only) (de4531e8)
Bug Fixes
- Fix clean compilation addressing _GNU_SOURCE redefined (e2392c36)
Updated
- docs(mosq): Prepare mosquitto component for publishing (c2c4bf83)
2024-10-11 09:46:47 +02:00
c2c4bf835a docs(mosq): Prepare mosquitto component for publishing 2024-10-11 08:54:15 +02:00
1af4bbe1ab feat(mosq): Added support for TLS transport using ESP-TLS 2024-10-11 08:38:06 +02:00
f5dc07fdcc Merge pull request #670 from david-cermak/remove/wifi_remote
[wifi-remote]: Moved esp-wifi-remote development to a separate repo
2024-10-09 16:13:52 +02:00
e992787bcd chore(common): Moved esp-wifi-remote devel to separate repo
esp-wifi-remote is being developed in https://github.com/espressif/esp-wifi-remote
from v0.4.0 (last released version from esp-protocols repo)
2024-10-07 15:05:31 +02:00
8c4f392f93 Merge pull request #663 from david-cermak/bump/wifi_remote
[wifi_remote]: Bump 0.3.0 -> 0.4.0
2024-09-26 15:58:05 +02:00
8d8f2bf130 Merge pull request #662 from david-cermak/fix/mosqutto_submodule
[mosquitto]: Fix incorrect upstream mosqutto submodule path
2024-09-26 14:43:50 +02:00
30f121e6a9 bump(wifi_remote): 0.3.0 -> 0.4.0
0.4.0
Features
- Make esp_hosted default RPC library (1b62adbd)
- Add build test for current IDF examples (50c113e4)
- Support for IDF v5.3 in a separate directory (bde97203)
- Support for IDF v5.4 via a separate dir (e9ac41e1)
- Add slave selection and peview targets (345c4577)
Bug Fixes
- Fix CMake to use inherent IDF build vars (c454ec09)
- Update per v5.4 espressif/esp-idf@97e42349 (ff5dac70)
- Fix CI builds to generate configs per slave selection (8795d164)
- Depend on esp_hosted only on targets with no WiFi (7ca5ed1d)
- Update per espressif/esp-idf@27f61966 (2e53b81f)
- Fix checking API compat against reference dir (1a57a878)
2024-09-26 14:36:48 +02:00
29810f4139 ci(mosq): Fix incorrect upstream mosqutto submodule path 2024-09-26 13:34:56 +02:00
2abe55c173 Merge pull request #643 from david-cermak/feat/wifi_remote_with_hosted
[wifi_remote]: Make esp_hosted default RPC library
2024-09-26 13:21:54 +02:00
eb7ea3450e ci(common): Use idf_build_apps >= 2.0 to fix pkg deprecation 2024-09-26 11:58:09 +02:00
1b62adbdf1 feat(wifi_remote): Make esp_hosted default RPC library 2024-09-26 11:58:04 +02:00
d6347a9d5f Merge pull request #660 from david-cermak/feat/wifi_remote_flat
[wifi_remote]: Make flat version structure across IDF releases
2024-09-26 10:07:28 +02:00
c454ec09e6 fix(wifi_remote): Fix CMake to use inherent IDF build vars
IDF_VERSION_MAJOR, IDF_VERSION_MAJOR, rather than environmental variable {ESP_IDF_VERSION}
2024-09-26 08:51:41 +02:00
ff5dac70b7 fix(wifi_remote): Update per v5.4 espressif/esp-idf@97e42349 2024-09-26 08:39:22 +02:00
50c113e412 feat(wifi_remote): Add build test for current IDF examples
Building also standard IDF examples that use esp-wifi-remote (building
for wifiless targets ESP32P4, ESP32H2 and one wifi target ESP32s3)
2024-09-26 08:37:40 +02:00
bde97203ed feat(wifi_remote): Support for IDF v5.3 in a separate directory 2024-09-26 08:37:07 +02:00
8795d16466 fix(wifi_remote): Fix CI builds to generate configs per slave selection
Rather than keeping sdkconfig.ci.*** for the smoke tests in git
2024-09-26 08:35:27 +02:00
e9ac41e1d7 feat(wifi_remote): Support for IDF v5.4 via a separate dir 2024-09-26 08:33:39 +02:00
7ca5ed1d3e fix(wifi_remote): Depend on esp_hosted only on targets with no WiFi 2024-09-26 08:31:37 +02:00
345c457711 feat(wifi_remote): Add slave selection and peview targets 2024-09-26 08:30:53 +02:00
2e53b81f64 fix(wifi_remote): Update per espressif/esp-idf@27f61966 2024-09-26 08:30:14 +02:00
1a57a878be fix(wifi_remote): Fix checking API compat against reference dir
rather than git history, as it might now work in GitHub CI (due to
shallow cloning)
2024-09-26 08:28:05 +02:00
010a404a04 feat(mdns): Send PTR query for mdns browse when interface is ready 2024-09-23 19:01:10 +08:00
8475adf1d1 Merge pull request #655 from david-cermak/fix/modem_target_catch2
[modem]: Update target test builds to use external Catch2
2024-09-20 09:18:14 +02:00
29e5fbdf93 Merge pull request #651 from david-cermak/fix/master_detect_bump
[ci]: Fix for components not published
2024-09-20 09:17:59 +02:00
554f022cbf fix(modem): Update target test builds to use external Catch2
Switched from the deprecated Catch framework (IDF/tools) to Catch2,
as Catch will be removed in v6.0.
Note that Catch2 has higher memory requirements,
necessitating an increase in stack size and partition table.
Additionally, Catch2 increases compilation time due to its larger footprint.
2024-09-20 07:55:41 +02:00
cfd6d6ad90 Merge pull request #653 from embedcat/docs/fix-at-raw-description
[modem]: Fix esp_modem_at_raw() description in docs (C-API)
2024-09-18 11:15:17 +02:00
6f90d85933 Merge pull request #658 from Ant2000/master
[modem] Minor change to exit_cmux behavior
2024-09-18 11:14:30 +02:00
0e0cbd6b17 feat(modem): Delete CMUX internal implementation even if terminal exit fails 2024-09-18 14:08:52 +05:30
e926a2c4e6 Merge pull request #654 from embedcat/feat/fix-arguments-c-api
[modem]: Fix arguments names when spawn esp_modem_xxx declarations
2024-09-18 09:04:25 +02:00
b6792c527c fix(modem): Fix arguments names when spawn esp_modem_xxx declarations 2024-09-18 09:09:44 +03:00
492a6a0029 docs(modem): Fix esp_modem_at_raw() description (C-API) 2024-09-17 14:49:01 +03:00
22ec03b3e6 ci(common): Fix for components not published 2024-09-17 10:42:49 +02:00
6705bcae5e Merge pull request #606 from david-cermak/feat/mosquitto
[mosq]: Support for TCP listener mode of mosquitto broker on ESP32
2024-09-17 10:05:08 +02:00
2208e76e04 Merge pull request #620 from david-cermak/feat/modem_urc
[modem]: Add support for handling URC
2024-09-17 09:54:15 +02:00
c348076849 fix(modem): Remove catch dependency 2024-09-16 19:19:13 +02:00
1b6a3b3b75 feat(modem): Add support for handling URC
Closes https://github.com/espressif/esp-protocols/issues/180
2024-09-16 15:17:29 +02:00
e2392c36fe fix(mosq): Fix clean compilation addressing _GNU_SOURCE redefined 2024-09-16 14:50:36 +02:00
a20c0c9d2c feat(mosq): Add API docs, memory consideration and tests 2024-09-16 14:50:36 +02:00
5c850cdad3 feat(mosq): Add target tests with localhost broker-client 2024-09-16 14:50:36 +02:00
de4531e8c7 feat(mosq): Initial moquitto v2.0.18 port (TCP only) 2024-09-16 14:50:31 +02:00
d2880418e5 Merge pull request #640 from david-cermak/feat/ppp_chap_test
[modem]: Added CHAP authentication test
2024-09-12 10:58:34 +02:00
8e4d43e00d Merge pull request #649 from embedcat/master
[modem]: Add ability to change ESP_MODEM_C_API_STR_MAX from Kconfig (IDFGH-13668)
2024-09-12 09:56:02 +02:00
fb7b0c201d ci(common): Fix clang-tidy job not use deprecated action 2024-09-12 09:37:03 +02:00
f5c13b927f fix(modem): Examples: use local configs for MQTT topic/data
To avoid issues in CI, as we're using public server
and could receive data by people playing with the example
2024-09-12 09:29:46 +02:00
571a741b56 Merge pull request #642 from david-cermak/fix/mdns_coverity
[mdns]: Fix recent issues on v1.4 reported by Coverity
2024-09-12 08:55:47 +02:00
1790989242 feat(modem): add ability to change ESP_MODEM_C_API_STR_MAX from Kconfig 2024-09-11 11:40:09 +03:00
f8ae7defd6 feat(modem): Added target test config with CHAP authentication
Related to https://github.com/espressif/esp-protocols/issues/635
2024-08-27 16:51:44 +02:00
25b3d5fd7b fix(mdns): Fix use after free reported by coverity
Fixes CID 467739: Use after free in mdns.c, mdns_service_remove_for_host
We should look only for one match in the service list, since if we
assume there could be aliases, we might free one and reference the
other.
2024-08-27 15:26:32 +02:00
11846c7d00 fix(mdns): Fixed dead-code reported by coverity
Fixes CID 467738: Logically dead code in mdns.c, _copy_mdns_txt_items
Introduced by probably by a merge confilict, as the fix was added in
two separate PRs, merging d4da9cb0 first and 8a690503 later
2024-08-27 15:20:58 +02:00
73c48307a3 Merge pull request #638 from david-cermak/bump/mdns_1.4
[mdns]: Bump: 1.3.2 -> 1.4.0
2024-08-21 08:41:02 +02:00
b9357b31b5 bump(mdns): 1.3.2 -> 1.4.0
1.4.0
Major changes
- Fixed mdns API issues when add/remove/update records from multiple threads (Fix services API races to directly add/remove services)
Features
- Unit tests for add/remove/update deleg/selfhosted services (0660ece1)
- Add console command for mdns browsing (1e8ede33)
- Console test: set instance for service (f107dcd1)
- Console test: add subtype for service (ee00e97b)
- Console test: set port for (delegated) srvs (07b79abf)
- Console test: add/remove TXT recs for delegated srvs (c9a58d73)
- Console test for changing TXT records (6b9a6ce6)
- Console test for add/remove delegated service APIs (43de7e5c)
- Console test for add/remove delegated host APIs (ce7f326a)
- Console test for lookup service APIs (a91ead8e)
- Add linux console functional tests (50d059af)
- check if the txt items is changed when browsing (e2f0477a)
Bug Fixes
- Fix mdns_delegate_hostname_add() to block until done (2c1b1661)
- Fix API races when removing all services (169405b5)
- Fix API races setting instance name for services (643dc6d4)
- Fix API races while adding subtypes for services (f9f234c4)
- Fix API races removing txt item for services (3f97a822)
- Fix API races adding txt item for services (c62b920b)
- Fix API races while setting txt for services (a927bf3a)
- Fix API races while setting port for services (99d5fb27)
- Fix services API races to directly add/remove services (8a690503)
- Fix mdns mdns_lookup_service() to handle empty TXT (d4da9cb0)
2024-08-21 07:51:53 +02:00
788f0513fa Merge pull request #615 from david-cermak/fix/mdns_hostname_race
fix(mdns): Fix add/remove selfhosted services while hostname changes
2024-08-20 20:58:11 +02:00
bcab28c1b8 Merge pull request #633 from bryghtlabs-richard/feat/websocketBeginEnd
Feat/websocket: begin end thread events (IDFGH-13507)
2024-08-20 16:41:52 +02:00
60817dd384 Merge pull request #630 from johanstokking/fix/websocket-esp-tls-errors
feat(websocket): propagate esp_tls stack error and cert verify flags
2024-08-20 06:11:55 -03:00
2c1b16617e fix(mdns): Fix mdns_delegate_hostname_add() to block until done
Adds action semaphore the same way it's done in mdns_hostname_add()
There could still potentially be a minor issue when calling these two APIs
simultanously. Will solve the same ways as in 8a690503 (tracked as
IDF-10913)
2024-08-19 14:34:08 +02:00
169405b534 fix(mdns): Fix API races when removing all services
Fixes **API race issue** (described in 8a690503) for API
mdns_service_remove_all()
2024-08-19 14:33:27 +02:00
0d8f2a6d53 fix(websocket): Move client to different state when disconnecting
If Websocket client is set to not reconnect, we move to Unknown state to
clean up the task after dispatching disconnected event.
2024-08-19 12:52:37 +02:00
643dc6d43b fix(mdns): Fix API races setting instance name for services
Fixes **API race issue** (described in 8a690503) for API
mdns_service_instance_name_set_for_host()
2024-08-19 12:38:35 +02:00
f9f234c440 fix(mdns): Fix API races while adding subtypes for services
Fixes **API race issue** (described in 8a690503) for API
mdns_service_subtype_add_for_host()
2024-08-19 12:38:28 +02:00
3f97a8228b fix(mdns): Fix API races removing txt item for services
Fixes **API race issue** (described in 8a690503) for API
mdns_service_txt_item_remove_for_host()
2024-08-19 12:38:20 +02:00
c62b920bb9 fix(mdns): Fix API races adding txt item for services
Fixes **API race issue** (described in 8a690503) for API
mdns_service_txt_item_set_for_host_with_explicit_value_len()
2024-08-19 12:38:12 +02:00
a927bf3a8d fix(mdns): Fix API races while setting txt for services
Fixes **API race issue** (described in 8a690503) for API
mdns_service_txt_set_for_host()
2024-08-19 12:38:03 +02:00
99d5fb27e9 fix(mdns): Fix API races while setting port for services
Fixes **API race issue** (described in 8a690503) for API
mdns_service_port_set_for_host()
2024-08-19 12:37:52 +02:00
8a690503ed fix(mdns): Fix services API races to directly add/remove services
Original issue (data race when updating hostname): mdns_service_add()
makes a copy of the local hostname and calls using the local copy
mdns_service_add_for_host().
When mdns's hostname is updated the local copy gets out of sync.
**API race issue**: Most of the current API correctly lock the mdns service,
but sometimes unlocks it before sending an action to the action queue,
so it's possible that the situation changes before the actual action
takes place.
**Fix**: After locking the mdns service, we proceed directly with updating
internal structures and do not post actions into the action queue.
**Fix wrtt hostname**: Use mdns_service_add_for_host(hostname=NULL)
for all self hosted services.
MAJOR CHANGE: Fixed mdns API issues when add/remove/update records from multiple threads
This and the following commits fix the API race issues for these mdns APIs:
* mdns_service_add_for_host
* mdns_service_port_set_for_host
* mdns_service_txt_set_for_host
* mdns_service_txt_item_set_for_host_with_explicit_value_len
* mdns_service_txt_item_remove_for_host
* mdns_service_subtype_add_for_host
* mdns_service_instance_name_set_for_host
* mdns_service_remove_for_host
* mdns_service_remove_all
2024-08-19 12:36:05 +02:00
7e5ac87d09 Merge pull request #619 from david-cermak/feat/more_unit_tests
[mdns]: Add unit test for services
2024-08-19 12:35:11 +02:00
d4da9cb079 fix(mdns): Fix mdns mdns_lookup_service() to handle empty TXT
the lookup_service API calls _copy_mdns_txt_items(), which tries to
allocate new TXT records, but didn't handle the case with no TXT.
Originally the _copy_mdns_txt_items() called calloc() with zero's which
returned NULL (on espressif toolchain), so it's safe, but we could see
an error message:
E (1170) mdns: Cannot allocate memory (line: 6191, free heap: 281368 bytes)
This commit addresses the empty TXT case and gets rid of the error
message.
2024-08-19 11:28:56 +02:00
0660ece128 feat(mdns): Unit tests for add/remove/update deleg/selfhosted services 2024-08-19 11:28:01 +02:00
d7fa24bc20 feat(websocket): add events for begin/end thread
Add events to signal the start and end of the
websocket thread handler, only once each per client.
2024-08-16 14:45:54 -05:00
9cf4163663 docs(websocket): improve websocket event list 2024-08-16 14:45:50 -05:00
a8f13bc861 Merge pull request #632 from david-cermak/fix/ci_jobs
[CI]: Fixes with recent IDF updates
2024-08-16 18:54:31 +02:00
aecf6f80bf feat(websocket): Make example to use certificate bundle
To easy maintenance, makes the example on websocket client to use
certificate bundle by default.
2024-08-16 16:17:10 +02:00
34d7c1b23b ci(common): Ignore nearly full partition on C6 builds 2024-08-16 15:41:53 +02:00
6766be6955 Merge pull request #618 from david-cermak/feat/mdns_console_host_more_tests
[mdns]: More console tests
2024-08-16 09:29:55 +02:00
234f579bd8 feat(websocket): propagate esp_tls stack error and cert verify flags 2024-08-15 21:14:08 +02:00
1e8ede3396 feat(mdns): Add console command for mdns browsing 2024-08-15 16:18:42 +02:00
f107dcd118 feat(mdns): Console test: set instance for service 2024-08-15 16:18:42 +02:00
ee00e97b2b feat(mdns): Console test: add subtype for service 2024-08-15 16:18:42 +02:00
07b79abf62 feat(mdns): Console test: set port for (delegated) srvs 2024-08-15 16:18:42 +02:00
c9a58d7350 feat(mdns): Console test: add/remove TXT recs for delegated srvs 2024-08-15 16:18:42 +02:00
6b9a6ce65b feat(mdns): Console test for changing TXT records 2024-08-15 16:18:42 +02:00
43de7e5c4d feat(mdns): Console test for add/remove delegated service APIs 2024-08-15 16:18:42 +02:00
ce7f326af0 feat(mdns): Console test for add/remove delegated host APIs 2024-08-15 16:18:42 +02:00
a91ead8ef5 feat(mdns): Console test for lookup service APIs 2024-08-15 16:18:42 +02:00
e425a3c504 Merge pull request #617 from david-cermak/feat/mdns_console_host
[mdns]: Add linux console functional tests
2024-08-15 15:59:18 +02:00
50d059af07 feat(mdns): Add linux console functional tests 2024-08-15 15:25:49 +02:00
f198967c98 Merge pull request #584 from espressif-abhikroy/component/console_cmd_ping
feat(console): Added command getaddrinfo, set/get dnsserver to console_cmd_ping
2024-08-15 19:54:26 +10:00
c41e8891ca bump(console): 1.0.0 -> 1.1.0
1.1.0
Features
- Added command getaddrinfo, set/get dnsserver to console_cmd_ping (b80c19d7)
2024-08-15 19:50:27 +10:00
b80c19d72c feat(console): Added command getaddrinfo, set/get dnsserver to console_cmd_ping 2024-08-15 19:49:53 +10:00
5964eadbf5 Merge pull request #613 from gytxxsy/feat/check_if_txt_changed_when_browsing
feat(mdns): check if the txt items is changed when browsing
2024-07-23 18:04:20 +02:00
e583848695 Merge pull request #616 from huming2207/master
fix(websocket): don't fetch transport from the list if external transport is set
2024-07-22 11:34:26 +04:00
cb1bc41386 Merge pull request #605 from gabsuren/ci/websocket_host_fix
CI: fix
2024-07-19 20:31:33 +04:00
8d91f5fd62 fix(ci): allow unsecure node version for self hosted runner 2024-07-19 17:00:00 +04:00
5ccc018a98 fix(websocket): fix of websocket host example 2024-07-19 15:50:07 +04:00
9d4d5d2d49 fix(websocket): don't get transport from the list if external transport is used 2024-07-16 16:53:40 +10:00
e2f0477a00 feat(mdns): check if the txt items is changed when browsing 2024-07-16 10:44:05 +08:00
906e447193 Merge pull request #573 from huming2207/feature/ws-transport-handle
feat(websocket): allow using external TCP transport handle (IDFGH-12825)
2024-07-12 16:50:33 +04:00
15ae280bbe Merge pull request #608 from johanstokking/feature/websocket/tls_keepalive_ifname
feat(websocket): adding support for `if_name` when using WSS transport
2024-07-10 12:37:27 +04:00
e6f9fe2385 Merge pull request #583 from DCSBL/ws-client-common-name
feat(websocket_client): Add option to set and use cert_common_name in Websocket client (IDFGH-12926)
2024-07-10 12:29:52 +04:00
3a6720ded6 feat(websocket): Add option to set and use cert_common_name in Websocket client 2024-07-10 09:19:48 +02:00
333a68936a feat(websocket): adding support for if_name when using WSS transport 2024-07-05 13:34:03 +02:00
25d8423e6d Merge pull request #594 from erkia/erkia/ws-reconnect-timeout
feat(esp_websocket_client): allow updating reconnect timeout for retry backoffs (IDFGH-13016)
2024-07-03 10:16:05 +04:00
bd9f062709 feat(websocket): allow updating reconnect timeout for retry backoffs 2024-07-02 21:07:50 +03:00
9152cfcf82 Merge pull request #598 from euripedesrocha/bump_mqtt_cxx040
bump(mqtt_cxx): 0.3.0 -> 0.4.0
2024-07-02 07:36:30 -03:00
8195fc4b8f Merge pull request #601 from david-cermak/bump/wifi_remote
bump(wifi_remote): 0.2.3 -> 0.3.0
2024-06-28 08:44:02 +02:00
68da69e4d8 Merge pull request #602 from david-cermak/bump/eppp
bump(eppp): 0.1.1 -> 0.2.0
2024-06-28 07:55:05 +02:00
c6e2eb2dac Merge pull request #556 from leeebo/master
feat(esp_modem): example add esp32p4 usb support (IDFGH-12673)
2024-06-24 15:51:57 +02:00
a9dd78ffad bump(eppp): 0.1.1 -> 0.2.0
0.2.0
Features
- Add support for SDIO transport (085dd790)
Bug Fixes
- Fixed strict prototype API decl issue in SDIO (eb09e426)
- Fix SIDO host to check/clear interrupts atomically (402176c9)
2024-06-24 15:50:50 +02:00
eb09e42638 fix(eppp): Fixed strict prototype API decl issue in SDIO 2024-06-24 15:50:40 +02:00
adafeae5cf feat(esp_modem): example add esp32p4 usb support
1. support ec20 cat.4 module in example modem_console and pppos_client
2. support esp32p4 in example modem_console and pppos_client
2024-06-24 18:55:20 +08:00
d7eaa77b89 Merge pull request #511 from david-cermak/feat/eppp_sdio
[eppp]: Add support for SDIO transport
2024-06-24 09:52:20 +02:00
5fe3870494 bump(wifi_remote): 0.2.3 -> 0.3.0
0.3.0
Features
- add esp_wifi_internal_tx_by_ref (ba35d14e)
- Make wifi_remote depend on esp_hosted (ac9972aa)
2024-06-24 09:40:25 +02:00
402176c9e0 fix(eppp): Fix SIDO host to check/clear interrupts atomically 2024-06-24 09:29:42 +02:00
085dd79079 feat(eppp): Add support for SDIO transport 2024-06-24 09:29:42 +02:00
a05fbc7ed9 Merge pull request #599 from SohKamYung-Espressif/feat/wifi_internal_tx_by_ref
feat(wifi_remote): add esp_wifi_internal_tx_by_ref
2024-06-21 17:42:00 +02:00
ba35d14e43 feat(wifi_remote): add esp_wifi_internal_tx_by_ref
Add esp_wifi_internal_tx_by_ref as building with CONFIG_SPIRAM=y will
get a linker error caused by an undefined reference to the function.
2024-06-21 15:24:16 +08:00
83ea2876fc feat(websocket): allow using external tcp transport handle 2024-06-21 14:47:03 +10:00
c714d24d75 bump(mqtt_cxx): 0.3.0 -> 0.4.0
0.4.0
Bug Fixes
- Adds missing configuration fields (d4c6d5ed)
2024-06-18 12:49:02 +02:00
2b64e80acd Merge pull request #596 from SohKamYung-Espressif/feat/depend_on_esp_hosted
feat(wifi_remote): Make wifi_remote depend on esp_hosted (IDFGH-13027)
2024-06-18 11:02:11 +02:00
ac9972aa48 feat(wifi_remote): Make wifi_remote depend on esp_hosted
Co-authored-by: david-cermak <38914379+david-cermak@users.noreply.github.com>
2024-06-18 11:14:09 +08:00
1c5a149b14 Merge pull request #597 from david-cermak/fix/pre_commit_hook_astyle
fix(common): Fix pre-commit hook to use released astyle_py
2024-06-14 15:33:56 +02:00
8d0152f612 fix(common): Fix pre-commit hook to use released astyle_py
The previous version (c00138088) required pyyaml 3.0.0 which is broken
on certain plafroms (e.g. Fedora 39)

Closes https://github.com/espressif/esp-protocols/issues/592
2024-06-14 12:24:31 +02:00
b2272b410d Merge pull request #513 from espressif-abhikroy/component/console_cmd_wifi
feat(console): wifi commands updates
2024-06-11 21:03:09 +10:00
5d43f9660f bump(console): 1.0.1 -> 1.1.0
1.1.0
Features
- Added support to join pre-configured network (bdbf16c1)
2024-06-11 20:50:49 +10:00
bdbf16c113 feat(console): Added support to join pre-configured network 2024-06-11 20:34:01 +10:00
7f248bd03f Merge pull request #591 from david-cermak/fix/modem_clang_tidy
[modem]: Fixes clang-tidy warnings
2024-06-07 17:01:02 +02:00
dabd4bfd0e fix(modem): Fix host tests to run gcov in python virt env 2024-06-07 12:45:23 +02:00
70fa3af771 fix(modem): Fixed clang-tidy warnings
* private field 'netif' is not used [clang-diagnostic-unused-private-field]
* private field 'instance' is not used [clang-diagnostic-unused-private-field]
* Call to virtual method 'FdTerminal::stop' during destruction bypasses virtual dispatch [clang-analyzer-optin.cplusplus.VirtualCall]
* unused variable 'TAG' [clang-diagnostic-unused-const-variable]
* Null pointer passed as 2nd argument to memory copy function [clang-analyzer-unix.cstring.NullArg]
* Array access (from variable 'data') results in a null pointer dereference [clang-analyzer-core.NullDereference]
2024-06-07 12:43:23 +02:00
5d69d3f0ac Merge pull request #588 from gabsuren/mdns_v1.3.2
bump(mdns): 1.3.1 -> 1.3.2
2024-06-05 12:58:45 +04:00
39d59032a2 Merge pull request #582 from david-cermak/fix/wifi_remote_server_sync
[wifi-remote]: Fix server race when receiving command and posting events
2024-06-05 08:14:19 +02:00
e3418b5527 bump(wifi_remote): 0.2.2 -> 0.2.3
0.2.3
Bug Fixes
- Fix server event/command race condtion using eventfd (732b1d5)
- Lock server before marshalling events (9e13870)
2024-06-05 07:27:12 +02:00
21d1540b76 bump(mdns): 1.3.1 -> 1.3.2
1.3.2
Features
- add check of instance when handling PTR query (6af6ca5)
Bug Fixes
- Fix of mdns afl tests (139166c)
- remove same protocol services with different instances (042533a)
2024-06-04 16:43:44 +04:00
186e258798 Merge pull request #587 from gabsuren/fix_mdns_config
fix(mdns): Fix of mdns afl tests
2024-06-04 16:41:52 +04:00
139166c2c5 fix(mdns): Fix of mdns afl tests 2024-06-04 10:23:27 +04:00
7437d31368 Merge pull request #574 from DejinChen/fix/remove_same_protocol_service
fix(mdns): remove same protocol services with different instances
2024-06-03 14:26:40 +04:00
d20255a40c Merge pull request #559 from gytxxsy/feature/add_instance_check_for_existing_answer
feat(mdns): add check of instance when handling PTR query (IDFGH-12701)
2024-06-03 14:24:54 +04:00
6af6ca52a2 feat(mdns): add check of instance when handling PTR query 2024-05-31 17:29:14 +08:00
042533af90 fix(mdns): remove same protocol services with different instances 2024-05-31 16:37:22 +08:00
732b1d5084 fix(wifi_remote): Fix server event/command race condtion using eventfd 2024-05-31 07:47:37 +02:00
9e13870ad4 fix(wifi_remote): Lock server before marshalling events 2024-05-30 15:40:26 +02:00
3f12ef6eea Merge pull request #580 from david-cermak/fix/ci_build_jobs
ci(common): Fix build jobs to install only idf-build-apps in idf cotainer
2024-05-28 17:39:25 +02:00
f1bc070b86 Merge pull request #579 from david-cermak/fix/wifi_remote_netif_example_sta
[wifi-remote]: Pass more netif options to eppp
2024-05-28 17:39:01 +02:00
28c0e0b77b bump(wifi_remote): 0.2.1 -> 0.2.2
0.2.2
Bug Fixes
- Added more netif options for eppp connection (24ce867)
- Do not restrict EPPP config to RSA keys only (f05c765, #570)
2024-05-28 16:37:24 +02:00
24ce86756d fix(wifi_remote): Added more netif options for eppp connection
Configurable in Kconfig:
* routing priority
* netif description
2024-05-28 16:36:16 +02:00
39dfe268a3 Merge pull request #578 from david-cermak/fix/eppp_netif_config
[eppp]: Make some common esp_netif options configurable
2024-05-28 16:34:33 +02:00
d96f45a1f9 bump(eppp): 0.1.0 -> 0.1.1
0.1.1
Bug Fixes
- Make some common netif options configurable (7829e8f)
2024-05-28 16:11:19 +02:00
90fdcfc340 fix(eppp): Add build test for IDF v5.3, fix idf-build-apps deps 2024-05-28 16:10:19 +02:00
7829e8f976 fix(eppp): Make some common netif options configurable 2024-05-28 16:10:19 +02:00
ce27c13352 ci(console): Ignore latest ethernet deprecation warning 2024-05-28 14:57:17 +02:00
eab58de630 ci(common): Fix build jobs to install only idf-build-apps in idf container 2024-05-28 14:40:46 +02:00
fcb60806a9 Merge pull request #575 from david-cermak/fix/wifi_remote_keys
fix(wifi_remote): Do not restrict EPPP config to RSA keys only
2024-05-28 08:52:04 +02:00
22914d4b7b fix(wifi_remote): Fix build test to download only idf-build-apps deps 2024-05-27 17:18:27 +02:00
150a3ec06a Merge pull request #577 from david-cermak/fix/clang_tidy_deps
CI: Fixed clang-tidy job
2024-05-23 17:48:53 +02:00
c12616c91d ci: remove libtinfo5 installation step 2024-05-23 17:25:52 +02:00
f05c765e8b fix(wifi_remote): Do not restrict EPPP config to RSA keys only
Now we can use any kind of certificate and keys, as long as they're in
PEM format.

Closes https://github.com/espressif/esp-protocols/issues/570
2024-05-20 15:13:16 +02:00
ed021a90d4 Merge pull request #550 from gabsuren/fix_websokcet_params
fix(websocket): Fix locking issues of `esp_websocket_client_send_with_exact_opcode` IDF-9380
2024-05-17 13:20:23 +04:00
6393fcd79a fix(websocket): Fix locking issues of esp_websocket_client_send_with_exact_opcode API
Extended examples to cover more cases
Added new config CONFIG_ESP_WS_CLIENT_ENABLE_DYNAMIC_BUFFER for testing
2024-05-17 12:37:10 +04:00
c9439bd3d5 Merge pull request #571 from gabsuren/mdns_v1.3.1_
bump(mdns): 1.3.0 -> 1.3.1
2024-05-14 16:23:35 +04:00
2c4c88b4fb bump(mdns): 1.3.0 -> 1.3.1
1.3.1
Bug Fixes
- free txt value len (afd98bb)
2024-05-14 15:00:27 +04:00
d45c5cef9a Merge pull request #569 from DejinChen/fix/free_txt_value_len
fix(mdns): free txt value len (IDFGH-12817)
2024-05-14 14:58:31 +04:00
afd98bb9c5 fix(mdns): free txt value len 2024-05-10 17:44:48 +08:00
8f19c60c19 Merge pull request #567 from gabsuren/CI/idf_5.3
ci(common): added idf release-v5.2, release-v5.3 targets(IDF-9875)
2024-05-09 22:40:16 +04:00
281e933808 ci(common): added idf release-v5.2, release-v5.3 targets 2024-05-09 20:56:02 +04:00
f4bdf0ab6c Merge pull request #545 from david-cermak/feat/clang_tidy_check
ci(common): Add clang tidy check to esp-protocols
2024-05-09 14:56:01 +02:00
e25b2a1d9d Merge pull request #568 from david-cermak/bump/wifi_remote_with_eppp
[wifi-remote]: Updated eppp dependency and more WiFi functions
2024-05-07 22:53:39 +02:00
608b835680 bump(wifi_remote): 0.2.0 -> 0.2.1
0.2.1
Bug Fixes
- Added misc wifi API in eppp impl (93256d1)
- Updated eppp dependency not to use fixed version (3a48c06)
2024-05-07 20:06:43 +02:00
93256d159b fix(wifi_remote): Added misc wifi API in eppp impl
Adds missing implementation of:
* esp_wifi_deinit()
* esp_wifi_disconnect()
* esp_wifi_set_storage()
2024-05-07 20:06:24 +02:00
3a48c06e96 fix(wifi_remote): Updated eppp dependency not to use fixed version 2024-05-07 20:06:19 +02:00
e011188377 Merge pull request #566 from david-cermak/feat/eppp_force_lwip_opts
[eppp]: Force the `PPP` LWIP opts which are OFF by default
2024-05-07 19:48:18 +02:00
1fb1ea9300 bump(eppp): 0.0.1 -> 0.1.0
0.1.0
Features
- Added CI job to build examples and tests (7eefcf0)
Bug Fixes
- Fixed to select PPP LWIP opts which are OFF by default (16be2f9)
- Example to use iperf component from the registry (bd6b66d)
- Fixed defalt config designated init issue in C++ (8bd4712)
2024-05-07 10:32:55 +02:00
16be2f963b fix(eppp): Fixed to select PPP LWIP opts which are OFF by default 2024-05-07 10:30:43 +02:00
d786f0db88 Merge pull request #555 from gabsuren/websocket_keep_alirve
feat(websocket): adding support for `keep_alive_enable` when using WSS transport (IDFGH-11457)
2024-05-03 14:49:42 +04:00
f6f6ded001 Merge pull request #560 from david-cermak/fix/ci_build_v5.3
Fix CI build per IDFv5.3
2024-05-03 12:44:25 +02:00
eb84eed8d3 ci(common): Add clang tidy check to esp-protocols 2024-04-26 12:39:52 +02:00
5df46437f2 fix(console): Ignore eth_init hidden config warning 2024-04-26 11:57:06 +02:00
bd6b66d9d1 fix(eppp): Example to use iperf component from the registry 2024-04-26 11:32:46 +02:00
d0c17ef0d5 fix(modem): Fix CI build per IDFv5.3 2024-04-26 11:25:30 +02:00
06d013b20b Merge pull request #557 from euripedesrocha/fix_lastwill
Adds missing configuration fields
2024-04-26 02:50:23 -03:00
f032a9f023 Merge pull request #538 from david-cermak/feat/wifi_remote_example
[wifi remote]: Add example without `esp_hosted`
2024-04-25 16:03:15 +02:00
d16387859f bump(wifi_remote): 0.1.12 -> 0.2.0
0.2.0
Features
- Add support for simple eppp based RPC (fd168d8)
Bug Fixes
- Make services restartable, code cleanup (6c82ce2)
- Add examples to CI (d2b7c55)
2024-04-25 15:13:49 +02:00
6c82ce2915 fix(wifi_remote): Make services restartable, code cleanup 2024-04-25 15:11:17 +02:00
d2b7c55b89 fix(wifi_remote): Add examples to CI 2024-04-25 15:11:17 +02:00
fd168d86fc feat(wifi_remote): Add support for simple eppp based RPC 2024-04-25 15:11:09 +02:00
d4c6d5ed5d fix(mqtt_cxx): Adds missing configuration fields
Some aspects of the underlying mqtt client were not set.

Fix #554
2024-04-22 12:30:20 +02:00
c728eae5ea feat(websocket): adding support for keep_alive_enable when using WSS transport 2024-04-22 10:57:36 +04:00
bd6e120509 Merge pull request #509 from david-cermak/feat/mbedtls_cxx_component
fix(tls_cxx): Publish mbedtls-cxx component
2024-04-11 18:32:08 +02:00
13793a8236 bump(tls_cxx): First version [0.1.0]
0.1.0
Features
- Publish mbedtls component (0140455f)
2024-04-11 16:52:51 +02:00
0140455ff7 feat(tls_cxx): Publish mbedtls component
Adds examples and tests.
Also supports DTLS now.
2024-04-11 16:49:54 +02:00
c4d9cc6beb Merge pull request #540 from david-cermak/fix/modem_uart_missed_event
fix(modem): Fixed UART task to check for buffered data periodically
2024-04-11 14:44:51 +02:00
887dbcd73b Merge pull request #549 from gabsuren/mdns_1.3.0
bump(mdns): 1.2.5 -> 1.3.0
2024-04-10 14:36:36 +04:00
b3ba71ff4d bump(mdns): 1.2.5 -> 1.3.0
1.3.0
Features
- add a new mdns query mode `browse` (af330b6)
- Make including mdns_console KConfigurable (27adbfe)
Bug Fixes
- Schedule all queued Tx packets from timer task (d4e693e)
- add lock for some common apis (21c84bf)
- fix mdns answer append while host is invalid (7be16bc)
2024-04-10 11:24:25 +04:00
fbdb2483f5 Merge pull request #522 from zwx1995esp/feature/mdns_add_browse_suport
mdns add browse support (IDFGH-12512)
2024-04-10 09:48:55 +04:00
zwx
af330b6396 feat(mdns): add a new mdns query mode browse 2024-04-10 11:23:24 +08:00
0b94d9ec47 Merge pull request #543 from david-cermak/feat/wifi_remote_publish
fix(wifi_remote): Publish missing esp_wifi_remote and add to README
2024-04-04 10:46:45 +02:00
f26f2f88c2 Merge pull request #537 from david-cermak/fix/eppp_cxx_init
fix(eppp): Fixed default config designated init issue in C++
2024-04-02 14:50:41 +02:00
08d06a4b7d fix(wifi_remote): Publish missing esp_wifi_remote and add to README 2024-04-02 14:42:31 +02:00
cb682a793e Merge pull request #516 from david-cermak/feat/wifi_remote
New component `esp_wifi_remote`
2024-04-02 12:56:12 +02:00
d053d671f4 bump(wifi_remote): Initial version 0.1.12
0.1.12
Features
- Added generation step for wifi_remote based on IDF (dfb00358)
- Move to esp-protocols (edc3c2d)
2024-04-02 11:21:38 +02:00
16b79d170b ci(common): Fix changelog: only add newline for new entries 2024-04-02 11:19:30 +02:00
dfb0035858 feat(wifi_remote): Added generation step for wifi_remote based on IDF 2024-04-02 11:19:24 +02:00
1750a3fda9 Merge pull request #535 from gabsuren/websocket_update
bump(websocket): 1.2.2 -> 1.2.3
2024-03-27 17:35:52 +04:00
2a3db45ef1 Merge pull request #541 from gabsuren/websocket_host_example_4
fix(websocket): fix of websocket host build
2024-03-26 20:33:55 +04:00
fcc61e0929 fix(websocket): fix of websocket host build 2024-03-26 19:00:03 +04:00
4bdd90cc88 fix(modem): Fixed UART task to check for buffered data periodically
Closes https://github.com/espressif/esp-protocols/issues/536
2024-03-26 14:44:59 +01:00
14763888ed Merge pull request #534 from gabsuren/mdns_docs
fix(mdns): updated the document to clarify service advertisment prerequisite (IDFGH-6982)
2024-03-26 13:15:21 +04:00
a5954dda17 Merge pull request #533 from david-cermak/fix/mdns_process_tx_packets
fix(mdns): Schedule all queued Tx packets from timer task
2024-03-26 10:12:41 +01:00
8bd4712677 fix(eppp): Fixed defalt config designated init issue in C++ 2024-03-25 12:48:41 +01:00
a65d81c954 bump(websocket): 1.2.2 -> 1.2.3
1.2.3
Features
- Expanded example to demonstrate the transfer over TLS (0d0630ed76)
Bug Fixes
- fix esp_event dependency management (1fb02a9a60)
- Skip warn on zero timeout and auto reconnect is disabled (5b467cbf5c)
- Fixed to use int return value in Tx functions (9c54b72e1f)
- Fixed Tx functions with DYNAMIC_BUFFER (16174470ee)
- added dependency checks, sdkconfig.defaults and refined README.md (312982e4aa)
- Close websocket and dispatch event if server does not close within a reasonable amount of time. (d85311880d)
- Continue waiting for TCP connection to be closed (2b092e0db4)
Updated
- docs(websocket): Added README for websocket host example (2f7c58259d)
2024-03-22 14:37:13 +04:00
2585565483 fix(mdns): updated the document to clarify service advertisment prerequisite (IDFGH-6982) 2024-03-22 11:57:24 +04:00
b9c675b0b1 Merge pull request #523 from bryghtlabs-richard/master
fix(websocket): fix esp_event dependency management (IDFGH-12301) (IDFGH-12302)
2024-03-20 19:09:29 +01:00
d4e693e392 fix(mdns): Schedule all queued Tx packets from timer task
Co-Authored-By: not-my-real-name <none@interent.com>

Partially addresses: https://github.com/espressif/esp-idf/issues/13333
2024-03-20 11:47:29 +01:00
963b32e7b4 Merge pull request #497 from rretanubun/make-mdns-console-kcconfig
feat(mdns): Make including mdns_console KConfig (IDFGH-11988)
2024-03-20 09:39:34 +01:00
cffe26818b Merge pull request #531 from david-cermak/fix/modem_minor_prs
[esp_modem]: Accept some PRs
2024-03-18 16:34:21 +01:00
08a62ccc85 fix(modem): Cleanup unused configs from PPPoS example
Merges https://github.com/espressif/esp-protocols/pull/403
2024-03-18 14:10:46 +01:00
56fe53279e fix(modem): Update CMUX example with SIM7070_gnss cleaned-up
Merges https://github.com/espressif/esp-protocols/pull/246
2024-03-18 14:10:46 +01:00
5baaf54291 fix(modem): Update console example with SIM7070_gnss format comments
Merges https://github.com/espressif/esp-protocols/pull/245
2024-03-18 14:10:46 +01:00
38de23fb1c Merge pull request #532 from gabsuren/ci_fix_modem
fix(modem): install requirements.txt for modem target tests
2024-03-18 14:09:53 +01:00
84390eb4d4 fix(modem): install requirements.txt for modem target tests 2024-03-18 15:18:44 +04:00
4e844936b7 Merge pull request #529 from zwx1995esp/fix/add_lock_for_mdns_common_api
fix(mdns): add lock for some common apis (IDFGH-12338)
2024-03-15 11:14:16 +04:00
zwx
21c84bfa8d fix(mdns): add lock for some common apis 2024-03-14 17:53:05 +08:00
438449f58f Merge pull request #454 from gabsuren/modem/latest_version
feat(modem): host test support of the latest ESP-IDF release (IDF-7828)
2024-03-14 13:49:05 +04:00
a23a0027fa ci(common): updated github actions(checkout, upload, download) v3 to 4, Ubuntu 20.04 to v22.04 2024-03-12 14:22:01 +04:00
3f74b4e8c0 feat(modem): host test support of the latest ESP-IDF release 2024-03-12 12:05:59 +04:00
46a6244c37 Merge pull request #526 from zwx1995esp/fix/mdns_send_answer_while_host_is_invalid
fix(mdns): fix mdns answer append while host is invalid
2024-03-12 10:26:02 +04:00
zwx
7be16bcc88 fix(mdns): fix mdns answer append while host is invalid 2024-03-11 20:26:38 +08:00
1fb02a9a60 fix(websocket): fix esp_event dependency management
Move esp_event from PRIV_REQUIRES to REQUIRES, as it is
included by esp_websocket_client.h, so any code including
that header also requires esp_event.

This resolves the following build error for files not
explicitly requiring esp_event:

ninja: build stopped: subcommand failed.
Compilation failed because esp_websocket_client.h (in "espressif__esp_websocket_client" component) includes esp_event.h, provided by esp_event component(s).
However, esp_event component(s) is in the private requirements list of "espressif__esp_websocket_client".
To fix this, move esp_event from PRIV_REQUIRES into REQUIRES list of idf_component_register call in ...\managed_components\espressif__esp_websocket_client\CMakeLists.txt.
ninja failed with exit code 1, output of the command is in...
2024-03-08 10:10:48 -06:00
b5be844c92 Merge pull request #521 from johanstokking/fix/websocket/reconnect-timeout-warning
fix(websocket): Skip warn on zero timeout and auto reconnect is disabled  (IDFGH-12288)
2024-03-07 11:49:18 +04:00
5b467cbf5c fix(websocket): Skip warn on zero timeout and auto reconnect is disabled 2024-03-06 22:20:48 +01:00
f8a776d8a5 Merge pull request #519 from gabsuren/mdns1.2.5
bump(mdns): 1.2.4 -> 1.2.5
2024-03-06 10:56:24 +04:00
a82c7922aa bump(mdns): 1.2.4 -> 1.2.5
1.2.5
Bug Fixes
- Fixed build issues for targets without WiFi caps (302b46f)
2024-03-06 10:32:17 +04:00
d31ad025c8 Merge pull request #515 from david-cermak/fix/ws_dyn_buffer
[ws-client]: Fix usage of the dynamic buffer
2024-03-05 16:25:51 +01:00
4977f96a61 Merge pull request #517 from david-cermak/fix/examples_format_warn
Fix remaining format warnings
2024-03-05 15:02:44 +01:00
dcdf31187a Merge pull request #518 from gabsuren/mdns_docs_update
fix(mdns): updated the document to clarify self-querying mechanism (IDFGH-7528)
2024-03-05 14:23:06 +04:00
b6bbe47cae fix(mdns): updated the document to clarify self-querying mechanism 2024-03-05 12:38:07 +04:00
302b46f8e2 fix(mdns): Fixed build issues for targets without WiFi caps 2024-03-01 10:24:29 +01:00
45b1597ac3 fix(examples): Fix SLIP example print format warnings 2024-03-01 10:08:27 +01:00
a06de6431b fix(examples): Fix MQTT example print format warnings
Partially addresses https://github.com/espressif/esp-protocols/issues/79
2024-02-28 19:25:28 +01:00
3b80181d30 fix(modem): Fix remaining print format warnings
Partially addresses https://github.com/espressif/esp-protocols/issues/79
2024-02-28 19:24:52 +01:00
edc3c2dee0 feat(wifi_remote): Move to esp-protocols 2024-02-28 18:44:19 +01:00
943b683d38 fix(wifi_remote): Support for wifi_native injection 2024-02-28 18:37:16 +01:00
d0ace0d1c9 feat(wifi_remote): Initial stubs for wifi-remote 2024-02-28 18:30:47 +01:00
9c54b72e1f fix(websocket): Fixed to use int return value in Tx functions 2024-02-28 12:48:06 +01:00
16174470ee fix(websocket): Fixed Tx functions with DYNAMIC_BUFFER 2024-02-28 12:47:59 +01:00
a363beea6f Merge pull request #462 from david-cermak/feat/eppp_link
New component ESP-PPP-Link
2024-02-23 12:22:43 +01:00
a8035c21a2 bump(eppp): Published ESP-PPP-Link as eppp-v0.0.1 2024-02-23 12:05:21 +01:00
7eefcf084e feat(eppp): Added CI job to build examples and tests 2024-02-23 12:05:02 +01:00
18f845275f feat(eppp): Added support for SPI transport 2024-02-23 11:47:22 +01:00
ad27414a64 feat(eppp): Added support for UART transport 2024-02-23 11:47:15 +01:00
a7610395ef feat(eppp): Introduced ESP-PPP-Link component 2024-02-23 11:11:49 +01:00
9b7c8755e9 Merge pull request #506 from gabsuren/websocket_ssl_example
feat(websocket): Expanded example to demonstrate the transfer over TLS (IDFGH-11681)
2024-02-23 12:39:05 +04:00
0d0630ed76 feat(websocket): Expanded example to demonstrate the transfer over TLS 2024-02-23 12:08:41 +04:00
38a3631a27 Merge pull request #495 from eht-datarespons/master
fix(websocket): Continue waiting for TCP connection to be closed (IDFGH-11965)
2024-02-08 14:37:44 +01:00
96f4ebd994 Merge pull request #504 from gabsuren/mdns_1.2.4
bump(mdns): 1.2.3 -> 1.2.4
2024-02-08 16:39:33 +04:00
247ca41bb7 bump(mdns): 1.2.3 -> 1.2.4
1.2.4
Bug Fixes
- Correction on 6d2c475 MDNS_PREDEF_NETIF_ETH fix (fc59f87c4e)
- fix the logic of creating pcb for networking socket (5000a9a20a)
- fix compiling issue when disabling IPv4 (2646dcd23a)
- Fix compile error when MDNS_PREDEF_NETIF_ETH is defined, but ETH_ENABLED is not (#459) (6d2c475c20)
2024-02-06 11:51:38 +04:00
891384cc53 Merge pull request #414 from wqx6/fix/mdns_disable_ipv4
fix(mdns): fix compiling issue when disabling IPv4 (IDFGH-11453)
2024-02-06 11:45:45 +04:00
38ef603296 Merge pull request #500 from gabsuren/websocket_linux
fix(websocket): added dependency checks, sdkconfig.defaults and refined README.md
2024-02-05 14:05:00 +04:00
312982e4aa fix(websocket): added dependency checks, sdkconfig.defaults and refined README.md 2024-02-05 13:22:39 +04:00
d9d377133e Merge pull request #501 from gabsuren/update_examples
docs(common): Enhance documentation clarity in the examples directory
2024-02-05 13:16:47 +04:00
110536ebb2 docs(common): Enhance documentation clarity in the examples directory 2024-02-05 13:15:25 +04:00
d85311880d fix(websocket): Close websocket and dispatch event if server does not close within a reasonable amount of time. 2024-01-29 08:01:39 +01:00
27adbfeb3b feat(mdns): Make including mdns_console KConfigurable
The CLI that mdns_console offers is very useful for debugging
and bootstrapping mDNS onto new projects, but some projects
may not want console CLI in place to reduce binary size.

This gives a KConfig option to do so.
2024-01-26 13:35:47 -05:00
5ba7cfab8e Merge pull request #496 from gabsuren/readme_websocket_linux
docs(websocket): Added README for websocket host example (IDF-9115)
2024-01-26 20:31:15 +04:00
2f7c58259d docs(websocket): Added README for websocket host example 2024-01-26 20:29:28 +04:00
2b092e0db4 fix(websocket): Continue waiting for TCP connection to be closed
Prevents an issue where WEBSOCKET_EVENT_CLOSED is not sent after
websocket is closed.
2024-01-23 14:58:27 +01:00
f42c0adfc0 Merge pull request #494 from david-cermak/bump/modem_v1.1
bump(modem): 1.0.5 -> 1.1.0
2024-01-22 17:08:55 +01:00
2782277f3f bump(modem): 1.0.5 -> 1.1.0
1.1.0
Features
- Added support for at_raw() command (ae38110, #471)
- Added iperf test for PPP netifs (976e98d)
- Added test that performs OTA to exercise modem layers (f2223dd)
Bug Fixes
- Fixed OTA test to gracefully fail with no verification (1dc4299)
- Added C-API to configure APN (ce7dadd, #485)
- Fixed AT commands to copy strings to prevent overrides (741d166, #463)
- Fixed incorrect dial command format (0998f3d, #433)
- Fixed documentation and example on creating custom device (577de67, #452)
- Removed CI jobs for IDF v4.2 (d88cd61)
- Fixed OAT test to verify server cert and CN (edc3e72)
- Fixed set_pdp_context() command timeout (1d80cbc, #455)
Updated
- docs(modem): Added description of manual test procedure (68ce794)
2024-01-22 16:33:07 +01:00
3225f40c22 Merge pull request #491 from david-cermak/feat/modem_set_apn
fix(modem): Added C-API to configure APN
2024-01-22 16:05:51 +01:00
d63f831fff Merge pull request #466 from gabsuren/websocket_bump_1.2.2
bump(websocket): 1.2.1 -> 1.2.2
2024-01-19 19:27:37 +04:00
f62db5cfa2 Merge pull request #492 from euripedesrocha/mqttcxx_0_3_0
bump(mqtt_cxx): 0.2.0 -> 0.3.0
2024-01-19 08:42:52 -03:00
68ce794098 docs(modem): Added description of manual test procedure 2024-01-19 11:16:18 +01:00
60174f290e bump(mqtt_cxx): 0.2.0 -> 0.3.0
0.3.0
Bug Fixes
- Incorrect documentation link (aa4e9d57)
- reference protocol_examples_common from IDF (e6c0538d)
- specify override_path in example manifest files (fa005c63)
2024-01-19 09:43:07 +01:00
efa26b7062 Merge pull request #484 from david-cermak/fix/modem_docs_ota
fix(modem): Documented some tips on failing OTA
2024-01-18 17:43:03 +01:00
7b777948fc Merge pull request #487 from euripedesrocha/mqttcxx_link_fix
Incorrect documentation link
2024-01-18 05:10:23 -03:00
1dc4299eb0 fix(modem): Fixed OTA test to gracefully fail with no verification 2024-01-17 17:43:47 +01:00
ce7daddc77 fix(modem): Added C-API to configure APN
Closes https://github.com/espressif/esp-protocols/issues/485
2024-01-17 14:30:05 +01:00
09e68cc0c0 Merge pull request #490 from david-cermak/fix/mdns_eth
fix(mdns): Correction on 6d2c475 MDNS_PREDEF_NETIF_ETH fix
2024-01-17 12:53:14 +01:00
fc59f87c4e fix(mdns): Correction on 6d2c475 MDNS_PREDEF_NETIF_ETH fix 2024-01-17 11:51:17 +01:00
7a2b23909f Merge pull request #489 from espressif/revert-478-component/console_cmd_iperf
Revert "feat(console): Added component with iperf command"
2024-01-17 10:24:17 +01:00
d3bf773445 Revert "feat(console): Added component with iperf command" 2024-01-17 20:20:30 +11:00
1c29af9237 Merge pull request #472 from david-cermak/fix/modem_at_corrupt_response
fix(modem): Fixed AT commands to copy strings to prevent overrides
2024-01-17 09:48:24 +01:00
b53981a68c Merge pull request #479 from marekmaskarinec/master
fix(mdns): Fix compile error when MDNS_PREDEF_NETIF_ETH is defined, but ETH_ENABLED is not (IDFGH-11868)
2024-01-17 09:48:05 +01:00
5000a9a20a fix(mdns): fix the logic of creating pcb for networking socket 2024-01-17 10:48:40 +08:00
2646dcd23a fix(mdns): fix compiling issue when disabling IPv4 2024-01-17 10:48:40 +08:00
de8ec67a88 Merge pull request #478 from espressif-abhikroy/component/console_cmd_iperf
feat(console): Added component with iperf command
2024-01-17 00:53:56 +11:00
8dac30781c Merge pull request #488 from gabsuren/fix_docs
docs(common): Added package requirements.txt for esp-docs
2024-01-16 16:59:05 +04:00
ba3f06f942 docs(common): Added package requirements.txt for esp-docs 2024-01-16 16:57:58 +04:00
a10f0008fb bump(console): First version [1.0.0]
1.0.0
Features
- Added component with iperf command (93d14087)
2024-01-16 20:27:56 +11:00
741d166034 fix(modem): Fixed AT commands to copy strings to prevent overrides
Previously we used std::string_view, which pointed to the lower-layers
buffer which might have been reused for other asynchronous operations
before processing it, thus causing corruption of replies.

Closes https://github.com/espressif/esp-protocols/issues/463
2024-01-16 09:51:51 +01:00
93d140875f feat(console): Added component with iperf command 2024-01-16 19:18:01 +11:00
eb7699388c bump(websocket): 1.2.1 -> 1.2.2
1.2.2
Bug Fixes
- continuation after FIN in websocket client (#460) (774d1c75e6)
- Re-applie refs to common comps idf_component.yml (9fe44a4504)
2024-01-16 12:17:25 +04:00
585e4b30b2 Merge pull request #483 from espressif-abhikroy/ci/build_app_failure_fix
fix(common): Fixed scripts for build test failure
2024-01-16 09:07:14 +01:00
aa4e9d5795 fix(mqtt_cxx): Incorrect documentation link
- Link in the component README was incorrect.

Fixes #486
2024-01-16 08:41:55 +01:00
6d2c475c20 fix(mdns): Fix compile error when MDNS_PREDEF_NETIF_ETH is defined, but ETH_ENABLED is not (#459)
Signed-off-by: Marek Maškarinec <marek@mrms.cz>
2024-01-15 16:50:44 +01:00
47736a2556 fix(common): Fixed scripts for build test failure 2024-01-16 01:59:11 +11:00
adde6df6e8 fix(modem): Documented some tips on failing OTA
Closes https://github.com/espressif/esp-protocols/issues/482
2024-01-15 14:58:03 +01:00
1393764dc5 Merge pull request #477 from david-cermak/feat/modem_at_raw
feat(modem): Added support for at_raw() command
2024-01-15 12:31:18 +01:00
0998f3dd4f fix(modem): Fixed incorrect dial command format
ATD command is used to switch generic device to the data mode
by dialing GPRS_SRC. The generic version of the command was incorrect
`ATD*99##` (containing extra trailing # char, which is accepted by most
devices). Command has been fixed, but the extra #'s been kept for devices
that we cannot test (to be fixed in IDFGH-9470).

Closes https://github.com/espressif/esp-protocols/issues/433
2024-01-09 12:48:16 +01:00
577de67c0e fix(modem): Fixed documentation and example on creating custom device
Updates docs and examples per recent changes:
* Modem example does no longer demonstrate how to overwrite an AT method
* PPPoS client example now contains much simpler custom module
definition

Closes https://github.com/espressif/esp-protocols/issues/452
2024-01-09 10:26:39 +01:00
ae38110d84 feat(modem): Added support for at_raw() command
at_raw() sends raw string and supports custom pass/fail phrases for the
API to return OK/FAIL. It also returns raw, unprocessed string as
output.
This allows sending custom requests, such as:
* dce->at_raw("", resp, "RDY", "...", 20000) -- waiting for reset
* esp_modem_at_raw(dce, "+++", resp, "DISCONNECTED", "ERROR", 5000) --
exits PPP mode

Closes https://github.com/espressif/esp-protocols/issues/471
Partially addresses https://github.com/espressif/esp-protocols/issues/468
2024-01-09 08:20:10 +01:00
5ab699d6f4 Merge pull request #354 from david-cermak/feat/modem_iperf_test
feat(modem): Add iperf test of PPP netif
2024-01-08 16:48:02 +01:00
976e98d6ff feat(modem): Added iperf test for PPP netifs 2024-01-08 16:22:22 +01:00
18b2ae103a Merge pull request #476 from david-cermak/fix/ci_examples
fix(examples): Fixed esp_netif_next() warning with IDFv5.3
2024-01-08 12:48:30 +01:00
52a34c21d0 fix(examples): Fixed esp_netif_next() warning with IDFv5.3 2024-01-08 08:02:20 +01:00
9df86641f3 Merge pull request #475 from gabsuren/bump_mdns__v1.2.3
bump(mdns): 1.2.2 -> 1.2.3
2024-01-05 14:22:25 +04:00
75af01670e bump(mdns): 1.2.2 -> 1.2.3
1.2.3
Bug Fixes
- fixed CI issues for host and afl tests (4be5efc84e)
- fix copy delegated host addr (19fb36000c)
- enable CONFIG_ESP_WIFI_ENABLED if CONFIG_SOC_WIFI_SUPPORTED is also enabled (for ESP-IDF <= 5.1) (d20a718320)
- remove protocol_examples_common (1ee9dae6bf)
- move the example into a subdirectory (d28232b9f8)
- reference protocol_examples_common from IDF (c83b76ea8f)
2024-01-05 14:00:34 +04:00
bf79e2f734 Merge pull request #465 from espressif-abhikroy/component/ifconfig_bug_fix
fix(console): Fixed ifconfig command for PPP interface and IPv4 only
2024-01-05 19:36:46 +11:00
a22c9e8da9 bump(console): 1.0.0 -> 1.0.1
1.0.1
Bug Fixes
- Fixed ifconfig command for PPP interface and IPv4 only (8548dabb)
2024-01-05 19:27:16 +11:00
8548dabbd6 fix(console): Fixed ifconfig command for PPP interface and IPv4 only 2024-01-05 19:23:52 +11:00
d2e4370d30 Merge pull request #469 from DejinChen/component/mdns_host_address_fix
fix(mdns): fix copy delegated host addr (IDFGH-11829)
2024-01-04 21:13:58 +04:00
e4c353760c Merge pull request #473 from gabsuren/mdns_fix_kconfig
fix(mdns): fixed CI issues for host and afl tests
2024-01-04 21:12:46 +04:00
4be5efc84e fix(mdns): fixed CI issues for host and afl tests 2024-01-04 17:46:18 +04:00
7451ec2a75 Merge pull request #363 from david-cermak/feat/modem_test_ota
feat(modem): Add OTA test to exercise modem layers
2024-01-03 21:27:36 +01:00
19fb36000c fix(mdns): fix copy delegated host addr 2024-01-03 17:12:41 +08:00
7d0eb5c48c Merge pull request #467 from espressif-abhikroy/component/console_cmd_wifi
fix(console): Fixed license file for console_cmd_wifi
2024-01-03 18:59:32 +11:00
a0a58e60b5 bump(console): 1.0.0 -> 1.0.1
1.0.1
Features
- Console for runtime wifi configuration (194d1179)
Bug Fixes
- Fixed license file for console_cmd_wifi (8285e973)
2023-12-23 21:19:53 +11:00
8285e9730f fix(console): Fixed license file for console_cmd_wifi 2023-12-23 21:19:30 +11:00
cf845cc23e Merge pull request #453 from espressif-abhikroy/component/console_cmd_wifi
feat(console): Console for runtime wifi configuration
2023-12-22 23:54:09 +11:00
a532e76ec1 bump(console): First version [1.0.0]
1.0.0
Features
- Console for runtime wifi configuration (194d1179)
2023-12-22 23:48:44 +11:00
194d1179bf feat(console): Console for runtime wifi configuration 2023-12-22 23:44:16 +11:00
aadda22961 Merge pull request #461 from 0xFEEDC0DE64/fix-websocket-client-fin
fix(websocket): continuation after FIN in websocket client (#460) (IDFGH-11761)
2023-12-22 14:45:51 +04:00
a6845f4cdd Merge pull request #456 from david-cermak/fix/modem_pdp_context_timeout
fix(modem): Fixed set_pdp_context() command timeout
2023-12-21 07:21:31 +01:00
d88cd6123b fix(modem): Removed CI jobs for IDF v4.2 2023-12-19 17:01:51 +01:00
10bb738911 fix(modem): Added CI jobs to build all tests for all targets 2023-12-19 17:01:51 +01:00
edc3e7251f fix(modem): Fixed OAT test to verify server cert and CN 2023-12-19 17:01:30 +01:00
774d1c75e6 fix: continuation after FIN in websocket client (#460) 2023-12-19 17:00:17 +01:00
f2223dd719 feat(modem): Added test that performs OTA to exercise modem layers 2023-12-19 16:55:34 +01:00
1d80cbc179 fix(modem): Fixed set_pdp_context() command timeout
Closes https://github.com/espressif/esp-protocols/issues/455
2023-12-19 16:43:59 +01:00
82c2cf8936 Merge pull request #451 from david-cermak/bump/modem_1.0.5
bump(modem): 1.0.4 -> 1.0.5
2023-12-06 09:54:37 +01:00
997cff5338 bump(modem): 1.0.4 -> 1.0.5
1.0.5
Major changes
- Added support for implementing user defined modules in standard C-API (Support for custom modules with C-API)
Bug Fixes
- Added test injecting unexpected replies (b220d1e, #426)
- Fixed inconsistent state on data after OK (bf99f28, #426)
- TLS example: Added restore session support in mbedtls-wrap (79d38e5)
- Fixed examples to show netif on ppp-changed event (a70b197)
- remove unused GNU Make based buildsystem files (d6b6f63)
- specify override_path in example manifest files (5b78da4)
- Added test-cases that exercise mode transitions (aff571d)
- Fixed mode transitions between any state and UNDEF (93cb2ca, #320)
- Fixed API docs within doxygen comments (020b407)
- Support for custom modules with C-API (0254d50)
- Fix CRLF issue with esp_modem_c_api.cpp (2661b4d)
Updated
- ci(common): Created reusable action for host and coverage tests (9ad04de)
2023-12-06 09:22:39 +01:00
ed8bbf2666 Merge pull request #447 from david-cermak/fix/modem_command_state_consistent_test
fix(modem): Added test injecting unexpected replies
2023-12-06 09:20:27 +01:00
b220d1ee5e fix(modem): Added test injecting unexpected replies
This test exhibits an issue of getting unexpected data just after
completing a command. The DTE rewrites the state to TIMEOUT, but the
signal has been already triggered, thus results in an unexpected state.

Related to Closes https://github.com/espressif/esp-protocols/issues/426
2023-12-06 09:09:47 +01:00
671190bc6d Merge pull request #446 from david-cermak/fix/modem_command_state_consistency
fix(modem): Fixed inconsistent state on data after OK
2023-12-06 09:06:23 +01:00
1bf6843b3e Merge pull request #332 from espressif-abhikroy/components/console_cmd_ifconfig
Added component: Console for runtime network interface configuration
2023-11-30 08:23:15 +01:00
b78569860d Merge pull request #438 from espressif-abhikroy/components/console_cmd_ping
bump(console): First version [1.0.0]
2023-11-30 08:19:43 +01:00
27f955abfa bump(console): First version [1.0.0]
1.0.0
Features
- Added ping command to console component (7babdeb9)
2023-11-30 18:14:59 +11:00
bf99f287bc fix(modem): Fixed inconsistent state on data after OK
If we received response in two chunks and the first one completes the
command (result=OK or FAIL), and the second chunk pre-empts command processing,
then we performed processing again rewritting the result back to
TIMEOUT. This would invalidate the command, but also causes an
exception: ESP_MODEM_THROW_IF_ERROR(ESP_ERR_INVALID_STATE)
Fixed by checking if the processing already finished in process_line().

Closes https://github.com/espressif/esp-protocols/issues/426
2023-11-29 20:24:53 +01:00
909e8d9494 Merge pull request #441 from david-cermak/fix/apply_examples_idf_component_refs
fix(common): Re-applied refs to common comps idf_component.yml
2023-11-28 17:44:13 +01:00
0c6bb4bedc Merge pull request #360 from david-cermak/fix/modem_example_mbedtls_wrapper
fix(modem): TLS example: Add restore session support in mbedtls wrapper
2023-11-28 17:12:10 +01:00
afbca5343e Merge pull request #416 from david-cermak/fix/modem_undef_mode
fix(modem): Fixed mode transitions between any state and UNDEF
2023-11-28 17:11:43 +01:00
3f49583761 Merge pull request #443 from gabsuren/websocket_1.2.1
bump(websocket): 1.2.0 -> 1.2.1
2023-11-28 17:20:14 +04:00
c6448c3bd1 bump(websocket): 1.2.0 -> 1.2.1
1.2.1
Bug Fixes
- consider failure if return value of `esp_websocket_client_send_with_exact_opcode` less than 0 (f523b4d)
- fix of return value for `esp_websocket_client_send_with_opcode` API (ba33588)
2023-11-28 16:42:55 +04:00
f523b4dc84 fix(websocket): consider failure if return value of esp_websocket_client_send_with_exact_opcode less than 0 2023-11-28 16:40:10 +04:00
6fda4c134e Merge pull request #442 from gabsuren/fix/websocket_return_opcode
fix(websocket): fix of return value for `esp_websocket_client_send_with_opcode` API (IDF-8745)
2023-11-28 15:51:27 +04:00
ba33588008 fix(websocket): fix of return value for esp_websocket_client_send_with_opcode API 2023-11-28 12:37:31 +04:00
9fe44a4504 fix(common): Re-applie refs to common comps idf_component.yml
This reverts commit 74fc228cdf.
This reverts commit b176d3abbb.
This reverts commit f9e0281a04.
2023-11-28 09:32:52 +01:00
9758379921 Merge pull request #440 from david-cermak/fix/revert_example_common_comp_refs
Temporarily revert IDF component references in examples
2023-11-28 08:15:28 +01:00
f52a38ba34 bump(websocket): 1.1.0 -> 1.2.0
1.2.0
Features
- Added new API `esp_websocket_client_append_header` (39e9725)
- Added new APIs to support fragmented messages transmission (fae80e2)
Bug Fixes
- Reference common component from IDF (74fc228)
- Revert referencing protocol_examples_common from IDF (b176d3a)
- reference protocol_examples_common from IDF (025ede1)
- specify override_path in example manifests (d5e7898)
- Return status code correctly on esp_websocket_client_send_with_opcode (ac8f1de)
- Fix pytest exclusion, gitignore, and changelog checks (2696221)
2023-11-28 07:42:49 +01:00
74fc228cdf fix(common): Reference common component from IDF 2023-11-28 07:42:28 +01:00
b176d3abbb fix(websocket): Revert referencing protocol_examples_common from IDF
This reverts commit 025ede12e8.
2023-11-28 07:23:32 +01:00
f9e0281a04 fix(asio): Revert referencing protocol_examples_common from IDF
This reverts commit 09abb18be6.
2023-11-28 07:21:56 +01:00
76a4a9f97a bump(console): First version [1.0.0]
1.0.0
Features
- Console for runtime network interface configuration and monitoring (8bab1420)
2023-11-24 22:12:33 +11:00
8bab1420d3 feat(console): Console for runtime network interface configuration and monitoring 2023-11-24 20:07:33 +11:00
9c555b90d4 Merge pull request #385 from espressif-abhikroy/components/console_cmd_ping
feat(console): Added ping command to console component
2023-11-23 19:58:33 +11:00
79d38e54f2 fix(modem): TLS example: Added restore session support in mbedtls-wrap
Reusable component in modem_tcp_client example implements a simple
mbedtls wrapper. This update add support for mbedtls deinit() and for
saving and restoring TLS session.
2023-11-23 09:56:01 +01:00
7babdeb970 feat(console): Added ping command to console component 2023-11-23 01:17:43 +11:00
7faa97450b Merge pull request #434 from david-cermak/bugfix/modem_examples_print_netif
fix(modem): Fixed examples to show netif on ppp-changed event
2023-11-16 17:52:03 +01:00
cc40cc1f84 Merge pull request #413 from david-cermak/feat/new_modem_cmd
Added support for implementing user defined modules in standard C-API
2023-11-16 17:51:28 +01:00
a70b197d02 fix(modem): Fixed examples to show netif on ppp-changed event 2023-11-16 10:10:02 +01:00
f50edd40b5 Merge pull request #425 from euripedesrocha/asio_contributing_guide
bump(asio): 1.28.0~0 -> 1.28.2~0
2023-11-14 14:50:47 +01:00
28f1e430fd bump(asio): 1.28.0~0 -> 1.28.2~0
1.28.2~0

Bug Fixes
- reference protocol_examples_common from IDF ([09abb18](https://github.com/espressif/esp-protocols/commit/09abb18))
- specify override_path in example manifest files ([1d8923c](https://github.com/espressif/esp-protocols/commit/1d8923c))

Updated
- docs(asio): Updates asio docs ([ce9337d](https://github.com/espressif/esp-protocols/commit/ce9337d))
2023-11-14 13:48:12 +01:00
93f5f7bf58 Merge pull request #427 from gabsuren/fix/mdns_config
mdns: enable CONFIG_ESP_WIFI_ENABLED if CONFIG_SOC_WIFI_SUPPORTED is also enabled (for ESP-IDF <= 5.1)
2023-11-14 16:24:10 +04:00
d20a718320 fix(mdns): enable CONFIG_ESP_WIFI_ENABLED if CONFIG_SOC_WIFI_SUPPORTED is also enabled (for ESP-IDF <= 5.1) 2023-11-14 14:48:42 +04:00
7ec41cd447 Merge pull request #424 from espressif/components/console_simple_init_plugin
bump(console): 1.0.2 -> 1.1.0
2023-11-13 23:31:43 +11:00
334dec8154 bump(console): 1.0.2 -> 1.1.0
1.1.0
Features
- Added runtime component registration support in console_simple_init (057873c1)
2023-11-13 19:40:36 +11:00
24f07f920f Merge pull request #420 from david-cermak/bugfix/examples_override_path
Add override_path in example manifests
2023-11-10 07:53:31 +01:00
e6fa2f84a2 Merge pull request #421 from gabsuren/fix_github_publish
fix(ci):fixed GitHub page publish path
2023-11-09 19:24:00 +04:00
1ee9dae6bf fix(common): remove protocol_examples_common
Remaining references to protocol_examples_common are replaced with
references to ESP-IDF.
We will later re-add protocol_examples_common or some equivalent of it
under components/, and release it to the Component Registry.
2023-11-09 15:38:44 +01:00
d28232b9f8 fix(mdns): move the example into a subdirectory
By default, component manager expects that the examples are located
under <component>/examples/<name>. Move mdns example so that it is
found.
2023-11-09 15:37:37 +01:00
c83b76ea8f fix(mdns): reference protocol_examples_common from IDF
This makes the example project usable from the component registry
2023-11-09 15:32:05 +01:00
025ede12e8 fix(esp_websocket_client): reference protocol_examples_common from IDF
This makes the 'target' example usable from the component registry.
'linux' example still has a bunch of EXTRA_COMPONENT_DIRS, but at
least we can delete the protocol_examples_common copy.
2023-11-09 15:32:05 +01:00
e6c0538d55 fix(esp_mqtt_cxx): reference protocol_examples_common from IDF
This makes the example project usable from the component registry
2023-11-09 15:32:05 +01:00
d6b6f634d7 fix(esp_modem): remove unused GNU Make based buildsystem files 2023-11-09 15:32:05 +01:00
09abb18be6 fix(asio): reference protocol_examples_common from IDF
This makes the example project usable from the component registry
2023-11-09 15:32:05 +01:00
d5e789883f fix(esp_websocket_client): specify override_path in example manifests 2023-11-09 15:32:05 +01:00
fa005c6363 fix(esp_mqtt_cxx): specify override_path in example manifest files 2023-11-09 15:32:05 +01:00
5b78da4689 fix(esp_modem): specify override_path in example manifest files 2023-11-09 15:32:05 +01:00
1d8923cfbb fix(asio): specify override_path in example manifest files 2023-11-09 15:32:00 +01:00
4d6e5ddb15 ci(common): fixed github page publish path 2023-11-09 14:12:17 +04:00
671422038c Merge pull request #418 from gabsuren/fix_action
fix(common): added 'write' permission for the check action
2023-11-08 15:25:40 +04:00
8105c60a4e fix(common): added 'write' permission for check action 2023-11-08 14:06:59 +04:00
ec78c3372c Merge pull request #402 from espressif-abhikroy/components/console_simple_init_plugin
feat(console): Added runtime component registration support in console_simple_init
2023-11-08 18:59:58 +11:00
5396de42d0 docs(modem): Added documentation about mode transitions
Closes https://github.com/espressif/esp-protocols/issues/318
2023-11-07 12:35:06 +01:00
aff571df2c fix(modem): Added test-cases that exercise mode transitions 2023-11-07 12:35:06 +01:00
93cb2caadb fix(modem): Fixed mode transitions between any state and UNDEF
Closes https://github.com/espressif/esp-protocols/issues/320
2023-11-07 12:35:00 +01:00
0584da5cb2 Merge pull request #397 from gabsuren/feat/modem_reusable_actions
ci(common): Created reusable actions for host and coverage tests (IDF-7856)
2023-11-06 19:32:00 +04:00
9ad04deb04 ci(common): Created reusable action for host and coverage tests 2023-11-06 19:15:20 +04:00
020b407472 fix(modem): Fixed API docs within doxygen comments 2023-11-02 15:46:38 +01:00
0254d50128 fix(modem): Support for custom modules with C-API
MAJOR CHANGE: Added support for implementing user defined modules in standard C-API
2023-11-02 13:35:07 +01:00
2661b4d28c fix(modem): Fix CRLF issue with esp_modem_c_api.cpp 2023-11-02 13:35:07 +01:00
7c5a832821 Merge pull request #411 from gabsuren/bump_mdns_2
bump(mdns): 1.2.1 -> 1.2.2
2023-11-01 15:15:41 +04:00
0bb72f29be bump(mdns): 1.2.1 -> 1.2.2
1.2.2
Bug Fixes
- add terminator for the getting host name (b6a4d94)
- Enable ESP_WIFI_CONFIG when ESP-IDF <= 5.1 (0b783c0)
- set host list NULL on destroy (ea54eef)
- removed Wno-format flag and fixed formatting warnings (c48e442)
- remove the the range of MDNS_MAX_SERVICES and fix issues of string functions (3dadce2)
2023-11-01 13:27:40 +04:00
ebdac9cc01 Merge pull request #409 from zwx1995esp/fix/mdns_host_name_get
fix(mdns): add terminator for the getting host name
2023-11-01 13:25:15 +04:00
df04b14e2b Merge pull request #386 from gabsuren/fix/mdns_config_issue_2
Enable ESP_WIFI_CONFIG when ESP-IDF <= 5.1 (IDFGH-11221)
2023-10-31 16:11:51 +04:00
zwx
b6a4d94ab0 fix(mdns): add terminator for the getting host name 2023-10-31 19:45:35 +08:00
418791cf79 Merge pull request #408 from euripedesrocha/asio_docs_review
Updates asio docs
2023-10-31 12:08:20 +01:00
ce9337d332 docs(asio): Updates asio docs
- Removes mention to WolfSSL
- Fix links to examples
- Fix diagram markdwon.
2023-10-31 09:24:38 +01:00
0b783c01dd fix(mdns): Enable ESP_WIFI_CONFIG when ESP-IDF <= 5.1 2023-10-30 13:34:51 +04:00
425931a808 Merge pull request #407 from david-cermak/bump/modem_1.0.4
bump(modem): 1.0.3 -> 1.0.4
2023-10-30 09:42:35 +01:00
1b94554f1f bump(modem): 1.0.3 -> 1.0.4
1.0.4
Bug Fixes
- Added USB runner with ESP32S2 with A7670 (edeb936)
- Extend docs on AT client example (1f2ceed)
- Fix pytest exclusion, gitignore, and changelog checks (2696221)
- Fix DTE to post fragments to parsers for USB term (1db1e15)
- Fix DUAL_MODE regression from cb6e03ac (2aada0f)
- Fix AT client example to use custom AT processing (1a5ba98, #352)
2023-10-30 07:30:47 +01:00
924f28e9c4 Merge pull request #373 from david-cermak/fix/at_client
fix(modem): Fix AT client example to use custom AT processing
2023-10-30 07:06:29 +01:00
6a74971d4b Merge pull request #395 from david-cermak/fix/modem_at_client_docs
fix(modem): Extend docs on AT client example
2023-10-30 07:06:05 +01:00
057873c1b5 feat(console): Added runtime component registration support in console_simple_init 2023-10-27 09:38:48 +02:00
11e58dc484 Merge pull request #405 from euripedesrocha/bump_mqtt_cxx
bump(mqtt_cxx): 0.1.0 -> 0.2.0
2023-10-26 14:07:00 +02:00
f795d2fd15 bump(mqtt_cxx): 0.1.0 -> 0.2.0
0.2.0
Features
- configure client authentication via certificate/key or secure element (ee09ff4)
Bug Fixes
- removed Wno-format flag and fixed formatting warnings (c48e442)
- Removes meaningless printf on subscribed handler (#358) (bac742d, #356)
- Removes unused type for configuration (839c79d)
- added idf_component.yml for examples (d273e10)
- Reintroduce missing CHANGELOGs (200cbb3, #235)
Updated
- docs(common): updated component and example links (f48d9b2)
- docs(esp_mqtt_cxx): updated documentation and deployment file (a547ec8)
- docs(common): improving documentation (ca3fce0)
- Add homepage URL and License to all components (ef3f0ee)
2023-10-25 15:35:50 +02:00
2e6732882d Merge pull request #391 from david-cermak/fix/modem_usb_dte
[esp-modem]: Added USB runner with ESP32S2 with A7670
2023-10-24 16:32:52 +02:00
d7d249013f Merge pull request #401 from gabsuren/PR_393
fix(websocket): Return status code correctly on esp_websocket_client (IDFGH-11290)
2023-10-24 16:32:19 +02:00
1f6e7f22ce Merge pull request #399 from euripedesrocha/fix_tag_creation
Fix tag creation
2023-10-24 16:31:14 +02:00
edeb936a5d fix(modem): Added USB runner with ESP32S2 with A7670 2023-10-24 15:57:51 +02:00
ac8f1de187 fix(websocket): Return status code correctly on esp_websocket_client_send_with_opcode 2023-10-24 17:23:57 +04:00
62e3756904 ci(common): Fix tag creation
In case the component needs versioning for the package version, e.g.
asio, the tag needs to be adjusted.
2023-10-24 11:06:52 +02:00
1f2ceedec5 fix(modem): Extend docs on AT client example 2023-10-23 17:08:39 +02:00
a7d981863f Merge pull request #394 from euripedesrocha/update/asio_1_28_0
Update/asio 1 28 0
2023-10-23 14:04:02 +02:00
96b0898f28 bump(asio): 1.14.1~3 -> 1.28.0~0
1.28.0~0
Features
- Updates asio to 1.28 (b310abe)
Bug Fixes
- Makes the examples to override path (842b2b2)
- Removes esp_exception and make all examples to use exceptions (c1c9350)
- removed Wno-format flag and fixed formatting warnings (c48e442)
- added idf_component.yml for examples (d273e10)
- Reintroduce missing CHANGELOGs (200cbb3)
Updated
- docs(common): updated component and example links (f48d9b2)
- docs(common): improving documentation (ca3fce0)
- Add homepage URL and License to all components (ef3f0ee)
- Added badges with version of components to the respective README files (e4c8a59)
- CI: Fix ASIO example test (6e2bb51)
- Examples: using pytest.ini from top level directory (aee016d)
- CI: fixing the files to be complient with pre-commit hooks (945bd17)
2023-10-23 11:01:05 +02:00
5134eedc45 Merge pull request #390 from espressif-abhikroy/common/pytest_gitignore_changelog
fix(common): Fix pytest exclusion, gitignore, and changelog checks
2023-10-23 09:22:41 +02:00
269622170e fix(common): Fix pytest exclusion, gitignore, and changelog checks 2023-10-20 17:28:48 +02:00
1db1e1508d fix(modem): Fix DTE to post fragments to parsers for USB term 2023-10-20 11:54:48 +02:00
3e8de3af3a Merge pull request #371 from gabsuren/feat/ws_client_multiheader_api
feat(websocket): Added new API `esp_websocket_client_append_header` (IDF-7893)
2023-10-16 14:28:51 +04:00
39e972544f feat(websocket): Added new API esp_websocket_client_append_header 2023-10-16 12:27:29 +04:00
9e3c53c27a Merge pull request #376 from david-cermak/bugfix/dte_dual_mode
fix(modem): Fix DUAL_MODE regression from cb6e03ac
2023-10-16 09:25:27 +02:00
f591b7f4c1 Merge pull request #383 from espressif-abhikroy/components/console_simple_init_1
fix(console): Fixed bump version check in publish-docs yml
2023-10-13 15:00:12 +02:00
b6e2ac2a70 bump(console): 1.0.1 -> 1.0.2
1.0.2
Bug Fixes
- Fixed bump version check in publish-docs yml (e834d47)
2023-10-13 12:24:21 +00:00
e834d47577 fix(console): Fixed bump version check in publish-docs yml 2023-10-13 12:08:24 +00:00
ffd3736d84 Merge pull request #381 from gabsuren/feat/fix_console_and_deploy_6
Fixing deployment of console_simple_init finial
2023-10-13 11:08:57 +02:00
a4cb1d9f8e bump(console): 1.0.0 -> 1.0.1
1.0.1
Bug Fixes
- Fixed versioning, publishing and changelog generation (3081f1a69c)
2023-10-13 12:09:55 +04:00
3081f1a69c fix(console): Fixed versioning, publishing and changelog generation 2023-10-13 12:09:31 +04:00
2aada0f308 fix(modem): Fix DUAL_MODE regression from cb6e03ac
In the recent DTE refactoring (cb6e03ac) we install terminal callbacks
in the constructor, but the change missed initializing modem_state
in DTE constructors which take two terminals as arguments to work in
DUAL mode.
2023-10-12 12:50:29 +02:00
93dd56750e Merge pull request #372 from espressif-abhikroy/components/console_simple_init
feat(common): Added simple component for console initialization
2023-10-10 14:58:25 +02:00
1ac4e41771 feat(console): Added simple component for console initialization 2023-10-10 23:46:01 +11:00
e63d4e3bd8 Merge pull request #370 from euripedesrocha/update_asio_128
Update asio to 1.28
2023-10-10 10:48:30 +02:00
b310abef7a feat(asio): Updates asio to 1.28
Updates ASIO version
2023-10-10 10:13:06 +02:00
842b2b22eb fix(asio): Makes the examples to override path
With this changes examples use local version instead of the published
version.
2023-10-10 09:12:32 +02:00
c1c93501b0 fix(asio): Removes esp_exception and make all examples to use exceptions
The usage of esp_exception header defining the exception handler
prevents users to customize the exception treatment. By removing it
we allow users that want to run without exceptions to customize the
behavior.
2023-10-10 09:12:32 +02:00
1a5ba98964 fix(modem): Fix AT client example to use custom AT processing
Need the callback reset upon removal of our custom AT command processing.
This issue has been introduced in cb6e03ac when refactoring DTE
callbacks.

Closes https://github.com/espressif/esp-protocols/issues/352
2023-10-09 17:49:15 +02:00
60d7145630 Merge pull request #364 from adafruit/circuitpython
Fix MDNS free host list (IDFGH-11116)
2023-10-09 14:44:51 +04:00
ea54eef0d0 fix(mdns): set host list NULL on destroy 2023-10-06 09:51:00 -07:00
ea14e15a6f Merge pull request #368 from gabsuren/feature/websocket_new_api
Added new API s to allow fragmented text to be send (IDFGH-10198)
2023-10-03 19:21:40 +04:00
fae80e2f3f feat(websocket): Added new APIs to support fragmented messages transmission
Intoduced new APIs`esp_websocket_client_send_text_partial`,
            `esp_websocket_client_send_bin_partial`
            `esp_websocket_client_send_cont_mgs`
            `esp_websocket_client_send_fin`
            `esp_websocket_client_send_with_exact_opcode`
2023-10-03 18:43:58 +04:00
af1f39e70d Merge pull request #355 from wqx6/mdns_service_limit
fix(mdns): remove the range of MDNS_MAX_SERVICES and fix some issues of str-functions
2023-09-26 19:59:26 +02:00
b8f3423dc0 Merge pull request #367 from david-cermak/test/sim800_cmux
fix(modem): Release v1.0.3: Fixes CMUX on SIM800
2023-09-26 19:56:06 +02:00
4e178735cd bump(modem): 1.0.2 -> 1.0.3
1.0.3
Bug Fixes
- Fix to allow MSC frame (SIM800 CMUX) after v1.0.2 (8d5947e, #366)
- Add CMUX example to target tests (4f2ebaa)
2023-09-26 15:50:42 +02:00
8d5947e5f1 fix(modem): Fix to allow MSC frame (SIM800 CMUX) after v1.0.2
Fixes the regression from 8edbac69 that added more strict conditions
for CMUX protocol, but didn't allow MSC frames that might be sent during
initializaiton by SIM800.

Closes https://github.com/espressif/esp-protocols/issues/366
2023-09-26 15:48:30 +02:00
4f2ebaa753 fix(modem): Add CMUX example to target tests 2023-09-26 15:30:49 +02:00
0db29f28db Merge pull request #365 from david-cermak/bump/esp_modem
bump(modem): 1.0.1 -> 1.0.2
2023-09-26 06:15:37 +02:00
223647e975 Merge pull request #326 from gabsuren/fix/fix_format_warnings
fix(common): removed Wno-format flag and fixed formatting warnings (IDFGH-7768)
2023-09-25 20:54:08 +04:00
c48e44205d fix(common): removed Wno-format flag and fixed formatting warnings 2023-09-25 19:55:44 +04:00
b9bdcf612a bump(modem): 1.0.1 -> 1.0.2
1.0.2
Features
- Add factory method for simple creation of custom DCEs (4cf9e50)
- Support custom transport in AT TCP client example (ae629ed)
Bug Fixes
- Fix host test race with async read and d'structor (c89d42f)
- More error handling in cmux protocol (8edbac6)
- Fix netif to set PPP config in C++ way (5287432)
- Fix vfs terminal not to reset read_cb() automatically (25a35e2)
- Fix netif data race causing PPP startup delays (c8c0507, #308)
- Added support for inflatable buffer (cb6e03a, #272)
- Fix LoadProhibited after failed CMUX initialization (IDFGH-10845) (60c87dd)
2023-09-25 16:20:59 +02:00
19baa7d43e Merge pull request #362 from david-cermak/fix/modem_cmux
fix(modem): More error handling in cmux protocol
2023-09-25 14:38:28 +02:00
c89d42f272 fix(modem): Fix host test race with async read and d'structor
Loopback terminal uses std::async to inject test data to the test
terminal. There was a hazardeous condition when destructing the terminal
while async batch_read() was in progress. Adding a signal and waiting
for destruction solves the issue.
2023-09-25 14:15:48 +02:00
3dadce2d5e fix(mdns): remove the the range of MDNS_MAX_SERVICES and fix issues of string functions 2023-09-22 17:25:23 +08:00
8edbac6974 fix(modem): More error handling in cmux protocol
Add error path to all CMUX protocol potential issues, checks for
consistency and add recovery.
2023-09-22 08:39:31 +02:00
163122ff54 Merge pull request #361 from david-cermak/fix/modem_cosmetic
fix(modem): Update vfs terminal; Removed designated init
2023-09-22 08:37:52 +02:00
4b7d1943ac fix(ci): fix host test failure for esp_modem 2023-09-22 08:00:12 +02:00
bac742df80 fix(mqtt_cxx): Removes meaningless printf on subscribed handler (#358)
Removes the printf since the information isn't in the event.

Closes https://github.com/espressif/esp-protocols/issues/356
2023-09-21 08:42:28 +02:00
5287432197 fix(modem): Fix netif to set PPP config in C++ way
If the config struct contains more items (or more items will be added in
future) this init will not compile cleanly
2023-09-20 11:38:04 +02:00
25a35e20a3 fix(modem): Fix vfs terminal not to reset read_cb() automatically
This change is needed for the fs terminal to work correctly again, after
merging 44bae24c78 which shifted
responsibility of thread safety from a terminal to the DTE. (Before it
was the terminal, which removed this callback safely when processing completed,
and thus we had to check the callback return value). Not the DTE layers
are responsible for thread safety and the return value indicates
success/failure from processing.
Also uses the default clock, the same way as UART terminal.
2023-09-20 11:37:36 +02:00
12bacdc3a0 Merge pull request #359 from euripedesrocha/fix/missing_event_callback_t
fix(mqtt_cxx): Removes unused type for configuration
2023-09-20 08:35:05 +02:00
839c79d460 fix(mqtt_cxx): Removes unused type for configuration
Event type was introduced in the original version and wasn't used in the
code. In 5.1 the leftover type was removed from esp_mqtt breaking this
wrapper.
2023-09-19 12:54:16 +02:00
13b29c2291 Merge pull request #349 from gabsuren/mdns/update_versioin_1_2_1
bump(mdns): 1.2.0 -> 1.2.1
2023-09-07 13:24:52 +04:00
0cb1156480 bump(mdns): 1.2.0 -> 1.2.1
1.2.1
Features
- Allow setting length of mDNS action queue in menuconfig (28cd898)
Bug Fixes
- fix build issue if CONFIG_ESP_WIFI_ENABLED disabled (24f7031)
- added idf_component.yml for examples (d273e10)
- added guard check for null pointer (71bb461)
2023-08-29 16:57:18 +04:00
6c7259fa7a Merge pull request #336 from gabsuren/mdns/fix_build_issue
fix(mdns): fix build issue if CONFIG_ESP_WIFI_ENABLED disabled (IDFGH-9699)
2023-08-29 14:15:01 +04:00
24f7031012 fix(mdns): fix build issue if CONFIG_ESP_WIFI_ENABLED disabled 2023-08-29 13:41:26 +04:00
62d809ac60 Merge pull request #309 from david-cermak/feat/modem_tcp_client_work
feat(modem): Support custom transport in AT TCP client example
2023-08-28 13:43:46 +02:00
b992ef6914 Merge pull request #346 from gabsuren/ci/update_websocket_1.1.0
bump(websocket): 1.0.1 -> 1.1.0
2023-08-28 12:52:37 +04:00
9cc594afaa Merge pull request #312 from david-cermak/fix/minor_modem_refactor
fix(modem): Refactor of DTE callbacks (and other fixes)
2023-08-28 10:49:18 +02:00
4cf9e505e1 feat(modem): Add factory method for simple creation of custom DCEs
This allows calling directly:
auto dce = dce_factory::Factory::create_unique_dce_from<SIM7600>(&dce_config, uart_dte, esp_netif);
instead of:
auto dce = create_SIM7600_dce(&dce_config, uart_dte, esp_netif);
Which is very useful when adding a custom module, so we won't need to
update factory layers and add the new device to enums, etc.
To add a new module, you just:
1) Define the module class NewModule: public GenericModule { };
2) Implement the specific commands:
command_result do_work_new_module(CommandableIf *t, params) {}
3) Connect 1) and 2)
command_result NewModule::do_work_new_module(params...)
{
    return dce_commands::do_work_new_module(dte.get(), params...);
}
2023-08-28 10:27:16 +02:00
c8c05075fb fix(modem): Fix netif data race causing PPP startup delays
Removes PPP_started signal on reception, since lwip handles data
reception if the netif is up/down (which we correctly set in start()
stop() methods)

Closes https://github.com/espressif/esp-protocols/issues/308
2023-08-28 10:27:16 +02:00
cb6e03ac62 fix(modem): Added support for inflatable buffer
As a configurable option, if disabled we report an error.

Closes https://github.com/espressif/esp-protocols/issues/272
2023-08-28 10:27:10 +02:00
2e42b9bb49 Merge pull request #347 from gabsuren/fix/websocket_fix_ci
fix(websocket): fix of websocket coverage report generation
2023-08-28 11:30:20 +04:00
86f7a8bbe3 Merge pull request #343 from victorrar/dev/IDFGH-10845
Fix LoadProhibited after failed CMUX initialization
2023-08-28 09:14:45 +02:00
7b5a41deea fix(websocket): fix of websocket coverage report generation 2023-08-22 19:42:14 +04:00
38d50eede0 bump(websocket): 1.0.1 -> 1.1.0
1.1.0
Features
- Added linux port for websocket (a22391a)
Bug Fixes
- added idf_component.yml for examples (d273e10)
2023-08-22 14:26:12 +04:00
27303d28b2 Merge pull request #345 from gabsuren/fix/example_component_manager
fix(common): added idf_component.yml for examples
2023-08-22 14:04:32 +04:00
d273e10819 fix(common): added idf_component.yml for examples 2023-08-22 13:55:10 +04:00
60c87ddf26 fix(modem): Fix LoadProhibited after failed CMUX initialization (IDFGH-10845) 2023-08-18 12:44:37 +03:00
a95891e211 fix(common): Bump espressif/check-copyright version for PyYAML fix 2023-08-18 12:42:23 +03:00
411dced3e2 Merge pull request #334 from gabsuren/mdns/fix_null_pointer
fix(mdns): added guard check for null pointer (IDF-7449)
2023-08-17 21:01:52 +04:00
d4925f2bd6 fix(modem): Per review comments 2023-08-17 13:17:20 +02:00
ae629ed3a9 feat(modem): Support custom transport in AT TCP client example 2023-08-17 13:11:51 +02:00
42fe60828f Merge pull request #342 from gabsuren/ci/fix_workflow_run
ci(common): start coverage publish action only against master branch
2023-08-16 11:36:30 +04:00
36899f1135 Merge pull request #340 from gabsuren/docs/updated_doc
docs(common): updated README regarding esp-idf integration
2023-08-15 17:32:55 +04:00
0714e100ee ci(common): start coverage publish action only against master branch 2023-08-12 17:54:55 +04:00
cbfee945a0 docs(common): updated README regarding esp-idf integration 2023-08-11 15:46:05 +04:00
71bb461ed8 fix(mdns): added guard check for null pointer 2023-08-03 13:53:17 +04:00
5143f5ac01 Merge pull request #310 from gabsuren/feat/websocket_linux_port_component
feat(websocket): Added linux port for websocket (IDF-7097)
2023-07-27 11:07:06 +04:00
7e83741615 Merge pull request #330 from gabsuren/websocket/release_1.0.1
bump(websocket): 1.0.0 -> 1.0.1
2023-07-25 14:29:08 +04:00
b880fc0367 bump(websocket): 1.0.0 -> 1.0.1
1.0.1
Bug Fixes
- esp_websocket_client client allow sending 0 byte packets (b5177cb)
- Cleaned up printf/format warnings (-Wno-format) (e085826)
- Added unit tests to CI + minor fix to pass it (c974c14)
- Reintroduce missing CHANGELOGs (200cbb3, #235)
Updated
- docs(common): updated component and example links (f48d9b2)
- docs(common): improving documentation (ca3fce0)
- Fix weird error message spacings (8bb207e)
2023-07-25 13:55:59 +04:00
f6d5186e5b Merge pull request #325 from gabsuren/docs/link_fix_esp_modem
docs(modem): Update Doxyfile to generate correct docs links
2023-07-19 12:05:56 +04:00
8eb3a0feea Merge pull request #324 from gytxxsy/feature/set_ation_queue_len_in_kconfig
feat(mdns): Allow setting length of mDNS action queue in menuconfig
2023-07-18 13:40:36 +02:00
28cd898eca feat(mdns): Allow setting length of mDNS action queue in menuconfig 2023-07-18 19:09:16 +08:00
a22391ae2c feat(websocket): Added linux port for websocket 2023-07-18 14:18:39 +04:00
f5a0d5fb40 docs(modem): Update Doxyfile to generate correct docs links 2023-07-17 11:18:51 +04:00
ecc465daa3 Merge pull request #321 from gabsuren/mdns/release_1.2.0
bump(mdns): 1.1.0 -> 1.2.0
2023-07-04 12:24:13 +04:00
181b6e4013 bump(mdns): 1.1.0 -> 1.2.0
1.2.0
Features
- add an API for setting address to a delegated host (ddc3eb6)
- Add support for lwip build under linux (588465d)
- Allow for adding a delegated host with no address (c562461)
- Add APIs for looking up self hosted services and getting the self hostname (f0df12d)
Bug Fixes
- Refactor freertos linux compat layers (79a0e57)
- Fix delegated service PTR response (cab0e1d)
- Added unit tests to CI + minor fix to pass it (c974c14)
Updated
- docs: update documentation links (4de5298)
2023-07-04 11:56:33 +04:00
40e3875f76 Merge pull request #315 from zwx1995esp/feature/add_delegate_host_addr_set
feat(mdns): add an API for setting address to a delegated host
2023-07-04 10:54:35 +04:00
ddc3eb62d0 feat(mdns): add an API for setting address to a delegated host 2023-06-29 21:57:39 +08:00
3625889049 Merge pull request #286 from david-cermak/feat/example_multiple_netifs
feat(examples): Add multiple netif demo: eth+wifi+PPP
2023-06-28 17:49:32 +02:00
2bd6163ec8 ci(common): Introduce global warning list file 2023-06-28 16:49:37 +02:00
f1eb46580e feat(examples): Add build/host tests to examples 2023-06-28 12:59:48 +02:00
1c20328dcf feat(examples): Support simple PPP connect in multinet example 2023-06-28 12:59:44 +02:00
6de22f3893 Merge pull request #314 from david-cermak/fix/issue_template
Update issue template with correct docs links
2023-06-27 17:40:36 +02:00
e280b3b541 docs(common): Update issue template with correct docs links 2023-06-26 10:33:16 +02:00
00d7c40848 feat(examples): Add multiple netif demo: eth+wifi+PPP 2023-06-22 11:49:59 +02:00
4f1769ec71 Merge pull request #311 from david-cermak/fix/modem_known_issues
docs(modem): Add known issues section to docs
2023-06-22 10:57:54 +02:00
20dd910b3a bump(modem): 1.0.0 -> 1.0.1
1.0.1
Bug Fixes
- Support UART clean build with IDF v5.2 (e620eb5)
- enable code coverage publishing to github pages (4910e89)
- fix esp_modem build issue (ab94566)
- Example to use 1.0.0 (afb6930)
- Changelog to correctly pick references (423e965)
Updated
- docs(esp_modem): updated documents to show missed topics (0534853)
- docs(common): improving documentation (ca3fce0)
2023-06-22 09:50:23 +02:00
3635e2fabc docs(modem): Add known issues section to docs
Also updates self-hosted runner tag (from runner name to test scope
related tag)
2023-06-21 10:43:27 +02:00
84035d8f3b Merge pull request #265 from david-cermak/feat/linux_port_component
examples: Add simple mqtt client demo running on linux
2023-06-20 16:23:15 +02:00
e620eb5fb1 fix(modem): Support UART clean build with IDF v5.2 2023-06-20 15:56:57 +02:00
7d4755f119 fix(common): Improve linux port 2023-06-20 15:15:37 +02:00
588465d9db feat(examples): Add support for lwip build under linux 2023-06-20 15:15:37 +02:00
c443326a34 feat(examples): Add example of using mqtt client on linux 2023-06-20 15:15:37 +02:00
79a0e57ca1 fix(mdns): Refactor freertos linux compat layers
Move it to a separate component that could be shared by multiple network
libs.
2023-06-20 15:15:37 +02:00
68392f0ba9 Merge pull request #301 from zwx1995esp/fix/delegated_service_PTR_response
fix(mdns): Fix delegated service PTR response (IDFGH-10237)
2023-06-01 23:38:56 +02:00
a67cbbcab9 Merge pull request #278 from gabsuren/fix/websocket_client_zero_byte
fix(websocket): esp_websocket_client client allow sending 0 byte packets (IDFGH-9316)
2023-06-01 20:12:43 +04:00
b5177cb23a fix(websocket): esp_websocket_client client allow sending 0 byte packets 2023-06-01 15:32:18 +04:00
cab0e1d10e fix(mdns): Fix delegated service PTR response 2023-06-01 19:01:54 +08:00
fbc79a846b Merge pull request #302 from gytxxsy/feature/allow_add_host_without_addr
mdns: allow for adding a delegated host with no address (IDFGH-10246)
2023-05-30 22:10:01 +02:00
a50f91f422 Merge pull request #296 from gabsuren/fix/enable_coverage_modem
fix(ci): enable code coverage publishing to github pages
2023-05-29 21:51:49 +04:00
4910e89249 fix(ci): enable code coverage publishing to github pages 2023-05-26 13:46:52 +04:00
c562461711 feat(mdns): Allow for adding a delegated host with no address 2023-05-26 14:03:22 +08:00
8b9c957fe0 Merge pull request #295 from wqx6/mdns/lookup_selfhosted_services
mdns: Add APIs for looking up self hosted services and getting the self hostname (IDFGH-10130)
2023-05-18 07:15:59 +02:00
f0df12dad3 feat(mdns): Add APIs for looking up self hosted services and getting the self hostname 2023-05-18 12:25:50 +08:00
9637517192 Merge pull request #298 from david-cermak/bugfix/improve_ci
fix(websocket): Add unit tests to the workflow
2023-05-17 16:07:33 +02:00
e085826dbb fix(websocket): Cleaned up printf/format warnings (-Wno-format) 2023-05-17 07:35:21 +02:00
c974c14220 fix(websocket): Added unit tests to CI + minor fix to pass it 2023-05-17 07:14:48 +02:00
247baeed22 Merge pull request #297 from david-cermak/bugfix/improve_ci
websocket(ci): Add IDF v5.1 in IDF tests for websockets
2023-05-16 16:17:04 +02:00
613d67d1cf fix(ci): Add IDF v5.1 in IDF tests for websockets 2023-05-16 12:26:33 +02:00
441f79022e Merge pull request #293 from gabsuren/docs/update_modified_links
docs: update documentation links
2023-05-15 11:20:42 +04:00
4de52981cb docs: update documentation links 2023-05-12 12:21:55 +04:00
ef1c5eb28a Merge pull request #292 from david-cermak/fix/mdns_host_test
fix(mdns): Run host test against v5.1 instead of latest IDF
2023-05-10 10:22:58 +02:00
9a3aa1d23f Merge pull request #291 from david-cermak/fix/upload_component_action
ci(common): Use upload-components-ci-action workflow action
2023-05-10 10:11:25 +02:00
64b0e4ef1a fix(mdns): Run host test against v5.1 instead of latest IDF 2023-05-10 06:51:42 +02:00
fcff00740a ci(common): Use upload-components-ci-action workflow action 2023-05-09 22:18:09 +02:00
1102133458 Merge pull request #290 from david-cermak/fix/deploy_docs
ci(common): Fix build and deploy docs jobs
2023-05-09 20:11:27 +02:00
4f54c49912 ci(common): Fix build and deploy docs jobs 2023-05-09 17:24:21 +02:00
910f6ffadc Merge pull request #289 from david-cermak/fix/ci_publish
ci(common): Update component version only if tag doesn't exist
2023-05-09 15:38:14 +02:00
9836a8620f ci(common): Update component version only if tag doesn't exist
If the merged PR is a few commits behind master, the merge commit could
show changes in the version files as well. This fix checks if the
version already exists and updates the envirionment only if the tag
is not present.
2023-05-09 15:26:50 +02:00
af0ed62ecf Merge pull request #282 from gabsuren/docs/deploy_on_version_change
docs(common): deploy docs if component version get changed
2023-05-09 07:12:38 +02:00
217a96a2e4 docs(common): deploy docs if component version got changed 2023-05-05 18:21:18 +04:00
6a94e61a7e Merge pull request #288 from david-cermak/bump/mdns
bump(mdns): 1.0.9 -> 1.1.0
2023-04-28 20:36:35 +02:00
c8fe4092c4 bump(mdns): 1.0.9 -> 1.1.0
1.1.0
Features
- Decouple main module from mdns-networking (d238e93)
Bug Fixes
- Use idf-build-apps package for building mdns (1a0a41f)
- socket networking to init interfaces properly (ee9b04f)
- Removed unused internal lock from mdns_server struct (a06fb77)
- Resolve conflicts only on self hosted items (e69a9eb, #185)
- Fix memory issues reported by valgrind (0a682e7)
Updated
- docs(common): updated component and example links (f48d9b2)
- Add APIs to look up delegated services (87dcd7d)
- Fix deadly mdns crash (4fa3023)
- docs(common): improving documentation (ca3fce0)
- append all ipv6 address in mdns answer (5ed3e9a)
- test(mdns): Host tests to use IDF's esp_event_stub (537d170)
2023-04-28 19:32:47 +02:00
31187b7d17 Merge pull request #283 from espressif/esp_modem/fix_build
fix(esp_modem): fix esp_modem build issue
2023-04-27 20:31:19 +04:00
ab94566995 fix(esp_modem): fix esp_modem build issue 2023-04-27 12:25:59 +04:00
f67511c2c1 Merge pull request #275 from gabsuren/docs/esp_modem_docs
docs(esp_modem): updated documents to show missed topics
2023-04-27 10:56:12 +04:00
05348534a6 docs(esp_modem): updated documents to show missed topics 2023-04-26 16:24:30 +04:00
18ea910f02 Merge pull request #279 from david-cermak/feat/auto_tag
ci(common): Support for tagging and releasing in CI
2023-04-25 16:31:11 +02:00
62be981c92 ci(common): Fail CI if the PR to too much behind origin
And removes the docs generation/deploy part
2023-04-25 16:27:05 +02:00
6daf6c6ba6 ci(common): Support for tagging and releasing in CI 2023-04-25 13:54:44 +02:00
b0d3b41aae Merge pull request #277 from gabsuren/docs/update_links
docs(common): updated component and example links
2023-04-20 12:01:22 +04:00
f48d9b2fcf docs(common): updated component and example links 2023-04-19 11:58:05 +04:00
6c299c068b Merge pull request #274 from david-cermak/bugfix/ci_mdns_all_targets
mdns: Build all targets and releases
2023-04-18 10:38:46 +02:00
ea5d3cee29 Merge pull request #268 from wqx6/search_delegated_service
mdns: Add APIs to lookup delegated services (IDFGH-9790)
2023-04-18 10:38:27 +02:00
7330597586 Merge pull request #270 from 0xFEEDC0DE64/fix_mdns_crash
Fix deadly mdns crash (IDFGH-9800)
2023-04-18 10:37:11 +02:00
1a0a41fa2d fix(mdns): Use idf-build-apps package for building mdns 2023-04-17 13:44:18 +02:00
2f7cbd16db ci(common): Fix pre-commit manual run 2023-04-17 13:43:14 +02:00
87dcd7dc7d mdns: Add APIs to look up delegated services 2023-04-17 19:35:41 +08:00
8e5a27f4b7 docs: fixed broken link in README.md 2023-04-10 18:38:23 +04:00
6528f446bc docs: fixed broken link on README.md 2023-04-07 16:43:43 +04:00
4fa3023ea2 Fix deadly mdns crash 2023-04-05 16:13:07 +02:00
10f8200564 Merge pull request #267 from gabsuren/esp_mqtt_cxx/updated_docs_and_yml_file
docs(esp_mqtt_cxx): updated documentation and deployment *yml file
2023-04-05 11:51:28 +04:00
a547ec8147 docs(esp_mqtt_cxx): updated documentation and deployment file 2023-04-05 11:42:59 +04:00
db0e20f446 Merge pull request #256 from gabsuren/docs/documentation_improving
docs: Improving documentation (IDF-7064)
2023-03-31 12:07:09 +04:00
ca3fce003e docs(common): improving documentation
- update esp_modem to use esp_docs
- migrated docs from github pages to docs.espressif.com
2023-03-31 12:04:46 +04:00
f6ff132eb1 Merge pull request #259 from 0xFEEDC0DE64/fix_websocket_error_spacings
Fix weird error message spacings (IDFGH-9704)
2023-03-23 17:57:12 +01:00
8bb207e9bb Fix weird error message spacings 2023-03-23 11:44:51 +01:00
76047a4cc6 Merge pull request #137 from david-cermak/mdns/isolate_networking
mdns: Decouple networking from the main mdns module
2023-03-22 14:40:49 +01:00
ee9b04f598 fix(mdns): socket networking to init interfaces properly 2023-03-22 12:17:09 +01:00
d238e9311b feat(mdns): Decouple main module from mdns-networking
Removed sharing the data via the global variable `_mdns_server`, added
API `mdns_is_netif_ready()`
2023-03-22 12:16:28 +01:00
a838af46a6 Merge pull request #251 from xieqinan/feature/append-all-ipv6-address-in-mdns-answer
mdns: append all ipv6 address in mdns answer (IDFGH-9646)
2023-03-22 08:16:38 +01:00
5ed3e9a6a1 mdns: append all ipv6 address in mdns answer 2023-03-22 12:00:38 +08:00
5b3346f5c5 Merge pull request #225 from david-cermak/bugfix/mdns_wrong_name_collision
fix(mdns): Incorrect name collision
2023-03-20 17:24:47 +01:00
a06fb7714b fix(mdns): Removed unused internal lock from mdns_server struct 2023-03-20 16:55:49 +01:00
e69a9ebb3d fix(mdns): Resolve conflicts only on self hosted items
Skip solving conflicts for delegated names and delegated services

Closes https://github.com/espressif/esp-protocols/issues/185
2023-03-20 16:55:49 +01:00
2e607e8ffb Merge pull request #257 from david-cermak/fix/mdns_valgrind
fix(mdns): Fix memory issues reported by valgrind
2023-03-20 16:49:36 +01:00
0a9765626b Merge pull request #255 from david-cermak/feat/modem_cz_bump
esp_modem: version 1.0.0 (plus cz-bump config)
2023-03-20 12:33:32 +01:00
537d170f1d test(mdns): Host tests to use IDF's esp_event_stub
Also fixes one minor from esp_netif_linux implementation
2023-03-20 12:17:36 +01:00
0a682e7f12 fix(mdns): Fix memory issues reported by valgrind
* Read after the allocated area (which may lead to subsequent
mdns name corruption)
* Potentially uninit variable used in condition
2023-03-19 20:58:10 +01:00
afb69308df fix(modem): Example to use 1.0.0 2023-03-16 20:47:59 +01:00
284cdeb2ed Merge pull request #254 from lhauswald/feature/mqtt_client_certificate
MQTT: complete client authentication configuration (IDFGH-9656)
2023-03-16 20:35:23 +01:00
97d52495d4 bump(modem): 0.1.28 -> 1.0.0 2023-03-16 20:19:00 +01:00
423e965c88 fix(common): Changelog to correctly pick references
Also added .cz config for modem components
2023-03-16 20:19:00 +01:00
e762ada551 Merge pull request #156 from david-cermak/feature/modem_example_at_mqtt
feat(esp_modem): Add mqtt example in  AT-only mode
2023-03-16 20:17:32 +01:00
31d4323f53 fix(modem): AT-only example: support MQTT over TLS on BG96 2023-03-16 19:49:10 +01:00
97831c62b1 fix(modem): AT-only example: added into CI 2023-03-16 19:48:34 +01:00
ceedcfca23 fix(modem): AT-only example: initial adaptation to BG96
Plus rework a little to support implementation of multiple devices
2023-03-16 19:45:43 +01:00
7547267336 feat(modem): Add mqtt example in AT-only mode
Similar to pppos-client, but without PPP mode.
This uses standard mqtt client and a loopback service that forwards the
TCP traffic from localhost to the modem and vice-versa.
(next step is to create a dedicated tcp-transport layer for modem)
Console example uses DCE commandable to demontrate how to handle URC
2023-03-16 19:42:29 +01:00
bf114d3624 feat(modem): DTE to support sending and receiving raw data
MAJOR CHANGE: Enable DTE to redefine on_read() and write(cmd) directly
2023-03-16 19:39:13 +01:00
574738b8d3 Merge pull request #252 from tore-espressif/feature/esp_modem/usb_examples
esp_modem: Update examples for USB v1.1
2023-03-16 13:32:29 +01:00
ee09ff45e5 feat(mqtt_cxx): configure client authentication via certificate/key or secure element 2023-03-16 09:42:43 +01:00
895a72b27d Merge pull request #249 from david-cermak/feat/cz_bump
mdns: Bump config to auto-generate change log
2023-03-16 09:40:45 +01:00
bf32e452d6 fix(modem): warning in ap-2-pppos example when using lwip/napt
Latest IDF added new napt API that support enabling NAPT based on netif
pointer. Need to include "lwip/netif.h"
2023-03-16 09:26:30 +01:00
4c7720a2c1 ci(common): Run all test on push event
Added a description about the release process to the contributing guide
2023-03-16 08:56:18 +01:00
c92ce075fd bump(mdns): 1.0.8 -> 1.0.9 2023-03-16 08:18:33 +01:00
f29719fa0b ci(common): force scoping commit messages with components
Add simple changelog generator and mdns tag formatter
2023-03-16 08:18:33 +01:00
2d1990614a Merge pull request #253 from david-cermak/bufix/precommit_check_only_pr
fix(ci): Run pre-commit checker only on PRs
2023-03-15 19:27:01 +01:00
2863e94a11 fix(ci): Run pre-commit checker only on PRs
Regression from a089e0d680 Merged as https://github.com/espressif/esp-protocols/pull/242
2023-03-15 19:11:27 +01:00
ba45e9a07e Merge pull request #242 from david-cermak/bugfix/modem_strip_idf_4.1
fix(esp_modem): run CI build job for all targets
2023-03-15 18:55:26 +01:00
610372f5a7 esp_modem: Update examples for USB v1.1 2023-03-15 17:13:37 +01:00
13eca128fb fix(ci): trigger PR jobs based on labels 2023-03-15 15:38:06 +01:00
c492d87316 Merge pull request #247 from david-cermak/fix/add_missing_changelogs
fix(common): Reintroduce missing CHANGELOGs
2023-03-13 19:38:15 +01:00
200cbb3383 fix(common): Reintroduce missing CHANGELOGs
Closes https://github.com/espressif/esp-protocols/issues/235
2023-03-13 12:58:25 +01:00
a96f17d9a1 Merge pull request #236 from gabsuren/CI/conventional_commits
ci: added conventionl commit pre-commit hook
2023-03-10 18:56:26 +01:00
cbda15724c ci: regroup tests per components and purpose 2023-03-08 17:33:48 +01:00
d0814bf963 fix(esp_modem): Use default UART CLK source
Some targets don't support UART_SCLK_APB (e.g. esp32c2)
This change is applicable only for IDFv5.0 and later, as older version
didn't define UART_SCLK_DEFAULT.

Closes https://github.com/espressif/esp-protocols/issues/241
2023-03-08 11:51:31 +01:00
a089e0d680 fix(esp_modem): run CI build job for all targets
Also
* removed IDFv4.1 from tests
* added common build_apps.py utility for finding/building apps
2023-03-08 11:51:25 +01:00
ef4985cce6 Merge pull request #243 from tore-espressif/feature/esp_modem/dual_dte
esp_modem: Dual DTE support
2023-03-08 11:01:16 +01:00
01c26c82fa esp_modem: Dual DTE support
Modems can expose 2 terminals, which can be used simultaneously.
One for AT commands, the other one for data.
2023-03-07 13:35:34 +01:00
08f1f0175d Merge pull request #228 from gabsuren/CI/update_websocket_version
websocket: Updated version to 1.0.0
2023-03-06 12:36:30 +04:00
a6817e0c7f ci: Add conventionl commit pre-commit hook 2023-03-03 12:38:27 +04:00
a2050ac041 Merge pull request #233 from tom-borcin/feature/add_issue_templates
Add issue templates
2023-03-02 17:19:59 +01:00
6015c19c31 Merge pull request #239 from kumekay/feature/add_url_license
Add homepage URL and License to all components (IDFGH-9521)
2023-03-02 17:17:00 +01:00
5df8fdb713 Add input for component version 2023-03-02 15:38:10 +01:00
ef3f0ee688 Add homepage URL and License to all components 2023-03-02 12:35:17 +01:00
996fef7fcf esp_websocket_client: Updated version to 1.0.0
Updated tests to run agains release-v5.0
2023-02-28 19:00:46 +04:00
9f87a8ca77 Add issue templates 2023-02-24 15:53:31 +01:00
3bf0511938 Merge pull request #216 from gabsuren/feature/websocket-errorhandling
esp_websocket_client: Improve error handling (IDFGH-8444)
2023-02-24 07:35:41 +01:00
319fce018e Merge pull request #231 from tore-espressif/fix/esp_modem/on_data_cb
esp_modem: Return true from on_data callback in data mode
2023-02-24 07:34:20 +01:00
44bae24c78 esp_modem: Return true from on_data callback in data mode
The callback should return false only if there is a problem with the received data.
The updated UART Terminal implementation cannot longer clear is callback.
It is DTE's responsibility to clear the callback.
2023-02-23 20:32:13 +01:00
d047ff569c esp_websocket_client:
* Error handling improved to show status code from server
* Added new API `esp_websocket_client_set_headers`
* Dispatches 'WEBSOCKET_EVENT_BEFORE_CONNECT' event before tcp connection
2023-02-22 11:41:33 +04:00
02be2b76f8 Merge pull request #227 from gabsuren/docs/mdns_document_link_fix
docs: fix of mdns link translation
2023-02-20 16:19:30 +04:00
1c850ddacf docs: fix of mdns link translation 2023-02-20 16:11:24 +04:00
9ae88aab48 Merge pull request #223 from AndriiFilippov/master
Unite all tags under common structure (IDFGH-9399)
2023-02-17 15:08:18 +01:00
c6db3ea84c unite all tags under common structure
py test: update tags under common structure
2023-02-17 14:27:34 +01:00
b23eedac3a Merge pull request #189 from euripedesrocha/master
Adds esp_mqtt_cxx component
2023-02-16 06:17:08 -03:00
1407dfc2e7 Adds esp_mqtt_cxx component
- Component moved from esp-idf
- Files moved to adjust to esp-protocol structure
2023-02-16 09:59:46 +01:00
34c6f52f70 build system: re-add -Wno-format as private flag for some example components 2023-02-15 10:26:19 +01:00
c674b8855d [MQTT] - Updates esp_mqtt configuration struct
- Layered config struct
- Fix examples.
2023-02-15 10:26:19 +01:00
256389613f docs: changes docs supported targets tables 2023-02-15 10:26:19 +01:00
2865255ec0 examples, components: remove C/C++ standard overrides
...where they are not necessary after switching to C17 and C++20.
2023-02-15 10:26:19 +01:00
7b2470ddd6 ci: partially enable example build for esp32c2 2023-02-15 10:26:19 +01:00
dda2722563 tools: Increase the minimal supported CMake version to 3.16
This updates the minimal supported version of CMake to 3.16, which in turn enables us to use more CMake features and have a cleaner build system.
This is the version that provides most new features and also the one we use in our latest docker image for CI.
2023-02-15 10:26:19 +01:00
36db37ea2b examples/cxx: add missing header 2023-02-15 10:26:19 +01:00
4f013e3522 Build & config: Remove leftover files from the unsupported "make" build system 2023-02-15 10:26:19 +01:00
231392d0c6 experimental/mqtt_cxx: Adds a C++ Mqtt client wrapper
- Base class with separated event handlers for each Mqtt client event.
- Topic matcher added to support data events.
- Filter class to allow only mqtt valid topic filters.
- Initial code for unit test on the host.
2023-02-15 10:26:19 +01:00
9fb01ca534 Merge pull request #219 from david-cermak/feat/mdns_reverse_query_ip6
feat(mdns): Add support for IPv6 reverse query
2023-02-15 08:07:17 +01:00
d464ed7d30 feat(mdns): Add reverse lookup to the example and test 2023-02-15 07:48:04 +01:00
b94a211e4b Merge pull request #222 from boborjan2/mdns_task_notification
components/mdns: use semaphore instead of task notification bits (IDFGH-9380) (IDFGH-9388)
2023-02-15 07:12:26 +01:00
73f2800b59 components/mdns: use semaphore instead of task notification bits (IDFGH-9380)
Component should not alter the task notification bits of the calling task.
2023-02-14 11:43:02 +01:00
e00e056162 Merge pull request #215 from ESP-YJM/feat/add_auth_for_websocket
websocket: Support HTTP basic authorization
2023-02-10 17:29:31 +04:00
1b134486db websocket: Support HTTP basic authorization 2023-02-09 15:09:40 +08:00
7ba1085e9f Merge pull request #32 from 0xFEEDC0DE64/websocketclient-errormsg
Add websocket client error message string (IDFGH-7591)
2023-02-08 16:11:38 +01:00
3bdb2067e0 Merge pull request #218 from 0xFEEDC0DE64/add_task_name
Add task_name config option (for websocket client) (IDFGH-9346)
2023-02-08 16:10:05 +01:00
1d6888445d Add task_name config option 2023-02-08 15:52:03 +01:00
d68624ec4f Add websocket error messages 2023-02-08 15:35:01 +01:00
d4825f5c53 feat(mdns): Add support for IPv6 reverse query
Implements reverse querries together with
b87bef52e5 (IPv4)

Closes https://github.com/espressif/esp-protocols/issues/101
2023-02-07 20:16:26 +01:00
de1480a072 Merge pull request #217 from david-cermak/mdns/bump_component_version
mdns: bump the component version to 1.0.8
2023-02-06 20:13:17 +01:00
b9b4a75000 mdns: bump the component version to 1.0.8 2023-02-06 15:43:01 +01:00
cc259aa035 Merge pull request #203 from david-cermak/feat/mdns_reverse_query
feat(mdns): Add support for IPv4 reverse query
2023-02-03 15:21:38 +01:00
91134f10ff mdns: Make reverse query conditional per Kconfig
and auto-register reverse logical names
2023-02-02 10:32:01 +01:00
fb8a2f0198 fix(mdns): Host test with IDFv5.1 2023-02-02 10:31:01 +01:00
b87bef52e5 feat(mdns): Add support for IPv4 reverse query
Partially addresses https://github.com/espressif/esp-protocols/issues/101
2023-02-02 10:31:00 +01:00
28813148b2 Merge pull request #211 from gabsuren/websocket/add_new_api_esp_destroy_selected
websocket: Added new API `esp_websocket_client_destroy_on_exit` (IDF-6458)
2023-02-01 18:00:30 +04:00
ae38f27997 Merge pull request #206 from david-cermak/bugfix/mdns_unit_tests
fix(mdns): Make unit test executable with pytest
2023-02-01 12:28:52 +01:00
d0c9070715 fix(mdns): Remove strict mode as it's invalid
Strict mode was introduced to support "one-shot" queries (described in
RFC6762/sec5.1) that are sent by lwip or dig. It was incorrectly assumed
that responding to such queries violates the spec, as we have to repeat
queries in responces, which is forbidden in RFC6762/sec6. It is however
required to repeat query fields according to the Section 6.7. Legacy
Unicast Responses: "it MUST repeat the query ID and the question
given in the query message."
2023-01-31 16:06:52 +01:00
a8339e4618 fix(mdns): Allow setting instance name only after hostname set
Closes https://github.com/espressif/esp-protocols/issues/190
2023-01-31 16:06:52 +01:00
12cfcb5aed fix(mdns): Make unit test executable with pytest 2023-01-31 16:06:52 +01:00
2cfffb056e Merge pull request #214 from david-cermak/bugfix/modem_cxx_broken_components
fix(esp_modem): Fix cmux client compilation issue
2023-01-31 14:42:46 +01:00
0247926219 fix(mdns): AFL port layer per IDF-latest changes 2023-01-31 11:15:06 +01:00
05fff94b91 update(esp_modem): Bump component version to 0.1.26
Closes https://github.com/espressif/esp-protocols/issues/213
Closes https://github.com/espressif/esp-protocols/issues/212
2023-01-31 11:02:52 +01:00
8958d5e37c fix(esp-modem): Example to use variable mqtt topic/data
This example is used in the CI with public broker and
users playing with the example can influence stability
of tests if we share the same topic id
2023-01-31 11:02:52 +01:00
f71192b876 fix(esp_modem): Fix cmux client compilation issue
Removed dependency on esp_event_cxx
2023-01-30 15:30:48 +01:00
f9b47900f2 websocket: Added new API esp_websocket_client_destroy_on_exit 2023-01-24 22:29:09 +04:00
0e215b118f Added the missing definition for the esp_modem_set_baud function (IDFGH-9181) (#209)
fix(esp_modem): Added the missing definition for the esp_modem_set_baud function
2023-01-19 13:57:06 +01:00
dc8b916561 Merge pull request #205 from gabsuren/docs/fix_documentation
docs: Disable code coverage report publishing to Github Pages
2023-01-13 17:54:04 +04:00
a01096f621 docs: Disable code coverage report publishing to Github Pages 2023-01-13 17:30:33 +04:00
3de4727385 Merge pull request #202 from gabsuren/CI/minor_fix_ci
CI: minor fix of host test *yml file
2023-01-12 20:02:12 +01:00
59053b8c98 CI: minor fix of host test *yml file 2023-01-09 22:09:53 +04:00
2956477353 Merge pull request #196 from gabsuren/CI/gcovr_analyser
CI: Added coverage analyzer for esp_modem host tests
2023-01-09 14:09:11 +01:00
1d9b6f7e90 Merge pull request #199 from franz-ms-muc/patch-1
Update esp_modem_command_library.cpp (IDFGH-9018)
2023-01-04 12:30:45 +01:00
6b684ceb0f CI: Added coverage analyzer for esp_modem host tests 2022-12-30 13:11:59 +04:00
5304a6ec0e Update esp_modem_command_library.cpp
AT+IFC=2,2 instead AT+IFC=2, 2
2022-12-22 11:55:37 +01:00
c7f20ee98e Merge pull request #191 from gabsuren/CI/refactor_yml_files
CI: Minor refactoring of *yml files for the target tests
2022-12-16 11:32:14 +04:00
7d47ec3b6b Merge pull request #192 from XDanielPaul/master
Added badges with version of components to the respective README files (IDFGH-8940)
2022-12-14 12:47:48 +01:00
e4c8a5932c Added badges with version of components to the respective README files 2022-12-12 18:13:04 +01:00
b56b1c577b CI: Minor refactoring of *yml files for target tests 2022-12-12 12:31:44 +04:00
4e212c31fe Merge pull request #182 from david-cermak/feat/modem_target_test
feat(esp_modem): Added target test
2022-12-09 15:26:26 +01:00
9a7bd90ad9 fix(esp_modem): Exit data mode only after state change
Previously, we set the notification also for  event
causing permature PPP mode exit
2022-12-01 18:35:06 +01:00
4314c78ca0 feat(esp_modem): Added target test 2022-12-01 18:35:01 +01:00
457f8335bb Merge pull request #169 from david-cermak/feat/modem_dce_on_read
fix(esp-modem): Extend CMUX mode to support manual transitions
2022-11-23 20:24:26 +01:00
42565ff5d7 Merge pull request #177 from gabsuren/CI/asio_fix
CI: Fix ASIO example test
2022-11-23 20:23:20 +01:00
6e2bb518fd CI: Fix ASIO example test 2022-11-23 19:07:26 +04:00
2180ab17d8 fix(esp-modem): Support AT with callback in C-API
Closes https://github.com/espressif/esp-protocols/issues/143
2022-11-21 14:58:15 +01:00
ac5d43882b feat(esp-modem): Add support for manual CMUX operations
Closes https://github.com/espressif/esp-protocols/issues/168
2022-11-21 14:58:15 +01:00
3f0262dfe5 Merge pull request #176 from gabsuren/CI/flake_use_github
CI: Updated flake8 to use github repo
2022-11-21 14:41:43 +01:00
74787c9aa8 CI: Updated flake8 to use github repo 2022-11-21 16:31:20 +04:00
045009bb82 Merge pull request #173 from mahavirj/bugfix/some_issue_with_coverity_scan
mdns: fix some coverity reported issues
2022-11-07 15:11:08 +01:00
79c11e9ecd Merge pull request #171 from gabsuren/feature/make_public_websocket_client_send_with_opcode
websocket: make `esp_websocket_client_send_with_opcode` a public API (IDFGH-6937)
2022-11-07 14:28:36 +01:00
c73c797595 mdns: fix some coverity reported issues
- Array compared against 0 NO_EFFECT
- dereference null pointer, FORWARD_NULL check
2022-11-07 18:38:06 +05:30
3330b96b10 websocket: make esp_websocket_client_send_with_opcode a public API 2022-11-07 16:20:34 +04:00
1547aa8c03 Merge pull request #166 from espressif-abhikroy/esp_modem/power_saving_mode
esp_modem/examples: Added example Power Saving Mode(PSM) in LTE modem.
2022-11-07 08:36:30 +01:00
1ca139109a esp_modem/examples: Add an example to synchronise PSM sleep in Sim70XX modem and esp32.
This example enables Power saving mode in Sim70XX modem and tries to synchronise the sleep cycle of the modem with esp32.
When the modem wakes up from PSM sleep it wakes up the esp32. While the modem is awake esp32 is set to light sleep.

Closes: https://github.com/espressif/esp-protocols/issues/54
2022-11-06 18:52:50 +05:30
55c1223a1e Merge pull request #165 from david-cermak/update/pick_update_prs
Accept some long standing example/demo PRs
2022-11-03 11:05:01 +01:00
0643613eee Merge pull request #172 from gabsuren/feauture/websocket_update_example
websocket: updated example to use local websocket echo server
2022-11-03 11:04:23 +01:00
55dc56462f websocket: updated example to use local websocket echo server 2022-11-03 10:35:14 +04:00
698fb3ae00 Merge pull request #152 from gabsuren/test_apps/mdns_pytest_migration
mDNS: test_app pytest migration
2022-10-26 07:12:07 +02:00
23a537b19b CI: Created a common requirements.txt 2022-10-25 23:59:44 +04:00
aee016d6e4 Examples: using pytest.ini from top level directory 2022-10-25 23:59:33 +04:00
f1ae14f263 update(esp_modem): Bump component version 2022-10-20 16:11:25 +02:00
65c0e0e195 fix(esp_modem): Cleanup custom lib-commands and factory 2022-10-20 16:11:19 +02:00
f71f61ff0a mDNS: test_app pytest migration 2022-10-19 09:23:36 +02:00
652314e73d fix(esp_modem) Add example that reads GNSS info 2022-10-17 20:30:55 +02:00
71a2388acb fix(esp_modem): Examples to configure MQTT Broker 2022-10-17 20:10:10 +02:00
ebc36a3519 fix(esp_modem): Extend pppos example project config 2022-10-17 20:01:45 +02:00
5097065a22 Merge pull request #153 from gabsuren/CI/pre-commit-hooks
CI: pre-commit hook integration (IDFGH-8439)
2022-10-17 19:23:55 +02:00
193ac643e4 Add .git-blame-ignore-revs file 2022-10-17 18:19:49 +02:00
945bd17701 CI: fixing the files to be complient with pre-commit hooks 2022-10-17 18:16:52 +02:00
9d45d505d5 CI: pre-commit hook integration 2022-10-17 18:07:54 +02:00
96fcbc0694 Merge pull request #142 from david-cermak/bugfix/cmux_missed_msc
(esp_modem): Fix switching to CMUX mode for devices that send `MSC`s
2022-10-17 14:43:22 +02:00
6b4767cba0 Merge pull request #163 from gabsuren/CI/asio_update_version
ASIO: Updated package version to "1.14.1~3"
2022-10-17 13:45:41 +02:00
f148c98b13 ASIO: Updated package version to "1.14.1~3" 2022-10-17 09:46:10 +02:00
06103e4bb4 Merge pull request #157 from david-cermak/bugfix/modem_lambda_capture
fix(esp-modem): On read/command callback fixes
2022-10-13 21:25:04 +02:00
c6fc267e5f Merge pull request #162 from gabsuren/CI/asio_package_update
CI: Updated repo-checkout flag to consider submodules (IDFGH-8515)
2022-10-13 21:24:21 +02:00
52b7f001a2 Merge pull request #161 from espressif-abhikroy/esp_modem/power_saving_mode_commands
Quick fix esp_modem: Added modem_console commands for deep-sleep and modem PSM.
2022-10-13 21:23:28 +02:00
cf504ec900 Quick fix esp_modem: Added modem_console commands for deep-sleep and modem PSM. 2022-10-13 20:54:08 +05:30
ab2e08f96c CI: Updated checkout flag to consider submodules 2022-10-13 17:23:43 +02:00
511ed541b8 fix(esp-modem) Make simple_cmux_client example configurable
* extended simple_cmux_client

* add the Descriptions as proposed by @david-cermak

* EXAMPLE_FLOW_CONTROL

Co-authored-by: Franz Höpfinger <krone-trailer@franzhoepfinger.de>
2022-10-13 09:00:16 +02:00
8d0e2aab6b Merge pull request #155 from espressif-abhikroy/esp_modem/power_saving_mode_commands
esp_modem: Added modem_console commands for deep-sleep and modem PSM. (IDFGH-8468)
2022-10-10 19:20:44 +02:00
a02bf05eed fix(esp-modem): Uart Terminal read_cb race 2022-10-10 15:39:09 +02:00
85a2e25093 esp_modem: Added modem_console commands for deep-sleep and modem PSM. 2022-10-10 12:51:47 +05:30
a9b5e66d0f Merge pull request #89 from tore-espressif/feature/esp_modem_usb
Use USB CDC driver from component registry (IDFGH-7816)
2022-10-05 11:58:43 +02:00
988b3f9905 ci: Compile esp_modem examples with USB support 2022-10-05 11:25:20 +02:00
53b59332dc esp_modem: Expand PPPoS example with USB DTE 2022-10-05 11:25:14 +02:00
bf84ae940a esp_modem: Allow USB DTE reconnection
esp_modem_usb_dte component is fetched from IDF component registry.
2022-10-05 11:25:06 +02:00
a89a0ab7a3 esp_modem: Add ConsoleCommand destructor
Commands are registered in Constructor. But there is now of deregistering it
This is needed for correct console re-construction,
for example with USB modem replugging.
2022-10-05 11:14:42 +02:00
fe536e476c esp_modem_get_gnss_power_mode (#136)
Co-authored-by: Franz Höpfinger <krone-trailer@franzhoepfinger.de>
2022-10-05 08:54:41 +02:00
afafcb7c24 Merge pull request #149 from diplfranzhoepfinger/feature/extend_example_modem_console2
remove unused Config Parameters ! (IDFGH-8442)
2022-10-04 10:10:08 +02:00
55b4775ca8 remove unused Config Parameters ! 2022-10-04 09:30:53 +02:00
1c6c610f20 Merge pull request #146 from MicroDev1/master
Prevent crash when hostname is null (IDFGH-8356)
2022-10-01 07:47:38 +02:00
9b48b0a5e0 update(esp_modem): Bump component version 2022-09-30 17:37:11 +02:00
25ac2d98c6 feat(esp_modem): Make some CMUX params compile-time configurable
* bool flag to defragment CMUX payload (useful for devices that send longer messages)
* int flag to force a delay between creating virtual terminals (useful for chatty devices that send some requests)
2022-09-30 17:36:38 +02:00
ce175df376 fix(esp_modem): CMUX to ignore MSC frames
Otherwise it gets confused with DISC frame and causes trouble when entering
CMUX mode (if device sends MSC requests)

Closes https://github.com/espressif/esp-protocols/issues/140
2022-09-30 17:36:38 +02:00
9d9d0db1ee Merge pull request #145 from david-cermak/bugfix/modem_console_flow_ctrl_config
fix(esp_modem): Console example to use configurable flow-ctrl
2022-09-30 16:56:22 +02:00
b704aaa33b Merge pull request #113 from david-cermak/feature/add_slip_example
Add protocols SLIP example
2022-09-30 16:39:30 +02:00
7a21db23ad fix(examples): Update SLIP example with error checks 2022-09-30 16:04:46 +02:00
fcd6f0bb14 feat(examples): Move the slip example to esp-netif folder
And update the slip_modem_get_ipv6_address() to return the address by
copy instead of reference (to employ return value optimizaiton where
possible)
2022-09-30 14:46:13 +02:00
52d7458b99 esp_netif: Migrate SLIP interface to user-space
* Original commit: espressif/esp-idf@83b8556f10
2022-09-30 14:46:13 +02:00
56cb58ced7 build system: re-add -Wno-format as private flag for some example components
* Original commit: espressif/esp-idf@e596c84d49
2022-09-30 14:46:13 +02:00
77a7538a02 docs: changes docs supported targets tables
* Original commit: espressif/esp-idf@c0568611dd
2022-09-30 14:46:13 +02:00
c8d0a13f0e ci: partially enable example build for esp32c2
* Original commit: espressif/esp-idf@f7be540222
2022-09-30 14:46:13 +02:00
582f5b5ff6 tools: Increase the minimal supported CMake version to 3.16
This updates the minimal supported version of CMake to 3.16, which in turn enables us to use more CMake features and have a cleaner build system.
This is the version that provides most new features and also the one we use in our latest docker image for CI.


* Original commit: espressif/esp-idf@facab8c5a7
2022-09-30 14:46:13 +02:00
06dd536d52 G0: target component (components/esp32*) doesn't depend on driver anymore
* Original commit: espressif/esp-idf@2571aaf3c9
2022-09-30 14:46:13 +02:00
e66b19c414 freertos: Remove legacy data types
This commit removes the usage of all legacy FreeRTOS data types that
are exposed via configENABLE_BACKWARD_COMPATIBILITY. Legacy types can
still be used by enabling CONFIG_FREERTOS_ENABLE_BACKWARD_COMPATIBILITY.


* Original commit: espressif/esp-idf@57fd78f5ba
2022-09-30 14:46:13 +02:00
0ad6cad8b2 Build & config: Remove leftover files from the unsupported "make" build system
* Original commit: espressif/esp-idf@766aa57084
2022-09-30 14:46:13 +02:00
ffa13e4b90 bugfix for ipv6_address_value_issue
Closes https://github.com/espressif/esp-idf/issues/5663


* Original commit: espressif/esp-idf@74236f0b29
2022-09-30 14:46:13 +02:00
0fc1fc6b23 Whitespace: Automated whitespace fixes (large commit)
Apply the pre-commit hook whitespace fixes to all files in the repo.

(Line endings, blank lines at end of file, trailing whitespace)


* Original commit: espressif/esp-idf@66fb5a29bb
2022-09-30 14:46:13 +02:00
f1d1d79daf esp-netif: Fix SLIP interface to start with correct IPv6 addr
Merges https://github.com/espressif/esp-idf/pull/4985


* Original commit: espressif/esp-idf@5dae28069f
2022-09-30 14:46:13 +02:00
36d0d32b35 esp-netif: removing SLIP related events as the slip-modem set state synchronously
* Original commit: espressif/esp-idf@bb9a7356ac
2022-09-30 14:46:13 +02:00
3bf488eb86 esp-netif: SLIP interface refactor to isolate interface from drivers
* Original commit: espressif/esp-idf@1a41545c3e
2022-09-30 14:46:13 +02:00
061885ad23 esp-netif: Added esp_netif slip support, slip_modem component and example
Merges https://github.com/espressif/esp-idf/pull/4985


* Original commit: espressif/esp-idf@266be00254
2022-09-30 14:46:13 +02:00
ab70791625 Merge pull request #147 from tore-espressif/feature/esp_modem/c_error
esp_modem: Allow C API extensions (IDFGH-8368)
2022-09-30 14:25:21 +02:00
62cb235aa9 esp_modem: Allow error handler register in C
C++ API offers interface to register error callback.
C API isn't flexible enough, so we offer conversion function between C++ and C enums.
2022-09-30 11:55:09 +02:00
04c711f757 esp_modem: Move common C definitions in to separate header
Separate header for C API created.
It can be used by C DTE extensions.
2022-09-30 11:41:34 +02:00
467fec5c9b Merge pull request #141 from gabsuren/examples/asio_examples_integrationn
ASIO: Example tests integration
2022-09-30 10:38:38 +02:00
5193ebc6ea ASIO: Example tests integration 2022-09-27 16:09:50 +04:00
3498e86d8b prevent crash when hostname is null 2022-09-21 21:03:07 +05:30
07a347f907 fix(esp_modem): Fix CRLF endlines in examples 2022-09-20 08:20:05 +02:00
d9c9681094 fix(esp_modem): Console example to use configurable flow-ctrl 2022-09-20 08:18:53 +02:00
7310a7a0bc Merge pull request #144 from jonathandreyer/feature/modem_cmux_exit_example
esp_modem: Exit CMUX after end of example
2022-09-20 07:37:21 +02:00
accf9244ca Minor formatting fix and spelling 2022-09-19 17:11:57 +02:00
290197c210 feat(esp-modem): Add exit PPP in example 2022-09-19 17:07:49 +02:00
b8d1e58778 Merge pull request #116 from gabsuren/examples/mdns_examples_integration
mdns: Example tests integration
2022-09-15 11:41:58 +02:00
cc4d33d871 Merge pull request #125 from david-cermak/bugfix/modem_command_race
fix(esp_modem): DTE command race of timeout vs reply's signal
2022-09-14 14:46:06 +02:00
ef0e48a678 extended the modem_console example. (#120)
Co-authored-by: Franz Höpfinger <krone-trailer@franzhoepfinger.de>
Co-authored-by: david-cermak <38914379+david-cermak@users.noreply.github.com>
2022-09-14 14:05:25 +02:00
187ef7676e update(esp_modem): Bump component version 2022-09-14 13:52:00 +02:00
a8714730fb fix(esp_modem): DTE command race of timeout vs reply's signal
Race condtion:
* First command timeouted, but the reply came just after evaluation and
set signal variable to GOT_LINE
* Second command should timeout too, but a consistency check validates
that it timeouted and at the same time GOT_LINE (from previous step) and
throws an exception

STR:
* Revert change in esp_modem_dte.cpp
* Run TEST_CASE("DTE command races", "[esp_modem]")

Closes https://github.com/espressif/esp-protocols/issues/110
2022-09-14 13:50:22 +02:00
d2f519f9e5 Merge pull request #139 from david-cermak/bugfix/modem_get_operator_name_with_act
fix(esp_modem): Make get_operator_name() return also ACT value
2022-09-14 13:46:28 +02:00
a045c1c885 mdns: Example tests integration 2022-09-14 10:58:31 +04:00
543521a220 Merge pull request #123 from thorrak/hygiene/TTL
Replace hardcoded TTL values with named defines (IDFGH-8113)
2022-09-09 15:13:22 +02:00
85be67e708 Merge pull request #126 from jonathandreyer/bugfix/ci-partial-disable
CI: Disable some runs on forks (which are not able to access to secrets) (IDFGH-8152)
2022-09-09 15:11:41 +02:00
5b1b2cce75 Disable specific runs..
.. which are not access to secrets
2022-09-09 14:30:37 +02:00
1029078541 fix(esp_modem): Correct timeouts for certain commands
And adds an explicit timeout parameter to the esp_modem_at()

Closes https://github.com/espressif/esp-protocols/issues/129
2022-09-09 11:23:21 +02:00
0015e5411c fix(esp_modem): Make get_operator_name() return also ACT value
Closes https://github.com/espressif/esp-protocols/issues/128
2022-09-09 10:54:55 +02:00
65b64e1fc1 Merge pull request #138 from tore-espressif/fix/idf_version_check
esp_modem: Fix IDF version resolution (IDFGH-8271)
2022-09-09 10:13:40 +02:00
d07237b2ce esp_modem: Fix IDF version resolution 2022-09-09 09:31:26 +02:00
3c65fde2a7 Merge pull request #117 from david-cermak/bugfix/mdns_add_service_fail_if_nohostname
mdns: Fix add_service() to report error if no hostname has been set
2022-09-08 12:59:08 +02:00
35833d2730 Merge pull request #131 from tore-espressif/feature/esp_modem/err_cb
esp_modem: Expose set_error_cb method
2022-09-08 12:54:13 +02:00
bbb4b7e686 Merge pull request #135 from mahavirj/bugfix/fix_broken_ipv4_only_build
mdns: fix IPV4 only build and also update CI configuration
2022-09-07 22:10:18 +05:30
64e31dae48 ci: fix issue with cryptography package installation 2022-09-07 13:58:10 +05:30
63ce3a5d59 protocol_examples_common: fix build for SPI_ETHERNET case with IDF v5.x 2022-09-07 12:52:39 +05:30
5dd138c883 ci: remove sdkconfig before starting new config based build 2022-09-07 12:52:39 +05:30
088f7ac3f8 mdns: bump up the component version 2022-09-07 09:44:33 +05:30
e079f8ba98 mdns: fix IPV4 only build and also update CI configuration
Earlier commit 48c157bc46 had typo
regarding variable name. This was not caught in CI because IPV6
was not really getting disabled due to an indirect dependency
of `CONFIG_EXAMPLE_CONNECT_IPV6`.

This commit fixes both the problems.
2022-09-07 09:43:46 +05:30
ff2b0734ea Merge pull request #132 from mahavirj/bugfix/build_issue_with_ipv6_disabled
mdns: fix build issue with CONFIG_LWIP_IPV6 disabled
2022-09-06 21:28:33 +05:30
330332a0fb mdns: add test configuration for IPV6 disabled build 2022-09-05 13:24:14 +05:30
48c157bc46 mdns: fix build issue with CONFIG_LWIP_IPV6 disabled 2022-09-02 16:13:17 +05:30
98bf3efeb6 esp_modem: Fix format warnings
Closes https://github.com/espressif/esp-protocols/issues/79
2022-09-02 10:02:34 +02:00
ae8479c77e esp_modem: Expose set_error_cb method 2022-09-02 09:17:49 +02:00
444fae9066 Merge pull request #115 from david-cermak/bugfix/cmux_exit_bg96
fix(esp_modem): Correct exit of CMUX mode
2022-08-29 16:13:31 +02:00
bb4c002841 Replace hardcoded TTL values with named defines
- Replaces hardcoded PTR "half-TTL" with `MDNS_ANSWER_PTR_TTL/2` (defined in mdns_private.h)
- Replaces hardcoded TXT "half-TTL" with `MDNS_ANSWER_TXT_TTL/2` (defined in mdns_private.h)
2022-08-23 08:44:36 -04:00
656ab21c9b mdns: Fix add_service() to report error if no-hostname 2022-08-19 18:47:47 +02:00
2099434b3f fix(esp_modem): Correct exit of CMUX mode
* Fix DISC message's control field (0xFF->0xFE) to keep Poll bit cleared
* Accept UIH resp on DISC for both (0xFF, 0xFE) ignoring P/F bit
* Fix timeout processing when handling DISC message

Closes https://github.com/espressif/esp-protocols/issues/103
2022-08-19 11:45:59 +02:00
8f00fc182a Merge pull request #114 from david-cermak/bugfix/dns-header-bit-order
mdns: fix bit order issue in DNS header flags (updated)
2022-08-19 09:03:04 +02:00
d74c296182 fix(mdns): Example makefile to add only mdns as extra comps 2022-08-18 16:41:38 +02:00
c4e85bd099 mdns: fix bit order issue in DNS header flags
The bit field in the header flags does not match its intended order on
little endian machines. The PR removes the bit field and uses bit
operations instead.
2022-08-18 16:39:38 +02:00
85ba60e405 Merge pull request #88 from david-cermak/bugfix/modem_better_exception_report
fix(esp-modem): Add filename/line info to exception message
2022-08-18 15:27:47 +02:00
89e1bd27b3 fix(esp-modem): Add filename/line info to exception message
This is useful if exceptions are enabled, but caught internally on C++ API boundary
2022-08-18 14:52:21 +02:00
341fcb0f40 Merge pull request #112 from gabsuren/bugfix/updated_esp_modem_package
esp_modem: updated package version to 0.1.19 (IDFGH-8032)
2022-08-18 14:47:47 +02:00
469f953b28 esp_modem: updated package version to 0.1.19 2022-08-18 15:59:48 +04:00
381eb314dc Merge pull request #93 from gabsuren/feature/websocket_json_example
websocket: updated example to show how to transfer json data
2022-08-15 14:50:48 +02:00
1ffc20c8e3 Merge pull request #105 from gabsuren/websocket/version_change_03
esp_websocket_client: upgraded package version to 0.0.3 (IDFGH-7986)
2022-08-05 12:37:40 +02:00
5c245dbdb5 esp_websocket_client: Upgraded version to 0.0.3 2022-08-05 10:21:41 +04:00
134a9a9eee Revert "bugfix: mdns IPv6 address convert error"
This reverts commit 238ee96783.
2022-08-04 15:52:40 +04:00
010f98ca80 Merge pull request #99 from gabsuren/bugfix/fix_ci_build
CI: Fix build issues
2022-07-29 11:10:11 +02:00
6e4e4fab1d CI: Fix build issues 2022-07-28 22:47:53 +04:00
b6852a0588 Merge pull request #96 from gjc13/bugfix/aa-bit-receive
fix(mdns): ignore authoritative flag on reception (IDFGH-7891)
2022-07-25 08:26:10 +02:00
415e04a55f fix(mdns): ignore authoritative flag on reception 2022-07-22 22:25:08 +08:00
3456781494 websocket: updated example to show json data transfer 2022-07-21 16:04:58 +04:00
d1129f3d19 esp_err_to_name (IDFGH-7793) (#78)
fix(esp-modem): Use err_to_name to log error message on error
2022-07-18 17:08:15 +02:00
973837dd66 Merge pull request #92 from david-cermak/feat/mdns_explicit_deps
feat(mdns): Define explicit dependencies on esp-wifi
2022-07-18 17:05:44 +02:00
36de9afe0c feat(mdns): Define explicit dependencies on esp-wifi 2022-07-18 09:49:03 +02:00
0d5081b841 Merge pull request #81 from lcj446068124/bugfix/mdns_ipv6_convert_error
bugfix: mdns IPv6 address convert error (IDFGH-7772)
2022-07-15 08:13:06 +02:00
85c7282641 Merge pull request #91 from Lapshin/feature/bump-versions
Bump asio/mdns/esp_websocket_client versions
2022-07-15 07:13:35 +02:00
57afa38f49 Bump asio/mdns/esp_websocket_client versions
Update components version afrer change d66f9dc158
2022-07-14 20:04:28 +04:00
238ee96783 bugfix: mdns IPv6 address convert error
In this fix, we manually convert esp_ip_addr_t to ip_addr_t.
2022-07-14 23:40:08 +08:00
10e6348e09 Merge pull request #85 from david-cermak/feature/modem_operator_name_add_act
feat(esp_modem): Add optional ACT to operator-name
2022-07-13 16:20:54 +02:00
a286634359 feat(esp_modem): Add optional ACT to operator-name
Closes https://github.com/espressif/esp-protocols/issues/80
2022-07-13 09:56:29 +02:00
4cdfc857ad Merge pull request #68 from gabsuren/refactor/organize_yml_files
CI: Organize GitHub workflow structures
2022-07-12 20:04:01 +02:00
371a32d4ae Merge pull request #72 from david-cermak/bugfix/modem_c_api_pdp_ctx
fix(esp-modem): Add missing set_pdp_context() to C-API
2022-07-12 20:03:03 +02:00
dc4e54e99a Merge pull request #87 from Lapshin/fix/ignore-format-warnings
ignore format warnings
2022-07-12 20:02:30 +02:00
d66f9dc158 ignore format warnings 2022-07-12 18:13:01 +04:00
4980ac85b7 fix(esp-modem): Add missing set_pdp_context() to C-API 2022-07-12 15:52:39 +02:00
626eb52d04 CI: Organize github workflow structure 2022-07-12 17:24:41 +04:00
82b1aa9280 Merge pull request #73 from Lapshin/fix/ignore-format-warnings
esp_modem: Ignore format warnings (IDFGH-7760)
2022-07-12 10:44:26 +02:00
e8145fcede esp_modem: Ignore format warnings 2022-07-12 12:32:15 +04:00
9c3e24b6cf Merge pull request #70 from david-cermak/bugfix/modem_ap2ppp_retry
fix(esp_modem): Update ap2ppp example to recover network on disconnection
2022-07-11 19:11:48 +02:00
b4d85d6aae Merge pull request #84 from Lapshin/fix/asio-exampels-build
asio: fix exampels build (IDFGH-7792)
2022-07-11 19:02:36 +02:00
0b102f6286 mdns: Fix test_app build 2022-07-11 20:39:56 +04:00
06e7baf2c2 CI: Fix ASIO build in CI run 2022-07-11 19:00:06 +04:00
3662c149fb asio: Fix exampels build 2022-07-11 18:01:46 +04:00
a243d7e878 fix(esp_modem): Update ap2ppp example to recover network on disconnection
Closes https://github.com/espressif/esp-protocols/issues/44
2022-07-01 13:52:49 +02:00
ef1bae5cdd Merge pull request #35 from ESP-YJM/pr/optimize_websocket
feat(websocket): Optimize memory size for websocket client init (IDFGH-7357)
2022-06-28 16:04:09 +02:00
4cefcd3606 feat(websocket): Optimize memory size for websocket client init 2022-06-28 21:09:05 +08:00
a177b3d024 Merge pull request #67 from gabsuren/bugfix/websocket_ci_long_run
CI: Fix CI long run on websocket examples
2022-06-28 13:59:56 +02:00
b7e73d25a7 CI: Fix CI long run on websocket examples 2022-06-28 15:25:40 +04:00
9b403d477f Merge pull request #64 from bbinet/custom-source-clk
Allow to customize uart source_clk (IDFGH-7659)
2022-06-24 16:24:00 +02:00
d723fb7a5a Allow to customize uart source_clk
This is for example needed when using an external crystal to select
UART_SCLK_XTAL, which fixes uart comm issue when using PM with light
sleep enabled.
2022-06-24 14:44:15 +02:00
9905fe4cf6 Merge pull request #62 from gabsuren/asio_submodule_migration_with_history
ASIO: Initial version based on IDF 5.0 with history
2022-06-24 14:29:39 +02:00
055f051f53 ASIO: Initial version based on IDF 5.0 with history 2022-06-24 15:33:10 +04:00
8dc3e5835c Merge pull request #63 from bbinet/add-raw-command
Add raw command (IDFGH-7658)
2022-06-23 18:00:42 +02:00
0cf08fb676 Add "at" api for custom commands 2022-06-23 17:40:06 +02:00
ac7bf465d2 asio: Disable concepts support
Fix example for compatibility with C++20

* Original commit: espressif/esp-idf@9dba0476a0
* Original commit: espressif/esp-idf@157247f98f
2022-06-22 17:58:30 +04:00
2cf7518114 ci: partially enable example build for esp32c2
* Original commit: espressif/esp-idf@f7be540222
2022-06-22 14:18:18 +04:00
057a5d2db8 lwip: Update socket API to include port-version of sockets/netdb
Added socket extention to the lwip hooks for implementing non-vanilla
{get/set}sockopts()


* Original commit: espressif/esp-idf@53c009e626
2022-06-22 14:18:18 +04:00
63bff632df esp_netif/lwip: Implement basic support for vanilla-lwip (2.1.3-REL)
* Reference lwip-2.1.3-REL vanilla lwip version
* Use inherent NETIF callbacks instead of dhcp/ipv6/autoip


* Original commit: espressif/esp-idf@5b471a1848
2022-06-22 14:18:18 +04:00
938ddf16b9 tools: Increase the minimal supported CMake version to 3.16
This updates the minimal supported version of CMake to 3.16, which in turn enables us to use more CMake features and have a cleaner build system.
This is the version that provides most new features and also the one we use in our latest docker image for CI.


* Original commit: espressif/esp-idf@facab8c5a7
2022-06-22 14:18:18 +04:00
0c84c9750c docs: update redirected links
* Original commit: espressif/esp-idf@030cb77597
2022-06-22 14:18:18 +04:00
952e5df477 [EXAMPLES/ASIO] Renames Kconfig parameter and clarify
On ip::tcp::resolver ASIO uses service to identify the type of
connection and get the port number. LWIP can't resolve this way.


* Original commit: espressif/esp-idf@232b0eda5f
2022-06-22 14:18:18 +04:00
e3c4391246 mbedtls: Remove certs.c and certs.h from port directory
* Original commit: espressif/esp-idf@f31d8dd295
2022-06-22 14:18:18 +04:00
98138189c9 mbedtls-3 update:
1) Fix build issue in mbedtls
2) skip the public headers check in IDF
3)Update Kconfig Macros
4)Remove deprecated config options
5) Update the sha API according to new nomenclature
6) Update mbedtls_rsa_init usage
7) Include mbedtls/build_info.h instead of mbedtls/config.h
8) Dont include check_config.h
9) Add additional error message in esp_blufi_api.h


* Original commit: espressif/esp-idf@45122533e0
2022-06-22 14:18:18 +04:00
30dae8f7ed EXAMPLES/ASIO: Adds a SOCKS4 example
Creates an example on how to connect using Socks4 based proxy.


* Original commit: espressif/esp-idf@f7b842bbc7
2022-06-22 14:18:18 +04:00
b76d3fbff9 EXAMPLE/ASIO Async HTTP request
Introduces a new example on ASIO to ilustrates on how to compose
async operation to build network related protocols.


* Original commit: espressif/esp-idf@2433816b14
2022-06-22 14:18:18 +04:00
f605fdd632 asio: Use internal ssl context and engine impl
Implement asio-ssl layer with three classes in asio::ssl::mbedtls:
* context -- replaces SSL_CTX, used mainly as a container to options,
certs, keys
* engine -- replaces SSL, implements the actual mbedtls operations
* bio -- implements openssl BIO specifically tailered to mbedtls and
its asio usage

Further updates:
* asio: Used shared_ptr<> for bio pairs
* asio: Add error checks to mbedtls-bio
* asio: Address potential ssl-context ownership issue
* asio: Address potential bio-engine ownership issue


* Original commit: espressif/esp-idf@d823106aa6
2022-06-22 14:18:18 +04:00
abbc8d9c5a Build & config: Remove leftover files from the unsupported "make" build system
* Original commit: espressif/esp-idf@766aa57084
2022-06-22 14:18:18 +04:00
a0297743dd openssl: Add deprecation warning to ssl.h
OpenSSL component will be discontinued in ESP-IDF v5.x. The only official TLS API will be esp-tls
Add docs warning about deprecation in v5.x

Removed all examples demonstrating usage of openssl in IDF


* Original commit: espressif/esp-idf@cfc001870c
2022-06-22 14:18:18 +04:00
3bcc46276a example_tests: Deletes usage esp32c3 ECO0 in CI (by default ECO3)
* Original commit: espressif/esp-idf@709abee65c
2022-06-22 14:18:18 +04:00
f0d0698582 docs: update asio docs with new example paths after refactor.
* Original commit: espressif/esp-idf@37d549916b
2022-06-22 14:18:18 +04:00
91262baede examples: Asio tests consolidation to use loopback interface
Closes IDF-3072


* Original commit: espressif/esp-idf@a06357ab62
2022-06-22 14:18:18 +04:00
cb2375827b CI: fix connection failures in asio example tests
* Original commit: espressif/esp-idf@b3b71bc8ab
2022-06-22 14:18:17 +04:00
cc0f2b3cf0 asio coap: If LWIP IPV6 is disabled, automatically don't build asio & coap
- Removes need to manually exclude these components as shown at
  https://github.com/espressif/esp-idf/issues/3781#issuecomment-825742378

- Hide the config for these components if IPV6 is disabled

- The components are still included in the build, but with no source
  files


* Original commit: espressif/esp-idf@e305f29382
2022-06-22 14:18:17 +04:00
47d57a5b14 asio: update copyright notice
* Original commit: espressif/esp-idf@2d0895e9a9
2022-06-22 14:18:17 +04:00
278b7bef3c partition_table: Add a "single factory app (large)" option for 1.5MB app size
Needed to build some examples in their default configurations (especially
ESP32-C3). Wasn't noticed until the CI checks for partition size were added.


* Original commit: espressif/esp-idf@920edd4e73
2022-06-22 14:18:17 +04:00
a165452ca1 Split example_tests with Example_WIFI tag group into Example_OTA and Example_Protocols
* Original commit: espressif/esp-idf@0a395134d4
2022-06-22 14:18:17 +04:00
55f95fb790 example_tests: CI uses ECO0 for esp32c3 tests
* Original commit: espressif/esp-idf@ec4de4fe5c
2022-06-22 14:18:17 +04:00
9b76388163 ci: run Example_GENERIC for C3
Add support for running example_GENERIC tests for C3 on label.

Fix examples that fail.


* Original commit: espressif/esp-idf@c85d949c1f
2022-06-22 14:18:17 +04:00
0d1d73eb35 style: format python files with isort and double-quote-string-fixer
* Original commit: espressif/esp-idf@0146f258d7
2022-06-22 14:18:17 +04:00
88d3eda156 test: remove fake binary size check in example test:
the binary size check in example test was removed long time ago. Now we
have updated ttfw_idf to raise exception when performance standard is
not found. These fake performance check will be regarded as error.
Remove them now.


* Original commit: espressif/esp-idf@a908174c06
2022-06-22 14:18:17 +04:00
622a360e97 Whitespace: Automated whitespace fixes (large commit)
Apply the pre-commit hook whitespace fixes to all files in the repo.

(Line endings, blank lines at end of file, trailing whitespace)


* Original commit: espressif/esp-idf@66fb5a29bb
2022-06-22 14:18:17 +04:00
4358c3ceab cmake: Apply cmakelint fixes
* Original commit: espressif/esp-idf@e82eac4354
2022-06-22 14:18:17 +04:00
f00c3be139 asio: make the example code conform to Espressif C++ standards
* Original commit: espressif/esp-idf@b2150f86a5
2022-06-22 14:18:17 +04:00
c05558ba28 asio: option to use wolfSSL as TLS stack for ASIO
Plus other minor update, make openssl aware of current modes (SSL_set_mode)
Update coding style in examples and tests, including copyright notices


* Original commit: espressif/esp-idf@1c8171c3e8
2022-06-22 14:18:17 +04:00
c0c1a65598 examples: asio ssl example demonstrating both server and client
By default it uses simple client connecting to https address. It is
possible to configure both server and client. As for example test the
configuration of both server and client connecting to each other on


* Original commit: espressif/esp-idf@213bbe51fc
2022-06-22 14:18:17 +04:00
dab12309e2 asio: Basic SSL/TLS support in asio port for ESP platform
This port employs IDF port of OpenSSL for most common features, others
are discouraged or not supported. The port also introduces several stubs
for OpenSSL functions which ASIO needs to get compiled and linked.

Upstream ASIO supports WolfSSL as SSL/TLS stack, as well, which is
another option for SSL support in ASIO on ESP platform.


* Original commit: espressif/esp-idf@9459c0dd43
2022-06-22 14:18:17 +04:00
789670e8c5 Add multi-target support for performance tests
* Original commit: espressif/esp-idf@15884eccf2
2022-06-22 14:18:17 +04:00
131613c5cc doc: fix broken example links
* Original commit: espressif/esp-idf@f2cb6bd4b6
2022-06-22 14:18:17 +04:00
919091766d asio: updated ASIO port to use latest asio and esp-idf features
closes https://github.com/espressif/esp-idf/issues/4296


* Original commit: espressif/esp-idf@13d603e486
2022-06-22 14:18:17 +04:00
4e4ab0908d test: update example and unit tests with new import roles:
tiny_test_fw is a python package now. import it using normal way.


* Original commit: espressif/esp-idf@c906e2afee
2022-06-22 14:18:17 +04:00
54e3a85983 esp_netif and examples: using wifi driver handle, update examples and tests to pass the CI
* Original commit: espressif/esp-idf@3a19bf055d
2022-06-22 14:18:17 +04:00
98dfb691b6 asio: fix asio test code to start the test after ip address received from common example code
Previously set to wait until IP address got from tcpip_adapter, but since common example connect code blocks until both IP4 and IPv6 address received it could happen that test code might have started connection to the ASIO counter-part while ESP32 still waiting for IPv6 address


* Original commit: espressif/esp-idf@208feef3c9
2022-06-22 14:18:17 +04:00
ff7d214f9c ASIO: fixed undefined ref to atomic functions and enabled examples for CI (esp32s2beta)
Implemented the atomic functions needed to compile and link the asio examples on esp32s2beta.


* Original commit: espressif/esp-idf@845003a1c3
2022-06-22 14:18:17 +04:00
ee6dbbfeaa ci: limit example test to ESP32s
* Original commit: espressif/esp-idf@63329b169b
2022-06-22 14:18:17 +04:00
a14331ad01 tools: Mass fixing of empty prototypes (for -Wstrict-prototypes)
* Original commit: espressif/esp-idf@afbaf74007
2022-06-22 14:18:17 +04:00
f3754a3683 examples: change default build instructions in docs to CMake
* Original commit: espressif/esp-idf@e7dba7d7bc
2022-06-22 14:18:17 +04:00
c1176ccdcc build system: Use CMake-based build system as default when describing commands
* Original commit: espressif/esp-idf@47bbb107a8
2022-06-22 14:18:17 +04:00
df51e60ac0 examples: use new component registration api
* Original commit: espressif/esp-idf@6771eead80
2022-06-22 14:18:17 +04:00
9e83b1eb0e components: use new component registration api
* Original commit: espressif/esp-idf@9eccd7c082
2022-06-22 14:18:17 +04:00
f82cbfde7b ci: support to build esp32s2beta simple examples
* Original commit: espressif/esp-idf@25ab8380c8
2022-06-22 14:18:17 +04:00
96d13293ab Rename Kconfig options (components/esp32)
* Original commit: espressif/esp-idf@0ae53691ba
2022-06-22 14:18:17 +04:00
3b49d1f559 Rename Kconfig options (root)
* Original commit: espressif/esp-idf@c5000c83d2
2022-06-22 14:18:17 +04:00
3e7591e92a examples/protocols/asio: use common network component
* Original commit: espressif/esp-idf@aa4a7804ec
2022-06-22 14:18:17 +04:00
de830e51d4 Correct Kconfigs according to the coding style
* Original commit: espressif/esp-idf@37126d3451
2022-06-22 14:18:17 +04:00
21c0878f0e examples: Fix Python coding style
* Original commit: espressif/esp-idf@57c54f96f1
2022-06-22 14:18:17 +04:00
a96c890f97 Fix Python 3 compatibility issues
* Original commit: espressif/esp-idf@9daf51e6be
2022-06-22 14:18:17 +04:00
86d107635b asio: examples renamed to have consistent binary names when build in make and CMake
* Original commit: espressif/esp-idf@9784df1c3a
2022-06-22 14:18:17 +04:00
57672d5add cmake: make main a component again
* Original commit: espressif/esp-idf@d9939cedd9
2022-06-22 14:18:17 +04:00
e8ea8786d2 cmake: Add missing example CMakeLists.txt files, CI check all examples have both
* Original commit: espressif/esp-idf@5689e446dc
2022-06-22 14:18:17 +04:00
142200c7ca Merge branch 'master' into feature/cmake
* Original commit: espressif/esp-idf@ff2404a272
2022-06-22 14:18:17 +04:00
6c47cfe30a asio: added socket timeout for example tests
* Original commit: espressif/esp-idf@c0186858ad
2022-06-22 14:18:17 +04:00
0ae8c3ca33 asio example tests: Increase timeout for DHCP lease to 30s
Covers time to connect to WiFi and negotiate lease,
may be more than 5-10s on some busy APs


* Original commit: espressif/esp-idf@8b35d8ef25
2022-06-22 14:18:17 +04:00
5472d5c52f asio: initial idf port of asio library without ssl
* Original commit: espressif/esp-idf@1ef13c524c
2022-06-22 14:18:17 +04:00
51a50db0fd Merge pull request #61 from gabsuren/feature/common_component_esp_dependency
protocol_examples_common: Updated to explicitly use esp-eth dependency if needed
2022-06-21 18:47:35 +02:00
e1660a1806 protocol_examples_common: Updated to explicitely use esp-eth dependency if needed
* Original commit: espressif/esp-idf@5e19b9c951
2022-06-21 20:39:46 +04:00
84f18bddfb Merge pull request #58 from gabsuren/feature/mdns_esp_dependency
mdns: Updated mDNS to explicitly use esp-eth dependency if needed
2022-06-21 18:09:46 +02:00
609594a849 Merge pull request #42 from david-cermak/feature/modem_cmux_ext
esp_modem: CMUX mode improvements
2022-06-21 18:08:34 +02:00
66e6d4cbf8 fix(esp_modem): Implement movable unique_buffer to bundle data, size, ptr
Also improves and fixes tests
2022-06-18 12:19:07 +02:00
4868689111 mdns: Updated mDNS to explicitely use esp-eth dependency if needed
* Original commit: espressif/esp-idf@5e19b9c951
2022-06-17 13:24:22 +04:00
f3ff98bb82 fix(exp_modem): DTE should own both command and data terminal
reworks to clear shared_ptr<> of both command and data terminals
and having DTE own it. When we swith to CMUX mode the ownership is transfered to CMux terminal
2022-06-11 21:33:51 +02:00
58a0b57e12 fix(esp_modem): Update CMUX example to use CMUX mode automatically 2022-06-11 21:29:25 +02:00
3fd4391c38 feat(esp_modem): Add CMUX mode to C-API
Closes https://github.com/espressif/esp-protocols/issues/41
2022-06-11 15:07:39 +02:00
a16aab6979 feat(esp_modem): Add support to CMUX exit
Closes https://github.com/espressif/esp-protocols/issues/37
2022-06-11 15:07:39 +02:00
1e0aefd72a fix(esp-modem): Improve PPP exit sequence
* Implement retry mechanism if escape PPP mode failed
* Stop networking and checking for NO-CARRIER manually on PPP exit

Closes https://github.com/espressif/esp-protocols/issues/47
2022-06-11 15:07:39 +02:00
ebf122bd36 Merge pull request #53 from david-cermak/bugfix/cmux_2byte_len
esp_modem: Support 2 byte size packets
2022-06-10 15:26:31 +02:00
5addf9e885 feat(esp_modem): Bumped version number to 0.1.17 2022-06-10 14:56:12 +02:00
6dbfc69627 Merge pull request #49 from trombik/feat-ca-bundle
feat(websocket): allow users to attach CA bundle (IDFGH-7520)
2022-06-06 15:11:51 +02:00
128c0a2d87 fix(esp_modem): Support 2 byte size packets
Closes https://github.com/espressif/esp-protocols/issues/46
2022-06-06 15:05:38 +02:00
1f91d248f5 Merge pull request #51 from gabsuren/bugfix/mix_fixes
Minor fixes here and there
2022-06-03 15:49:26 +02:00
8fe2a3a661 Minor fixes here and there
1. mDNS: Added idf_component.yml
2. mDNS: Updated document generation paths
2. Websocket: Updated conf_common.py to use internal
3. Websocket: Updated CmakeList.txt to use internal
2022-06-03 17:18:57 +04:00
417591b99f Merge pull request #43 from gabsuren/mdns_migration_with_history
mdns: Initial version based on IDF 5.0
2022-06-03 12:57:35 +02:00
d56b5d90ea feat(websocket): allow users to attach CA bundle
with esp_transport_ssl_crt_bundle_attach(), it is not necessary to
include a specific certificate. other protocol clients, such as
esp_http_client, do the same.

fixes #48
2022-06-02 12:29:22 +07:00
b6b20ad399 mDNS: Initial version based on IDF 5.0 2022-06-01 21:04:37 +04:00
8863ed944d docs: update redirected links
* Original commit: espressif/esp-idf@030cb77597
2022-05-27 17:44:25 +04:00
78001ec871 Examples: common source for GPIO range in Kconfigs defined
* Original commit: espressif/esp-idf@1a20b10fd3
2022-05-27 17:44:25 +04:00
4a52cf23f5 soc: moved kconfig options out of the target component.
Moved the following kconfig options out of the target component:
 * CONFIG_ESP*_DEFAULT_CPU_FREQ* -> esp_system
 * ESP*_REV_MIN -> esp_hw_support
 * ESP*_TIME_SYSCALL -> newlib
 * ESP*_RTC_* -> esp_hw_support

Where applicable these target specific konfig names were merged into
a single common config, e.g;
CONFIG_ESP*_DEFAULT_CPU_FREQ -> CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ


* Original commit: espressif/esp-idf@d2872095f9
2022-05-27 17:44:25 +04:00
00e7675913 examples: added ESP-NETIF L2 TAP example
* Original commit: espressif/esp-idf@fcdb0306d0
2022-05-27 17:44:25 +04:00
87c269911d cmake: fix issue with passing cxx_std option for GCC 11, a common workaround
* Original commit: espressif/esp-idf@ea0d2123c8
2022-05-27 17:44:25 +04:00
eb536a74a0 kconfig: Changed default values of bool configs
- Some bool configs were using default values true and false,
  instead of y and n.


* Original commit: espressif/esp-idf@25c5c214f3
2022-05-27 17:44:25 +04:00
b720d02fca examples: Fix implicit includes after legacy code removal
* Original commit: espressif/esp-idf@c941e29cf6
2022-05-27 17:44:25 +04:00
3e93ea9b76 esp_netif: Remove tcpip_adapter compatibility layer
* Original commit: espressif/esp-idf@795b7ed993
2022-05-27 17:44:25 +04:00
2c764b1b7a mdns: Fix copyright messages, update API descrition
* Impove docs and comments on custom netifs
* Make predef interfaces const, minor docs fixes


* Original commit: espressif/esp-idf@42ba8a8338
2022-05-27 17:44:25 +04:00
f836ae7f65 mdns: Add API to control custom network interfaces
* Original commit: espressif/esp-idf@b02468dc98
2022-05-27 17:44:25 +04:00
e9a1c26e0c CI/mdns: Reworked example test to be run repeatably
* Original commit: espressif/esp-idf@dd3cd52fd6
2022-05-27 17:44:25 +04:00
4b5f24f5b8 CI/mdns: Fix fuzzer build
* Original commit: espressif/esp-idf@98e9426b66
2022-05-27 17:44:25 +04:00
05675c7d63 CI/mdns: Extend example test for sockets, netifs
* Original commit: espressif/esp-idf@d1b809e6a1
2022-05-27 17:44:25 +04:00
30f37c0565 mdns: Add support for registering custom netif
* Original commit: espressif/esp-idf@bec42ff85d
2022-05-27 17:44:25 +04:00
ddc58e8220 mdns: Indicate interface using esp_netif in search results
* Original commit: espressif/esp-idf@f8495f1e86
2022-05-27 17:44:25 +04:00
fa951bf320 mdns: Use predefined interfaces to prepare for custom netifs
* Original commit: espressif/esp-idf@f90b3b798b
2022-05-27 17:44:25 +04:00
605d1fab73 mdns: Prepare for dynamic esp-netif support
* Original commit: espressif/esp-idf@f9892f77b8
2022-05-27 17:44:25 +04:00
58bf2186f7 esp_hw_support/esp_system: Re-evaluate header inclusions and include directories
This commit updates the visibility of various header files and cleans up
some unnecessary inclusions. Also, this commit removes certain header
include paths which were maintained for backward compatibility.


* Original commit: espressif/esp-idf@a9fda54d39
2022-05-27 17:44:24 +04:00
d39a4c744e mdns: Stabilization of mdns test app
* Original commit: espressif/esp-idf@93a902ba80
2022-05-27 17:44:24 +04:00
ec491ec536 system: move kconfig options out of target component
Moved the following kconfig options out of the target component:
 * ESP32_X_BROWNOUT_* -> esp_system
 * ESP32_X_DEBUG_OCDAWARE -> esp_system
 * APP_NO_BLOBS -> build type (main kconfig)


* Original commit: espressif/esp-idf@bb88338118
2022-05-27 17:44:24 +04:00
defdfd59b6 G0: target component (components/esp32*) doesn't depend on driver anymore
* Original commit: espressif/esp-idf@2571aaf3c9
2022-05-27 17:44:24 +04:00
7f42c31252 ci/mdsn: Fix example test on ethernet runners
* Ethernet kit uses GPIO0 for ref-clock, so the test button hits
constantly
* Add a freeRTOS delay when checking result on assync queries


* Original commit: espressif/esp-idf@afe7ab3b2c
2022-05-27 17:44:24 +04:00
94ae672041 mdns: Update to drop our own packet if bounced back
* Original commit: espressif/esp-idf@b5149e3ee7
2022-05-27 17:44:24 +04:00
e5a3a3df1d mdns: Fix potential read behind parsed packet
* Original commit: espressif/esp-idf@51a5de2525
2022-05-27 17:44:24 +04:00
7710ea9a11 mdns: Fix memleak when adding delegated host
* Original commit: espressif/esp-idf@9cbdb8767b
2022-05-27 17:44:24 +04:00
034c55e18a mdns: Fix null-service issue when parsing packets
Closes https://github.com/espressif/esp-idf/issues/8307


* Original commit: espressif/esp-idf@a57be7b7d1
2022-05-27 17:44:24 +04:00
ec03fec3d3 mdns: Update fuzzer test (add delegation, check memory)
* Add new config with no services
* Add new test packets and more queries
* Allocate packet to check for mem issues


* Original commit: espressif/esp-idf@2c1007156e
2022-05-27 17:44:24 +04:00
5909e9e54c mdns: Remove legacy esp_event API
* Original commit: espressif/esp-idf@e46aa515bd
2022-05-27 17:44:24 +04:00
82e2a5dcc1 mdns: added missing includes
* Original commit: espressif/esp-idf@28d09c7dbe
2022-05-27 17:44:24 +04:00
48e4d4035c mdns: Clear notification value in mdns_hostname_set
Merges https://github.com/espressif/esp-idf/pull/8284


* Original commit: espressif/esp-idf@83a4ddbd25
2022-05-27 17:44:24 +04:00
ba3fa24a96 esp_eth: Update esp32's EMAC API to decouple driver and vendor config
* Original commit: espressif/esp-idf@8da2e4088c
2022-05-27 17:44:24 +04:00
869f5b75af esp_eth: Make EMAC DMA burst size configurable
Merges https://github.com/espressif/esp-idf/pull/7874
Closes  https://github.com/espressif/esp-idf/issues/7380


* Original commit: espressif/esp-idf@2553fb5845
2022-05-27 17:44:24 +04:00
ac6dcb6830 esp_timer: remove legacy ESP32 FRC timer implementation.
* Original commit: espressif/esp-idf@edb76f14d6
2022-05-27 17:44:24 +04:00
085dbd8c4e freertos: Remove legacy data types
This commit removes the usage of all legacy FreeRTOS data types that
are exposed via configENABLE_BACKWARD_COMPATIBILITY. Legacy types can
still be used by enabling CONFIG_FREERTOS_ENABLE_BACKWARD_COMPATIBILITY.


* Original commit: espressif/esp-idf@57fd78f5ba
2022-05-27 17:44:24 +04:00
f78e8cfce8 Tools: Custom baud-rate setup is not possible for IDF Monitor from menuconfig anymore
IDF Monitor follows the console baud rate by default. Other baud rate
can be set from command line by "idf.py monitor -B <baud>" or through
environment variables. Run "idf.py monitor --help" for more information.


* Original commit: espressif/esp-idf@36a4011ff8
2022-05-27 17:44:24 +04:00
6cdf5ee074 mdns: Use memcpy() for copy to support non-text TXTs
* Original commit: espressif/esp-idf@6aefe9c185
2022-05-27 17:44:24 +04:00
fcb5515f1e mdns: Support for null-value TXT records
Closes https://github.com/espressif/esp-idf/issues/8267


* Original commit: espressif/esp-idf@23c2db406d
2022-05-27 17:44:24 +04:00
9fdbe5f130 mdns: Fix alloc issue if TXT has empty value
* Original commit: espressif/esp-idf@205f6ba854
2022-05-27 17:44:24 +04:00
20e6e9e7fe mdns: Fix random crash when defalt service instance queried
Merges https://github.com/espressif/esp-idf/pull/8248


* Original commit: espressif/esp-idf@f46dffca62
2022-05-27 17:44:24 +04:00
3c5b13ea0d ci/mdns: Run mdns test on ethernet runners
* Original commit: espressif/esp-idf@96616b6056
2022-05-27 17:44:24 +04:00
c588263b45 mdns: Fix minor memory leaks when creating services
* Original commit: espressif/esp-idf@fad62cc1ed
2022-05-27 17:44:24 +04:00
6258edf23b Fix mDNS memory leak
* Original commit: espressif/esp-idf@119b4a9dd1
2022-05-27 17:44:24 +04:00
c8b0d5ea9d Fix mDNS memory leak
* Original commit: espressif/esp-idf@f5ffd53aeb
2022-05-27 17:44:24 +04:00
5252b1d801 mdns: Use multi/uni-cast types in API
* Original commit: espressif/esp-idf@125c312552
2022-05-27 17:44:24 +04:00
4e11cc86fe mdns: Allow for unicast PTR queries
Adresses https://github.com/espressif/esp-idf/issues/7932


* Original commit: espressif/esp-idf@7eeeb01ea7
2022-05-27 17:44:24 +04:00
7af91ec490 mdns: Fix potential null deref for ANY query type
* Original commit: espressif/esp-idf@99dd8eedb1
2022-05-27 17:44:24 +04:00
01256d3e34 mdns: Make fuzzer layers compatible with llvm>=6
* Original commit: espressif/esp-idf@1882cbe44e
2022-05-27 17:44:24 +04:00
5a2d4eab6d mdns: Fix copyright
* Original commit: espressif/esp-idf@c83678f64f
2022-05-27 17:44:24 +04:00
9de3f534e2 Add mDNS miss comment
* Original commit: espressif/esp-idf@08e081340d
2022-05-27 17:44:24 +04:00
bcabc8ea16 freertos: remove FREERTOS_ASSERT option
Freertos asserts are now configured the same way as all other asserts in IDF,
i.e. by configuring COMPILER_OPTIMIZATION_ASSERTION_LEVEL.


* Original commit: espressif/esp-idf@7255497146
2022-05-27 17:44:24 +04:00
dfb27b39cc mdns: Minor err print fix in socket-networking layer
* Original commit: espressif/esp-idf@f1b8f5c102
2022-05-27 17:44:24 +04:00
076c095aec unified errno format
* Original commit: espressif/esp-idf@87506f46e2
2022-05-27 17:44:24 +04:00
7dd0bc1fff mdns: always send A/AAAA records in announcements
* Original commit: espressif/esp-idf@456f80b754
2022-05-27 17:44:24 +04:00
7e82a7cef7 mdns: filter instance name for ANY queries
The instance name in ANY quries was ignored. The MR fixes the issue.


* Original commit: espressif/esp-idf@5d0c47303d
2022-05-27 17:44:24 +04:00
ae381b779f mdns: Fix potential null deref reported by fuzzer test
* Original commit: espressif/esp-idf@cb5653fd94
2022-05-27 17:44:24 +04:00
d0f4e68c7a mdns: Unbreak test app cauased by async API change
Regression from 81d496ace9080fcd97df3cc7e9ce279531d67a48


* Original commit: espressif/esp-idf@c0d08faf91
2022-05-27 17:44:24 +04:00
941dc5c42f mdns: Minor fix of API description and API usage
* Original commit: espressif/esp-idf@c297301ecc
2022-05-27 17:44:24 +04:00
525c64915e Added results count to MDNS
* Original commit: espressif/esp-idf@f391d610e8
2022-05-27 17:44:24 +04:00
f0839d909b mdns: fix mdns server instance mismatch
* Original commit: espressif/esp-idf@6173dd7809
2022-05-27 17:44:24 +04:00
69902ea8e1 mdns: support multiple instance for mdns service txt set
* Original commit: espressif/esp-idf@50f6302c5d
2022-05-27 17:44:24 +04:00
d5001e894f mdns: added test app
Closes IDF-4132


* Original commit: espressif/esp-idf@e0d5fca390
2022-05-27 17:44:24 +04:00
145a8d2291 esp_eth: rework KSZ80xx implementation and add more KSZ80xx PHYs
* add support for KSZ8001, KSZ8021, KSZ8031, KSZ8051 and KSZ8061
* remove duplicate code
* simplify architecture to make the code base extensible (for future work)


* Original commit: espressif/esp-idf@3fb83f2866
2022-05-27 17:44:24 +04:00
d0bbe880b6 mdns: fix wrong PTR record count
* Original commit: espressif/esp-idf@5d3f8157e0
2022-05-27 17:44:24 +04:00
4a9d55edf7 Build & config: Remove leftover files from the unsupported "make" build system
* Original commit: espressif/esp-idf@766aa57084
2022-05-27 17:44:24 +04:00
be2a924674 Build & config: Remove the "make" build system
The "make" build system was deprecated in v4.0 in favor of idf.py
(cmake). The remaining support is removed in v5.0.


* Original commit: espressif/esp-idf@9c1d4f5b54
2022-05-27 17:44:24 +04:00
76fcd4128a freertos: update freertos folder structure to match upstream
The following changes have been made:
1. All FreeRTOS kernel source files are now placed in the
   freertos/FreeRTOS-Kernel folder to match with the upstream folder structure.
2. All kernel include files are now placed in freertos/FreeRTOS-Kernel/include.
3. All port files are now placed in freertos/FreeRTOS-Kernel/portable.
4. All additions/customizations are placed in freertos/esp_additions.
5. All other miscellaneous files (README, License files etc.) are moved to
   freertos/FreeRTOS-Kernel folder to match with the upstream.
6. Updated esp-cryptoauthlib to latest commit to resolve FreeRTOS
   include dependencies.

Signed-off-by: Sudeep Mohanty <sudeep.mohanty@espressif.com>


* Original commit: espressif/esp-idf@4846222102
2022-05-27 17:44:24 +04:00
fd8499c874 mdns: support service subtype
* Closes https://github.com/espressif/esp-idf/issues/5508


* Original commit: espressif/esp-idf@e7e8610f56
2022-05-27 17:44:24 +04:00
38b4fe2353 mdns: Fix parsing non-standard queries
Fix for packets containing unexpected domains, such as openthread.thread.home.arpa.
If we find this packet we set the name entry as invalid, but continue with parsing as the packet might contain related queries for us.

Closes https://github.com/espressif/esp-idf/issues/7694


* Original commit: espressif/esp-idf@d16f9bade5
2022-05-27 17:44:24 +04:00
eb7eeb58d3 [examples]: removed hyphens
Replaced hyphens with underscores in examples
project definition for all examples which had
hyphens in their project name. dpp-enrollee is
an exceptions because the name matches the
project directory name while the project
directory also contains hyphens.


* Original commit: espressif/esp-idf@81e9266204
2022-05-27 17:44:24 +04:00
b26606252f mdns: allow mutiple instances with same service type
* Original commit: espressif/esp-idf@b7a99f4658
2022-05-27 17:44:24 +04:00
5e087d82d6 mdns: Update copyright header
* Original commit: espressif/esp-idf@2a2b95b9c2
2022-05-27 17:44:24 +04:00
91a3d95f96 mdns: Fix potential null dereference identified by fuzzer tests
* Original commit: espressif/esp-idf@e7dabb14f7
2022-05-27 17:44:24 +04:00
6d6dd2b75e components/bt: move config BT_RESERVE_DRAM from bluedroid to ESP32 controller
* Original commit: espressif/esp-idf@b310c062cd
2022-05-27 17:44:24 +04:00
0611b0cb67 Eth_examples: added support of ESP32-S3 chip
Defined SPI modules default GPIO values for ESP32-S3

SPI bus needs to be initialized with SPI_DMA_CH_AUTO option


* Original commit: espressif/esp-idf@35454b2bf7
2022-05-27 17:44:24 +04:00
cf6ed1cc53 esp_eth: add support for multiple Ethernets modules at a time
Ethernet driver events properly bounded with ESP NETIF actions to support multiple Ethernet modules used at a time.

Components using Ethernet updated to conform with new API.

Closes https://github.com/espressif/esp-idf/issues/7318


* Original commit: espressif/esp-idf@ef30384902
2022-05-27 17:44:24 +04:00
52306e914f mdns: add notification callback for async APIs
* Original commit: espressif/esp-idf@986603cf07
2022-05-27 17:44:24 +04:00
d37ab6dd25 mdns: add more mdns result attributes
* Original commit: espressif/esp-idf@76ec76c12c
2022-05-27 17:44:24 +04:00
05dcd8f0ee examples/protocols: fix compilation when CONFIG_EXAMPLE_USE_OPENETH=y
The code checked CONFIG_ETH_USE_SPI_ETHERNET (which is usually set),
but CONFIG_EXAMPLE_ETH_SPI_xxx_GPIO options are only defined if
CONFIG_EXAMPLE_USE_SPI_ETHERNET is set. Fix the ifdef accordingly.
Regression from abc79de6.


* Original commit: espressif/esp-idf@ece73a3e55
2022-05-27 17:44:24 +04:00
5c55ea6e02 mdns: Add host test using linux target
* Original commit: espressif/esp-idf@fc7e2d9e90
2022-05-27 17:44:24 +04:00
0c71c7bfe1 mdns: Implement mdns_networking using BSD sockets
And use only if configured. By default we still use lwip raw (low-level) API


* Original commit: espressif/esp-idf@73dfe84bf2
2022-05-27 17:44:24 +04:00
4c368c0090 mdns: fix crash when adding services without hostname set
* Original commit: espressif/esp-idf@5e98772eaf
2022-05-27 17:44:24 +04:00
c2abeff476 examples: Update Ethernet examples to use new PHY LAN87xx init function
Ethernet examples device usage and Kconfig options synchronized


* Original commit: espressif/esp-idf@4e77430107
2022-05-27 17:44:24 +04:00
6a92d3253f CI: mdns example test: start responder after valid IP
to clean up the test and not to pollute the network unnecessarily.
Also keeps sending the delegated query until a response found


* Original commit: espressif/esp-idf@042fa1831e
2022-05-27 17:44:24 +04:00
af2275341e mdns: Fix fuzzer IDF-mock layer
Removed lwip dependencies
Simplified the mocks for esp32 and esp-netif


* Original commit: espressif/esp-idf@619235c2ee
2022-05-27 17:44:24 +04:00
b0957e70fd mdns: Clean the main mdns module from lwip dependencies
* Reduced number of include paths
* Abstract the internals of mdns packet (specifics defined in
mdns_networking.c)
* Use ESP_IP addresses instead of lwip addresses


* Original commit: espressif/esp-idf@54e329444a
2022-05-27 17:44:24 +04:00
47c7266103 mdns: Add asynchronous query API
Closes https://github.com/espressif/esp-idf/issues/7090


* Original commit: espressif/esp-idf@d81482d699
2022-05-27 17:44:24 +04:00
40da0d29be mdns: Fix crashes reported by the fuzzer tests
* Original commit: espressif/esp-idf@4a2e72677c
2022-05-27 17:44:24 +04:00
5f6b6f9273 mdns/fuzzer: Fix non-instrumentation test to reproduce fuzzer issues
Regression from 2893d7e21b skipped reading the packet causing issues when locally reproducing crashed found by the fuzzer


* Original commit: espressif/esp-idf@dae803335e
2022-05-27 17:44:24 +04:00
8a120829e2 mdns: return ESP_OK rather than ERR_OK in API functions
* Original commit: espressif/esp-idf@2386113972
2022-05-27 17:44:24 +04:00
46f28a8011 mdns: fix memory leak in mdns_free when adding delegated hostnames
* Original commit: espressif/esp-idf@0baee93211
2022-05-27 17:44:24 +04:00
5a81eaea3f mdns: Support for One-Shot mDNS queries
* Original commit: espressif/esp-idf@f167238fac
2022-05-27 17:44:24 +04:00
2ddaee2b6e mdns: allow explicit txt value length
* Original commit: espressif/esp-idf@b4e0088b68
2022-05-27 17:44:24 +04:00
73b1763029 example: set example wifi scan method to all channel:
in CI example test we could have runners with same SSID in the same lab.
Use scan on all channel will let DUT connect to the AP with best RSSI.


* Original commit: espressif/esp-idf@97a09e51ce
2022-05-27 17:44:24 +04:00
27fc285000 mdns: Fix crashes reported by the fuzzer
* Original commit: espressif/esp-idf@79ba738626
2022-05-27 17:44:24 +04:00
93e6efedc7 mdns: Minor correction of the test code
* Original commit: espressif/esp-idf@7d76245173
2022-05-27 17:44:24 +04:00
bc4cda8ea7 mdns: Fix fuzzer from miss-interpreting adding services as timeouts
* Original commit: espressif/esp-idf@14099fe15e
2022-05-27 17:44:24 +04:00
8a8d58d4dc mdns: fix test script delayed response
* Original commit: espressif/esp-idf@a4f263948c
2022-05-27 17:44:24 +04:00
402baebfee mdns: fix wrong SRV/PTR record handling
* Original commit: espressif/esp-idf@e6135552d2
2022-05-27 17:44:24 +04:00
9fa25ef3b6 mdns: fix wrong service hostname after mangling
* Original commit: espressif/esp-idf@439b31d065
2022-05-27 17:44:24 +04:00
121b525108 mdns: fix empty address change announce packets
* Original commit: espressif/esp-idf@7bbb72d865
2022-05-27 17:44:24 +04:00
418fb60dd9 mdns: fix mdns probe/reply behavior
* send correct hostnames when probing.
* add test for mdns host delegation.


* Original commit: espressif/esp-idf@d2a5d25984
2022-05-27 17:44:24 +04:00
4049b3b5ed mdns: make delegate host address a list
Also adds unit test and doc string for new apis.


* Original commit: espressif/esp-idf@2d34352f3d
2022-05-27 17:44:24 +04:00
c8821199a2 mdns: add remove delegate host api
* Original commit: espressif/esp-idf@2174693096
2022-05-27 17:44:24 +04:00
1eb5df9780 mdns: add mdns delegation
This allows publishing mdns services for other devices.


* Original commit: espressif/esp-idf@401ff56cc1
2022-05-27 17:44:24 +04:00
b62b4b3e25 mdns: fix memory free issue when repeating the query in reply
The repeated query will be copied in the next event loop while the
memory is freed instantly. Delay the free to fix this issue.


* Original commit: espressif/esp-idf@5f244c86f2
2022-05-27 17:44:24 +04:00
4d8aec1ad3 mdns: Fix of crash when wifi interface get deleted and mdns receives the packets
Closes https://github.com/espressif/esp-idf/issues/6973


* Original commit: espressif/esp-idf@03de74a728
2022-05-27 17:44:24 +04:00
6d649102ab Docs: Added README.md for lwip fuzzer tests
Closes IDFCI-540


* Original commit: espressif/esp-idf@53c18a85db
2022-05-27 17:44:24 +04:00
3ad559bf3f Split example_tests with Example_WIFI tag group into Example_OTA and Example_Protocols
* Original commit: espressif/esp-idf@0a395134d4
2022-05-27 17:44:24 +04:00
ab3fa69b8f mdns: Fixed the ip header TTL to be correctly set to 255
Defined in https://tools.ietf.org/html/rfc6762#section-11: All Multicast DNS responses (including responses sent via unicast)
   SHOULD be sent with IP TTL set to 255


* Original commit: espressif/esp-idf@5cce919cbe
2022-05-27 17:44:24 +04:00
c3a5826d60 mdns: Fix parsing answers with questions when instance name not set
mdns resolver didn't correctly resolved queries when host name wasn't
assigned. Fixed by allowing processing also if some answer present
(non-strict mode)

Closes https://github.com/espressif/esp-idf/issues/6598


* Original commit: espressif/esp-idf@34049454df
2022-05-27 17:44:24 +04:00
cbcbe4ffd7 mdns: Fix the resolver to correctly parse it's own non-strict answers
The resolver was able to respond correctly, but would also resolve its
own queries and cause issues with BCT 1.5.2, specifically
* MULTIPLE QUESTIONS - DUPLICATE SUPPRESSION
* MULTIPLE QUESTIONS - DISTRIBUTED DUPLICATE SUPPRESSION
tests failed.


* Original commit: espressif/esp-idf@b649603a0d
2022-05-27 17:44:23 +04:00
adc34309dc mdns: Add MDNS_STRICT_MODE config option
Strict mode was hardcoded in private header file, but it's useful for
users to enable/disable it depending on the mdns library they are using.
e.g. Avahi might not resolve the non-strict answers.


* Original commit: espressif/esp-idf@0eee31546d
2022-05-27 17:44:23 +04:00
7a8329cb5c Bugfix: Connect example to add scan mode config
Closes https://github.com/espressif/esp-idf/issues/6595


* Original commit: espressif/esp-idf@3373eff989
2022-05-27 17:44:23 +04:00
c30617d872 freertos: common config header
* Original commit: espressif/esp-idf@39cf818838
2022-05-27 17:44:23 +04:00
1e5eeb16ec mdns: Removed freeRTOS dependancies from fuzzer tests
* Original commit: espressif/esp-idf@55716945a9
2022-05-27 17:44:23 +04:00
22c7c0a195 mDNS: Updated APIs description and shows the warning when hostname contains domain name during the query
Closes https://github.com/espressif/esp-idf/issues/6590


* Original commit: espressif/esp-idf@9f8d2b944d
2022-05-27 17:44:23 +04:00
eda5d72acf examples: Strip IPv6 function in example and use sockaddr_storage to replace sockaddr_in6
* Original commit: espressif/esp-idf@821eea45b3
2022-05-27 17:44:23 +04:00
1623c0e729 components: Use CONFIG_LWIP_IPV6 to strip IPv6 function in components
* Original commit: espressif/esp-idf@da58235a0e
2022-05-27 17:44:23 +04:00
b114ed69de mdns: add bound check when setting interface as duplicate
Closes IDF-2787

Partially addresses https://github.com/espressif/esp-idf/issues/6440


* Original commit: espressif/esp-idf@2b9d2c06f5
2022-05-27 17:44:23 +04:00
49a00c2455 style: format python files with isort and double-quote-string-fixer
* Original commit: espressif/esp-idf@0146f258d7
2022-05-27 17:44:23 +04:00
dec1d7dcf8 esp_wifi: Modify ESP_IF_WIFI_STA to WIFI_IF_STA
* Original commit: espressif/esp-idf@b8a8fe3f54
2022-05-27 17:44:23 +04:00
2ffd22382d mDNS: Fix of text length calculation when detecting a collision
* Original commit: espressif/esp-idf@be0ae1ebbb
2022-05-27 17:44:23 +04:00
487287157d example: We should not check the return value of esp_wifi_connect() in any case
* Original commit: espressif/esp-idf@c260c223e9
2022-05-27 17:44:23 +04:00
1fe901f70f global: fix sign-compare warnings
* Original commit: espressif/esp-idf@753a929525
2022-05-27 17:44:23 +04:00
2cf9fd8891 lwip: Moved default SNTP API to esp_sntp.h
and make sntp.h in port folders of lwip component obsoleted


* Original commit: espressif/esp-idf@76f6dd6214
2022-05-27 17:44:23 +04:00
89439e0a9b mdns: Allow resolve its own non-strict answers
the mDNS responder should not repeat questions when replying, however resolvers
must ignore these questions field if they are present. esp-idf mDNS
library does include questions in answering packets (thus not strictly
following the RFC6762) so the resolver did not correctly resolved
another instance host name.

Closes https://github.com/espressif/esp-idf/issues/6190


* Original commit: espressif/esp-idf@0693e172de
2022-05-27 17:44:23 +04:00
becd5d0266 mDNS: Fix of collision detection during txt length calculation
Closes https://github.com/espressif/esp-idf/issues/6114


* Original commit: espressif/esp-idf@f33772c960
2022-05-27 17:44:23 +04:00
0d7a30944e esp32c3: Apply one-liner/small changes for ESP32-C3
* Original commit: espressif/esp-idf@5228d9f9ce
2022-05-27 17:44:23 +04:00
e2653e7fb0 eth: hide spi configuration when using internal emac
* Original commit: espressif/esp-idf@8d0a0537cc
2022-05-27 17:44:23 +04:00
df6a208f45 test: remove fake binary size check in example test:
the binary size check in example test was removed long time ago. Now we
have updated ttfw_idf to raise exception when performance standard is
not found. These fake performance check will be regarded as error.
Remove them now.


* Original commit: espressif/esp-idf@a908174c06
2022-05-27 17:44:23 +04:00
1fdffbbbab test: fix several test build error
* Original commit: espressif/esp-idf@b7ecccd901
2022-05-27 17:44:23 +04:00
d5566971fb eth: support W5500 in network examples
* Original commit: espressif/esp-idf@aea901f014
2022-05-27 17:44:23 +04:00
988d120902 freertos: Add RISC-V port
Changes come from internal branch commit a6723fc


* Original commit: espressif/esp-idf@87e13baaf1
2022-05-27 17:44:23 +04:00
fd47df3e30 mdns: Fix wrong mdns source address if lwIP IPv6 zones disabled
The struct definition of ip6_addr_t in lwip and esp_ip6_addr_t
differs since zone could be possibly disabled in lwip. Using memcpy to copy the
address will cause wrong source address. Copy the entries manually
instead.

Merges https://github.com/espressif/esp-idf/pull/6055


* Original commit: espressif/esp-idf@7ac97616c1
2022-05-27 17:44:23 +04:00
2cb3a6e35e Whitespace: Automated whitespace fixes (large commit)
Apply the pre-commit hook whitespace fixes to all files in the repo.

(Line endings, blank lines at end of file, trailing whitespace)


* Original commit: espressif/esp-idf@66fb5a29bb
2022-05-27 17:44:23 +04:00
ccd48bc9a9 lwip: Added description to Kconfig option on IPv6 SLAAC
Closes https://github.com/espressif/esp-idf/issues/6076
Merges https://github.com/espressif/esp-idf/pull/6078


* Original commit: espressif/esp-idf@9207c6ca8e
2022-05-27 17:44:23 +04:00
825652f3e1 test_compile_fuzzers: Fix include paths for host build
Regression in 988be6946681b592e3e51bb652b91bce54d7ba34, need to add
esp_hw_support component include dir here.


* Original commit: espressif/esp-idf@98a0cc783f
2022-05-27 17:44:23 +04:00
fc53888115 CI: Add a test to pre-check fuzzer tests compilation before weekly run
* Original commit: espressif/esp-idf@637f5c0a68
2022-05-27 17:44:23 +04:00
7635c0479b soc: descriptive part occupy whole component
* Original commit: espressif/esp-idf@79887fdc6c
2022-05-27 17:44:23 +04:00
d5fe42bffb Coredump config option rename throughout IDF
* Original commit: espressif/esp-idf@20af94ff53
2022-05-27 17:44:23 +04:00
e0bc60a586 mdns, dns, dhcp, dhcps: update fuzzer test to work in CI
Closes: IDF-1861 and IDF-1990


* Original commit: espressif/esp-idf@a43c06a592
2022-05-27 17:44:23 +04:00
9772e49b26 cmock: added cmock as component
* changing dependencies from unity->cmock
* added component.mk and Makefile.projbuild
* ignore test dir in gen_esp_err_to_name.py
* added some brief introduction of CMock in IDF


* Original commit: espressif/esp-idf@20c068ef3b
2022-05-27 17:44:23 +04:00
110f1f652d mdns test: Add test to resolve esp32 hostname with DiG
* Original commit: espressif/esp-idf@81e89476fe
2022-05-27 17:44:23 +04:00
ed77d65a82 examples: Common connect component: Unregister shutdown handler on disconnection
To be able to connect smoothly after disconnecting, we have to unregister all handlers including shutdown handler on disconnection


* Original commit: espressif/esp-idf@52a7721bf7
2022-05-27 17:44:23 +04:00
6021a88657 mdns: Support queries in responses in mDNS non-strict mode
By default adds original queries to responses in order to be resolved by some resolvers, such as lwIP mdns library. This functionality however is discouraged by the RFC6762, so it could be disabled in menuconfig if MDNS_STRICT_MODE configured

Closes https://github.com/espressif/esp-idf/issues/5521


* Original commit: espressif/esp-idf@bcfa36db8f
2022-05-27 17:44:23 +04:00
78f71ecdf6 mdns: Fix include query ID in reponses
Closes https://github.com/espressif/esp-idf/issues/5574


* Original commit: espressif/esp-idf@f62e321d87
2022-05-27 17:44:23 +04:00
07f57523c8 examples: common connect to also support no connection flow if no inteface chosen
This is useful for testing if there's no need for external network and connection


* Original commit: espressif/esp-idf@085d2b8d25
2022-05-27 17:44:23 +04:00
ad67a23097 vfs: support vfs uart set line endings with specified uart number
* Original commit: espressif/esp-idf@8e00522cd7
2022-05-27 17:44:23 +04:00
078abd8161 esp_rom: extract common GPIO apis into esp_rom_gpio.h
* Original commit: espressif/esp-idf@a4d0033c03
2022-05-27 17:44:23 +04:00
f1f6c5de05 examples: common connect: fix build error if ipv6 disabled
Declaration of local variable esp_ip6_addr_t ip6[]; was active even if IPV6 disabled in sdkconfig. Introduced in 62e39adff8db0605875fe7103c8919fbfe229f20


* Original commit: espressif/esp-idf@5c6bca69a5
2022-05-27 17:44:23 +04:00
12fb6d8e15 protocol_examples_common: keep buffering enabled on stdout
- Newlib uses significantly more stack space when printing to an unbuffered stream
- For examples tests, disabling buffering on stdout is not really required

This issue was found during one of the OTA example test failure, root cause
being stack overflow in `esp_event` task.


* Original commit: espressif/esp-idf@7925ba245d
2022-05-27 17:44:23 +04:00
2258d5bcef mdns-example: fail gracefully if mdns response not received within timeout
If mdns answer hasn't been received within timeout, Value error would be raised, but the mdns-server-thread would still run, blocking CI jobs. Fixed by moving the raise statement within try-finally block


* Original commit: espressif/esp-idf@3758177bf8
2022-05-27 17:44:23 +04:00
54f5c6f29c examples: common connect component to use both interfaces at once
* Original commit: espressif/esp-idf@06711c7c36
2022-05-27 17:44:23 +04:00
3319844745 mdns: Allow config mDNS task stack size
Signed-off-by: Axel Lin <axel.lin@gmail.com>

Merges https://github.com/espressif/esp-idf/pull/5216


* Original commit: espressif/esp-idf@cf7e48c779
2022-05-27 17:44:23 +04:00
ac70c9aba8 mdns: Remove mbedtls dependency
mdns does not use mbedtls, so remove mbedtls dependency.

Signed-off-by: Axel Lin <axel.lin@gmail.com>


* Original commit: espressif/esp-idf@f4a4549a34
2022-05-27 17:44:23 +04:00
123ae8db62 examples: add socket stdin utils to common connect component
* Original commit: espressif/esp-idf@a5a750ba48
2022-05-27 17:44:23 +04:00
e24cc7d1ae common_connect: add support for getting multiple IPv6 addresses
* Original commit: espressif/esp-idf@63aa0d6e9c
2022-05-27 17:44:23 +04:00
9d9aac1569 esp-netif: support for ipv6 addr types and indices
* Original commit: espressif/esp-idf@56725fa678
2022-05-27 17:44:23 +04:00
ef9a758662 Add multi-target support for performance tests
* Original commit: espressif/esp-idf@15884eccf2
2022-05-27 17:44:23 +04:00
2a23f355c7 examples: enable IPv6 in example common connect for esp32s2
Closes IDF-1115


* Original commit: espressif/esp-idf@0927ac648f
2022-05-27 17:44:23 +04:00
07399011f7 examples: common connect code to ignore GOT_IP6_EVENT if comes from unrelated netif
* Original commit: espressif/esp-idf@48fe3a13f5
2022-05-27 17:44:23 +04:00
2b7d43e1f8 mdns: limit the GOT_IP6_EVENT to only known network interfaces
* Original commit: espressif/esp-idf@ab8cab1c55
2022-05-27 17:44:23 +04:00
7bf23a7fe9 doc: Changed Chinese doc to use dynamic chip name
* Original commit: espressif/esp-idf@cfeb9e68cb
2022-05-27 17:44:23 +04:00
881ca095f0 doc: Update English pages with generic target name
* Original commit: espressif/esp-idf@9352899d69
2022-05-27 17:44:23 +04:00
d9fa457b4f docs: add new top-level docs builder that builds docs for a single chip
* Original commit: espressif/esp-idf@e6211c7864
2022-05-27 17:44:23 +04:00
4eb3e89841 esp32: add implementation of esp_timer based on TG0 LAC timer
Closes: IDF-979


* Original commit: espressif/esp-idf@739eb05bb9
2022-05-27 17:44:23 +04:00
74aee42f80 ethernet: work with cache disabled
add ETH_MAC_FLAG_WORK_WITH_CACHE_DISABLE flag, make ethenret driver
possible to work when cache disabled

Closes https://github.com/espressif/esp-idf/issues/4406


* Original commit: espressif/esp-idf@5ad0bdd8db
2022-05-27 17:44:23 +04:00
b5e5a64e7f mdns: fixed typos in the variable names and the comments
* Original commit: espressif/esp-idf@ecca39e19f
2022-05-27 17:44:23 +04:00
6713ffedcc mdns: fix preset of esp_netif ptr for local interfaces
mdns module store local copy of esp_netif for common interfaces,
but it was correctly initialized only when interface started.
If the event were missed (e.g. mdns_init after interface start)
the local copy wouldn't be initialized. Fixed by restoring the local
copy.

Closes WIFI-1538


* Original commit: espressif/esp-idf@09e36f9f33
2022-05-27 17:44:23 +04:00
817c4fd2e8 mdns: fixed crash on event during deinit
mdns library deinitialization destroys internal structures including action queue. if an event (e.g. network update) received
after some essential stucture is destoyed, an unexpected behavour might be introduced (e.g. crash of adding the event notification
to the action queue which was already destroyed

Closes WIFI-1485


* Original commit: espressif/esp-idf@eaa2f12d67
2022-05-27 17:44:23 +04:00
8f0dc6d578 mdns: respond to discovery with the proper pseudo name _services._dns-sd._udp
Closes https://github.com/espressif/esp-idf/issues/4369
Closes IDFGH-2219


* Original commit: espressif/esp-idf@de17a1487f
2022-05-27 17:44:23 +04:00
7a3aa26df8 test: update example and unit tests with new import roles:
tiny_test_fw is a python package now. import it using normal way.


* Original commit: espressif/esp-idf@c906e2afee
2022-05-27 17:44:23 +04:00
c7ff8ba0c9 ethernet: warning when double start/stop
* Original commit: espressif/esp-idf@ac11545e0a
2022-05-27 17:44:23 +04:00
80ce63d73e ethernet: move netif glue && add ref counter
1. move netif glue into single file
2. add reference counter for Ethernet driver


* Original commit: espressif/esp-idf@c3ee156df0
2022-05-27 17:44:23 +04:00
d20666f3a0 mdns: fixed forgotten merge conflicts in debug code
* Original commit: espressif/esp-idf@d9433ef692
2022-05-27 17:44:23 +04:00
cd3cc0be3b ethernet: add gpio number into config structure
* Original commit: espressif/esp-idf@05d71319de
2022-05-27 17:44:23 +04:00
1734e59057 zh_CN translation of mdns service
* Original commit: espressif/esp-idf@9691a755f6
2022-05-27 17:44:23 +04:00
662a4ce050 mdns: add missing include of esp_task.h
* Original commit: espressif/esp-idf@5884b80908
2022-05-27 17:44:23 +04:00
fb1de80fd7 mdns: add configuration values for task priority, affinity and internal service timeouts
closes https://github.com/espressif/esp-idf/issues/4217


* Original commit: espressif/esp-idf@c6f38f04f8
2022-05-27 17:44:23 +04:00
1f35e9a728 tcpip_adapter: updated tcpip_adapter compatablity layer to include all
public API and keep 100% backward compatibility
update build of tcpip adapter when ethernet disabled


* Original commit: espressif/esp-idf@7f5cda1b82
2022-05-27 17:44:23 +04:00
573855031d esp_netif: extract wifi_netif module as an abstraction to wifi universal interface defined by if handle and callback
* Original commit: espressif/esp-idf@20add7da60
2022-05-27 17:44:23 +04:00
d1c62628b8 esp_netif and examples: using wifi driver handle, update examples and tests to pass the CI
* Original commit: espressif/esp-idf@3a19bf055d
2022-05-27 17:44:23 +04:00
48b819bbc1 mdns: update mdns to use esp-netif for mdns supported services such as STA, AP, ETH
removes also include dependency on lwip to use esp_netif defined address fields and structures


* Original commit: espressif/esp-idf@19e24fe61e
2022-05-27 17:44:23 +04:00
dfcefc38fd examples: protocol examples which use common connection component
updated to use esp_netif_init instead of tcpip_adapter in initialization code


* Original commit: espressif/esp-idf@a49b934ef8
2022-05-27 17:44:23 +04:00
879a6cdfa3 examples: common component initialization code to use new esp_netif
instead of tcpip_adapter


* Original commit: espressif/esp-idf@21464465ea
2022-05-27 17:44:23 +04:00
53e2aa3241 esp_netif: Introduction of esp-netif component as a replacement of tcpip_adpter
- provides object oriented access to network intefaces
- not limited to default netifs
- more generic abstraction to network input output functions
- event handler registration removed from component responsibility
- backward compatibility layer for legacy tcpip_apapter APIs

Closes IDF-39


* Original commit: espressif/esp-idf@ffe043b1a8
2022-05-27 17:44:23 +04:00
3cc64469c1 examples: removed ip4addr_ntoa and used prefered IP2STR for displaying IP addresses
* Original commit: espressif/esp-idf@ec9f245dd3
2022-05-27 17:44:23 +04:00
248b11bb0a esp_event, mdns: fixes for CONFIG_ETH_ENABLED=n
* Original commit: espressif/esp-idf@569ad7545c
2022-05-27 17:44:23 +04:00
d52dddfea5 ci: limit example test to ESP32s
* Original commit: espressif/esp-idf@63329b169b
2022-05-27 17:44:23 +04:00
67d310b988 run WiFi on ESP32SBETA
* Original commit: espressif/esp-idf@99ef587a05
2022-05-27 17:44:23 +04:00
901124b7ee build and link hello-world for esp32s2beta
* Original commit: espressif/esp-idf@84b2f9f14d
2022-05-27 17:44:23 +04:00
f6ff165be9 mdns: fix crash for hostname queries
Receiving TXT, PTR, SDPTR and SRV record type queries would crash the application if the hostname
 was used as instance name.

Closes https://github.com/espressif/esp-idf/issues/4224


* Original commit: espressif/esp-idf@3d1170031b
2022-05-27 17:44:23 +04:00
d8d6b35553 mdns: updated example test to exercise also hostnames resolved by lwip gethostbyname and getaddrinfo
* Original commit: espressif/esp-idf@f3cb91ef71
2022-05-27 17:44:23 +04:00
f44c569422 mdns: fix possible race condition when checking DHCP status on WIFI_EVENT_STA_CONNECTED event.
tcpip_adapter_dhcpc_get_status() returns the actual internal value of dhcp client without any locking or TCP/IP stack context call, so when CONNECTED event fired with default settings it started DHCP client in TCP/IP stack context and at the same time mdns event handler checking actual DHCP state, which could still be INIT (not STARTED). Purpose of this check is to enable PCB if DHCP was stopped before setting network interface up (typically static IP settings), so the solutin is to check against TCPIP_ADAPTER_DHCP_STOPPED state


* Original commit: espressif/esp-idf@7f410a0bcb
2022-05-27 17:44:23 +04:00
7dfe14c83d ethernet: support OpenCores ethernet MAC
OpenCores Ethernet MAC has a relatively simple interface, and is
already supported in QEMU. This makes it a good candidate for enabling
network support when running IDF apps in QEMU, compared to the
relatively more complex task of writing a QEMU model of ESP32 EMAC.

This driver is written with QEMU in mind: it does not implement or
handle things that aren't implemented or handled in the QEMU model:
error flags, error interrupts. The transmit part of the driver also
assumes that the TX operation is done immediately when the TX
descriptor is written (which is the case with QEMU), hence waiting for
the TX operation to complete is not necessary.

For simplicity, the driver assumes that the peripheral register
occupy the same memory range as the ESP32 EMAC registers, and the
same interrupt source number is used.


* Original commit: espressif/esp-idf@31dac92e5f
2022-05-27 17:44:23 +04:00
286c646725 mdns: use constant size of AAAA answer in mdns packets instead of deriving from lwip struct size, since the struct could contain also zones
closes WIFI-771


* Original commit: espressif/esp-idf@e5e31c5d01
2022-05-27 17:44:23 +04:00
0582187b9a examples: gracefully shut down Wi-Fi before restart
This fixes the issue that if Wi-Fi is stopped from a shutdown handler,
the code in connect.c tries to reconnect, and fails because Wi-Fi is
already stopped.
Also make the error check in connect.c less strict.


* Original commit: espressif/esp-idf@28a440521e
2022-05-27 17:44:23 +04:00
28d5b74a00 ethernet: update spi-ethernet api
* Original commit: espressif/esp-idf@546ac64a9e
2022-05-27 17:44:23 +04:00
c70d527d80 esp_wifi: wifi support new event mechanism
1. WiFi support new event mechanism
2. Update examples to use new event mechanism


* Original commit: espressif/esp-idf@003a9872b7
2022-05-27 17:44:23 +04:00
7cdf96cffa mdns: fix missing bye packet if services removed with mdns_service_remove_all() or mdns_free()
Closes https://github.com/espressif/esp-idf/issues/3660


* Original commit: espressif/esp-idf@a001998d52
2022-05-27 17:44:23 +04:00
407875d9c5 mdns: mdns_service_remove_all doesn't take an argument
Merges https://github.com/espressif/esp-idf/pull/2937


* Original commit: espressif/esp-idf@c2764f6fe8
2022-05-27 17:44:23 +04:00
3e753f5e2d tools: Mass fixing of empty prototypes (for -Wstrict-prototypes)
* Original commit: espressif/esp-idf@afbaf74007
2022-05-27 17:44:23 +04:00
aaba3fc47a examples: change default build instructions in docs to CMake
* Original commit: espressif/esp-idf@e7dba7d7bc
2022-05-27 17:44:23 +04:00
144d4ad1d4 mdns: fix ignoring mdns packet with some invalid name entries in question field
In case of invalid name entry, only this entry is invalidated and parsing continues as other query entries could contain questions to be responded to


* Original commit: espressif/esp-idf@4bd4c7caf3
2022-05-27 17:44:23 +04:00
e431b6b7fe build system: Use CMake-based build system as default when describing commands
* Original commit: espressif/esp-idf@47bbb107a8
2022-05-27 17:44:23 +04:00
ed71a239a8 ethernet: support dm9051
1. move resource allocation from xxx_init to xxx_new
2. fix enabling tx checksum insertion by mistake
3. iperf example: enlarge max arguments
4. add examples for spi-ethernet

Closes https://github.com/espressif/esp-idf/issues/3715
Closes https://github.com/espressif/esp-idf/issues/3711


* Original commit: espressif/esp-idf@cb42c29252
2022-05-27 17:44:23 +04:00
680bad646f add esp_eth component
* Original commit: espressif/esp-idf@90c4827bd2
2022-05-27 17:44:23 +04:00
271665e0cb examples: use new component registration api
* Original commit: espressif/esp-idf@6771eead80
2022-05-27 17:44:23 +04:00
7fb6686716 components: use new component registration api
* Original commit: espressif/esp-idf@9eccd7c082
2022-05-27 17:44:23 +04:00
4912bef740 mdns: fix static analysis warnings
* Original commit: espressif/esp-idf@c34de4cba6
2022-05-27 17:44:23 +04:00
181a22ec2b mdns: added initial suite of api unit tests
* Original commit: espressif/esp-idf@e6801912c5
2022-05-27 17:44:23 +04:00
4172219225 mdns tests: adapt mdns fuzzer test to compile with event loop library
* Original commit: espressif/esp-idf@38d15cbd63
2022-05-27 17:44:23 +04:00
9a0803ad7e Rename Kconfig options (examples)
* Original commit: espressif/esp-idf@151f757912
2022-05-27 17:44:23 +04:00
05ddd5f0e4 Rename Kconfig options (components/esp32)
* Original commit: espressif/esp-idf@0ae53691ba
2022-05-27 17:44:23 +04:00
7e3b35efd9 mdns: documentation: fixed inconsistent enum in example of reading mdns results
* Original commit: espressif/esp-idf@786f5641f7
2022-05-27 17:44:23 +04:00
98d2c1a073 mdns: fixed mdns crashing on reception of txt packet without a corresponding service
closes #2866


* Original commit: espressif/esp-idf@af48977f21
2022-05-27 17:44:23 +04:00
84cbb1f3cf mdns: use const char* for mdns txt items types to remove warning when assigning
* Original commit: espressif/esp-idf@c050a75616
2022-05-27 17:44:23 +04:00
4c6818ee97 mdns: updated doxygen comments documenting mdns api
Closes https://github.com/espressif/esp-idf/issues/1718


* Original commit: espressif/esp-idf@a851aac255
2022-05-27 17:44:23 +04:00
c440114d14 mdns: update mdns_out_question_s to be in line with mdns_parsed_question_s struct
Closes  https://github.com/espressif/esp-idf/issues/1568


* Original commit: espressif/esp-idf@eddd5c4f2c
2022-05-27 17:44:23 +04:00
c0f65a6997 mdns example: Remove a warned unused constant
* Original commit: espressif/esp-idf@453a33ce79
2022-05-27 17:44:23 +04:00
778eaa6ced examples/protocols/mdns: use common network component
* Original commit: espressif/esp-idf@9628c60a1d
2022-05-27 17:44:23 +04:00
25f8656fbc examples: add component for protocol examples network functionality
* Original commit: espressif/esp-idf@22bef90bd3
2022-05-27 17:44:23 +04:00
6ea0ea93fa mdns: use esp_event library to handle events
* Original commit: espressif/esp-idf@a2d59525e5
2022-05-27 17:44:23 +04:00
d9aec9fc71 fuzzer tests: update of mdns and lwip host compilation for fuzzer testing
Closes IDF-540


* Original commit: espressif/esp-idf@bc60bbbeaf
2022-05-27 17:44:23 +04:00
985e69117e mdns: fix possible crash when probing on particular interface with duplicated service instances due to naming conflicts on network
Issue: MDNS server initially sends probing packets to resolve naming confilicts with already registered service instances. In case of a conflict, instance name is altered and probing restarts. Original instance however wasnnot removed from the structure and upon service removal only one entry was removed and a dangling service might have been kept in the structure to bring about a crash.
Resolution: Keep only one instance of a service in the probing structure.

Closes IDF-498


* Original commit: espressif/esp-idf@265e983a45
2022-05-27 17:44:23 +04:00
75deebbf03 mdns: enable pcbs before starting service thread to avoid updating pcb's internal variables from concurent tasks
possible race condition: user task runs mdns_init, which enables pcbs while mdns-task already created could execute enable/disable of the same pcbs if an appropriate system event received


* Original commit: espressif/esp-idf@c87f0cb6ca
2022-05-27 17:44:23 +04:00
fdd27dc9fa mdns: fix possible deadlock on mdns deinit calling mdns_free()
mnds_free() initiates stop and delete timer tasks, which after locking the mutex could lead to a dead lock in case timer task executed before deleting the task, as it would wait indefinitelly for unlocking the mutex. This condition is fixed by calling _mdns_stop_timer without locking the mutex, because there's no need to protect any data when stopping and deleting the timer task

Closes https://github.com/espressif/esp-idf/issues/1696


* Original commit: espressif/esp-idf@48b5501c25
2022-05-27 17:44:23 +04:00
2ec3b558ea mdsn: fix race condition in updating packet data from user task when failed to allocate or queue a new service
Issue: mdns_service_add API allocates and queues an action to be processed in mdns task context; when allocation or queueing fails, allocated structure needs to be freed. Function _mdns_free_service did not only fee all the structures, but also updates packet data.
Resolution: Moved removal of packet data outside of _mdns_free_service function.


* Original commit: espressif/esp-idf@021dc5d453
2022-05-27 17:44:23 +04:00
450cbf03cf mdns: fix possible crash when packet scheduled to transmit contained service which might have been already removed
packets scheduled to transmit are pushed to action queue and removed from tx_queue_head structure, which is searched for all remaining services and while service is removed, then service questions/asnwers are also removed from this structure. This update fixes possible crash when packet is pushed to action queue, and when service is removed, its answers are removed from tx_queue_head, but not from action queue. this could lead to a crash when the packet is poped from action queue containing questions/answers to already removed (freed) service

Closes IDF-504


* Original commit: espressif/esp-idf@67051a286b
2022-05-27 17:44:23 +04:00
34f6d8dd33 mdns: use binary semaphore instead of mutex when searching
mdns_search_once_t::lock is used to synchronize tasks (taken by one
task and given by the other) so it should not be a mutex.
Convert to semaphore, and rename to indicate its purpose.


* Original commit: espressif/esp-idf@eef0b5090a
2022-05-27 17:44:22 +04:00
b6efc688b5 mdns: fix memory leak in pbuf if tcpipadapter failed to get netif
* Original commit: espressif/esp-idf@8462751f95
2022-05-27 17:44:22 +04:00
11e4aebefd mdns example: fix print result for IPv6 addresses
* Original commit: espressif/esp-idf@fbef5297fc
2022-05-27 17:44:22 +04:00
90e4babc61 mdns: fix malfuctional query_txt
when running a query for a single txt, result entries were not created and attached to result structure. this issue was introduced when fixing memory leak in txt structure, which worked correctly for PTR queries, but caused trouble for TXT query.


* Original commit: espressif/esp-idf@1a027734af
2022-05-27 17:44:22 +04:00
c546ab8dea mdns: fix possible crash when mdns_free called while action queue not empty
* Original commit: espressif/esp-idf@206b47c03a
2022-05-27 17:44:22 +04:00
6582b41cd1 mdns: fix memory leak when query for service receives multiple ptr entries for one instance
fixes redmine issue 27300


* Original commit: espressif/esp-idf@9a4da97fb4
2022-05-27 17:44:22 +04:00
358d26c8a1 mdns: fix crash after init if no memory for task
mdns init first starts timer task, then starts service task. if service task failed to be created, timer task needs to be stopped too.
fixed https://ezredmine.espressif.cn:8765/issues/28466


* Original commit: espressif/esp-idf@a47768dc4e
2022-05-27 17:44:22 +04:00
8d08e5ed95 mdns tests: execute test services only when running example in ci
Test services may cause confussion (and did cause some GitHub/forum issues). This update runs test services only when example executed in ci. Also host name is a simple config entry if executed outside of ci.


* Original commit: espressif/esp-idf@74cc7a065f
2022-05-27 17:44:22 +04:00
2ac83d0f27 mdns: fixed crash on free undefined ptr after skipped strdup
Shortcircuit evaluation may cause skip of _mdns_strdup_check of any further question field, which after clear_rx_packet freed undefined memory.
Fixes https://ezredmine.espressif.cn:8765/issues/28465


* Original commit: espressif/esp-idf@e0a8044a16
2022-05-27 17:44:22 +04:00
98e3171db6 Correct Kconfigs according to the coding style
* Original commit: espressif/esp-idf@37126d3451
2022-05-27 17:44:22 +04:00
2f85c075be mdns: fix networking running udp_sendif from lwip thread
* Original commit: espressif/esp-idf@f7d4a4be6a
2022-05-27 17:44:22 +04:00
b30a7fec27 mdns: fixed static memory leak
* Original commit: espressif/esp-idf@6bb68a5a75
2022-05-27 17:44:22 +04:00
7a4fdad16d mdns: check all mallocs for failure and add default hook to log error with free heap
solves crash about _mdns_result_txt_create when stress test


* Original commit: espressif/esp-idf@c8cb4cd3c8
2022-05-27 17:44:22 +04:00
b4e57424f9 mdns: resolve memory leak when txt record received multiple times
* Original commit: espressif/esp-idf@a6b2b73f03
2022-05-27 17:44:22 +04:00
2763bcdb8d mdns: skip sending search when finished, not properly locked timer task
* Original commit: espressif/esp-idf@31163f02d5
2022-05-27 17:44:22 +04:00
dce0b26ef8 examples: Fix Python coding style
* Original commit: espressif/esp-idf@57c54f96f1
2022-05-27 17:44:22 +04:00
ade4aeffa5 mdns: added example test for ci runners
* Original commit: espressif/esp-idf@6309643c1d
2022-05-27 17:44:22 +04:00
8cd0e8a501 mdns: sending search packets also in probing and announcing state
mdns queries did not work properly when send imeadiately after set_hostname, which cuased reinit of pcb and therefore restarted probing, so search packets were blocked until probing finished
closes #2507, closes #2593


* Original commit: espressif/esp-idf@d16762a036
2022-05-27 17:44:22 +04:00
9b3b41c3f1 mdns: fixed crashes on network changes
1) two events AP_STOP, AP_START shortly after each other may cause IGMP config on already stopped netif
2) not properly locked sending packets to queue from timer task

closes #2580


* Original commit: espressif/esp-idf@097282a8e3
2022-05-27 17:44:22 +04:00
ea2300753e Update network code for mDNS to work with newest LwIP
- Uses one PCB that listens to all interfaces
- Manages multicast groups for each interface


* Original commit: espressif/esp-idf@3ec0e7e2d2
2022-05-27 17:44:22 +04:00
81c219d4ee feat(mdns): fix bug when clean action memory
* Original commit: espressif/esp-idf@3d4deb9726
2022-05-27 17:44:22 +04:00
0c17121ad7 bugfix: mdns_service_txt_set() wasn't allocating memory for TXT records
Allocation was happening later, causing possible use of stack variables
of caller function, which could be invalid.

Signed-off-by: Piyush Shah <piyush@espressif.com>


* Original commit: espressif/esp-idf@e5e2702ca3
2022-05-27 17:44:22 +04:00
67173f6770 cmake: make main a component again
* Original commit: espressif/esp-idf@d9939cedd9
2022-05-27 17:44:22 +04:00
fed787f54f Feature/sync lwip as submodule
* Original commit: espressif/esp-idf@3578fe39e0
2022-05-27 17:44:22 +04:00
b4ab30b5de mdns: Fix a portion of the queries are issued with the wildcard query type
* Original commit: espressif/esp-idf@f3f0445f4d
2022-05-27 17:44:22 +04:00
dd714947d6 added CI job for AFL fuzzer tests
* Original commit: espressif/esp-idf@0c147648f7
2022-05-27 17:44:22 +04:00
39de491597 mdns: Minor fix for mdns_service_remove()
Send the Goodbye packet while removing an mDNS service as an "Authoritative" packet so
that the listeners remove the service from their records immediately.


* Original commit: espressif/esp-idf@5c7eb7e27b
2022-05-27 17:44:22 +04:00
19acac76eb Replace all DOS line endings with Unix
Command run was:
git ls-tree -r HEAD --name-only | xargs dos2unix


* Original commit: espressif/esp-idf@a67d5d89e0
2022-05-27 17:44:22 +04:00
0191d6fcd7 fix(mdns): add the maximum number of services
* Original commit: espressif/esp-idf@ba458c69cf
2022-05-27 17:44:22 +04:00
b26c8665f8 fix(mdns): fix the exception when remove one of multiple service
* Original commit: espressif/esp-idf@696d733eb0
2022-05-27 17:44:22 +04:00
98069f9ca2 remove executable permission from source files
* Original commit: espressif/esp-idf@cb649e452f
2022-05-27 17:44:22 +04:00
ad29d34bb6 Fixed nullptr dereference in MDNS.c
* Original commit: espressif/esp-idf@fffbf7b750
2022-05-27 17:44:22 +04:00
9f1be3668e MDNS-Fuzzer: AFL fuzzer tests for mdsn packet parser
* Original commit: espressif/esp-idf@e983230be9
2022-05-27 17:44:22 +04:00
450c9de67b Fix potential NULL pointer dereference crash.
* Original commit: espressif/esp-idf@be707f1c6b
2022-05-27 17:44:22 +04:00
c7701d41f8 cmake: Add component dependency support
Components should set the COMPONENT_REQUIRES & COMPONENT_PRIVATE_REQUIRES variables to define their
requirements.


* Original commit: espressif/esp-idf@1cb5712463
2022-05-27 17:44:22 +04:00
b9726db48e cmake: Add CMakeLists.txt files for all examples
Generating using convert_to_cmake.py, with some minor cleanup


* Original commit: espressif/esp-idf@800bffb8b0
2022-05-27 17:44:22 +04:00
f1ccc4052e cmake: Remove defaults for COMPONENT_SRCDIRS, COMPONENT_SRCS, COMPONENT_ADD_INCLUDEDIRS
* Philosophical: "explicit is better than implicit".
* Practical: Allows useful errors if invalid directories given in components as the defaults aren't
  always used. Also trims the -I path from a number of components that have no actual include
  directory.
* Simplifies knowing which components will be header-only and which won't


* Original commit: espressif/esp-idf@4f1a856dbf
2022-05-27 17:44:22 +04:00
84bd1d7e88 build system: Initial cmake support, work in progress
* Original commit: espressif/esp-idf@c671a0c3eb
2022-05-27 17:44:22 +04:00
259d3fc609 fix the bug that in mdns test code redefine esp_err_t to uint32_t, which should be int32_t
* Original commit: espressif/esp-idf@81e4cad615
2022-05-27 17:44:22 +04:00
6d99957f2d Fix Kconfig.projbuild in some examples, where myssid is erroneously kept as the default value for password.
Signed-off-by: Hrishikesh Dhayagude <hrishi@espressif.com>


* Original commit: espressif/esp-idf@59d19d12af
2022-05-27 17:44:22 +04:00
7784d002fc Fix exception when service is removed while there are pending packets that depend on it
* Original commit: espressif/esp-idf@421c6f154b
2022-05-27 17:44:22 +04:00
9ebd9852ca Examples: Demonstrate the usage of esp_err_to_name
* Original commit: espressif/esp-idf@27a63c492f
2022-05-27 17:44:22 +04:00
26f00e8ddb Moved files into separate folders per 'en' and 'zh_CN' language version and linked 'zh_CN' files back to 'en' files if translation is not yet available
* Original commit: espressif/esp-idf@097adc3a33
2022-05-27 17:44:22 +04:00
bce7d5231c mdns: Fix case where service is NULL and that will cause exception
* Original commit: espressif/esp-idf@4fa130ae4f
2022-05-27 17:44:22 +04:00
ef924f1aa5 mdns: Fix issue with some mDNS parsers
Some mDNS parser have issue with zero terminated TXT lists. This fix targets to overcome this issue. Found and tested with jmdns.


* Original commit: espressif/esp-idf@51dde19a76
2022-05-27 17:44:22 +04:00
ad8c92db52 Import mDNS changes
* Original commit: espressif/esp-idf@4bddbc031c
2022-05-27 17:44:22 +04:00
3aa605fe24 Fix compilation errors when using gcc-7.2.0 for the crosstool-ng toolchain
* Change snprintf for strlcat does not complain w/gcc7.2.0 and it is safer, thanks @projectgus
* Use proper quotes for character literals

Merges https://github.com/espressif/esp-idf/pull/1163


* Original commit: espressif/esp-idf@519edc332d
2022-05-27 17:44:22 +04:00
00a72b8920 components/mdns: wrong Message compression detect
Old behavior assumes message compressed when any of 2 most significant bits are set,
But in fact Message compressed only when both those bits are set to 1.

Also maximal label length should be 63 bytes.


* Original commit: espressif/esp-idf@6e24566186
2022-05-27 17:44:22 +04:00
907e7ee29e mdns: fix leak after _mdns_create_service if we have a malloc error.
* Original commit: espressif/esp-idf@b6b36bd9dd
2022-05-27 17:44:22 +04:00
b367484361 Use LwIP IPC for low-level API calls
* Original commit: espressif/esp-idf@713964fe9e
2022-05-27 17:44:22 +04:00
4a8582f500 Add AFL fuzz test
* Original commit: espressif/esp-idf@4c2622755d
2022-05-27 17:44:22 +04:00
75de31cea3 implement fixes for issues found while fuzz testing
* Original commit: espressif/esp-idf@99d39909c4
2022-05-27 17:44:22 +04:00
4acf639afc mdns: add simple dns-sd meta query support
tabs to spaces

match domain


* Original commit: espressif/esp-idf@96e8a3c725
2022-05-27 17:44:22 +04:00
1a1cf71a84 examples: Standardise naming of files, symbols, etc. in examples
* Use "example" in all example function & variable names,
  ie use i2c_example_xxx instead of i2c_xxx for example functions.
  Closes #198 https://github.com/espressif/esp-idf/issues/198
* Mark example functions, etc. static
* Replace uses of "test" & "demo" with "example"
* Split the UART example into two
* Rename "main" example files to end with "_main.c" for disambiguation


* Original commit: espressif/esp-idf@821c70f5d7
2022-05-27 17:44:22 +04:00
5924dafd94 examples: check return value of nvs_flash_init
nvs_flash_init may return an error code in some cases, and applications
should check this error code (or at least assert on it being ESP_OK, to
make potential issues more immediately obvious).

This change modifies all the examples which use NVS to check the error
code. Most examples get a simple ESP_ERROR_CHECK assert, while NVS
examples, OTA example, and NVS unit tests get a more verbose check which
may be used in real applications.


* Original commit: espressif/esp-idf@4813ab2d28
2022-05-27 17:44:22 +04:00
91bb5095f5 address security issues with mDNS
* Original commit: espressif/esp-idf@c89e11c8fa
2022-05-27 17:44:22 +04:00
caa4884b3a Added README.md to example category folders
* Original commit: espressif/esp-idf@0b6598c492
2022-05-27 17:44:22 +04:00
441a53c604 Moved examples to new folders / categories. Removed example numbers from example names
* Original commit: espressif/esp-idf@382999b378
2022-05-27 17:44:22 +04:00
7fbf8e5247 Initial mDNS component and example
* Original commit: espressif/esp-idf@dd3f18d2d8
2022-05-27 17:44:22 +04:00
7346ed9765 Merge pull request #24 from gabsuren/ci/websocket_add_test_job
CI: Added pytest example for websocket (IDFGH-7253)
2022-05-26 11:37:39 +02:00
76298ff70e CI: Added CI example run job 2022-05-25 20:12:38 +04:00
0875008a46 Merge pull request #30 from Sjurinho/feature/extended-simcom-support
Feature/extended simcom support (IDFGH-7243)
2022-05-25 13:21:50 +02:00
a661e51f7e esp_modem: Fix param description for get_operator_name()
Co-authored-by: Franz Höpfinger <krone-trailer@franzhoepfinger.de>
2022-05-24 17:44:35 +02:00
3ced2d9709 Update: Removed stringstream to decrease static sizes 2022-05-24 14:54:24 +02:00
ba88d7fdbc Update: Renamed list_in to be type-specific
Update: Removed modem-specific comment
2022-05-24 14:53:58 +02:00
4f3c4299d6 Update: Changed tests to coincide with new initial esp_modem mode 2022-05-24 14:53:11 +02:00
2a4e684848 Merge pull request #34 from david-cermak/bugfix/modem_cmux_uih
fix(esp_modem): Correction of switching to CMUX mode
2022-05-24 10:38:59 +02:00
541b391c3e Merge pull request #40 from gabsuren/docs/esp_websocket_client_readme
DOC: Updated README.md regarding esp_websocket_client
2022-05-24 10:28:10 +02:00
279a3cb6e0 DOC: Updated README.md regarding esp_websocket_client 2022-05-23 17:08:35 +04:00
60bb0eea99 Merge pull request #36 from diplfranzhoepfinger/feature/dte
typo (IDFGH-7360)
2022-05-15 15:54:49 +02:00
52de8f1b2a typo 2022-05-13 17:29:34 +02:00
503218b3ba fix(esp_modem): Correction of switching to CMUX
* BG96 needs a small pause between CMUX command reception and actual use
of the CMUX mode
* Correct CMUX payload reception to check FT_UIH message type (P/F flag
could be cleared or set)

Closes https://github.com/espressif/esp-protocols/issues/33
2022-05-10 18:04:18 +02:00
38149c8d9b Merge pull request #22 from 0xFEEDC0DE64/websocket_client_change_ping_interval
Add methods to allow get/set of websocket client ping interval (IDFGH-7096)
2022-05-03 09:26:54 +02:00
1984da150d Merge pull request #23 from 0xFEEDC0DE64/websocket_client_error
Implement websocket client connect error (IDFGH-7245)
2022-04-27 15:52:17 +02:00
9e37f537bd Implement websocket client connect error 2022-04-26 11:15:57 +02:00
e55f54b69e Add methods to allow get/set of websocket client ping interval 2022-04-26 11:06:20 +02:00
6e4d8a19ed Merge pull request #29 from MacDue/expose_fin
esp_websocket_client: Expose frame fin flag in websocket event
2022-04-26 08:47:15 +02:00
e98cf16859 Update: Removed duplicate power down function
Add: gnss power mode function
2022-04-20 09:37:39 +02:00
be3d2ece55 Update: Formatting 2022-04-20 09:16:05 +02:00
15ed885035 Add: Sim7600 extended support 2022-04-19 16:23:22 +02:00
b72a9ae710 esp_websocket_client: Expose frame fin flag in websocket event 2022-04-15 17:06:03 +01:00
0733ea8ff4 Add: Support for SIM7000 modules 2022-04-13 15:36:15 +02:00
15cbc9bd50 Update: modem_mode::UNDEF initially 2022-04-13 13:44:11 +02:00
bb7f198bea Add: sim7070 support 2022-04-13 13:42:57 +02:00
d3f7ea67fb Add: Expanded modem_command_library with more "standard" commands 2022-04-13 13:41:56 +02:00
6e5bede4c7 Merge pull request #28 from bitron/esp-modem_sim800_fix
esp_modem fix for SIM800 modem devices (IDFGH-7166)
2022-04-12 16:07:05 +02:00
d191a720d1 esp_modem: Fix DCE selection in ‘pppos_client’ example 2022-04-07 17:08:54 +02:00
cc0d52793b esp_modem: Fix AT command in ‘set_data_mode_sim8xx()’ for SIM800 modem device 2022-04-07 17:02:12 +02:00
804a8d5df6 Merge pull request #25 from tore-espressif/feature/usb_dte
Add USB DTE example
2022-04-04 16:05:29 +02:00
74040cfd1a esp_modem: Extend modem_console example with USB DTE 2022-04-04 15:48:47 +02:00
16ea3f7eb8 Merge pull request #21 from tore-espressif/fix/idf5.0
Fix IDFv5.0 include paths (IDFGH-6972)
2022-03-22 14:38:09 +01:00
1f5eb396c5 Fix IDFv5.0 include paths
Changed in commit a9fda54d39d1321005c3bc9b3cc268d0b7e9f052
2022-03-16 08:30:03 +01:00
827bebd2bc Merge pull request #20 from antmak/bugfix/passing_cmake_cxx_std_option
build: fix issue with passing cxx_std option, a common workaround (IDFGH-6876)
2022-03-04 12:49:51 +01:00
745201b188 build: fix issue with passing cxx_std option, a common workaround
issue: https://gitlab.kitware.com/cmake/cmake/-/issues/23297
2022-03-04 18:24:44 +07:00
ca266cabd0 Merge pull request #16 from david-cermak/update/modem_test_dynamic_poly
add(esp_modem): Add unit test to check polymorphic delete
2022-03-04 08:45:20 +01:00
e54b240870 add(esp_modem): Add unit test to check polymorphic delete 2022-03-04 08:37:22 +01:00
4ccc32ffb5 Merge pull request #19 from david-cermak/bugfix/fix_docs_build
CI: Fix docs build failure
2022-03-04 08:18:53 +01:00
91a177edd4 fix(ws_client): Docs to refer esp-protocols 2022-03-04 07:57:24 +01:00
f303cdc70b fix(CI): build docs & publish component failure 2022-03-04 07:44:45 +01:00
ab8c2da395 Merge pull request #18 from gabsuren/esp_websocket_client_migration_with_history
websocket: Initial version based on IDF 5.0 with history
2022-03-02 13:43:34 +01:00
80c3cf0f02 websocket: Initial version based on IDF 5.0 2022-03-02 15:48:43 +04:00
b3c777ad43 freertos: Remove legacy data types
This commit removes the usage of all legacy FreeRTOS data types that
are exposed via configENABLE_BACKWARD_COMPATIBILITY. Legacy types can
still be used by enabling CONFIG_FREERTOS_ENABLE_BACKWARD_COMPATIBILITY.


* Original commit: espressif/esp-idf@57fd78f5ba
2022-03-01 12:18:50 +04:00
8ce791e969 websocket: Added configs reconnect_timeout_ms and network_timeout_ms
Closes https://github.com/espressif/esp-idf/issues/8263


* Original commit: espressif/esp-idf@6c26d65203
2022-03-01 12:18:50 +04:00
fc7ed90d74 websocket: Updated Kconfig to use 'echo.websocket.events' echo server
Updated README to show how to run websocket echo server using Flask

Merges https://github.com/espressif/esp-idf/pull/8262


* Original commit: espressif/esp-idf@23598dfcec
2022-03-01 12:18:50 +04:00
59e82695e7 ws_client: Optimize example test payloads and timeouts
Important update: NO_DATA_TIMEOUT_SEC=5, as some ws-servers typically send pings in 30s or 10s intervals, so we might never fire shutdown test


* Original commit: espressif/esp-idf@323622be64
2022-03-01 12:18:50 +04:00
755f16222f ci/websockets: Run ws-client example test on ethernet runners
* Original commit: espressif/esp-idf@2649413ae8
2022-03-01 12:18:50 +04:00
bece6e7045 Add http_parser (new component) dependency
* Original commit: espressif/esp-idf@8e94cf2bb1
2022-03-01 12:18:50 +04:00
46bd32d952 websocket: removed deprecated API "esp_websocket_client_send"
Closes IDF-1470


* Original commit: espressif/esp-idf@7f6ab93f7e
2022-03-01 12:18:50 +04:00
525c70c0b2 refactor (test_utils)!: separate file for memory check functions
Memory check (leaks and heap tracing) functions for unit tests
now have a separate file now and are renamed for more consistency.

BREAKING CHANGE: renamed memory check function names which may be used
                 in unit tests outside IDF.


* Original commit: espressif/esp-idf@16514f93f0
2022-03-01 12:18:50 +04:00
c4c323666e docs: Fix spell and grammatical errors
- PCNT
- ESP-TLS
- ESP WebSocket Client


* Original commit: espressif/esp-idf@1df7f340be
2022-03-01 12:18:50 +04:00
19c0455b4d Build & config: Remove leftover files from the unsupported "make" build system
* Original commit: espressif/esp-idf@766aa57084
2022-03-01 12:18:50 +04:00
665c520faf [examples]: removed hyphens
Replaced hyphens with underscores in examples
project definition for all examples which had
hyphens in their project name. dpp-enrollee is
an exceptions because the name matches the
project directory name while the project
directory also contains hyphens.


* Original commit: espressif/esp-idf@81e9266204
2022-03-01 12:18:50 +04:00
9118e0f044 transport: Add CONFI_WS_TRANSPORT for optimize the code size
* Original commit: espressif/esp-idf@8b02c9026a
2022-03-01 12:18:50 +04:00
fbdbd550c0 ws_client: Fix const correctness in the API config structure
Merges https://github.com/espressif/esp-idf/pull/7113


* Original commit: espressif/esp-idf@70b1247a47
2022-03-01 12:18:50 +04:00
028be5a8d7 Split example_tests with Example_WIFI tag group into Example_OTA and Example_Protocols
* Original commit: espressif/esp-idf@0a395134d4
2022-03-01 12:18:50 +04:00
de7cd72f70 components: Remove repeated keep alive function by ssl layer function
In esp_http_client and esp_websocket_client components, esp_transport_tcp_set_keep_alive has been called and keep-alive config has been saved in ssl->cfg.keep_alive_cfg,
So no need to call esp_transport_ssl_set_keep_alive again.


* Original commit: espressif/esp-idf@c79a907e4f
2022-03-01 12:18:50 +04:00
4a608ec1cd components: Support bind socket to specified interface in esp_http_client and esp_websocket_client component
* Original commit: espressif/esp-idf@bead3599ab
2022-03-01 12:18:50 +04:00
f0351ff378 esp_websocket_client: Don't log the filename when logging "Websocket already stop"
Progress towards https://jira.espressif.com:8443/browse/IDFGH-4477


* Original commit: espressif/esp-idf@10bde42551
2022-03-01 12:18:50 +04:00
9219ff710a websocket: Add websocket unit tests
* Original commit: espressif/esp-idf@cd01a0ca81
2022-03-01 12:18:50 +04:00
86aa0b8d39 websockets: Set keepalive options after adding transport to the list
To be in line with other code and mainly to support base/foundation transport used by both tcp and ssl transport layers


* Original commit: espressif/esp-idf@99805d880f
2022-03-01 12:18:50 +04:00
1933367f63 websocket: Add configurable ping interval
Merges https://github.com/espressif/esp-idf/pull/6399

Signed-off-by: David Cermak <cermak@espressif.com>


* Original commit: espressif/esp-idf@9ff9137e7a
2022-03-01 12:18:50 +04:00
cf697a1a1b style: format python files with isort and double-quote-string-fixer
* Original commit: espressif/esp-idf@0146f258d7
2022-03-01 12:18:50 +04:00
95cf983502 ws_transport: Add option to propagate control packets to the app
Client could choose if they want to receive control packets and handle
them.
* If disabled (default) the transport itself tries to handle PING
and CLOSE frames automatically during read operation. If handled
correctly, read outputs 0 indicating no (actual app) data received.
* if enabled, all control frames are passed to the application to be
  processed there.

Closes https://github.com/espressif/esp-idf/issues/6307


* Original commit: espressif/esp-idf@acc7bd2ca4
2022-03-01 12:18:50 +04:00
8a6c320a29 Add options for esp_http_client and esp_websocket_client to support keepalive
* Original commit: espressif/esp-idf@b53e46a68e
2022-03-01 12:18:50 +04:00
d1dd6ece38 websocket: support mutual tls for websocket
Closes https://github.com/espressif/esp-idf/issues/6059


* Original commit: espressif/esp-idf@5ab774f9d8
2022-03-01 12:18:50 +04:00
36167db336 test: remove fake binary size check in example test:
the binary size check in example test was removed long time ago. Now we
have updated ttfw_idf to raise exception when performance standard is
not found. These fake performance check will be regarded as error.
Remove them now.


* Original commit: espressif/esp-idf@a908174c06
2022-03-01 12:18:50 +04:00
d376480766 Whitespace: Automated whitespace fixes (large commit)
Apply the pre-commit hook whitespace fixes to all files in the repo.

(Line endings, blank lines at end of file, trailing whitespace)


* Original commit: espressif/esp-idf@66fb5a29bb
2022-03-01 12:18:50 +04:00
e90272c812 Websocket client: avoid deadlock if stop called from event handler
* Original commit: espressif/esp-idf@c2bb0762bb
2022-03-01 12:18:50 +04:00
fda070ba39 ws_client tests: Updated example test to use WebsSocket package
Added a new test for closing connection with close frames


* Original commit: espressif/esp-idf@44c553fd14
2022-03-01 12:18:50 +04:00
6d12d06605 tcp_transport: Added internal API for underlying socket, used for custom select on connection end for WS
Internal tcp_transport functions could now use custom socket operations.
This is used for WebSocket transport, when we typically wait for clean
connection closure, i.e. selecting for read/error with expected errno or
recv size=0 while socket readable (=connection terminated by FIN flag)


* Original commit: espressif/esp-idf@5e9f8b52e7
2022-03-01 12:18:50 +04:00
1455bc0305 ws_client: Added support for close frame, closing connection gracefully
* Original commit: espressif/esp-idf@b213f2c6d3
2022-03-01 12:18:50 +04:00
01b4f640d9 driver, http_client, web_socket, tcp_transport: remove __FILE__ from log messages
__FILE__ macro in the error messages adds full paths to the production binarys, remove __FILE__ from the ESP_LOGE.

Closes https://github.com/espressif/esp-idf/issues/5637
Merges https://github.com/espressif/esp-idf/pull/5638


* Original commit: espressif/esp-idf@caaf62bdad
2022-03-01 12:18:50 +04:00
6ab0aea841 websocket_client : fix some issues for websocket client
1. will post twice disconnect event when read error
2. will block `timeout` times when set disable_auto_connect
3. When `esp_websocket_client_stop` before `esp_websocket_client_send*`,
if the `esp_websocket_client_send*` fails, the status will change to
 'WEBSOCKET_STATE_WAIT_TIMEOUT', and the next `esp_websocket_client_start` will fail forever


* Original commit: espressif/esp-idf@341e480573
2022-03-01 12:18:50 +04:00
5f2a50f09f doc/websocket: updates the API reference for ESP WebSocket Client
* Original commit: espressif/esp-idf@09f240c1e1
2022-03-01 12:18:50 +04:00
b71c49c277 websocket: add configurable timeout for PONG not received
Closes IDF-1744


* Original commit: espressif/esp-idf@0049385850
2022-03-01 12:18:50 +04:00
f8e3ba7813 websocket client: the client now aborts the connection if send fails.
Closes IDF-1744


* Original commit: espressif/esp-idf@6bebfc84f3
2022-03-01 12:18:50 +04:00
7a5b2d5a7d ws_client: fix fragmented send setting proper opcodes
Previous implementation violated the RFC by having both the actual opcode and WS_FIN flag set for all fragments of a message.
Fixed by setting the opcode only for the first fragment and WS_FIN for the last one

Closes IDFGH-2938
Closes https://github.com/espressif/esp-idf/issues/4974


* Original commit: espressif/esp-idf@14992e62c5
2022-03-01 12:18:50 +04:00
42920d7fb5 Fix format string in websocket example
* Original commit: espressif/esp-idf@5288a797ef
2022-03-01 12:18:50 +04:00
2b044f2434 Add multi-target support for performance tests
* Original commit: espressif/esp-idf@15884eccf2
2022-03-01 12:18:50 +04:00
2b6022c85d examples: websocket example to send textual data with esp_websocket_client_send_text()
Closes https://github.com/espressif/esp-idf/issues/4640


* Original commit: espressif/esp-idf@e5650d1ed8
2022-03-01 12:18:50 +04:00
fae2343b19 docs: add new top-level docs builder that builds docs for a single chip
* Original commit: espressif/esp-idf@e6211c7864
2022-03-01 12:18:50 +04:00
17281a515e esp32: add implementation of esp_timer based on TG0 LAC timer
Closes: IDF-979


* Original commit: espressif/esp-idf@739eb05bb9
2022-03-01 12:18:50 +04:00
aec6a75d40 tcp_transport/ws_client: websockets now correctly handle messages longer than buffer
transport_ws can now be read multiple times in a row to read frames larger than the buffer.

Added reporting of total payload length and offset to the user in websocket_client.

Added local example test for long messages.

Closes IDF-1083


* Original commit: espressif/esp-idf@ffeda3003c
2022-03-01 12:18:50 +04:00
a6be8e2e3d websocket: added missing event data
user_context was missing from websocket event data, added. Also added the websocket client handle to the event data.

Removed  unused event data struct.

Closes: IDF-1271


* Original commit: espressif/esp-idf@7c0e3765ec
2022-03-01 12:18:50 +04:00
09453e4694 esp_netif, examples: esp_netif_init() moved into ESP_ERROR_CHECK()
esp_netif_init() returns standard esp_err_t error code (unlike tcpip_adapter init), so shall be checked for the return value
Also to make the initialization code more consistent.


* Original commit: espressif/esp-idf@31b2702387
2022-03-01 12:18:50 +04:00
3b0488cfdc websocket_client: added example_test with a local websocket server
- Added a example test that connects to a local python websocket server.
- Added readme for websocket_client example.

Closes IDF-907


* Original commit: espressif/esp-idf@67c5225c14
2022-03-01 12:18:50 +04:00
f21a2f32e0 test: update example and unit tests with new import roles:
tiny_test_fw is a python package now. import it using normal way.


* Original commit: espressif/esp-idf@c906e2afee
2022-03-01 12:18:50 +04:00
a48b0fafe8 Add User-Agent and additional headers to esp_websocket_client
Merges https://github.com/espressif/esp-idf/pull/4345


* Original commit: espressif/esp-idf@9200250f51
2022-03-01 12:18:50 +04:00
1fcc001ae8 ws_client: fix handling timeouts by websocket client.
tcp-transport component did not support wait forever. this update uses value of -1 to request this state.
websocket client uses timeouts in RTOS ticks. fixed recalculation to ms (including special value of -1) to use correctly tcp-transport component

Closes https://github.com/espressif/esp-idf/issues/4316


* Original commit: espressif/esp-idf@e1f982921a
2022-03-01 12:18:50 +04:00
a41e3383b3 examples: protocol examples which use common connection component
updated to use esp_netif_init instead of tcpip_adapter in initialization code


* Original commit: espressif/esp-idf@a49b934ef8
2022-03-01 12:18:50 +04:00
d0121b964d websocket_client: fix locking mechanism in ws-client task and when sending data
closes https://github.com/espressif/esp-idf/issues/4169


* Original commit: espressif/esp-idf@7c5011f411
2022-03-01 12:18:50 +04:00
f55d8391c9 ws_client: fix for not sending ping responses, updated to pass events also for PING and PONG messages, added interfaces to send both binary and text data
closes https://github.com/espressif/esp-idf/issues/3982


* Original commit: espressif/esp-idf@abf9345b85
2022-03-01 12:18:50 +04:00
fe26b734b5 Cosmetic Kconfig fixes
* Original commit: espressif/esp-idf@d3ed17acd7
2022-03-01 12:18:50 +04:00
f5a26c4d32 websocket_client: fix URI parsing to include also query part in websocket connection path
closes https://github.com/espressif/esp-idf/issues/4090


* Original commit: espressif/esp-idf@271e6c4c9c
2022-03-01 12:18:50 +04:00
23f6a1d46e ws_client: fixed posting to event loop with websocket timeout
Executing event loop `esp_event_loop_run()` with timeout causes delays in receiving events from user code. Fixed by removing the timeout to post synchronously.

closes https://github.com/espressif/esp-idf/issues/3957


* Original commit: espressif/esp-idf@50505068c4
2022-03-01 12:18:50 +04:00
2553d65e64 ws_client: added subprotocol configuration option to websocket client
closes https://github.com/espressif/esp-idf/issues/3893


* Original commit: espressif/esp-idf@de6ea396f1
2022-03-01 12:18:50 +04:00
67949f94f4 ws_client: fixed path config issue when ws server configured using host and path instead of uri
closes https://github.com/espressif/esp-idf/issues/3892


* Original commit: espressif/esp-idf@c0ba9e19fc
2022-03-01 12:18:50 +04:00
bfc88ab76c ws_client: fixed transport config option when server address configured as host, port, transport rather then uri
closes https://github.com/espressif/esp-idf/issues/3891


* Original commit: espressif/esp-idf@adee25d90e
2022-03-01 12:18:50 +04:00
343fbfdcc9 ci: limit example test to ESP32s
* Original commit: espressif/esp-idf@63329b169b
2022-03-01 12:18:50 +04:00
4d644954fe esp_wifi: wifi support new event mechanism
1. WiFi support new event mechanism
2. Update examples to use new event mechanism


* Original commit: espressif/esp-idf@003a9872b7
2022-03-01 12:18:50 +04:00
da74a4a489 tools: Mass fixing of empty prototypes (for -Wstrict-prototypes)
* Original commit: espressif/esp-idf@afbaf74007
2022-03-01 12:18:50 +04:00
f718676083 ws_client: fix double delete issue in ws client initialization
* Original commit: espressif/esp-idf@9b507c45c8
2022-03-01 12:18:50 +04:00
13a40d2344 ws_client: removed dependency on internal tcp_transport header
* Original commit: espressif/esp-idf@d1433564ec
2022-03-01 12:18:50 +04:00
35d6f9a2c6 examples: use new component registration api
* Original commit: espressif/esp-idf@6771eead80
2022-03-01 12:18:50 +04:00
f3a0586663 esp_websocket_client: Add websocket client component
Closes https://github.com/espressif/esp-idf/issues/2829


* Original commit: espressif/esp-idf@2a2d932cfe
2022-03-01 12:18:50 +04:00
04a7643d67 Merge pull request #17 from mensi/implement-sync
Implement esp_modem_sync for the C API
2022-02-28 10:05:21 +01:00
8b3d420055 Implement esp_modem_sync for the C API 2022-02-23 17:49:58 +01:00
50b083a58c Merge pull request #14 from b1ackviking/fix-missing-virtual-dtors
fix: add virtual destructors to ModuleIf and CommandableIf
2022-02-23 11:01:48 +01:00
325a1933c4 fix: missing default statement in a switch in the modem_console example 2022-01-28 22:34:03 +07:00
face03e4e5 fix: add virtual destructors to ModuleIf and CommandableIf 2022-01-28 22:34:03 +07:00
5d27b2681a Merge pull request #10 from david-cermak/bugfix/modem_parse_battery_status
fix(esp_modem): Fix battery status parser
2021-12-07 16:03:00 +01:00
830 changed files with 56924 additions and 1806 deletions

140
.flake8 Normal file
View File

@ -0,0 +1,140 @@
[flake8]
select =
# Full lists are given in order to suppress all errors from other plugins
# Full list of pyflakes error codes:
F401, # module imported but unused
F402, # import module from line N shadowed by loop variable
F403, # 'from module import *' used; unable to detect undefined names
F404, # future import(s) name after other statements
F405, # name may be undefined, or defined from star imports: module
F406, # 'from module import *' only allowed at module level
F407, # an undefined __future__ feature name was imported
F601, # dictionary key name repeated with different values
F602, # dictionary key variable name repeated with different values
F621, # too many expressions in an assignment with star-unpacking
F622, # two or more starred expressions in an assignment (a, *b, *c = d)
F631, # assertion test is a tuple, which are always True
F701, # a break statement outside of a while or for loop
F702, # a continue statement outside of a while or for loop
F703, # a continue statement in a finally block in a loop
F704, # a yield or yield from statement outside of a function
F705, # a return statement with arguments inside a generator
F706, # a return statement outside of a function/method
F707, # an except: block as not the last exception handler
F721, F722, # doctest syntax error syntax error in forward type annotation
F811, # redefinition of unused name from line N
F812, # list comprehension redefines name from line N
F821, # undefined name name
F822, # undefined name name in __all__
F823, # local variable name referenced before assignment
F831, # duplicate argument name in function definition
F841, # local variable name is assigned to but never used
F901, # raise NotImplemented should be raise NotImplementedError
# Full list of pycodestyle violations:
E101, # indentation contains mixed spaces and tabs
E111, # indentation is not a multiple of four
E112, # expected an indented block
E113, # unexpected indentation
E114, # indentation is not a multiple of four (comment)
E115, # expected an indented block (comment)
E116, # unexpected indentation (comment)
E121, # continuation line under-indented for hanging indent
E122, # continuation line missing indentation or outdented
E123, # closing bracket does not match indentation of opening bracket's line
E124, # closing bracket does not match visual indentation
E125, # continuation line with same indent as next logical line
E126, # continuation line over-indented for hanging indent
E127, # continuation line over-indented for visual indent
E128, # continuation line under-indented for visual indent
E129, # visually indented line with same indent as next logical line
E131, # continuation line unaligned for hanging indent
E133, # closing bracket is missing indentation
E201, # whitespace after '('
E202, # whitespace before ')'
E203, # whitespace before ':'
E211, # whitespace before '('
E221, # multiple spaces before operator
E222, # multiple spaces after operator
E223, # tab before operator
E224, # tab after operator
E225, # missing whitespace around operator
E226, # missing whitespace around arithmetic operator
E227, # missing whitespace around bitwise or shift operator
E228, # missing whitespace around modulo operator
E231, # missing whitespace after ',', ';', or ':'
E241, # multiple spaces after ','
E242, # tab after ','
E251, # unexpected spaces around keyword / parameter equals
E261, # at least two spaces before inline comment
E262, # inline comment should start with '# '
E265, # block comment should start with '# '
E266, # too many leading '#' for block comment
E271, # multiple spaces after keyword
E272, # multiple spaces before keyword
E273, # tab after keyword
E274, # tab before keyword
E275, # missing whitespace after keyword
E301, # expected 1 blank line, found 0
E302, # expected 2 blank lines, found 0
E303, # too many blank lines
E304, # blank lines found after function decorator
E305, # expected 2 blank lines after end of function or class
E306, # expected 1 blank line before a nested definition
E401, # multiple imports on one line
E402, # module level import not at top of file
E501, # line too long (82 > 79 characters)
E502, # the backslash is redundant between brackets
E701, # multiple statements on one line (colon)
E702, # multiple statements on one line (semicolon)
E703, # statement ends with a semicolon
E704, # multiple statements on one line (def)
E711, # comparison to None should be 'if cond is None:'
E712, # comparison to True should be 'if cond is True:' or 'if cond:'
E713, # test for membership should be 'not in'
E714, # test for object identity should be 'is not'
E721, # do not compare types, use 'isinstance()'
E722, # do not use bare except, specify exception instead
E731, # do not assign a lambda expression, use a def
E741, # do not use variables named 'l', 'O', or 'I'
E742, # do not define classes named 'l', 'O', or 'I'
E743, # do not define functions named 'l', 'O', or 'I'
E901, # SyntaxError or IndentationError
E902, # IOError
W191, # indentation contains tabs
W291, # trailing whitespace
W292, # no newline at end of file
W293, # blank line contains whitespace
W391, # blank line at end of file
W503, # line break before binary operator
W504, # line break after binary operator
W505, # doc line too long (82 > 79 characters)
W601, # .has_key() is deprecated, use 'in'
W602, # deprecated form of raising exception
W603, # '<>' is deprecated, use '!='
W604, # backticks are deprecated, use 'repr()'
W605, # invalid escape sequence 'x'
W606, # 'async' and 'await' are reserved keywords starting with Python 3.7
# Full list of flake8 violations
E999, # failed to compile a file into an Abstract Syntax Tree for the plugins that require it
# Full list of mccabe violations
C901 # complexity value provided by the user
ignore =
E221, # multiple spaces before operator
E231, # missing whitespace after ',', ';', or ':'
E241, # multiple spaces after ','
W503, # line break before binary operator
W504 # line break after binary operator
max-line-length = 160
show_source = True
statistics = True
exclude =
docs/asio/conf_common.py

2
.git-blame-ignore-revs Normal file
View File

@ -0,0 +1,2 @@
# Formating according pre-commit hooks
945bd177011d984b705daee9b895f88212292a42

51
.github/ISSUE_TEMPLATE/bug-report.yml vendored Normal file
View File

@ -0,0 +1,51 @@
name: Installation or build bug report
description: Report installation or build bugs
labels: ['Type: Bug']
body:
- type: checkboxes
id: checklist
attributes:
label: Answers checklist.
description: Before submitting a new issue, please follow the checklist and try to find the answer.
options:
- label: I have read the documentation for esp-protocols [components](https://github.com/espressif/esp-protocols#readme) and the issue is not addressed there.
required: true
- label: I have updated my esp-protocols branch (master or release) to the latest version and checked that the issue is present there.
required: true
- label: I have searched the issue tracker for a similar issue and not found a similar issue.
required: true
- type: dropdown
id: component
attributes:
label: What component are you using? If you choose Other, provide details in More Information.
multiple: false
options:
- ASIO port
- esp_modem
- esp_websocket_client
- mDNS
- Other
validations:
required: true
- type: input
id: component_id
attributes:
label: component version
description: Which component version does this issue occur on? (see your `idf_component.yml`)
placeholder: ex. 1.0.0
- type: input
id: idf_version
attributes:
label: IDF version.
description: On which IDF version does this issue occur on? Run `git describe --tags` to find it.
placeholder: ex. v3.2-dev-1148-g96cd3b75c
validations:
required: true
- type: textarea
id: more-info
attributes:
label: More Information.
description: Do you have any other information from investigating this?
placeholder: ex. I tried on my friend's Windows 10 PC and the command works there.
validations:
required: false

14
.github/ISSUE_TEMPLATE/config.yml vendored Normal file
View File

@ -0,0 +1,14 @@
blank_issues_enabled: false
contact_links:
- name: esp-protocols documentation links
url: https://github.com/espressif/esp-protocols#readme
about: Documenation for esp-protocols components.
- name: ESP-IDF Programming Guide
url: https://docs.espressif.com/projects/esp-idf/en/latest/
about: Documentation for configuring and using ESP-IDF.
- name: Espressif documentation page
url: https://www.espressif.com/en/support/download/documents
about: Hardware documentation (datasheets, Technical Reference Manual, etc).
- name: Forum
url: https://esp32.com
about: For questions about using ESP-IDF and/or ESP32 series chips. Please submit all questions starting "How do I..." here.

View File

@ -0,0 +1,33 @@
name: Feature request
description: Suggest an idea or new component for this project.
labels: ['Type: Feature Request']
body:
- type: markdown
attributes:
value: |
* We welcome any ideas or feature requests! Its helpful if you can explain exactly why the feature would be useful.
* There are usually some outstanding feature requests in the [existing issues list](https://github.com/espressif/esp-protocols/labels/Type%3A%20Feature%20Request), feel free to add comments to them.
- type: textarea
id: problem-related
attributes:
label: Is your feature request related to a problem?
description: Please provide a clear and concise description of what the problem is.
placeholder: ex. I'm always frustrated when ...
- type: textarea
id: solution
attributes:
label: Describe the solution you'd like.
description: Please provide a clear and concise description of what you want to happen.
placeholder: ex. When building my application ...
- type: textarea
id: alternatives
attributes:
label: Describe alternatives you've considered.
description: Please provide a clear and concise description of any alternative solutions or features you've considered.
placeholder: ex. Choosing other approach wouldn't work, because ...
- type: textarea
id: context
attributes:
label: Additional context.
description: Please add any other context or screenshots about the feature request here.
placeholder: ex. This would work only when ...

23
.github/ISSUE_TEMPLATE/other-issue.yml vendored Normal file
View File

@ -0,0 +1,23 @@
name: General issue report
description: File an issue report
body:
- type: checkboxes
id: checklist
attributes:
label: Answers checklist.
description: Before submitting a new issue, please follow the checklist and try to find the answer.
options:
- label: I have read the documentation for esp-protocols [components](https://github.com/espressif/esp-protocols#readme) and the issue is not addressed there.
required: true
- label: I have updated my esp-protocols branch (master or release) to the latest version and checked that the issue is present there.
required: true
- label: I have searched the issue tracker for a similar issue and not found a similar issue.
required: true
- type: textarea
id: issue
attributes:
label: General issue report
description: Your issue report goes here.
placeholder: ex. How do I...
validations:
required: true

View File

@ -0,0 +1,100 @@
name: "asio: build/target-tests"
on:
push:
branches:
- master
pull_request:
types: [opened, synchronize, reopened, labeled]
jobs:
build_asio:
if: contains(github.event.pull_request.labels.*.name, 'asio') || github.event_name == 'push'
name: Build
strategy:
matrix:
idf_ver: ["latest", "release-v5.0", "release-v5.1", "release-v5.2", "release-v5.3", "release-v5.4"]
idf_target: ["esp32", "esp32s2"]
example: ["asio_chat", "async_request", "socks4", "ssl_client_server", "tcp_echo_server", "udp_echo_server"]
runs-on: ubuntu-22.04
container: espressif/idf:${{ matrix.idf_ver }}
env:
TEST_DIR: components/asio/examples
steps:
- name: Checkout esp-protocols
uses: actions/checkout@v4
with:
submodules: recursive
- name: Build ${{ matrix.example }} with IDF-${{ matrix.idf_ver }} for ${{ matrix.idf_target }}
working-directory: ${{ env.TEST_DIR }}/${{ matrix.example }}
env:
IDF_TARGET: ${{ matrix.idf_target }}
shell: bash
run: |
. ${IDF_PATH}/export.sh
test -f sdkconfig.ci && cat sdkconfig.ci >> sdkconfig.defaults || echo "No sdkconfig.ci"
idf.py set-target ${{ matrix.idf_target }}
idf.py build
- name: Merge binaries with IDF-${{ matrix.idf_ver }} for ${{ matrix.idf_target }} for ${{ matrix.example }}
working-directory: ${{ env.TEST_DIR }}/${{ matrix.example }}/build
env:
IDF_TARGET: ${{ matrix.idf_target }}
shell: bash
run: |
. ${IDF_PATH}/export.sh
esptool.py --chip ${{ matrix.idf_target }} merge_bin --fill-flash-size 4MB -o flash_image.bin @flash_args
- uses: actions/upload-artifact@v4
with:
name: examples_app_bin_${{ matrix.idf_target }}_${{ matrix.idf_ver }}_${{ matrix.example }}
path: |
${{ env.TEST_DIR }}/${{ matrix.example }}/build/bootloader/bootloader.bin
${{ env.TEST_DIR }}/${{ matrix.example }}/build//partition_table/partition-table.bin
${{ env.TEST_DIR }}/${{ matrix.example }}/build/*.bin
${{ env.TEST_DIR }}/${{ matrix.example }}/build/*.elf
${{ env.TEST_DIR }}/${{ matrix.example }}/build/flasher_args.json
${{ env.TEST_DIR }}/${{ matrix.example }}/build/config/sdkconfig.h
${{ env.TEST_DIR }}/${{ matrix.example }}/build/config/sdkconfig.json
if-no-files-found: error
target_tests_asio:
# Skip running on forks since it won't have access to secrets
if: |
github.repository == 'espressif/esp-protocols' &&
( contains(github.event.pull_request.labels.*.name, 'asio') || github.event_name == 'push' )
name: Target tests
strategy:
matrix:
idf_ver: ["latest", "release-v5.1", "release-v5.2", "release-v5.3", "release-v5.4"]
idf_target: ["esp32"]
example: ["asio_chat", "tcp_echo_server", "udp_echo_server", "ssl_client_server"]
needs: build_asio
runs-on:
- self-hosted
- ESP32-ETHERNET-KIT
env:
TEST_DIR: components/asio/examples
steps:
- name: Clear repository
run: sudo rm -fr $GITHUB_WORKSPACE && mkdir $GITHUB_WORKSPACE
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: examples_app_bin_${{ matrix.idf_target }}_${{ matrix.idf_ver }}_${{ matrix.example }}
path: ${{ env.TEST_DIR }}/${{ matrix.example }}/build
- name: Install Python packages
env:
PIP_EXTRA_INDEX_URL: "https://www.piwheels.org/simple"
run: |
sudo apt-get install -y dnsutils
- name: Download Example Test to target ${{ matrix.config }}
run: |
python -m esptool --chip ${{ matrix.idf_target }} write_flash 0x0 ${{ env.TEST_DIR }}/${{ matrix.example }}/build/flash_image.bin
- name: Run Example Test ${{ matrix.example }} on target
working-directory: ${{ env.TEST_DIR }}/${{ matrix.example }}
run: |
python -m pytest --log-cli-level DEBUG --junit-xml=./examples_results_${{ matrix.idf_target }}_${{ matrix.idf_ver }}_${{ matrix.config }}.xml --target=${{ matrix.idf_target }}
- uses: actions/upload-artifact@v4
if: always()
with:
name: examples_results_${{ matrix.idf_target }}_${{ matrix.idf_ver }}_${{ matrix.example }}
path: ${{ env.TEST_DIR }}/${{ matrix.example }}/*.xml

View File

@ -1,36 +0,0 @@
name: Build
on: [push, pull_request]
jobs:
build:
strategy:
matrix:
idf_ver: ["latest", "release-v4.1", "release-v4.2", "release-v4.3", "release-v4.4"]
example: ["pppos_client", "modem_console", "ap_to_pppos", "simple_cmux_client"]
idf_target: ["esp32"]
exclude:
- idf_ver: "release-v4.1"
example: modem_console
- idf_ver: "release-v4.1"
example: ap_to_pppos
- idf_ver: "release-v4.1"
example: simple_cmux_client
- idf_ver: "release-v4.2"
example: simple_cmux_client
runs-on: ubuntu-20.04
container: espressif/idf:${{ matrix.idf_ver }}
steps:
- name: Checkout esp-protocols
uses: actions/checkout@master
with:
path: esp-protocols
- name: Build ${{ matrix.example }} with IDF-${{ matrix.idf_ver }} for ${{ matrix.idf_target }}
env:
IDF_TARGET: ${{ matrix.idf_target }}
shell: bash
run: |
. ${IDF_PATH}/export.sh
cd $GITHUB_WORKSPACE/esp-protocols/components/esp_modem/examples/${{ matrix.example }}
idf.py build

56
.github/workflows/clang-tidy.yml vendored Normal file
View File

@ -0,0 +1,56 @@
name: Run clang-tidy
on:
pull_request:
push:
branches:
- master
jobs:
build:
name: Run clang-tidy
runs-on: ubuntu-20.04
container: espressif/idf:latest
steps:
- uses: actions/checkout@v3
with:
submodules: 'true'
- name: Install esp-clang
run: |
${IDF_PATH}/tools/idf_tools.py --non-interactive install esp-clang
- name: Install clang-tidy-sarif
run: |
curl -sSL https://github.com/psastras/sarif-rs/releases/download/clang-tidy-sarif-v0.3.3/clang-tidy-sarif-x86_64-unknown-linux-gnu -o clang-tidy-sarif
chmod +x clang-tidy-sarif
curl -sSL https://raw.githubusercontent.com/espressif/idf-extra-components/master/.github/filter_sarif.py -o filter_sarif.py
- name: Install pyclang
shell: bash
run: |
. ${IDF_PATH}/export.sh
pip install pyclang~=0.2.0
- name: Run code analysis
shell: bash
env:
IDF_TOOLCHAIN: clang
IDF_TARGET: esp32
working-directory: test_app
run: |
. ${IDF_PATH}/export.sh
idf.py clang-check --include-paths $GITHUB_WORKSPACE --exclude-paths $PWD --run-clang-tidy-py run-clang-tidy --run-clang-tidy-options "-checks=-clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling"
cp warnings.txt ../
- name: Convert clang-tidy results into SARIF output
run: |
export PATH=$PWD:$PATH
./clang-tidy-sarif -o results.sarif.raw warnings.txt
python3 filter_sarif.py -o results.sarif --include-prefix ${GITHUB_WORKSPACE}/ results.sarif.raw
- uses: actions/upload-artifact@v4
with:
path: |
warnings.txt
results.sarif
results.sarif.raw
- name: Upload SARIF file
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: results.sarif
category: clang-tidy

View File

@ -0,0 +1,38 @@
name: "console_cmd_ifconfig: build-tests"
on:
push:
branches:
- master
pull_request:
types: [opened, synchronize, reopened, labeled]
jobs:
build_console_cmd_ifconfig:
if: contains(github.event.pull_request.labels.*.name, 'console') || github.event_name == 'push'
name: Build
strategy:
matrix:
idf_ver: ["latest", "release-v5.0", "release-v5.1", "release-v5.2", "release-v5.3"]
idf_target: ["esp32"]
test: [ { app: ifconfig-basic, path: "components/console_cmd_ifconfig/examples"}]
include:
- idf_ver: "latest"
warning: "the choice symbol ETHERNET_PHY_LAN867X\nis deprecated: Please use smi_gpio instead"
runs-on: ubuntu-22.04
container: espressif/idf:${{ matrix.idf_ver }}
steps:
- name: Checkout esp-protocols
uses: actions/checkout@v4
with:
submodules: recursive
- name: Build ${{ matrix.test.app }} with IDF-${{ matrix.idf_ver }} for ${{ matrix.idf_target }}
env:
EXPECTED_WARNING: ${{ matrix.warning }}
shell: bash
working-directory: ${{matrix.test.path}}
run: |
. ${IDF_PATH}/export.sh
pip install idf-component-manager idf-build-apps --upgrade
python ../../../ci/build_apps.py ./${{ matrix.test.app }} --target ${{ matrix.idf_target }} -vv --preserve-all --pytest-app

View File

@ -0,0 +1,32 @@
name: "console_cmd_mqtt: build-tests"
on:
push:
branches:
- master
pull_request:
types: [opened, synchronize, reopened, labeled]
jobs:
build_console_cmd_mqtt:
if: contains(github.event.pull_request.labels.*.name, 'console') || github.event_name == 'push'
name: Build
strategy:
matrix:
idf_ver: ["latest", "release-v5.0", "release-v5.1", "release-v5.2", "release-v5.3"]
idf_target: ["esp32"]
test: [ { app: mqtt_ssl_auth_console, path: "components/console_cmd_mqtt/examples" }]
runs-on: ubuntu-22.04
container: espressif/idf:${{ matrix.idf_ver }}
steps:
- name: Checkout esp-protocols
uses: actions/checkout@v4
with:
submodules: recursive
- name: Build ${{ matrix.test.app }} with IDF-${{ matrix.idf_ver }} for ${{ matrix.idf_target }}
shell: bash
working-directory: ${{matrix.test.path}}
run: |
. ${IDF_PATH}/export.sh
pip install idf-component-manager idf-build-apps --upgrade
python ../../../ci/build_apps.py ./${{ matrix.test.app }} --target ${{ matrix.idf_target }} -vv --preserve-all --pytest-app

View File

@ -0,0 +1,32 @@
name: "console_cmd_ping: build-tests"
on:
push:
branches:
- master
pull_request:
types: [opened, synchronize, reopened, labeled]
jobs:
build_console_cmd_ping:
if: contains(github.event.pull_request.labels.*.name, 'console') || github.event_name == 'push'
name: Build
strategy:
matrix:
idf_ver: ["latest", "release-v5.0", "release-v5.1", "release-v5.2", "release-v5.3"]
idf_target: ["esp32"]
test: [ { app: ping-basic, path: "components/console_cmd_ping/examples" }]
runs-on: ubuntu-22.04
container: espressif/idf:${{ matrix.idf_ver }}
steps:
- name: Checkout esp-protocols
uses: actions/checkout@v4
with:
submodules: recursive
- name: Build ${{ matrix.test.app }} with IDF-${{ matrix.idf_ver }} for ${{ matrix.idf_target }}
shell: bash
working-directory: ${{matrix.test.path}}
run: |
. ${IDF_PATH}/export.sh
pip install idf-component-manager idf-build-apps --upgrade
python ../../../ci/build_apps.py ./${{ matrix.test.app }} --target ${{ matrix.idf_target }} -vv --preserve-all --pytest-app

View File

@ -0,0 +1,32 @@
name: "console_cmd_wifi: build-tests"
on:
push:
branches:
- master
pull_request:
types: [opened, synchronize, reopened, labeled]
jobs:
build_console_cmd_wifi:
if: contains(github.event.pull_request.labels.*.name, 'console') || github.event_name == 'push'
name: Build
strategy:
matrix:
idf_ver: ["latest", "release-v5.0", "release-v5.1", "release-v5.2", "release-v5.3"]
idf_target: ["esp32"]
test: [ { app: wifi-basic, path: "components/console_cmd_wifi/examples" }]
runs-on: ubuntu-22.04
container: espressif/idf:${{ matrix.idf_ver }}
steps:
- name: Checkout esp-protocols
uses: actions/checkout@v4
with:
submodules: recursive
- name: Build ${{ matrix.test.app }} with IDF-${{ matrix.idf_ver }} for ${{ matrix.idf_target }}
shell: bash
working-directory: ${{matrix.test.path}}
run: |
. ${IDF_PATH}/export.sh
pip install idf-component-manager idf-build-apps --upgrade
python ../../../ci/build_apps.py ./${{ matrix.test.app }} --target ${{ matrix.idf_target }} -vv --preserve-all --pytest-app

View File

@ -0,0 +1,32 @@
name: "console_simple_init: build-tests"
on:
push:
branches:
- master
pull_request:
types: [opened, synchronize, reopened, labeled]
jobs:
build_console_simple_init:
if: contains(github.event.pull_request.labels.*.name, 'console') || github.event_name == 'push'
name: Build
strategy:
matrix:
idf_ver: ["latest", "release-v5.0", "release-v5.1", "release-v5.2", "release-v5.3"]
idf_target: ["esp32"]
test: [ { app: console_basic, path: "components/console_simple_init/examples" }]
runs-on: ubuntu-22.04
container: espressif/idf:${{ matrix.idf_ver }}
steps:
- name: Checkout esp-protocols
uses: actions/checkout@v4
with:
submodules: recursive
- name: Build ${{ matrix.test.app }} with IDF-${{ matrix.idf_ver }} for ${{ matrix.idf_target }}
shell: bash
working-directory: ${{matrix.test.path}}
run: |
. ${IDF_PATH}/export.sh
pip install idf-component-manager idf-build-apps --upgrade
python ../../../ci/build_apps.py ./${{ matrix.test.app }} --target ${{ matrix.idf_target }} -vv --preserve-all --pytest-app

28
.github/workflows/eppp__build.yml vendored Normal file
View File

@ -0,0 +1,28 @@
name: "eppp_link: build-tests"
on:
push:
branches:
- master
pull_request:
types: [opened, synchronize, reopened, labeled]
jobs:
build_eppp:
if: contains(github.event.pull_request.labels.*.name, 'eppp') || github.event_name == 'push'
name: Build
strategy:
matrix:
idf_ver: ["latest", "release-v5.3"]
test: [ { app: host, path: "examples/host" }, { app: slave, path: "examples/slave" }, { app: test_app, path: "test/test_app" }]
runs-on: ubuntu-20.04
container: espressif/idf:${{ matrix.idf_ver }}
steps:
- name: Checkout esp-protocols
uses: actions/checkout@v3
- name: Build ${{ matrix.test.app }} with IDF-${{ matrix.idf_ver }}
shell: bash
run: |
. ${IDF_PATH}/export.sh
pip install idf-component-manager idf-build-apps --upgrade
python ./ci/build_apps.py ./components/eppp_link/${{matrix.test.path}} -vv --preserve-all

View File

@ -0,0 +1,53 @@
name: "examples: build/host-tests"
on:
push:
branches:
- master
pull_request:
types: [opened, synchronize, reopened, labeled]
jobs:
build_all_examples:
if: contains(github.event.pull_request.labels.*.name, 'examples') || github.event_name == 'push'
name: Build examples
strategy:
matrix:
idf_ver: ["latest", "release-v5.1", "release-v5.2", "release-v5.3"]
include:
- idf_ver: "latest"
warning: "Warning: The smallest app partition is nearly full"
runs-on: ubuntu-22.04
container: espressif/idf:${{ matrix.idf_ver }}
steps:
- name: Checkout esp-protocols
uses: actions/checkout@v4
- name: Build with IDF-${{ matrix.idf_ver }}
env:
EXPECTED_WARNING: ${{ matrix.warning }}
shell: bash
run: |
. ${IDF_PATH}/export.sh
python -m pip install idf-build-apps
# Build default configs for all targets
python ./ci/build_apps.py examples -m examples/.build-test-rules.yml -d -c
build_and_run_on_host:
if: contains(github.event.pull_request.labels.*.name, 'examples') || github.event_name == 'push'
name: Build and run examples on linux
strategy:
matrix:
idf_ver: ["latest"]
runs-on: ubuntu-22.04
container: espressif/idf:${{ matrix.idf_ver }}
steps:
- name: Checkout esp-protocols
uses: actions/checkout@v4
- name: Build with IDF-${{ matrix.idf_ver }}
shell: bash
run: |
. ${IDF_PATH}/export.sh
python -m pip install idf-build-apps
python ./ci/build_apps.py examples/mqtt -l -t linux
timeout 5 ./examples/mqtt/build_linux_default/esp_mqtt_demo.elf | tee test.log || true
grep 'MQTT_EVENT_DATA' test.log

View File

@ -1,44 +0,0 @@
name: Host test
on: [push, pull_request]
jobs:
host_test:
name: Build and test
runs-on: ubuntu-20.04
container: espressif/idf:release-v4.3
env:
lwip: lwip-2.1.2
lwip_contrib: contrib-2.1.0
lwip_uri: http://download.savannah.nongnu.org/releases/lwip
steps:
- name: Checkout esp-protocols
uses: actions/checkout@master
with:
path: esp-protocols
- name: Build and Test
shell: bash
run: |
apt-get update && apt-get install -y gcc-8 g++-8
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 800 --slave /usr/bin/g++ g++ /usr/bin/g++-8
export LWIP_PATH=`pwd`/${{ env.lwip }}
export LWIP_CONTRIB_PATH=`pwd`/${{ env.lwip_contrib }}
wget --no-verbose ${lwip_uri}/${lwip}.zip
unzip -oq ${lwip}.zip
wget --no-verbose ${lwip_uri}/${lwip_contrib}.zip
unzip -oq ${lwip_contrib}.zip
. ${IDF_PATH}/export.sh
cd $GITHUB_WORKSPACE/esp-protocols/components/esp_modem/examples/linux_modem
idf.py build
cd $GITHUB_WORKSPACE/esp-protocols/components/esp_modem/test/host_test
idf.py build
./build/host_modem_test.elf -r junit -o junit.xml
- name: Publish Results
uses: EnricoMi/publish-unit-test-result-action@v1
if: always()
with:
files: esp-protocols/components/esp_modem/test/host_test/junit.xml

View File

@ -0,0 +1,84 @@
name: "mdns: build/target-tests"
on:
push:
branches:
- master
pull_request:
types: [opened, synchronize, reopened, labeled]
jobs:
build_mdns:
if: contains(github.event.pull_request.labels.*.name, 'mdns') || github.event_name == 'push'
name: Build
strategy:
matrix:
idf_ver: ["latest", "release-v5.0", "release-v5.2", "release-v5.3"]
test: [ { app: example, path: "examples/query_advertise" }, { app: unit_test, path: "tests/unit_test" }, { app: test_app, path: "tests/test_apps" } ]
runs-on: ubuntu-22.04
container: espressif/idf:${{ matrix.idf_ver }}
steps:
- name: Checkout esp-protocols
uses: actions/checkout@v4
- name: Build ${{ matrix.test.app }} with IDF-${{ matrix.idf_ver }}
shell: bash
run: |
. ${IDF_PATH}/export.sh
python -m pip install idf-build-apps
# Build default configs for all targets
python ./ci/build_apps.py components/mdns/${{ matrix.test.path }} -r default -d
# Build specific configs for test targets
python ./ci/build_apps.py components/mdns/${{ matrix.test.path }}
cd components/mdns/${{ matrix.test.path }}
for dir in `ls -d build_esp32_*`; do
$GITHUB_WORKSPACE/ci/clean_build_artifacts.sh `pwd`/$dir
zip -qur artifacts.zip $dir
done
- uses: actions/upload-artifact@v4
with:
name: mdns_bin_esp32_${{ matrix.idf_ver }}_${{ matrix.test.app }}
path: components/mdns/${{ matrix.test.path }}/artifacts.zip
if-no-files-found: error
target_tests_mdns:
# Skip running on forks since it won't have access to secrets
if: |
github.repository == 'espressif/esp-protocols' &&
( contains(github.event.pull_request.labels.*.name, 'mdns') || github.event_name == 'push' )
name: Target Example and Unit tests
strategy:
matrix:
idf_ver: ["latest"]
idf_target: ["esp32"]
test: [ { app: example, path: "examples/query_advertise" }, { app: unit_test, path: "tests/unit_test" }, { app: test_app, path: "tests/test_apps" } ]
needs: build_mdns
runs-on:
- self-hosted
- ESP32-ETHERNET-KIT
steps:
- name: Clear repository
run: sudo rm -fr $GITHUB_WORKSPACE && mkdir $GITHUB_WORKSPACE
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: mdns_bin_${{ matrix.idf_target }}_${{ matrix.idf_ver }}_${{ matrix.test.app }}
path: components/mdns/${{ matrix.test.path }}/ci/
- name: Install Python packages
env:
PIP_EXTRA_INDEX_URL: "https://www.piwheels.org/simple"
run: |
sudo apt-get install -y dnsutils
- name: Run ${{ matrix.test.app }} application on ${{ matrix.idf_target }}
working-directory: components/mdns/${{ matrix.test.path }}
run: |
unzip ci/artifacts.zip -d ci
for dir in `ls -d ci/build_*`; do
rm -rf build sdkconfig.defaults
mv $dir build
python -m pytest --log-cli-level DEBUG --junit-xml=./results_${{ matrix.test.app }}_${{ matrix.idf_target }}_${{ matrix.idf_ver }}_${dir#"ci/build_"}.xml --target=${{ matrix.idf_target }}
done
- uses: actions/upload-artifact@v4
if: always()
with:
name: results_${{ matrix.test.app }}_${{ matrix.idf_target }}_${{ matrix.idf_ver }}.xml
path: components/mdns/${{ matrix.test.path }}/*.xml

64
.github/workflows/mdns__host-tests.yml vendored Normal file
View File

@ -0,0 +1,64 @@
name: "mdns: host-tests"
on:
push:
branches:
- master
pull_request:
types: [opened, synchronize, reopened, labeled]
jobs:
host_test_mdns:
if: contains(github.event.pull_request.labels.*.name, 'mdns') || github.event_name == 'push'
name: Host test build
runs-on: ubuntu-22.04
container: espressif/idf:release-v5.3
steps:
- name: Checkout esp-protocols
uses: actions/checkout@v4
with:
path: protocols
- name: Build and Test
shell: bash
run: |
. ${IDF_PATH}/export.sh
python -m pip install idf-build-apps dnspython pytest pytest-embedded pytest-embedded-serial-esp pytest-embedded-idf
cd $GITHUB_WORKSPACE/protocols
# Build host tests app (with all configs and targets supported)
python ./ci/build_apps.py components/mdns/tests/host_test/
cd components/mdns/tests/host_test
# First run the linux_app and send a quick A query and a reverse query
./build_linux_app/mdns_host.elf &
python dnsfixture.py A myesp.local --ip_only | xargs python dnsfixture.py X
# Next we run the pytest (using the console app)
pytest
build_afl_host_test_mdns:
if: contains(github.event.pull_request.labels.*.name, 'mdns') || github.event_name == 'push'
name: Build AFL host test
strategy:
matrix:
idf_ver: ["latest"]
idf_target: ["esp32"]
runs-on: ubuntu-22.04
container: espressif/idf:${{ matrix.idf_ver }}
steps:
- name: Checkout esp-protocols
uses: actions/checkout@v4
with:
path: esp-protocols
- name: Install Necessary Libs
run: |
apt-get update -y
apt-get install -y libbsd-dev
- name: Build ${{ matrix.example }} with IDF-${{ matrix.idf_ver }} for ${{ matrix.idf_target }}
env:
IDF_TARGET: ${{ matrix.idf_target }}
shell: bash
run: |
. ${IDF_PATH}/export.sh
cd $GITHUB_WORKSPACE/esp-protocols/components/mdns/tests/test_afl_fuzz_host/
make INSTR=off

View File

@ -0,0 +1,93 @@
name: "esp-modem: build/host-tests"
on:
push:
branches:
- master
pull_request:
types: [opened, synchronize, reopened, labeled]
jobs:
build_esp_modem_examples:
if: contains(github.event.pull_request.labels.*.name, 'modem') || github.event_name == 'push'
name: Build examples
strategy:
matrix:
idf_ver: ["latest", "release-v5.0", "release-v5.1", "release-v5.2", "release-v5.3", "release-v5.4"]
example: ["pppos_client", "modem_console", "modem_tcp_client", "ap_to_pppos", "simple_cmux_client"]
include:
- idf_ver: "release-v5.0"
example: "simple_cmux_client"
warning: "Warning: The smallest app partition is nearly full"
runs-on: ubuntu-22.04
container: espressif/idf:${{ matrix.idf_ver }}
steps:
- name: Check out code
uses: actions/checkout@v4
with:
path: protocols
- if: ${{ matrix.skip_config }}
run: rm -f $GITHUB_WORKSPACE/protocols/components/esp_modem/examples/${{ matrix.example }}/sdkconfig.ci.${{ matrix.skip_config }}*
- name: Build ${{ matrix.example }} with IDF-${{ matrix.idf_ver }}
env:
EXPECTED_WARNING: ${{ matrix.warning }}
shell: bash
run: |
. ${IDF_PATH}/export.sh
python -m pip install idf-build-apps
cd $GITHUB_WORKSPACE/protocols
python ./ci/build_apps.py components/esp_modem/examples/${{ matrix.example }} -m components/esp_modem/.build-test-rules.yml
build_esp_modem_tests:
if: contains(github.event.pull_request.labels.*.name, 'modem') || github.event_name == 'push'
name: Build tests
strategy:
matrix:
idf_ver: ["release-v5.0", "release-v5.1", "release-v5.2", "release-v5.3", "release-v5.4", "latest"]
test: ["target", "target_ota", "target_iperf"]
runs-on: ubuntu-22.04
container: espressif/idf:${{ matrix.idf_ver }}
steps:
- name: Checkout esp-protocols
uses: actions/checkout@v4
with:
path: protocols
- name: Build ${{ matrix.test }} with IDF-${{ matrix.idf_ver }}
env:
EXPECTED_WARNING: ${{ matrix.warning }}
shell: bash
run: |
. ${IDF_PATH}/export.sh
python -m pip install idf-build-apps
cd $GITHUB_WORKSPACE/protocols
python ./ci/build_apps.py components/esp_modem/test/${{ matrix.test }} -m components/esp_modem/.build-test-rules.yml
host_test_esp_modem:
if: contains(github.event.pull_request.labels.*.name, 'modem') || github.event_name == 'push'
uses: "./.github/workflows/run-host-tests.yml"
with:
idf_version: "latest"
app_name: "host_modem_test"
app_path: "esp-protocols/components/esp_modem/test/host_test"
component_path: "esp-protocols/components/esp_modem"
upload_artifacts: true
run_executable: true
run_coverage: true
pre_run_script: "esp-protocols/components/esp_modem/test/host_test/env.sh"
publish_unit_test_result: true
build_linux_example:
if: contains(github.event.pull_request.labels.*.name, 'modem') || github.event_name == 'push'
uses: "./.github/workflows/run-host-tests.yml"
with:
idf_version: "latest"
app_name: "linux_modem"
app_path: "esp-protocols/components/esp_modem/examples/linux_modem"
component_path: "esp-protocols/components/esp_modem"
upload_artifacts: true
run_executable: false
run_coverage: false
pre_run_script: "esp-protocols/components/esp_modem/test/host_test/env.sh"

View File

@ -0,0 +1,91 @@
name: "esp-modem: target-tests"
on:
push:
branches:
- master
pull_request:
types: [opened, synchronize, reopened, labeled]
jobs:
build_esp_modem_tests:
if: contains(github.event.pull_request.labels.*.name, 'modem') || github.event_name == 'push'
name: Build Target tests
strategy:
matrix:
idf_ver: ["latest"]
idf_target: ["esp32c3"]
test: [ { app: pppd, path: test/target }, { app: pppd_chap_auth, path: test/target }, { app: sim800_c3, path: examples/pppos_client }, { app: sim800_cmux, path: examples/simple_cmux_client } ]
include:
- idf_ver: "latest"
idf_target: "esp32s2"
test: { app: usb_a7670_s2, path: examples/pppos_client }
runs-on: ubuntu-22.04
container: espressif/idf:${{ matrix.idf_ver }}
env:
TEST_DIR: components/esp_modem/${{ matrix.test.path }}
steps:
- name: Checkout esp-protocols
uses: actions/checkout@v4
with:
submodules: recursive
- name: Build esp-modem target tests with IDF-${{ matrix.idf_ver }} for ${{ matrix.idf_target }}
env:
IDF_TARGET: ${{ matrix.idf_target }}
SDKCONFIG: sdkconfig.ci.${{ matrix.test.app }}
shell: bash
working-directory: ${{ env.TEST_DIR }}
run: |
. ${IDF_PATH}/export.sh
rm -rf sdkconfig build
[ -f ${SDKCONFIG} ] && cp ${SDKCONFIG} sdkconfig.defaults
idf.py set-target ${{ matrix.idf_target }}
idf.py build
$GITHUB_WORKSPACE/ci/clean_build_artifacts.sh ${GITHUB_WORKSPACE}/${TEST_DIR}/build
- uses: actions/upload-artifact@v4
with:
name: modem_target_bin_${{ matrix.idf_target }}_${{ matrix.idf_ver }}_${{ matrix.test.app }}
path: ${{ env.TEST_DIR }}/build
if-no-files-found: error
target_tests_esp_modem:
# Skip running on forks since it won't have access to secrets
if: |
github.repository == 'espressif/esp-protocols' &&
( contains(github.event.pull_request.labels.*.name, 'modem') || github.event_name == 'push' )
name: Run Target tests
strategy:
matrix:
idf_ver: ["latest"]
idf_target: ["esp32c3"]
test: [ { app: pppd, path: test/target }, { app: pppd_chap_auth, path: test/target }, { app: sim800_c3, path: examples/pppos_client }, { app: sim800_cmux, path: examples/simple_cmux_client } ]
include:
- idf_ver: "latest"
idf_target: "esp32s2"
test: { app: usb_a7670_s2, path: examples/pppos_client }
needs: build_esp_modem_tests
runs-on:
- self-hosted
- modem
env:
TEST_DIR: components/esp_modem/${{ matrix.test.path }}
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
steps:
- name: Clear repository
run: |
sudo rm -fr $GITHUB_WORKSPACE && mkdir $GITHUB_WORKSPACE
- uses: actions/checkout@v3
- uses: actions/download-artifact@v4
with:
name: modem_target_bin_${{ matrix.idf_target }}_${{ matrix.idf_ver }}_${{ matrix.test.app }}
path: ${{ env.TEST_DIR }}/build
- name: Run Example Test on target
env:
PIP_EXTRA_INDEX_URL: "https://dl.espressif.com/pypi/"
run: |
python -m venv .venv
source .venv/bin/activate
pip install --prefer-binary cryptography pytest-embedded pytest-embedded-serial-esp pytest-embedded-idf pytest-custom_exit_code esptool
pip install -r $GITHUB_WORKSPACE/ci/requirements.txt
cd ${{ env.TEST_DIR }}
python -m pytest --log-cli-level DEBUG --target=${{ matrix.idf_target }}

177
.github/workflows/mosq__build.yml vendored Normal file
View File

@ -0,0 +1,177 @@
name: "mosq: build-tests"
on:
push:
branches:
- master
pull_request:
types: [opened, synchronize, reopened, labeled]
jobs:
build_mosq:
if: contains(github.event.pull_request.labels.*.name, 'mosquitto') || github.event_name == 'push'
name: Mosquitto build
strategy:
matrix:
idf_ver: ["latest", "release-v5.3"]
runs-on: ubuntu-22.04
container: espressif/idf:${{ matrix.idf_ver }}
env:
TEST_DIR: components/mosquitto/examples
TARGET_TEST: broker
TARGET_TEST_DIR: build_esp32_default
steps:
- name: Checkout esp-protocols
uses: actions/checkout@v4
with:
submodules: recursive
- name: Build with IDF-${{ matrix.idf_ver }}
shell: bash
run: |
. ${IDF_PATH}/export.sh
pip install idf-component-manager idf-build-apps --upgrade
python ci/build_apps.py -c ${TEST_DIR} -m components/mosquitto/.build-test-rules.yml
# upload only the target test artifacts
cd ${TEST_DIR}/${TARGET_TEST}
${GITHUB_WORKSPACE}/ci/clean_build_artifacts.sh `pwd`/${TARGET_TEST_DIR}
zip -qur artifacts.zip ${TARGET_TEST_DIR}
- uses: actions/upload-artifact@v4
with:
name: mosq_target_esp32_${{ matrix.idf_ver }}
path: ${{ env.TEST_DIR }}/${{ env.TARGET_TEST }}/artifacts.zip
if-no-files-found: error
test_mosq:
# Skip running on forks since it won't have access to secrets
if: |
github.repository == 'espressif/esp-protocols' &&
( contains(github.event.pull_request.labels.*.name, 'mosquitto') || github.event_name == 'push' )
name: Mosquitto target test
needs: build_mosq
strategy:
matrix:
idf_ver: ["latest", "release-v5.3"]
runs-on:
- self-hosted
- ESP32-ETHERNET-KIT
env:
TEST_DIR: components/mosquitto/examples/broker
TARGET_TEST_DIR: build_esp32_default
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: mosq_target_esp32_${{ matrix.idf_ver }}
path: ${{ env.TEST_DIR }}/ci/
- name: Run Test
working-directory: ${{ env.TEST_DIR }}
run: |
python -m pip install pytest-embedded-serial-esp pytest-embedded-idf pytest-rerunfailures pytest-timeout pytest-ignore-test-results
unzip ci/artifacts.zip -d ci
for dir in `ls -d ci/build_*`; do
rm -rf build sdkconfig.defaults
mv $dir build
python -m pytest --log-cli-level DEBUG --junit-xml=./results_esp32_${{ matrix.idf_ver }}_${dir#"ci/build_"}.xml --target=esp32
done
check_consistency:
if: contains(github.event.pull_request.labels.*.name, 'mosquitto') || github.event_name == 'push'
name: Checks that API docs and versions are consistent
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Checks API Docs and versions
run: |
sudo apt-get update
sudo apt-get -y install doxygen
pip install esp-doxybook
cd components/mosquitto
cp api.md api_orig.md
./generate_api_docs.sh
diff -wB api.md api_orig.md
# check version consistency
CONFIG_VERSION=$(grep -Po '(?<=#define VERSION ")[^"]*' port/priv_include/config.h)
CZ_VERSION=$(grep -Po '(?<=version: )[^"]*' .cz.yaml)
COMP_VERSION=$(grep -Po '(?<=version: ")[^"]*' idf_component.yml)
if [ "$CONFIG_VERSION" != "v$CZ_VERSION" ] || [ "$CONFIG_VERSION" != "v$COMP_VERSION" ]; then
echo "Version mismatch detected:"
echo "config.h: $CONFIG_VERSION"
echo ".cz.yaml: $CZ_VERSION"
echo "idf_component.yml: $COMP_VERSION"
exit 1
fi
echo "Versions are consistent: $CONFIG_VERSION"
build_idf_tests_with_mosq:
name: Build IDF tests
strategy:
matrix:
idf_ver: ["latest"]
idf_target: ["esp32"]
test: [ { app: publish, path: "tools/test_apps/protocols/mqtt/publish_connect_test" }]
runs-on: ubuntu-20.04
container: espressif/idf:${{ matrix.idf_ver }}
env:
TARGET_TEST_DIR: build_esp32_local_broker
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: recursive
- name: Build ${{ matrix.test.app }} with IDF-${{ matrix.idf_ver }} for ${{ matrix.idf_target }}
shell: bash
run: |
. ${IDF_PATH}/export.sh
pip install idf-component-manager idf-build-apps --upgrade
export MOSQUITTO_PATH=`pwd`/components/mosquitto
# to use the actual version of mosquitto
sed -i '/espressif\/mosquitto:/a \ \ \ \ override_path: "${MOSQUITTO_PATH}"' ${IDF_PATH}/${{matrix.test.path}}/main/idf_component.yml
export PEDANTIC_FLAGS="-DIDF_CI_BUILD -Werror -Werror=deprecated-declarations -Werror=unused-variable -Werror=unused-but-set-variable -Werror=unused-function"
export EXTRA_CFLAGS="${PEDANTIC_FLAGS} -Wstrict-prototypes"
export EXTRA_CXXFLAGS="${PEDANTIC_FLAGS}"
cd ${IDF_PATH}/${{matrix.test.path}}
idf-build-apps find --config sdkconfig.ci.local_broker -vv --target ${{ matrix.idf_target }} --build-dir=${TARGET_TEST_DIR}
idf-build-apps build --config sdkconfig.ci.local_broker -vv --target ${{ matrix.idf_target }} --build-dir=${TARGET_TEST_DIR}
${GITHUB_WORKSPACE}/ci/clean_build_artifacts.sh `pwd`/${TARGET_TEST_DIR}
# to replace mqtt test configs with specific mosquitto markers
python ${MOSQUITTO_PATH}/test/replace_decorators.py pytest_mqtt_publish_app.py ${TARGET_TEST_DIR}/pytest_mosquitto.py
zip -qur ${GITHUB_WORKSPACE}/artifacts.zip ${TARGET_TEST_DIR}
- uses: actions/upload-artifact@v4
with:
name: mosq_publish_esp32_${{ matrix.idf_ver }}
path: artifacts.zip
if-no-files-found: error
test_idf_ci_with_mosq:
# Skip running on forks since it won't have access to secrets
if: |
github.repository == 'espressif/esp-protocols' &&
( contains(github.event.pull_request.labels.*.name, 'mosquitto') || github.event_name == 'push' )
name: Mosquitto IDF target tests
needs: build_idf_tests_with_mosq
strategy:
matrix:
idf_ver: ["latest"]
runs-on:
- self-hosted
- ESP32-ETHERNET-KIT
env:
TEST_DIR: examples
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: mosq_publish_esp32_${{ matrix.idf_ver }}
path: ${{ env.TEST_DIR }}/ci/
- name: Run Test
working-directory: ${{ env.TEST_DIR }}
run: |
python -m pip install pytest-embedded-serial-esp pytest-embedded-idf pytest-rerunfailures pytest-timeout pytest-ignore-test-results "paho-mqtt<2"
unzip ci/artifacts.zip -d ci
for dir in `ls -d ci/build_*`; do
rm -rf build sdkconfig.defaults
mv $dir build
mv build/*.py .
# Run only "test_mosquitto" marked tests
python -m pytest --log-cli-level DEBUG --junit-xml=./results_esp32_${{ matrix.idf_ver }}_${dir#"ci/build_"}.xml --target=esp32 -m test_mosquitto
done

32
.github/workflows/mqtt_cxx__build.yml vendored Normal file
View File

@ -0,0 +1,32 @@
name: "mqtt-cxx: build-tests"
on:
push:
branches:
- master
pull_request:
types: [opened, synchronize, reopened, labeled]
jobs:
build_esp_mqtt_cxx:
if: contains(github.event.pull_request.labels.*.name, 'mqtt') || github.event_name == 'push'
name: Build
strategy:
matrix:
idf_ver: ["latest", "release-v5.0", "release-v5.1", "release-v5.2", "release-v5.3"]
idf_target: ["esp32"]
test: [ { app: mqtt-basic, path: "components/esp_mqtt_cxx/examples" }]
runs-on: ubuntu-22.04
container: espressif/idf:${{ matrix.idf_ver }}
steps:
- name: Checkout esp-protocols
uses: actions/checkout@v4
with:
submodules: recursive
- name: Build ${{ matrix.test.app }} with IDF-${{ matrix.idf_ver }} for ${{ matrix.idf_target }}
shell: bash
working-directory: ${{matrix.test.path}}
run: |
. ${IDF_PATH}/export.sh
pip install idf-component-manager idf-build-apps --upgrade
python ../../../ci/build_apps.py ./${{ matrix.test.app }} --target ${{ matrix.idf_target }} -vv --preserve-all --pytest-app

45
.github/workflows/pre_commit_check.yml vendored Normal file
View File

@ -0,0 +1,45 @@
name: Check pre-commit rules
on:
pull_request:
types: [opened, reopened, synchronize]
permissions:
contents: read
jobs:
pre_commit_check:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.base_ref }}
fetch-depth: 20
- name: Fetch head and base refs
# This is necessary for pre-commit to check the changes in the PR branch (and to set origin/HEAD and HEAD refs)
run: |
git fetch origin ${{ github.event.pull_request.head.sha }}:pr_ref
git checkout pr_ref
git remote set-head origin --auto
git merge-base origin/HEAD HEAD || ( echo "Your PR is far behind origin/HEAD, please rebase" && exit 1 )
- name: Set up Python environment
uses: actions/setup-python@master
with:
python-version: v3.8
- name: Install python packages
run: |
pip install pre-commit
pre-commit install-hooks
- name: Run pre-commit and check for any changes
run: |
echo "Commits being checked:"
git log --oneline --no-decorate origin/HEAD..HEAD
echo ""
if ! pre-commit run --from-ref origin/HEAD --to-ref HEAD --hook-stage manual --show-diff-on-failure ; then
echo ""
echo "::notice::It looks like the commits in this PR have been made without having pre-commit hooks installed."
echo "::notice::Please see https://github.com/espressif/esp-protocols/CONTRIBUTING.md for instructions."
echo ""
exit 1
fi

View File

@ -0,0 +1,45 @@
name: Publish coverage report to Github Pages
on:
workflow_run:
workflows: ["websocket: build/host-tests", "esp-modem: build/host-tests"]
types:
- completed
branches:
- master
jobs:
publish_github_pages:
runs-on: ubuntu-latest
if: github.repository == 'espressif/esp-protocols'
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Download Websocket Artifact
uses: dawidd6/action-download-artifact@v2
with:
workflow: websocket__build-host-tests.yml
workflow_conclusion: success
name: websocket_coverage_report
path: websocket_coverage_report_artifact
- name: Download Modem Artifact
uses: dawidd6/action-download-artifact@v2
with:
workflow: modem__build-host-tests.yml
workflow_conclusion: success
name: host_modem_test_coverage_report
path: host_modem_test_coverage_report_artifact
- name: Merge HTML files
run: |
echo "<html><body>" > index.html
cat host_modem_test_coverage_report_artifact/index.html >> index.html
cat websocket_coverage_report_artifact/index.html >> index.html
echo "</body></html>" >> index.html
mkdir coverage_report
mv index.html coverage_report
- name: Deploy generated docs
uses: JamesIves/github-pages-deploy-action@4.1.5
with:
branch: gh-pages
folder: coverage_report

View File

@ -5,41 +5,102 @@ on:
branches:
- master
jobs:
docs_build:
name: Docs-Build-And-Upload
runs-on: ubuntu-latest
env:
DOCS_DEPLOY_URL_BASE: ${{ secrets.DOCS_DEPLOY_URL_BASE }}
DOCS_DEPLOY_SERVER: ${{ secrets.DOCS_DEPLOY_SERVER }}
DOCS_DEPLOY_SERVER_USER: ${{ secrets.DOCS_DEPLOY_SERVER_USER }}
DOCS_DEPLOY_KEY: ${{ secrets.DOCS_DEPLOY_PRIVATEKEY }}
DOCS_DEPLOY_PATH_ORIG : ${{ secrets.DOCS_DEPLOY_PATH }}
jobs:
publish:
name: Publish Tag, Release, Docs, Component
runs-on: ubuntu-latest
# Skip running on forks since it won't have access to secrets
if: github.repository == 'espressif/esp-protocols'
steps:
- name: Checkout esp-protocols
uses: actions/checkout@master
uses: actions/checkout@v4
with:
persist-credentials: false
fetch-depth: 0
- name: Generate docs
run: |
sudo apt-get update
sudo apt-get -y install doxygen clang python3-pip
python -m pip install breathe recommonmark
cd $GITHUB_WORKSPACE/components/esp_modem/docs
./generate_docs
mkdir -p $GITHUB_WORKSPACE/docs/esp_modem
cp -r html/. $GITHUB_WORKSPACE/docs/esp_modem
cd $GITHUB_WORKSPACE/docs
touch .nojekyll
echo '<a href="esp_modem/index.html">esp-modem</a>' > index.html
- name: Upload components to component service
uses: espressif/github-actions/upload_components@master
submodules: recursive
token: "${{ secrets.GITHUB_TOKEN }}"
- name: Check for version update
shell: bash
run: ./ci/detect_component_bump
- name: Tag merge commit
if: env.BUMP_VERSION != ''
uses: anothrNick/github-tag-action@1.61.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CUSTOM_TAG: ${{ env.BUMP_TAG }}
- name: Create Release
if: env.BUMP_VERSION != ''
uses: softprops/action-gh-release@v1
with:
directories: "components/esp_modem"
name: "esp_modem"
body_path: "release_notes.md"
tag_name: ${{ env.BUMP_TAG }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Generate docs
shell: bash
run: |
sudo apt-get update
sudo apt-get -y install doxygen clang python3-pip
python -m pip install -r docs/requirements.txt
for comp in `ls components`; do
if [[ -d $GITHUB_WORKSPACE/docs/${comp} ]]; then
cd $GITHUB_WORKSPACE/docs/${comp}
if [[ "${{ env.BUMP_COMPONENT }}" == "${comp}" ]]; then
echo "Building specific version of ${comp} (${{ env.BUMP_VERSION }})"
./generate_docs ${{ env.BUMP_VERSION }}
else
echo "Building latest version of ${comp}"
./generate_docs
fi
fi
done
- name: Deploying generated docs
shell: bash
run: |
source $GITHUB_WORKSPACE/docs/utils.sh
add_doc_server_ssh_keys $DOCS_DEPLOY_KEY $DOCS_DEPLOY_SERVER $DOCS_DEPLOY_SERVER_USER
export GIT_VER=$(git describe --always)
export GITHUB_REF_NAME=latest
for comp in `ls components`; do
if [[ -d $GITHUB_WORKSPACE/docs/${comp} ]]; then
echo "Deploying latest of ${comp}"
export DOCS_BUILD_DIR=$GITHUB_WORKSPACE/docs/${comp}
export DOCS_DEPLOY_PATH=$DOCS_DEPLOY_PATH_ORIG/${comp}
cd $GITHUB_WORKSPACE/docs/${comp}
deploy-docs
fi
done;
# Deploy docs with version path
if [[ "${{ env.BUMP_VERSION }}" != "" ]] && [[ -d $GITHUB_WORKSPACE/docs/${{ env.BUMP_COMPONENT }} ]]; then
echo "Deploying specific version of ${{ env.BUMP_COMPONENT }} (${{ env.BUMP_VERSION }})"
cd $GITHUB_WORKSPACE/docs/${{ env.BUMP_COMPONENT }}
export GITHUB_REF_NAME=${{ env.BUMP_VERSION }}
deploy-docs
fi
- name: Upload components to component service
uses: espressif/upload-components-ci-action@v1
with:
directories: >
components/asio;
components/esp_modem;
components/esp_mqtt_cxx;
components/esp_websocket_client;
components/eppp_link;
components/mdns;
components/console_simple_init;
components/console_cmd_ping;
components/console_cmd_ifconfig;
components/console_cmd_wifi;
components/console_cmd_mqtt;
components/mbedtls_cxx;
components/mosquitto;
components/sock_utils;
namespace: "espressif"
api_token: ${{ secrets.IDF_COMPONENT_API_TOKEN }}
- name: Deploy generated docs
uses: JamesIves/github-pages-deploy-action@4.1.5
with:
branch: gh-pages
folder: docs

125
.github/workflows/run-host-tests.yml vendored Normal file
View File

@ -0,0 +1,125 @@
name: Run on host
on:
workflow_call:
inputs:
idf_version:
required: true
type: string
app_name:
type: string
required: true
app_path:
type: string
required: true
component_path:
type: string
required: true
upload_artifacts:
type: boolean
required: true
run_executable:
type: boolean
required: true
run_coverage:
type: boolean
required: true
pre_run_script:
type: string
required: false
publish_unit_test_result:
type: boolean
required: false
jobs:
build:
name: Build App
runs-on: ubuntu-22.04
permissions:
checks: write
contents: write
container: espressif/idf:${{inputs.idf_version}}
steps:
- name: Checkout esp-protocols
uses: actions/checkout@v4
with:
path: esp-protocols
- name: Build ${{ inputs.app_name }} with IDF-${{ inputs.idf_version }}
shell: bash
run: |
component=$(basename ${{ inputs.component_path }})
if [ -f "${{ inputs.pre_run_script }}" ]; then
source ${{ inputs.pre_run_script }} ${{ inputs.idf_version }} $component
fi
. ${IDF_PATH}/export.sh
cd ${{inputs.app_path}}
rm -rf sdkconfig sdkconfig.defaults build
# The sdkconfig.ci.linux specifies Linux as the build target with apropriate settings.
cp sdkconfig.ci.linux sdkconfig.defaults
idf.py build
if [ "${{ inputs.run_executable}}" == "false" ]; then
echo "Executeable wasn't run"
exit 0
fi
./build/${{inputs.app_name}}.elf
- name: Publish Unit Test Result
uses: EnricoMi/publish-unit-test-result-action@v2
if: ${{ inputs.publish_unit_test_result }}
with:
files: ${{inputs.component_path}}/**/*junit.xml
- name: Build with Coverage Enabled
shell: bash
if: ${{ inputs.run_coverage }}
run: |
component=$(basename ${{ inputs.component_path }})
if [ -f "${{ inputs.pre_run_script }}" ]; then
source ${{ inputs.pre_run_script }} ${{ inputs.idf_version }} $component
fi
. ${IDF_PATH}/export.sh
cd $GITHUB_WORKSPACE/${{inputs.app_path}}
rm -rf build sdkconfig sdkconfig.defaults
idf.py fullclean
# The sdkconfig.ci.coverage specifies Linux as the build target with apropriate settings (CONFIG_GCOV_ENABLED=y).
cp sdkconfig.ci.coverage sdkconfig.defaults
idf.py build
./build/${{inputs.app_name}}.elf
- name: Run Coverage
shell: bash
if: ${{ inputs.run_coverage }}
run: |
apt-get update && apt-get install -y rsync
python3 -m venv .venv
source .venv/bin/activate
python3 -m pip install gcovr
cd $GITHUB_WORKSPACE/${{inputs.component_path}}
component=$(basename ${{ inputs.component_path }})
gcov `find . -name "$component*gcda"`
gcovr --gcov-ignore-parse-errors -g -k -r . --html index.html -x ${{inputs.app_name}}_coverage.xml
mkdir ${{inputs.app_name}}_coverage_report
touch ${{inputs.app_name}}_coverage_report/.nojekyll
cp index.html ${{inputs.app_name}}_coverage_report
cp -rf ${{inputs.app_name}}_coverage_report ${{inputs.app_name}}_coverage.xml $GITHUB_WORKSPACE
- name: Code Coverage Summary Report
if: ${{ inputs.run_coverage }}
uses: irongut/CodeCoverageSummary@v1.3.0
with:
filename: esp-protocols/**/${{inputs.app_name}}_coverage.xml
badge: true
fail_below_min: false
format: markdown
hide_branch_rate: false
hide_complexity: false
indicators: true
output: both
thresholds: '60 80'
- name: Write to Job Summary
run: cat code-coverage-results.md >> $GITHUB_STEP_SUMMARY
if: ${{ inputs.run_coverage }}
- name: Upload files to artifacts for run-target job
uses: actions/upload-artifact@v4
if: ${{ inputs.run_coverage }}
with:
name: ${{inputs.app_name}}_coverage_report
path: |
${{inputs.component_path}}/${{inputs.app_name}}_coverage_report
if-no-files-found: error

95
.github/workflows/sockutls_build.yml vendored Normal file
View File

@ -0,0 +1,95 @@
name: "sock_utils: build-tests"
on:
push:
branches:
- master
pull_request:
types: [opened, synchronize, reopened, labeled]
jobs:
build_sock_utils:
if: contains(github.event.pull_request.labels.*.name, 'sock_utils') || github.event_name == 'push'
name: Socket helpers build
strategy:
matrix:
idf_ver: ["latest", "release-v5.3"]
runs-on: ubuntu-22.04
container: espressif/idf:${{ matrix.idf_ver }}
env:
TEST_DIR: components/sock_utils/examples/simple
TARGET_TEST_DIR: build_esp32_default
steps:
- name: Checkout esp-protocols
uses: actions/checkout@v4
with:
submodules: recursive
- name: Build with IDF-${{ matrix.idf_ver }}
shell: bash
run: |
. ${IDF_PATH}/export.sh
pip install idf-component-manager idf-build-apps --upgrade
python ci/build_apps.py ${TEST_DIR}
cd ${TEST_DIR}
${GITHUB_WORKSPACE}/ci/clean_build_artifacts.sh `pwd`/${TARGET_TEST_DIR}
zip -qur artifacts.zip ${TARGET_TEST_DIR}
- uses: actions/upload-artifact@v4
with:
name: sock_utils_target_esp32_${{ matrix.idf_ver }}
path: ${{ env.TEST_DIR }}/artifacts.zip
if-no-files-found: error
host_test_sock_utils:
if: contains(github.event.pull_request.labels.*.name, 'sock_utils') || github.event_name == 'push'
name: Socket helpers host test
strategy:
matrix:
idf_ver: ["latest", "release-v5.3"]
runs-on: ubuntu-22.04
container: espressif/idf:${{ matrix.idf_ver }}
env:
TEST_DIR: components/sock_utils/test/host
steps:
- name: Checkout esp-protocols
uses: actions/checkout@v4
with:
submodules: recursive
- name: Build with IDF-${{ matrix.idf_ver }}
shell: bash
run: |
. ${IDF_PATH}/export.sh
pip install idf-component-manager idf-build-apps --upgrade
cd ${TEST_DIR}
idf.py build
./build/sock_utils_host_test.elf
test_sock_utils:
# Skip running on forks since it won't have access to secrets
if: |
github.repository == 'espressif/esp-protocols' &&
( contains(github.event.pull_request.labels.*.name, 'sock_utils') || github.event_name == 'push' )
name: Socket helpers target test
needs: build_sock_utils
strategy:
matrix:
idf_ver: ["latest", "release-v5.3"]
runs-on:
- self-hosted
- ESP32-ETHERNET-KIT
env:
TEST_DIR: components/sock_utils/examples/simple
TARGET_TEST_DIR: build_esp32_default
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: sock_utils_target_esp32_${{ matrix.idf_ver }}
path: ${{ env.TEST_DIR }}/ci/
- name: Run Test
working-directory: ${{ env.TEST_DIR }}
run: |
unzip ci/artifacts.zip -d ci
for dir in `ls -d ci/build_*`; do
rm -rf build sdkconfig.defaults
mv $dir build
python -m pytest --log-cli-level DEBUG --junit-xml=./results_esp32_${{ matrix.idf_ver }}_${dir#"ci/build_"}.xml --target=esp32
done

30
.github/workflows/tls_cxx__build.yml vendored Normal file
View File

@ -0,0 +1,30 @@
name: "mbedtls-cxx: build-tests"
on:
push:
branches:
- master
pull_request:
types: [opened, synchronize, reopened, labeled]
jobs:
build_tls_cxx:
if: contains(github.event.pull_request.labels.*.name, 'tls_cxx') || github.event_name == 'push'
name: Build
strategy:
matrix:
idf_ver: ["latest", "release-v5.3", "release-v5.2", "release-v5.1"]
test: [ { app: client, path: "examples/tls_client" }, { app: udp, path: "examples/udp_mutual_auth" }, { app: test, path: "tests/uart_mutual_auth" } ]
runs-on: ubuntu-20.04
container: espressif/idf:${{ matrix.idf_ver }}
steps:
- name: Checkout esp-protocols
uses: actions/checkout@v3
with:
submodules: recursive
- name: Build ${{ matrix.test.app }} with IDF-${{ matrix.idf_ver }}
shell: bash
run: |
. ${IDF_PATH}/export.sh
pip install idf-component-manager idf-build-apps --upgrade
python ./ci/build_apps.py ./components/mbedtls_cxx/${{ matrix.test.path }} -vv --preserve-all

View File

@ -0,0 +1,22 @@
name: "websocket: build/host-tests"
on:
push:
branches:
- master
pull_request:
types: [opened, synchronize, reopened, labeled]
jobs:
host_test_websocket:
if: contains(github.event.pull_request.labels.*.name, 'websocket') || github.event_name == 'push'
uses: "./.github/workflows/run-host-tests.yml"
with:
idf_version: "latest"
app_name: "websocket"
app_path: "esp-protocols/components/esp_websocket_client/examples/linux"
component_path: "esp-protocols/components/esp_websocket_client"
run_executable: true
upload_artifacts: true
run_coverage: true

View File

@ -0,0 +1,86 @@
name: "websocket: build/target-tests"
on:
push:
branches:
- master
pull_request:
types: [opened, synchronize, reopened, labeled]
jobs:
build_websocket:
if: contains(github.event.pull_request.labels.*.name, 'websocket') || github.event_name == 'push'
name: Build
strategy:
matrix:
idf_ver: ["release-v5.0", "release-v5.1", "release-v5.2", "release-v5.3", "latest"]
test: [ { app: example, path: "examples/target" }, { app: unit_test, path: "test" } ]
runs-on: ubuntu-22.04
container: espressif/idf:${{ matrix.idf_ver }}
env:
TEST_DIR: components/esp_websocket_client/${{ matrix.test.path }}
steps:
- name: Checkout esp-protocols
uses: actions/checkout@v4
with:
submodules: recursive
- name: Build ${{ matrix.example }} with IDF-${{ matrix.idf_ver }} for ${{ matrix.idf_target }}
shell: bash
run: |
. ${IDF_PATH}/export.sh
python -m pip install idf-build-apps
python ./ci/build_apps.py ${TEST_DIR}
cd ${TEST_DIR}
for dir in `ls -d build_esp32_*`; do
$GITHUB_WORKSPACE/ci/clean_build_artifacts.sh `pwd`/$dir
zip -qur artifacts.zip $dir
done
- uses: actions/upload-artifact@v4
with:
name: websocket_bin_esp32_${{ matrix.idf_ver }}_${{ matrix.test.app }}
path: ${{ env.TEST_DIR }}/artifacts.zip
if-no-files-found: error
run-target-websocket:
# Skip running on forks since it won't have access to secrets
if: |
github.repository == 'espressif/esp-protocols' &&
( contains(github.event.pull_request.labels.*.name, 'websocket') || github.event_name == 'push' )
name: Target test
needs: build_websocket
strategy:
fail-fast: false
matrix:
idf_ver: ["release-v5.0", "release-v5.1", "release-v5.2", "release-v5.3", "latest"]
idf_target: ["esp32"]
test: [ { app: example, path: "examples/target" }, { app: unit_test, path: "test" } ]
runs-on:
- self-hosted
- ESP32-ETHERNET-KIT
env:
TEST_DIR: components/esp_websocket_client/${{ matrix.test.path }}
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: websocket_bin_esp32_${{ matrix.idf_ver }}_${{ matrix.test.app }}
path: ${{ env.TEST_DIR }}/ci/
- name: Install Python packages
env:
PIP_EXTRA_INDEX_URL: "https://www.piwheels.org/simple"
run: |
pip install --only-binary cryptography --extra-index-url https://dl.espressif.com/pypi/ -r $GITHUB_WORKSPACE/ci/requirements.txt
- name: Run Example Test on target
working-directory: ${{ env.TEST_DIR }}
run: |
unzip ci/artifacts.zip -d ci
for dir in `ls -d ci/build_*`; do
rm -rf build sdkconfig.defaults
mv $dir build
python -m pytest --log-cli-level DEBUG --junit-xml=./results_${{ matrix.test.app }}_${{ matrix.idf_target }}_${{ matrix.idf_ver }}_${dir#"ci/build_"}.xml --target=${{ matrix.idf_target }}
done
- uses: actions/upload-artifact@v4
if: always()
with:
name: results_${{ matrix.test.app }}_${{ matrix.idf_target }}_${{ matrix.idf_ver }}.xml
path: components/esp_websocket_client/${{ matrix.test.path }}/*.xml

View File

@ -90,4 +90,7 @@ build
dependencies.lock
# ignore generated docs
docs/html
docs/html
# esp-idf managed components
**/managed_components/**

6
.gitmodules vendored Normal file
View File

@ -0,0 +1,6 @@
[submodule "components/asio/asio"]
path = components/asio/asio
url = https://github.com/chriskohlhoff/asio
[submodule "components/mosquitto/mosquitto"]
path = components/mosquitto/mosquitto
url = https://github.com/eclipse/mosquitto

26
.mypy.ini Normal file
View File

@ -0,0 +1,26 @@
[mypy]
# Specifies the Python version used to parse and check the target program
python_version = 3.9
# Disallows defining functions without type annotations or with incomplete type annotations
# True => enforce type annotation in all function definitions
disallow_untyped_defs = True
# Shows a warning when returning a value with type Any from a function declared with a non- Any return type
warn_return_any = True
# Shows errors for missing return statements on some execution paths
warn_no_return = True
# Suppress error messages about imports that cannot be resolved
# True => ignore all import errors
ignore_missing_imports = True
# Disallows defining functions with incomplete type annotations
disallow_incomplete_defs = False
# Directs what to do with imports when the imported module is found as a .py file and not part of the files,
# modules and packages provided on the command line.
# SKIP -> mypy checks only single file, not included imports
follow_imports = skip

68
.pre-commit-config.yaml Normal file
View File

@ -0,0 +1,68 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
hooks:
- id: check-yaml
- id: check-added-large-files
- id: fix-byte-order-marker
- id: check-case-conflict
- id: end-of-file-fixer
- id: trailing-whitespace
- id: mixed-line-ending
- id: debug-statements
- repo: https://github.com/pycqa/flake8
rev: 5.0.4
hooks:
- id: flake8
args: ['--config=.flake8', '--tee', '--benchmark']
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.981
hooks:
- id: mypy
exclude: >
(?x)^(
.*.py
)$
- repo: https://github.com/myint/unify
rev: v0.5
hooks:
- id: unify
- repo: https://github.com/pre-commit/mirrors-yapf
rev: "v0.32.0"
hooks:
- id: yapf
args: ['style={based_on_style: google, column_limit: 160, indent_width: 4}']
- repo: https://github.com/pre-commit/mirrors-isort
rev: v5.10.1
hooks:
- id: isort
- repo: https://github.com/myint/eradicate/
rev: v2.1.0
hooks:
- id: eradicate
- repo: https://github.com/espressif/check-copyright/
rev: v1.0.3
hooks:
- id: check-copyright
args: ['--ignore', 'ci/check_copyright_ignore.txt', '--config', 'ci/check_copyright_config.yaml']
- repo: https://github.com/igrr/astyle_py.git
rev: v1.0.5
hooks:
- id: astyle_py
args: ['--style=otbs', '--attach-namespaces', '--attach-classes', '--indent=spaces=4', '--convert-tabs', '--align-pointer=name', '--align-reference=name', '--keep-one-line-statements', '--pad-header', '--pad-oper', '--exclude-list=ci/ignore_astyle.txt']
- repo: https://github.com/commitizen-tools/commitizen
rev: v2.42.1
hooks:
- id: commitizen
- id: commitizen-branch
stages: [push, manual]
- repo: local
hooks:
- id: commit message scopes
name: "commit message must be scoped with: mdns, modem, websocket, asio, mqtt_cxx, console, common, eppp, tls_cxx, mosq, sockutls"
entry: '\A(?!(feat|fix|ci|bump|test|docs|chore)\((mdns|modem|common|console|websocket|asio|mqtt_cxx|examples|eppp|tls_cxx|mosq|sockutls)\)\:)'
language: pygrep
args: [--multiline]
stages: [commit-msg]

68
CONTRIBUTING.md Normal file
View File

@ -0,0 +1,68 @@
# Information for Contributors
Contributions in the form of pull requests, issue reports, and feature requests are welcome!
## Common Terminology:
* [Type]: Examples include feat (for new features), fix (for bug fixes), ci (for continuous integration), bump (for version updates), etc. You can find a comprehensive list of types in .pre-commit-config.yaml on line 65.
* [Scope]: Refers to specific sections or areas within the project, such as mdns, modem, common, console, etc. You can discover additional scopes in .pre-commit-config.yaml on line 65.
* [Component]: This is the name of the component, and it should match the directory name where the component code is located.
## Submitting a PR
- [ ] Fork the [esp-protocols repository on GitHub](https://github.com/espressif/esp-protocols) to start making your changes.
- [ ] Install pre-commit hooks: `pip install pre-commit && pre-commit install-hooks && pre-commit install --hook-type commit-msg --hook-type pre-push`
- [ ] Send a pull request (PR) and work with us until it gets merged and published. Contributions may need some modifications, so a few rounds of review and fixing may be necessary.
For quick merging, the contribution should be short, and concentrated on a single feature or topic. The larger the contribution is, the longer it would take to review it and merge it.
Please follow the [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/) rule when writing commit messages.
A typical commit message title template:
Template:
`[type]([scope]): Message`
e.g.
`feat(console): Added fully operational ifconfig command`
## Creating a new component
Once the commit containing a new component is ready follow the steps below:
1. Add a file named .cz.yaml to the root of the component and add it to your commit.
The template for .cz.yaml should look like this:
```
---
commitizen:
bump_message: 'bump([scope]): $current_version -> $new_version'
pre_bump_hooks: python ../../ci/changelog.py [component]
tag_format: [component]-v$version
version: 0.0.0
version_files:
- idf_component.yml
```
2. Run the following command to bump the version of the component:
`ci/bump [component] [version] --bump-message "bump([scope]): First version [version]"`
Replace [component], [version] and [scope] with the specific component name, version and scope you are working with. This command will help you bump the version of the component with the provided details.
Note: It is crucial to adhere to the above steps when introducing a new component. Never merge the code for a new component without first implementing a bump commit.
## Release process
When releasing a new component version we have to:
* Update the version number
* Update the changelog
* Create the version tag in this repository
* Deploy the component to component registry
* Update the documentation
This process is not fully automated, the first step needs to be performed manually by project maintainers running the `bump` command. Release procedure is as follows:
* Run `ci/bump [component] [version]` (version number is optional, `cz` would automatically increment it if not present)
* Check the updated `CHANGELOG.md` and the generated bump commit message
* Create a PR
Once the PR is merged, the CI job tags the merge commit, creates a new release, builds and deploys documentation and the new component to the component registry

View File

@ -1,10 +1,68 @@
# Collection of protocol components for ESP-IDF
[Documentation of esp-protocol](https://espressif.github.io/esp-protocols)
## How to use
The [ESP-Protocols](https://github.com/espressif/esp-protocols) repository contains a collection of protocol components for [ESP-IDF](https://github.com/espressif/esp-idf).
Additionally, each component is available in [IDF Component Registry](https://components.espressif.com).
Please refer to instructions in [ESP-IDF](https://github.com/espressif/esp-idf)
## Components
### esp_modem
* Brief introduction [README](components/esp_modem/README.md)
* Full html [documentation](https://espressif.github.io/esp-protocols/esp_modem/index.html)
* Full html [documentation](https://docs.espressif.com/projects/esp-protocols/esp_modem/docs/latest/index.html)
### mDNS
* Brief introduction [README](components/mdns/README.md)
* Full html [documentation(English)](https://docs.espressif.com/projects/esp-protocols/mdns/docs/latest/en/index.html)
* Full html [documentation(Chinese)](https://docs.espressif.com/projects/esp-protocols/mdns/docs/latest/zh_CN/index.html)
### esp_websocket_client
* Brief introduction [README](components/esp_websocket_client/README.md)
* Full html [documentation](https://docs.espressif.com/projects/esp-protocols/esp_websocket_client/docs/latest/index.html)
### ASIO port
* Brief introduction [README](components/asio/README.md)
* Full html [documentation](https://docs.espressif.com/projects/esp-protocols/asio/docs/latest/index.html)
### esp_mqtt_cxx
* Brief introduction [README](components/esp_mqtt_cxx/README.md)
* Full html [documentation](https://docs.espressif.com/projects/esp-protocols/esp_mqtt_cxx/docs/latest/index.html)
### console_simple_init
* Brief introduction [README](components/console_simple_init/README.md)
### console_cmd_ping
* Brief introduction [README](components/console_cmd_ping/README.md)
### console_cmd_ifconfig
* Brief introduction [README](components/console_cmd_ifconfig/README.md)
### console_cmd_wifi
* Brief introduction [README](components/console_cmd_wifi/README.md)
### ESP PPP Link (eppp)
* Brief introduction [README](components/eppp_link/README.md)
### mbedtls_cxx
* Brief introduction [README](components/mbedtls_cxx/README.md)
### mosquitto
* Brief introduction [README](components/mosquitto/README.md)
* API documentation [api.md](components/mosquitto/api.md)
### Socket helpers (sock-utils)
* Brief introduction [README](components/sock_utils/README.md)

72
ci/build_apps.py Normal file
View File

@ -0,0 +1,72 @@
# SPDX-FileCopyrightText: 2023-2024 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: Apache-2.0
"""
This file is used in CI for esp-protocols build tests
"""
import argparse
import os
import sys
from idf_build_apps import build_apps, find_apps, setup_logging
from idf_build_apps.constants import SUPPORTED_TARGETS
if __name__ == '__main__':
parser = argparse.ArgumentParser(
description='Build all projects',
formatter_class=argparse.ArgumentDefaultsHelpFormatter,
)
parser.add_argument('paths', nargs='+', help='Paths to the apps to build.')
parser.add_argument(
'-v',
'--verbose',
action='count',
help='Increase the LOGGER level of the script. Can be specified multiple times.',
)
parser.add_argument(
'-t',
'--target',
default='all',
help='Build apps for given target',
)
parser.add_argument('-r', '--rules', nargs='*', default=['sdkconfig.ci=default', 'sdkconfig.ci.*=', '=default'], help='Rules how to treat configs')
parser.add_argument('-m', '--manifests', nargs='*', default=[], help='list of manifest files')
parser.add_argument('-d', '--delete', action='store_true', help='Delete build artifacts')
parser.add_argument('-c', '--recursive', action='store_true', help='Build recursively')
parser.add_argument('-l', '--linux', action='store_true', help='Include linux build (dont check warnings)')
parser.add_argument('--preserve-all', action='store_true', help='Preserve the binaries for all apps when specified.')
parser.add_argument('--pytest-apps', action='store_true', help='Only build apps required by pytest scripts.')
args = parser.parse_args()
IDF_PATH = os.environ['IDF_PATH']
# Compose the ignore warning strings from the global list and from the environment
ignore_warning_file = os.path.join(os.path.dirname(os.path.realpath(__file__)),'ignore_build_warnings.txt')
ignore_warning = open(ignore_warning_file).read().rstrip('\n').split('\n')
if 'EXPECTED_WARNING' in os.environ:
ignore_warning += os.environ['EXPECTED_WARNING'].split('\n')
if args.linux:
SUPPORTED_TARGETS.append('linux')
ignore_warning = 'warning: ' # Ignore all common warnings on linux builds
setup_logging(2)
apps = find_apps(
args.paths,
recursive=args.recursive,
target=args.target,
build_dir='build_@t_@w',
config_rules_str=args.rules,
build_log_filename='build_log.txt',
size_json_filename='size.json' if not args.linux else None,
check_warnings=True,
manifest_files=args.manifests,
default_build_targets=SUPPORTED_TARGETS,
manifest_rootpath='.',
)
sys.exit(
build_apps(apps,
dry_run=False,
keep_going=False,
no_preserve=args.delete,
ignore_warning_strs=ignore_warning)
)

23
ci/bump Executable file
View File

@ -0,0 +1,23 @@
#!/usr/bin/env bash
if [ -z "$1" ]; then
echo "Usage: bump component [version]"
exit 1;
fi
comp=$1; shift;
cd components/${comp}
if ! cz bump --dry-run; then
echo "Commitizen bump commad failed!"
exit 1;
fi
cz_bump_out=`cz bump --files-only "$@"`
commit_title=`echo "${cz_bump_out}" | grep "bump(" | head -1`
commit_body=`cat ../../release_notes.txt`
git add -u .
git commit -m $"${commit_title}
${commit_body}"

116
ci/changelog.py Normal file
View File

@ -0,0 +1,116 @@
# SPDX-FileCopyrightText: 2023 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: Apache-2.0
import argparse
import os
import re
import sh
def main():
parser = argparse.ArgumentParser(
description='Generates a change log from cz commits')
parser.add_argument('component')
args = parser.parse_args()
old_ref = os.environ.get('CZ_PRE_CURRENT_TAG_VERSION')
new_tag = os.environ.get('CZ_PRE_NEW_TAG_VERSION')
new_ref = os.environ.get('CZ_PRE_NEW_VERSION')
component = args.component
root_path = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
git = sh.git.bake(_cwd=root_path)
keys = ['breaking', 'major', 'feat', 'fix', 'update']
items = {key: [] for key in keys}
sections = {
'feat': 'Features',
'fix': 'Bug Fixes',
'update': 'Updated',
'breaking': 'Breaking changes',
'major': 'Major changes'
}
res = git('show-ref', '--tags', _tty_out=False)
if old_ref not in res:
old_ref = git('rev-list', '--max-parents=0', 'HEAD', _tty_out=False).strip()
brief_log = git.log('--oneline', '{}..HEAD'.format(old_ref), '--', 'components/' + component, _tty_out=False)
for oneline in brief_log.splitlines():
[commit, brief_msg] = oneline.split(' ', 1)
if 'Merge' in str(brief_msg) or brief_msg.startswith('bump('): # skip Merge commits and bumps
continue
find_title = re.findall(r'^(fix|feat|esp_modem|esp-modem|mdns)(\([^\)]+\))?:\s*(.+)$', str(brief_msg))
item_type = '' # default prefix
item_message = brief_msg # default body
if find_title is not None and len(find_title) > 0: # Use scopes & types
item_type = find_title[0][0] # prefix (fix/feat/ci)
item_message = find_title[0][-1] # title body
# Add details in parentheses (commit-id and references from the FOOTER section)
details = '[{}](https://github.com/espressif/esp-protocols/commit/{})'.format(commit, commit)
msg_details = git.show('-s', commit, _tty_out=False)
# check references
if any(s in str(msg_details) for s in ['esp-protocols/issues', 'BREAKING CHANGE', 'MAJOR CHANGE']):
# Closes <issue>
closes = re.findall(r'Closes ([^\d]+/(\d+))', str(msg_details), re.MULTILINE)
if closes and closes[0] is not None:
details += ', [#{}]({})'.format(closes[0][1], closes[0][0])
# Breaking changes
find_breaking = re.findall(r'BREAKING CHANGE:\s*([^\n]*)', str(msg_details), re.MULTILINE)
if find_breaking is not None and len(find_breaking) > 0:
if find_breaking[0] != '':
items['breaking'].append('{} ([{}](https://github.com/espressif/esp-protocols/commit/{}))'.format(find_breaking[0], item_message, commit))
else:
items['breaking'].append('{} ({})'.format(item_message, details))
details += ', !BREAKING'
# Major changes
find_major = re.findall(r'MAJOR CHANGE:\s*([^\n]*)',
str(msg_details), re.MULTILINE)
if find_major is not None and len(
find_major) > 0 and find_major[0] != '':
items['major'].append('{} ([{}](https://github.com/espressif/esp-protocols/commit/{}))'.format(find_major[0], item_message, commit))
if item_type in ['fix', 'feat']:
items[item_type].append('{} ({})'.format(item_message, details))
else:
items['update'].append('{} ({})'.format(item_message, details))
# Generate changelog
changelog = '## [{}](https://github.com/espressif/esp-protocols/commits/{})\n'.format(
new_ref, new_tag)
for section, item in items.items():
if len(item) > 0:
changelog += '\n### {}\n\n'.format(sections[section])
for it in item:
changelog += '- {}\n'.format(it)
filename = os.path.join(root_path, 'components', component, 'CHANGELOG.md')
# Check if the changelog file exists.
if not os.path.exists(filename):
# File does not exist, create it
with open(filename, 'w') as file:
file.write('# Changelog\n\n')
else:
changelog += '\n'
# insert the actual changelog to the beginning of the file, just after the title (2nd line)
with open(filename, 'r') as orig_changelog:
changelog_title = orig_changelog.readline(
) # expect # Changelog title on the first line
changelog_nl = orig_changelog.readline()
orig_items = orig_changelog.read()
with open(filename, 'w') as updated_changelog:
updated_changelog.write(changelog_title)
updated_changelog.write(changelog_nl)
updated_changelog.write(changelog)
updated_changelog.write(orig_items)
git.add(filename)
# write the current changelog entry to a local text file (removing links, captions and extra newlines)
changelog = re.sub(r'\[([^\]]+)\]\([^\)]+\)', r'\1', changelog)
changelog = re.sub(r'\#\#[\#\s]*(.+)', r'\1', changelog)
changelog = re.sub(r'\n\n', '\n', changelog)
with open(os.path.join(root_path, 'release_notes.txt'), 'w') as release_notes:
release_notes.write(changelog)
if __name__ == '__main__':
main()

View File

@ -0,0 +1,72 @@
# don't modify this section!
DEFAULT:
perform_check: yes # should the check be performed?
# Sections setting this to 'no' don't need to include any other options as they are ignored
# When a file is using a section with the option set to 'no', no checks are performed.
# what licenses (or license expressions) are allowed for files in this section
# when setting this option in a section, you need to list all the allowed licenses
allowed_licenses:
- Apache-2.0
license_for_new_files: Apache-2.0 # license to be used when inserting a new copyright notice
new_notice_c: | # notice for new C, CPP, H, HPP and LD files
/*
* SPDX-FileCopyrightText: {years} Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: {license}
*/
new_notice_python: | # notice for new python files
# SPDX-FileCopyrightText: {years} Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: {license}
# comment lines matching:
# SPDX-FileCopyrightText: year[-year] Espressif Systems
# or
# SPDX-FileContributor: year[-year] Espressif Systems
# are replaced with this template prefixed with the correct comment notation (# or // or *) and SPDX- notation
espressif_copyright: '{years} Espressif Systems (Shanghai) CO LTD'
# this section sets the default license for examples and unit tests of components
examples_and_unit_tests:
include:
- 'examples/**'
- 'components/**/examples/**'
- 'components/**/test/**'
- 'components/**/tests/**'
- 'common_components/**'
allowed_licenses:
- Apache-2.0
- Unlicense
- CC0-1.0
license_for_new_files: Unlicense OR CC0-1.0
asio_component:
include:
- 'components/asio/port/**'
allowed_licenses:
- Apache-2.0
- BSL-1.0
mosquitto_component:
include:
- 'components/mosquitto/port/**'
allowed_licenses:
- EPL-2.0
- Apache-2.0
- BSD-3-Clause
slim_modem_examples:
include:
- 'examples/esp_netif/slip_custom_netif/**'
allowed_licenses:
- Apache-2.0
- Unlicense
- CC0-1.0
ignore:
perform_check: no
include:
- '**/docs/**'
- 'components/esp_modem/port/linux/**'
- 'components/asio/examples/**'
- 'components/mdns/**/esp_system_protocols_linux/**'

View File

@ -0,0 +1 @@
components/mosquitto/examples/serverless_mqtt/components/libjuice/port/juice_random.c

7
ci/clean_build_artifacts.sh Executable file
View File

@ -0,0 +1,7 @@
# Remove everything, but
# - elf/bin files in the build dir
# - partition-table and bootloader binaries
# - flasher args
# - sdkconfigs (header and json)
# (Ignoring the command failure as it refuses to delete nonempty dirs)
find $1 ! -regex ".*/build[^/]*/[^/]+.\(bin\|elf\)" -a ! -regex ".*\(bootloader\|partition-table\).bin" -a ! -name "flasher_args.json" -a ! -regex ".*/build[^/]*/config/sdkconfig.\(h\|json\)" -delete || true

46
ci/detect_component_bump Executable file
View File

@ -0,0 +1,46 @@
#!/usr/bin/env bash
set -e
if ! git show -s | grep -q '^Merge'; then
echo "Not a merge commit"
exit 0;
fi
for comp in `ls components`; do
if git log -1 -m --name-only --pretty="" | grep -q components/${comp}/idf_component.yml; then
echo "${comp}: Component version file has changed"
version=`grep version: components/${comp}/.cz.yaml`
version=${version#*version: }
version="${version//\~/_}"
tag_format=`grep tag_format: components/${comp}/.cz.yaml`
tag_format=${tag_format#*tag_format: }
eval tag=$tag_format
# check if the tag is already created
if [ $(git tag -l "$tag") ]; then
echo "${comp}: version (${tag}) already exits"
else
# skip components that do not have changelog
[ -f components/${comp}/CHANGELOG.md ] || continue
echo "${comp}: Component version has been updated to ${version}"
# creates release notes from the last entry (between first two "## sections")
awk '/^## \[/{a++};{if(a==1){print}}' components/${comp}/CHANGELOG.md > release_notes.md
echo "BUMP_VERSION=${version}"
echo "BUMP_COMPONENT=${comp}"
echo "BUMP_TAG=${tag}"
# export the findings to github env, so it could be used in other jobs
echo "BUMP_VERSION=${version}" >> "$GITHUB_ENV"
echo "BUMP_COMPONENT=${comp}" >> "$GITHUB_ENV"
echo "BUMP_TAG=${tag}" >> "$GITHUB_ENV"
exit 0;
fi
fi
done
echo "No changes in component version file"

0
ci/ignore_astyle.txt Normal file
View File

View File

@ -0,0 +1 @@
DeprecationWarning: pkg_resources is deprecated as an API

8
ci/requirements.txt Normal file
View File

@ -0,0 +1,8 @@
pytest-embedded-serial-esp
pytest-embedded-idf
junit_xml
SimpleWebSocketServer
dpkt
pytest
idf_build_apps
netifaces

View File

@ -0,0 +1 @@
idf_component_register()

View File

@ -0,0 +1,8 @@
idf_component_register(SRCS esp_timer_linux.c timer_task.cpp
INCLUDE_DIRS include)
set_target_properties(${COMPONENT_LIB} PROPERTIES
CXX_STANDARD 17
CXX_STANDARD_REQUIRED ON
CXX_EXTENSIONS ON
)

View File

@ -0,0 +1,47 @@
/*
* SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#include "esp_err.h"
#include "esp_timer.h"
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include <pthread.h>
void *create_tt(esp_timer_cb_t cb);
void destroy_tt(void *tt);
void set_tout(void *tt, uint32_t ms);
esp_err_t esp_timer_create(const esp_timer_create_args_t *create_args,
esp_timer_handle_t *out_handle)
{
*out_handle = (esp_timer_handle_t)create_tt(create_args->callback);
return ESP_OK;
}
esp_err_t esp_timer_start_periodic(esp_timer_handle_t timer, uint64_t period)
{
set_tout(timer, period / 1000);
return ESP_OK;
}
esp_err_t esp_timer_stop(esp_timer_handle_t timer)
{
return ESP_OK;
}
esp_err_t esp_timer_delete(esp_timer_handle_t timer)
{
destroy_tt(timer);
return ESP_OK;
}
int64_t esp_timer_get_time(void)
{
struct timespec spec;
clock_gettime(CLOCK_REALTIME, &spec);
return spec.tv_nsec / 1000 + spec.tv_sec * 1000000;
}

View File

@ -0,0 +1,45 @@
/*
* SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#pragma once
#include <stdbool.h>
#include <stdint.h>
#include "bsd/string.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef struct esp_timer *esp_timer_handle_t;
typedef void (*esp_timer_cb_t)(void *arg);
typedef enum {
ESP_TIMER_TASK,
} esp_timer_dispatch_t;
typedef struct {
esp_timer_cb_t callback; //!< Function to call when timer expires
void *arg; //!< Argument to pass to the callback
esp_timer_dispatch_t dispatch_method; //!< Call the callback from task or from ISR
const char *name; //!< Timer name, used in esp_timer_dump function
bool skip_unhandled_events; //!< Skip unhandled events for periodic timers
} esp_timer_create_args_t;
esp_err_t esp_timer_create(const esp_timer_create_args_t *create_args,
esp_timer_handle_t *out_handle);
esp_err_t esp_timer_start_periodic(esp_timer_handle_t timer, uint64_t period);
esp_err_t esp_timer_stop(esp_timer_handle_t timer);
esp_err_t esp_timer_delete(esp_timer_handle_t timer);
int64_t esp_timer_get_time(void);
#ifdef __cplusplus
}
#endif

View File

@ -0,0 +1,30 @@
/*
* SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#include "timer_task.hpp"
#include <cstdint>
#include <vector>
#include <memory>
#include <cstring>
extern "C" void *create_tt(cb_t cb)
{
auto *tt = new TimerTaskMock(cb);
return tt;
}
extern "C" void destroy_tt(void *tt)
{
auto *timer_task = static_cast<TimerTaskMock *>(tt);
delete (timer_task);
}
extern "C" void set_tout(void *tt, uint32_t ms)
{
auto *timer_task = static_cast<TimerTaskMock *>(tt);
timer_task->SetTimeout(ms);
}

View File

@ -0,0 +1,57 @@
/*
* SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#pragma once
#include <queue>
#include <mutex>
#include <condition_variable>
#include <memory>
#include <thread>
#include <atomic>
typedef void (*cb_t)(void *arg);
class TimerTaskMock {
public:
TimerTaskMock(cb_t cb): cb(cb), active(false), ms(INT32_MAX) {}
~TimerTaskMock(void)
{
active = false;
t.join();
}
void SetTimeout(uint32_t m)
{
ms = m;
active = true;
t = std::thread(run_static, this);
}
private:
static void run_static(TimerTaskMock *timer)
{
timer->run();
}
void run(void)
{
while (!active.load()) {
std::this_thread::sleep_for(std::chrono::milliseconds(1));
}
while (active.load()) {
std::this_thread::sleep_for(std::chrono::milliseconds(ms));
cb(nullptr);
}
}
cb_t cb;
std::thread t;
std::atomic<bool> active;
uint32_t ms;
};

View File

@ -0,0 +1,13 @@
idf_component_register(SRCS freertos_linux.c
osal/queue.cpp osal/event_group.cpp osal/mutex.cpp
INCLUDE_DIRS include)
set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)
target_link_libraries(${COMPONENT_LIB} PRIVATE Threads::Threads)
set_target_properties(${COMPONENT_LIB} PROPERTIES
CXX_STANDARD 17
CXX_STANDARD_REQUIRED ON
CXX_EXTENSIONS ON
)

View File

@ -0,0 +1,7 @@
menu "FreeRTOS"
config FREERTOS_NO_AFFINITY
hex
default 0x7FFFFFFF
endmenu

View File

@ -0,0 +1,326 @@
/*
* SPDX-FileCopyrightText: 2021-2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <unistd.h>
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include <pthread.h>
#include <assert.h>
#include <stdlib.h>
#include <string.h>
#include "osal/osal_api.h"
#include <semaphore.h>
typedef struct task_notifiers {
sem_t sem;
TaskHandle_t id;
} task_notifiers_t;
typedef struct pthread_params {
void *const param;
TaskFunction_t task;
bool started;
TaskHandle_t handle;
} pthread_params_t;
static uint64_t s_semaphore_data = 0;
static task_notifiers_t *s_notifiers;
static int s_threads = 0;
pthread_mutex_t s_mutex;
typedef enum queue_type_tag {
MUTEX_REC,
MUTEX,
SEMA,
QUEUE,
} queue_type_t;
struct generic_queue_handle {
queue_type_t type;
size_t item_size;
void *q;
};
static struct generic_queue_handle *create_generic_queue(queue_type_t type, uint32_t len, uint32_t item_size)
{
struct generic_queue_handle *h = calloc(1, sizeof(struct generic_queue_handle));
h->item_size = len;
h->type = type;
switch (type) {
default:
case QUEUE:
case SEMA:
h->q = osal_queue_create();
break;
case MUTEX:
case MUTEX_REC:
h->q = osal_mutex_create();
break;
}
return h;
}
QueueHandle_t xQueueCreate(uint32_t uxQueueLength, uint32_t uxItemSize )
{
return (QueueHandle_t)create_generic_queue(QUEUE, uxQueueLength, uxItemSize);
}
uint32_t xQueueSend(QueueHandle_t xQueue, const void *pvItemToQueue, TickType_t xTicksToWait)
{
struct generic_queue_handle *h = xQueue;
return osal_queue_send(h->q, (uint8_t *)pvItemToQueue, h->item_size) ? pdTRUE : pdFAIL;
}
uint32_t xQueueSendToBack(QueueHandle_t xQueue, const void *pvItemToQueue, TickType_t xTicksToWait )
{
return xQueueSend(xQueue, pvItemToQueue, xTicksToWait);
}
uint32_t xQueueReceive(QueueHandle_t xQueue, void *pvBuffer, TickType_t xTicksToWait)
{
struct generic_queue_handle *h = xQueue;
return osal_queue_recv(h->q, (uint8_t *)pvBuffer, h->item_size, xTicksToWait) ? pdTRUE : pdFAIL;
}
BaseType_t xSemaphoreGive( QueueHandle_t xQueue)
{
struct generic_queue_handle *h = xQueue;
if (h->type == MUTEX) {
osal_mutex_give(h->q);
return pdTRUE;
}
return xQueueSend(xQueue, &s_semaphore_data, portMAX_DELAY);
}
BaseType_t xSemaphoreGiveRecursive( QueueHandle_t xQueue)
{
struct generic_queue_handle *h = xQueue;
if (h->type == MUTEX_REC) {
osal_mutex_give(h->q);
return pdTRUE;
}
return pdFALSE;
}
BaseType_t xSemaphoreTake( QueueHandle_t xQueue, TickType_t pvTask )
{
struct generic_queue_handle *h = xQueue;
if (h->type == MUTEX) {
osal_mutex_take(h->q);
return pdTRUE;
}
return xQueueReceive(xQueue, &s_semaphore_data, portMAX_DELAY);
}
BaseType_t xSemaphoreTakeRecursive( QueueHandle_t xQueue, TickType_t pvTask )
{
struct generic_queue_handle *h = xQueue;
if (h->type == MUTEX_REC) {
osal_mutex_take(h->q);
return pdTRUE;
}
return pdFALSE;
}
void vQueueDelete( QueueHandle_t xQueue )
{
struct generic_queue_handle *h = xQueue;
if (h->q) {
if (h->type == MUTEX || h->type == MUTEX_REC) {
osal_mutex_delete(h->q);
} else {
osal_queue_delete(h->q);
}
}
free(xQueue);
}
QueueHandle_t xSemaphoreCreateBinary(void)
{
return xQueueCreate(1, 1);
}
QueueHandle_t xSemaphoreCreateMutex(void)
{
return (QueueHandle_t)create_generic_queue(MUTEX, 1, 1);
}
QueueHandle_t xSemaphoreCreateRecursiveMutex(void)
{
return (QueueHandle_t)create_generic_queue(MUTEX_REC, 1, 1);
}
void vTaskDelete(TaskHandle_t *task)
{
for (int i = 0; i < s_threads; ++i) {
if (task == s_notifiers[i].id) {
sem_destroy(&s_notifiers[i].sem);
s_notifiers[i].id = 0;
}
}
if (task == NULL) {
pthread_exit(0);
}
void *thread_rval = NULL;
pthread_join((pthread_t)task, &thread_rval);
}
void vTaskSuspend(void *task)
{
vTaskDelete(task);
}
TickType_t xTaskGetTickCount( void )
{
struct timespec spec;
clock_gettime(CLOCK_REALTIME, &spec);
return spec.tv_nsec / 1000000 + spec.tv_sec * 1000;
}
void vTaskDelay( const TickType_t xTicksToDelay )
{
usleep(xTicksToDelay * 1000);
}
void *pthread_task(void *params)
{
pthread_params_t *pthread_params = params;
void *const param = pthread_params->param;
TaskFunction_t task = pthread_params->task;
pthread_params->handle = xTaskGetCurrentTaskHandle();
if (s_threads == 0) {
pthread_mutex_init(&s_mutex, NULL);
}
pthread_mutex_lock(&s_mutex);
s_notifiers = realloc(s_notifiers, sizeof(struct task_notifiers) * (++s_threads));
assert(s_notifiers);
s_notifiers[s_threads - 1].id = pthread_params->handle;
sem_init(&s_notifiers[s_threads - 1].sem, 0, 0);
pthread_mutex_unlock(&s_mutex);
pthread_params->started = true;
task(param);
return NULL;
}
BaseType_t xTaskCreatePinnedToCore( TaskFunction_t pvTaskCode,
const char *const pcName,
const uint32_t usStackDepth,
void *const pvParameters,
UBaseType_t uxPriority,
TaskHandle_t *const pvCreatedTask,
const BaseType_t xCoreID)
{
xTaskCreate(pvTaskCode, pcName, usStackDepth, pvParameters, uxPriority, pvCreatedTask);
return pdTRUE;
}
BaseType_t xTaskCreate(TaskFunction_t pvTaskCode, const char *const pcName, const uint32_t usStackDepth, void *const pvParameters, UBaseType_t uxPriority, TaskHandle_t *const pvCreatedTask)
{
pthread_t new_thread = (pthread_t)NULL;
pthread_attr_t attr;
pthread_params_t pthread_params = { .param = pvParameters, .task = pvTaskCode};
int res = pthread_attr_init(&attr);
assert(res == 0);
res = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
assert(res == 0);
res = pthread_create(&new_thread, &attr, pthread_task, &pthread_params);
assert(res == 0);
// just wait till the task started so we can unwind params from the stack
while (pthread_params.started == false) {
usleep(1000);
}
if (pvCreatedTask) {
*pvCreatedTask = pthread_params.handle;
}
return pdTRUE;
}
void xTaskNotifyGive(TaskHandle_t task)
{
int i = 0;
while (true) {
pthread_mutex_lock(&s_mutex);
if (task == s_notifiers[i].id) {
sem_post(&s_notifiers[i].sem);
pthread_mutex_unlock(&s_mutex);
return;
}
pthread_mutex_unlock(&s_mutex);
if (++i == s_threads) {
i = 0;
}
usleep(1000);
}
}
BaseType_t xTaskNotifyWait(uint32_t bits_entry_clear, uint32_t bits_exit_clear, uint32_t *value, TickType_t wait_time )
{
return true;
}
TaskHandle_t xTaskGetCurrentTaskHandle(void)
{
return (TaskHandle_t)pthread_self();
}
EventGroupHandle_t xEventGroupCreate( void )
{
return osal_signal_create();
}
void vEventGroupDelete( EventGroupHandle_t xEventGroup )
{
osal_signal_delete(xEventGroup);
}
EventBits_t xEventGroupClearBits( EventGroupHandle_t xEventGroup, const EventBits_t uxBitsToClear )
{
return osal_signal_clear(xEventGroup, uxBitsToClear);
}
EventBits_t xEventGroupGetBits( EventGroupHandle_t xEventGroup)
{
return osal_signal_get(xEventGroup);
}
EventBits_t xEventGroupSetBits( EventGroupHandle_t xEventGroup, const EventBits_t uxBitsToSet )
{
return osal_signal_set(xEventGroup, uxBitsToSet);
}
EventBits_t xEventGroupWaitBits( EventGroupHandle_t xEventGroup, const EventBits_t uxBitsToWaitFor, const BaseType_t xClearOnExit, const BaseType_t xWaitForAllBits, TickType_t xTicksToWait )
{
return osal_signal_wait(xEventGroup, uxBitsToWaitFor, xWaitForAllBits, xTicksToWait);
}
void ulTaskNotifyTake(bool clear_on_exit, uint32_t xTicksToWait)
{
TaskHandle_t task = xTaskGetCurrentTaskHandle();
int i = 0;
while (true) {
pthread_mutex_lock(&s_mutex);
if (task == s_notifiers[i].id) {
pthread_mutex_unlock(&s_mutex);
sem_wait(&s_notifiers[i].sem);
return;
}
pthread_mutex_unlock(&s_mutex);
if (++i == s_threads) {
i = 0;
}
usleep(1000);
}
}

View File

@ -0,0 +1,13 @@
/*
* SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#pragma once
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#define ESP_TASK_PRIO_MAX 25
#define ESP_TASKD_EVENT_PRIO 5
#define ESP_TASKD_EVENT_STACK 1024

View File

@ -0,0 +1,37 @@
/*
* SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#pragma once
#include <stdio.h>
#include <stdint.h>
#include <stdbool.h>
#include <stddef.h>
#include <stdlib.h>
#define portTICK_PERIOD_MS 1
#define portMAX_DELAY ( TickType_t ) 0xffffffffUL
typedef void *SemaphoreHandle_t;
typedef void *QueueHandle_t;
typedef void *TaskHandle_t;
typedef void *EventGroupHandle_t;
typedef uint32_t TickType_t;
typedef TickType_t EventBits_t;
typedef void (*TaskFunction_t)( void * );
typedef unsigned int UBaseType_t;
typedef int BaseType_t;
#define pdFALSE ( ( BaseType_t ) 0 )
#define pdTRUE ( ( BaseType_t ) 1 )
#define pdPASS ( pdTRUE )
#define pdFAIL ( pdFALSE )
#define pdMS_TO_TICKS(tick) (tick)
uint32_t esp_random(void);
void vTaskSuspendAll(void);

View File

@ -0,0 +1,6 @@
/*
* SPDX-FileCopyrightText: 2023 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#pragma once

View File

@ -0,0 +1,6 @@
/*
* SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Unlicense OR CC0-1.0
*/
#pragma once

View File

@ -0,0 +1,6 @@
/*
* SPDX-FileCopyrightText: 2023 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Unlicense OR CC0-1.0
*/
#pragma once

View File

@ -0,0 +1,6 @@
/*
* SPDX-FileCopyrightText: 2023 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Unlicense OR CC0-1.0
*/
#pragma once

View File

@ -0,0 +1,86 @@
/*
* SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#pragma once
#include "freertos/FreeRTOS.h"
#ifdef __cplusplus
extern "C" {
#endif
#define tskNO_AFFINITY ( ( BaseType_t ) 0x7FFFFFFF )
#define TaskHandle_t TaskHandle_t
#define vSemaphoreDelete( xSemaphore ) vQueueDelete( ( QueueHandle_t ) ( xSemaphore ) )
void vTaskDelay( const TickType_t xTicksToDelay );
void xTaskNotifyGive(TaskHandle_t task);
void ulTaskNotifyTake(bool stuff, uint32_t timeout);
TaskHandle_t xTaskGetCurrentTaskHandle(void);
BaseType_t xTaskNotifyWait(uint32_t bits_entry_clear, uint32_t bits_exit_clear, uint32_t *value, TickType_t wait_time );
BaseType_t xTaskCreatePinnedToCore( TaskFunction_t pvTaskCode,
const char *const pcName,
const uint32_t usStackDepth,
void *const pvParameters,
UBaseType_t uxPriority,
TaskHandle_t *const pvCreatedTask,
const BaseType_t xCoreID);
BaseType_t xTaskCreate(TaskFunction_t pvTaskCode, const char *const pcName, const uint32_t usStackDepth, void *const pvParameters, UBaseType_t uxPriority, TaskHandle_t *const pvCreatedTask);
TickType_t xTaskGetTickCount( void );
void vQueueDelete( QueueHandle_t xQueue );
QueueHandle_t xSemaphoreCreateBinary(void);
QueueHandle_t xSemaphoreCreateMutex(void);
QueueHandle_t xSemaphoreCreateRecursiveMutex(void);
BaseType_t xSemaphoreGive( QueueHandle_t xQueue);
BaseType_t xSemaphoreTake( QueueHandle_t xQueue, TickType_t pvTask );
BaseType_t xSemaphoreGiveRecursive( QueueHandle_t xQueue);
BaseType_t xSemaphoreTakeRecursive( QueueHandle_t xQueue, TickType_t pvTask );
void vTaskDelete(TaskHandle_t *task);
QueueHandle_t xQueueCreate( uint32_t uxQueueLength,
uint32_t uxItemSize );
uint32_t xQueueSend(QueueHandle_t xQueue, const void *pvItemToQueue, TickType_t xTicksToWait);
uint32_t xQueueReceive(QueueHandle_t xQueue, void *pvBuffer, TickType_t xTicksToWait);
void vTaskSuspend(void *task);
EventGroupHandle_t xEventGroupCreate( void );
void vEventGroupDelete( EventGroupHandle_t xEventGroup );
EventBits_t xEventGroupClearBits( EventGroupHandle_t xEventGroup,
const EventBits_t uxBitsToClear );
EventBits_t xEventGroupWaitBits( EventGroupHandle_t xEventGroup,
const EventBits_t uxBitsToWaitFor,
const BaseType_t xClearOnExit,
const BaseType_t xWaitForAllBits,
TickType_t xTicksToWait );
EventBits_t xEventGroupGetBits( EventGroupHandle_t xEventGroup);
EventBits_t xEventGroupSetBits( EventGroupHandle_t xEventGroup,
const EventBits_t uxBitsToSet );
uint32_t xQueueSendToBack(QueueHandle_t xQueue, const void *pvItemToQueue, TickType_t xTicksToWait );
#ifdef __cplusplus
}
#endif //__cplusplus

View File

@ -0,0 +1,109 @@
/*
* SPDX-FileCopyrightText: 2023 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <mutex>
#include <condition_variable>
#include "osal_api.h"
class SignalGroup {
struct SignalGroupInternal {
std::condition_variable notify;
std::mutex m;
uint32_t flags{ 0 };
};
using SignalT = std::unique_ptr<SignalGroupInternal>;
public:
void set(uint32_t bits)
{
std::unique_lock<std::mutex> lock(event_group->m);
event_group->flags |= bits;
event_group->notify.notify_all();
}
uint32_t get()
{
return event_group->flags;
}
void clear(uint32_t bits)
{
std::unique_lock<std::mutex> lock(event_group->m);
event_group->flags &= ~bits;
event_group->notify.notify_all();
}
// waiting for all and clearing if set
bool wait(uint32_t flags, uint32_t time_ms)
{
std::unique_lock<std::mutex> lock(event_group->m);
return event_group->notify.wait_for(lock, std::chrono::milliseconds(time_ms), [&] {
if ((flags & event_group->flags) == flags)
{
event_group->flags &= ~flags;
return true;
}
return false;
});
}
// waiting for any bit, not clearing them
bool wait_any(uint32_t flags, uint32_t time_ms)
{
std::unique_lock<std::mutex> lock(event_group->m);
return event_group->notify.wait_for(lock, std::chrono::milliseconds(time_ms), [&] { return flags & event_group->flags; });
}
private:
SignalT event_group{std::make_unique<SignalGroupInternal>()};
};
void *osal_signal_create()
{
auto signal = new SignalGroup;
return signal;
}
void osal_signal_delete(void *s)
{
delete static_cast<SignalGroup *>(s);
}
uint32_t osal_signal_clear(void *s, uint32_t bits)
{
auto signal = static_cast<SignalGroup *>(s);
signal->clear(bits);
return signal->get();
}
uint32_t osal_signal_set(void *s, uint32_t bits)
{
auto signal = static_cast<SignalGroup *>(s);
signal->set(bits);
return signal->get();
}
uint32_t osal_signal_get(void *s)
{
auto signal = static_cast<SignalGroup *>(s);
return signal->get();
}
uint32_t osal_signal_wait(void *s, uint32_t flags, bool all, uint32_t timeout)
{
auto signal = static_cast<SignalGroup *>(s);
if (all) {
signal->wait(flags, timeout);
} else {
signal->wait_any(flags, timeout);
}
return signal->get();
}

View File

@ -0,0 +1,31 @@
/*
* SPDX-FileCopyrightText: 2023 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <queue>
#include <mutex>
#include "osal_api.h"
void *osal_mutex_create()
{
auto mut = new std::recursive_mutex();
return mut;
}
void osal_mutex_delete(void *mut)
{
delete static_cast<std::recursive_mutex *>(mut);
}
void osal_mutex_take(void *m)
{
auto mut = static_cast<std::recursive_mutex *>(m);
mut->lock();
}
void osal_mutex_give(void *m)
{
auto mut = static_cast<std::recursive_mutex *>(m);
mut->unlock();
}

View File

@ -0,0 +1,34 @@
/*
* SPDX-FileCopyrightText: 2023 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#pragma once
#ifdef __cplusplus
extern "C" {
#endif
// queue api
void *osal_queue_create(void);
void osal_queue_delete(void *q);
bool osal_queue_send(void *q, uint8_t *data, size_t len);
bool osal_queue_recv(void *q, uint8_t *data, size_t len, uint32_t ms);
// mutex api
void *osal_mutex_create(void);
void osal_mutex_delete(void *m);
void osal_mutex_take(void *m);
void osal_mutex_give(void *m);
// event groups
void *osal_signal_create(void);
void osal_signal_delete(void *s);
uint32_t osal_signal_clear(void *s, uint32_t bits);
uint32_t osal_signal_set(void *s, uint32_t bits);
uint32_t osal_signal_get(void *s);
uint32_t osal_signal_wait(void *s, uint32_t flags, bool all, uint32_t timeout);
#ifdef __cplusplus
}
#endif

View File

@ -0,0 +1,78 @@
/*
* SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <cstdint>
#include <vector>
#include <cstring>
#include <queue>
#include <mutex>
#include <condition_variable>
#include <atomic>
#include "osal_api.h"
template <class T>
class Queue {
public:
void send(std::unique_ptr<T> t)
{
std::lock_guard<std::mutex> lock(m);
q.push(std::move(t));
c.notify_one();
}
std::unique_ptr<T> receive(std::chrono::milliseconds ms)
{
std::unique_lock<std::mutex> lock(m);
while (q.empty()) {
if (c.wait_for(lock, ms) == std::cv_status::timeout) {
return nullptr;
}
}
std::unique_ptr<T> val = std::move(q.front());
q.pop();
return val;
}
private:
std::queue<std::unique_ptr<T>> q{};
mutable std::mutex m{};
std::condition_variable c{};
};
using item_t = std::vector<uint8_t>;
void *osal_queue_create(void)
{
auto *q = new Queue<item_t>();
return q;
}
void osal_queue_delete(void *q)
{
auto *queue = static_cast<Queue<item_t> *>(q);
delete (queue);
}
bool osal_queue_send(void *q, uint8_t *data, size_t len)
{
auto v = std::make_unique<item_t>(len);
v->assign(data, data + len);
auto queue = static_cast<Queue<item_t> *>(q);
queue->send(std::move(v));
return true;
}
bool osal_queue_recv(void *q, uint8_t *data, size_t len, uint32_t ms)
{
auto queue = static_cast<Queue<item_t> *>(q);
auto v = queue->receive(std::chrono::milliseconds(ms));
if (v != nullptr) {
memcpy(data, (void *)v->data(), len);
return true;
}
return false;
}

8
components/asio/.cz.yaml Normal file
View File

@ -0,0 +1,8 @@
---
commitizen:
bump_message: 'bump(asio): $current_version -> $new_version'
pre_bump_hooks: python ../../ci/changelog.py asio
tag_format: asio-v$version
version: 1.32.0
version_files:
- idf_component.yml

View File

@ -0,0 +1,99 @@
# Changelog
## [1.32.0](https://github.com/espressif/esp-protocols/commits/asio-v1.32.0)
### Features
- Upgrade asio to 1.32 ([9bdd429c](https://github.com/espressif/esp-protocols/commit/9bdd429c))
- Drop esp/asio patches in favor of sock-utils ([27435b7f](https://github.com/espressif/esp-protocols/commit/27435b7f))
### Bug Fixes
- Fix chat example to print only the message body ([76aaea08](https://github.com/espressif/esp-protocols/commit/76aaea08))
- Make asio enable if_nametoindex to fix linking ([5db32cce](https://github.com/espressif/esp-protocols/commit/5db32cce))
- Re-applie refs to common comps idf_component.yml ([9fe44a45](https://github.com/espressif/esp-protocols/commit/9fe44a45))
- Reference common component from IDF ([74fc228c](https://github.com/espressif/esp-protocols/commit/74fc228c))
- Revert referencing protocol_examples_common from IDF ([f9e0281a](https://github.com/espressif/esp-protocols/commit/f9e0281a))
- reference protocol_examples_common from IDF ([09abb18b](https://github.com/espressif/esp-protocols/commit/09abb18b))
- specify override_path in example manifest files ([1d8923cf](https://github.com/espressif/esp-protocols/commit/1d8923cf))
### Updated
- docs(asio): Updates asio docs ([ce9337d3](https://github.com/espressif/esp-protocols/commit/ce9337d3))
## [1.28.2~0](https://github.com/espressif/esp-protocols/commits/asio-1.28.2_0)
### Bug Fixes
- reference protocol_examples_common from IDF ([09abb18](https://github.com/espressif/esp-protocols/commit/09abb18))
- specify override_path in example manifest files ([1d8923c](https://github.com/espressif/esp-protocols/commit/1d8923c))
### Updated
- docs(asio): Updates asio docs ([ce9337d](https://github.com/espressif/esp-protocols/commit/ce9337d))
## [1.28.0~0](https://github.com/espressif/esp-protocols/commits/asio-1.28.0~0)
### Features
- Updates asio to 1.28 ([b310abe](https://github.com/espressif/esp-protocols/commit/b310abe))
### Bug Fixes
- Makes the examples to override path ([842b2b2](https://github.com/espressif/esp-protocols/commit/842b2b2))
- Removes esp_exception and make all examples to use exceptions ([c1c9350](https://github.com/espressif/esp-protocols/commit/c1c9350))
- removed Wno-format flag and fixed formatting warnings ([c48e442](https://github.com/espressif/esp-protocols/commit/c48e442))
- added idf_component.yml for examples ([d273e10](https://github.com/espressif/esp-protocols/commit/d273e10))
- Reintroduce missing CHANGELOGs ([200cbb3](https://github.com/espressif/esp-protocols/commit/200cbb3), [#235](https://github.com/espressif/esp-protocols/issues/235))
### Updated
- docs(common): updated component and example links ([f48d9b2](https://github.com/espressif/esp-protocols/commit/f48d9b2))
- docs(common): improving documentation ([ca3fce0](https://github.com/espressif/esp-protocols/commit/ca3fce0))
- Add homepage URL and License to all components ([ef3f0ee](https://github.com/espressif/esp-protocols/commit/ef3f0ee))
- Added badges with version of components to the respective README files ([e4c8a59](https://github.com/espressif/esp-protocols/commit/e4c8a59))
- CI: Fix ASIO example test ([6e2bb51](https://github.com/espressif/esp-protocols/commit/6e2bb51))
- Examples: using pytest.ini from top level directory ([aee016d](https://github.com/espressif/esp-protocols/commit/aee016d))
- CI: fixing the files to be complient with pre-commit hooks ([945bd17](https://github.com/espressif/esp-protocols/commit/945bd17))
## [1.14.1~3](https://github.com/espressif/esp-protocols/commits/f148c98)
### Updated
- ASIO: Updated package version to "1.14.1~3" ([f148c98](https://github.com/espressif/esp-protocols/commit/f148c98))
- ASIO: Example tests integration ([5193ebc](https://github.com/espressif/esp-protocols/commit/5193ebc))
## [1.0.2](https://github.com/espressif/esp-protocols/commits/57afa38)
### Updated
- Bump asio/mdns/esp_websocket_client versions ([57afa38](https://github.com/espressif/esp-protocols/commit/57afa38))
- ignore format warnings ([d66f9dc](https://github.com/espressif/esp-protocols/commit/d66f9dc))
- asio: Fix exampels build ([3662c14](https://github.com/espressif/esp-protocols/commit/3662c14))
## [1.0.1](https://github.com/espressif/esp-protocols/commits/055f051)
### Updated
- ASIO: Initial version based on IDF 5.0 with history ([055f051](https://github.com/espressif/esp-protocols/commit/055f051))
- asio: Disable concepts support Fix example for compatibility with C++20 ([ac7bf46](https://github.com/espressif/esp-protocols/commit/ac7bf46), [IDF@9dba047](https://github.com/espressif/esp-idf/commit/9dba0476a01cd80d76e21706ad350009606b877e))
- lwip: Update socket API to include port-version of sockets/netdb ([057a5d2](https://github.com/espressif/esp-protocols/commit/057a5d2), [IDF@53c009e](https://github.com/espressif/esp-idf/commit/53c009e62631bae569fa849c6b6c9e70a10b3afe))
- esp_netif/lwip: Implement basic support for vanilla-lwip (2.1.3-REL) ([63bff63](https://github.com/espressif/esp-protocols/commit/63bff63), [IDF@5b471a1](https://github.com/espressif/esp-idf/commit/5b471a18489b056f65fe8dcbb2c992d27909ebc9))
- mbedtls: Remove certs.c and certs.h from port directory ([e3c4391](https://github.com/espressif/esp-protocols/commit/e3c4391), [IDF@f31d8dd](https://github.com/espressif/esp-idf/commit/f31d8dd2955be0fe949340dcf3b043ec6daf4378))
- mbedtls-3 update: 1) Fix build issue in mbedtls 2) skip the public headers check in IDF 3)Update Kconfig Macros 4)Remove deprecated config options 5) Update the sha API according to new nomenclature 6) Update mbedtls_rsa_init usage 7) Include mbedtls/build_info.h instead of mbedtls/config.h 8) Dont include check_config.h 9) Add additional error message in esp_blufi_api.h ([9813818](https://github.com/espressif/esp-protocols/commit/9813818), [IDF@4512253](https://github.com/espressif/esp-idf/commit/45122533e0bca5d538585e22308f14b74c33e474))
- asio: Use internal ssl context and engine impl ([f605fdd](https://github.com/espressif/esp-protocols/commit/f605fdd), [IDF@d823106](https://github.com/espressif/esp-idf/commit/d823106aa6b24b8bdcc30373513c8688c61438c4))
- Build & config: Remove leftover files from the unsupported "make" build system ([abbc8d9](https://github.com/espressif/esp-protocols/commit/abbc8d9), [IDF@766aa57](https://github.com/espressif/esp-idf/commit/766aa5708443099f3f033b739cda0e1de101cca6))
- openssl: Add deprecation warning to ssl.h ([a029774](https://github.com/espressif/esp-protocols/commit/a029774), [IDF@cfc0018](https://github.com/espressif/esp-idf/commit/cfc001870c5e0afed7b42b6bf8c326eae053fe96))
- asio coap: If LWIP IPV6 is disabled, automatically don't build asio & coap ([cc0f2b3](https://github.com/espressif/esp-protocols/commit/cc0f2b3), [IDF@e305f29](https://github.com/espressif/esp-idf/commit/e305f2938278c2a39e75c21a3ed59d8f4d4e62fa))
- asio: update copyright notice ([47d57a5](https://github.com/espressif/esp-protocols/commit/47d57a5), [IDF@2d0895e](https://github.com/espressif/esp-idf/commit/2d0895e9a98bc7846d0ac7321f2b86b47346bf21))
- Whitespace: Automated whitespace fixes (large commit) ([622a360](https://github.com/espressif/esp-protocols/commit/622a360), [IDF@66fb5a2](https://github.com/espressif/esp-idf/commit/66fb5a29bbdc2482d67c52e6f66b303378c9b789))
- cmake: Apply cmakelint fixes ([4358c3c](https://github.com/espressif/esp-protocols/commit/4358c3c), [IDF@e82eac4](https://github.com/espressif/esp-idf/commit/e82eac4354b8b4111697656f3acce7450eeff366))
- asio: option to use wolfSSL as TLS stack for ASIO ([c05558b](https://github.com/espressif/esp-protocols/commit/c05558b), [IDF@1c8171c](https://github.com/espressif/esp-idf/commit/1c8171c3e8d5a67e47dc8d6abac27ad2989470c3))
- asio: Basic SSL/TLS support in asio port for ESP platform ([dab1230](https://github.com/espressif/esp-protocols/commit/dab1230), [IDF@9459c0d](https://github.com/espressif/esp-idf/commit/9459c0dd432fdd0fccb49ea65bb5c72d1849e1ba))
- asio: updated ASIO port to use latest asio and esp-idf features ([9190917](https://github.com/espressif/esp-protocols/commit/9190917), [IDF@13d603e](https://github.com/espressif/esp-idf/commit/13d603e486624380d49f2e89614b10425c208d14))
- components: use new component registration api ([9e83b1e](https://github.com/espressif/esp-protocols/commit/9e83b1e), [IDF@9eccd7c](https://github.com/espressif/esp-idf/commit/9eccd7c0826d6cc2e9de59304d1e5f76c0063ccf))
- Rename Kconfig options (root) ([3b49d1f](https://github.com/espressif/esp-protocols/commit/3b49d1f), [IDF@c5000c8](https://github.com/espressif/esp-idf/commit/c5000c83d250896fffbddd7a3991384ea0fc286d))
- cmake: make main a component again ([57672d5](https://github.com/espressif/esp-protocols/commit/57672d5), [IDF@d9939ce](https://github.com/espressif/esp-idf/commit/d9939cedd9b44d63dc148354c3a0a139b9c7113d))
- asio: initial idf port of asio library without ssl ([5472d5c](https://github.com/espressif/esp-protocols/commit/5472d5c), [IDF@1ef13c5](https://github.com/espressif/esp-idf/commit/1ef13c524c484e9fb62e6c0b11482c30c5383728))

View File

@ -0,0 +1,47 @@
if(NOT CONFIG_LWIP_IPV6 AND NOT CMAKE_BUILD_EARLY_EXPANSION)
# note: the component is still included in the build so it can become visible again in config
# without needing to re-run CMake. However no source or header files are built.
message(STATUS "IPV6 support is disabled so the asio component will not be built")
idf_component_register()
return()
endif()
set(asio_sources "asio/asio/src/asio.cpp" "port/src/asio_stub.cpp")
set(asio_requires lwip sock_utils)
if(CONFIG_ASIO_SSL_SUPPORT)
list(APPEND asio_sources
"port/src/asio_ssl_impl.cpp"
"port/mbedtls/src/mbedtls_context.cpp"
"port/mbedtls/src/mbedtls_engine.cpp")
set(asio_priv_includes "port/mbedtls/include")
endif()
idf_component_register(SRCS ${asio_sources}
INCLUDE_DIRS "port/include" "asio/asio/include"
PRIV_INCLUDE_DIRS ${asio_priv_includes}
PRIV_REQUIRES ${asio_requires})
target_compile_definitions(${COMPONENT_LIB} PUBLIC SA_RESTART=0x01
SA_NOCLDSTOP=0x2
SA_NOCLDWAIT=0x4
ASIO_DISABLE_SERIAL_PORT
ASIO_SEPARATE_COMPILATION
ASIO_STANDALONE
ASIO_HAS_PTHREADS
OPENSSL_NO_ENGINE
ASIO_DETAIL_IMPL_POSIX_EVENT_IPP # this replaces asio's posix_event constructor
)
if(NOT CONFIG_COMPILER_CXX_EXCEPTIONS)
target_compile_definitions(${COMPONENT_LIB} PUBLIC ASIO_NO_EXCEPTIONS)
endif()
if(NOT CONFIG_COMPILER_RTTI)
target_compile_definitions(${COMPONENT_LIB} PUBLIC ASIO_NO_TYPEID)
endif()
if(CONFIG_ASIO_SSL_SUPPORT)
idf_component_get_property(mbedtls mbedtls COMPONENT_LIB)
target_link_libraries(${COMPONENT_LIB} PUBLIC ${mbedtls})
endif()

View File

@ -0,0 +1,40 @@
# Information for Contributors
Contributions in the form of pull requests, issue reports, and feature requests are welcome!
## Updating ASIO
ASIO is managed as a submodule, to updated the version first the [espressif](github.com/espressif/asio) ASIO fork must be updated.
## Release process
When releasing a new component version we have to:
* Update the submodule reference
* Update the version number
* Update the changelog
And the automation process takes care of the last steps:
* Create the version tag in this repository
* Deploy the component to component registry
* Update the documentation
This process needs to be manually handled for ASIO component since commitizen doesn't accept the versioning schema used.
* Increment manually the version in the [manifest file](idf_component.yml)
* Export environment variables for changelog generation:
- CZ_PRE_CURRENT_TAG_VERSION
- CZ_PRE_NEW_TAG_VERSION
- CZ_PRE_NEW_VERSION
* Run `python ../../ci/changelog.py asio` from this directory to generate the change log
* Check the updated `CHANGELOG.md`
* Commit the changes with the adequated message format.
```
bump(asio): $current_version -> $new_version
$Changelog for the version
```
* Create a PR
Once the PR is merged, the CI job tags the merge commit, creates a new release, builds and deploys documentation and the new component to the component registry

28
components/asio/Kconfig Normal file
View File

@ -0,0 +1,28 @@
menu "ESP-ASIO"
visible if LWIP_IPV6
config ASIO_IS_ENABLED
# Invisible option that is enabled if ASIO is added to the IDF components.
# This is used to "select" LWIP_NETIF_API option
# which enables if_indextoname() and if_nametoindex() functions
# (these are optionally used in asio)
bool
default "y"
select LWIP_NETIF_API
config ASIO_SSL_SUPPORT
bool "Enable SSL/TLS support of ASIO"
default n
help
Enable support for basic SSL/TLS features, available for mbedTLS/OpenSSL
config ASIO_SSL_BIO_SIZE
int "Size of BIO object"
default 1024
depends on ASIO_SSL_SUPPORT
help
Size in bytes of SSL-BIO implementation.
Reducing the BIO size saves more RAM, but may slow down input output operations due to
fragmentation.
endmenu

23
components/asio/LICENSE Normal file
View File

@ -0,0 +1,23 @@
Boost Software License - Version 1.0 - August 17th, 2003
Permission is hereby granted, free of charge, to any person or organization
obtaining a copy of the software and accompanying documentation covered by
this license (the "Software") to use, reproduce, display, distribute,
execute, and transmit the Software, and to prepare derivative works of the
Software, and to permit third-parties to whom the Software is furnished to
do so, all subject to the following:
The copyright notices in the Software and this entire statement, including
the above license grant, this restriction and the following disclaimer,
must be included in all copies of the Software, in whole or in part, and
all derivative works of the Software, unless such copies or derivative
works are solely in the form of machine-executable object code generated by
a source language processor.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.

13
components/asio/README.md Normal file
View File

@ -0,0 +1,13 @@
# ASIO port
[![Component Registry](https://components.espressif.com/components/espressif/asio/badge.svg)](https://components.espressif.com/components/espressif/asio)
Asio is a cross-platform C++ library, see https://think-async.com/Asio/. It provides a consistent asynchronous model using a modern C++ approach.
## Examples
Get started with examples [examples](https://github.com/espressif/esp-protocols/tree/master/components/asio/examples)
## Documentation
* View the full [html documentation](https://docs.espressif.com/projects/esp-protocols/asio/docs/latest/index.html)

1
components/asio/asio Submodule

Submodule components/asio/asio added at 03ae834edb

View File

@ -0,0 +1,6 @@
# The following lines of boilerplate have to be in your project's CMakeLists
# in this exact order for cmake to work correctly
cmake_minimum_required(VERSION 3.16)
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
project(asio_chat)

View File

@ -0,0 +1,65 @@
| Supported Targets | ESP32 | ESP32-S2 | ESP32-S3 | ESP32-C3 |
| ----------------- | ----- | -------- | -------- | -------- |
# Asio chat client and server examples
(See the README.md file in the upper level 'examples' directory for more information about examples.)
The application aims to demonstrate a simple use of Asio library in different modes.
In project settings it could be configured to run either a Asio chat server, a Asio chat client, or both.
## How to use example
The example is configured by default as an Asio chat client.
Note that the example uses string representation of IP addresses and ports.
You can find the upstream asio chat implementation [here] https://github.com/chriskohlhoff/asio/tree/master/asio/src/examples/cpp11/chat
### Asio Client
In the client mode, the example connects to the configured address, sends the message, which was inserted as an input in the terminal, and receives a response.
### Asio Server
In the server mode, Asio chat server with a specified port number is created and being polled till a connection request from the client arrives.
Chat server echoes a message (received from any client) to all connected clients.
## Configure the project
```
idf.py menuconfig
```
Set following parameters under Example Configuration Options:
* Set `EXAMPLE_CHAT_SERVER` to use the example as an ASIO chat server
* Configure `EXAMPLE_CHAT_SERVER_BIND_PORT` to the port number.
* Set `EXAMPLE_CHAT_CLIENT` to use the example as an ASIO chat client
* Configure `EXAMPLE_CHAT_CLIENT_CONNECT_ADDRESS` to a string representation of the address to connect the client to.
* Configure `EXAMPLE_CHAT_CLIENT_CONNECT_PORT` to the port number.
* Configure Wi-Fi or Ethernet under "Example Connection Configuration" menu. See "Establishing Wi-Fi or Ethernet Connection" section in [examples/protocols/README.md](../../README.md) for more d etails.
## Running the example in server mode
- Configure the example according "Configure the project" section.
- Run `idf.py -p PORT flash monitor` to build and upload the example to your board and connect to it's serial terminal.
- Wait for the board to connect to WiFi or Ethernet (note the IP address).
- Connect to the server using multiple clients, for example using any option below.
- build and run asio chat client on your host machine
- run chat_client asio example on ESP platform
- since chat messages consists of ASCII size and message, it is possible to
netcat `nc IP PORT` and type for example ` 4ABC<CR>` to transmit 'ABC\n'
## Running the example in client mode
- Configure the example according "Configure the project" section.
- Start chat server either on host machine or as another ESP device running chat_server example.
- Run `idf.py -p PORT flash monitor` to build and upload the example to your board and connect to it's serial terminal.
- Wait for the board to connect to WiFi or Ethernet.
- Receive and send messages to/from other clients on stdin/stdout via serial terminal.
See the README.md file in the upper level 'examples' directory for more information about examples.

View File

@ -0,0 +1,2 @@
idf_component_register(SRCS "asio_chat.cpp"
INCLUDE_DIRS ".")

View File

@ -0,0 +1,39 @@
menu "Example Configuration"
config EXAMPLE_CHAT_SERVER
bool "Asio example chat server"
default n
help
This example will setup a chat server, binds it to the specified address
and starts listening.
if EXAMPLE_CHAT_SERVER
config EXAMPLE_CHAT_SERVER_BIND_PORT
string "Asio example server bind port"
default "3344"
help
Server listener's socket would be bound to this port.
endif
config EXAMPLE_CHAT_CLIENT
bool "Asio example chat client"
default y
help
This example will setup an asio chat client.
and sends the data.
if EXAMPLE_CHAT_CLIENT
config EXAMPLE_CHAT_CLIENT_CONNECT_ADDRESS
string "Client connection address"
default "192.168.0.1"
help
Client's socket would connect to this address/host.
config EXAMPLE_CHAT_CLIENT_CONNECT_PORT
string "Client connection port"
default "3344"
help
Client's connection port.
endif
endmenu

View File

@ -0,0 +1,120 @@
/* ASIO chat server client example
This example code is in the Public Domain (or CC0 licensed, at your option.)
Unless required by applicable law or agreed to in writing, this
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied.
*/
#include "protocol_examples_common.h"
#include "esp_log.h"
#include "esp_event.h"
#include "nvs_flash.h"
#include "server.hpp"
#include "client.hpp"
#include <thread>
#include <pthread.h>
using asio::ip::tcp;
static const char *TAG = "asio-chat";
// This variable is necessary for `python test` execution, it provides synchronisation between server/client(as server should be started before client)
std::mutex server_ready;
#ifdef CONFIG_EXAMPLE_CHAT_CLIENT
static void get_string(char *line, size_t size)
{
int count = 0;
while (count < size) {
int c = fgetc(stdin);
if (c == '\n') {
line[count] = '\0';
break;
} else if (c > 0 && c < 127) {
line[count] = c;
++count;
}
vTaskDelay(10 / portTICK_PERIOD_MS);
}
}
void start_client(void)
{
const std::string port(CONFIG_EXAMPLE_CHAT_CLIENT_CONNECT_PORT);
const std::string name(CONFIG_EXAMPLE_CHAT_CLIENT_CONNECT_ADDRESS);
asio::io_context io_context;
char line[128];
tcp::resolver resolver(io_context);
auto endpoints = resolver.resolve(name, port);
chat_client c(io_context, endpoints);
#ifdef CONFIG_EXAMPLE_CHAT_SERVER
std::lock_guard<std::mutex> guard(server_ready);
#endif
std::thread t([&io_context]() {
try {
io_context.run();
} catch (const std::exception &e) {
ESP_LOGE(TAG, "Exception occured during client thread execution %s", e.what());
} catch (...) {
ESP_LOGE(TAG, "Unknown exception");
}
});
do {
ESP_LOGI(TAG, "CLIENT: Waiting for input");
get_string(line, sizeof(line));
chat_message msg;
msg.body_length(std::strlen(line));
std::memcpy(msg.body(), line, msg.body_length());
msg.encode_header();
c.write(msg);
sleep(1);
} while (strcmp(line, "exit") != 0);
c.close();
t.join();
}
#endif // CONFIG_EXAMPLE_CHAT_CLIENT
extern "C" void app_main(void)
{
ESP_ERROR_CHECK(nvs_flash_init());
esp_netif_init();
ESP_ERROR_CHECK(esp_event_loop_create_default());
/* This helper function configures Wi-Fi or Ethernet, as selected in menuconfig.
* Read "Establishing Wi-Fi or Ethernet Connection" section in
* examples/protocols/README.md for more information about this function.
*/
ESP_ERROR_CHECK(example_connect());
try {
#ifdef CONFIG_EXAMPLE_CHAT_SERVER
asio::io_context io_context;
chat_server server(io_context, tcp::endpoint(tcp::v4(), std::atoi(CONFIG_EXAMPLE_CHAT_SERVER_BIND_PORT)));
std::thread t = std::thread([&io_context]() { // Chat server starting here
try {
io_context.run();
} catch (const std::exception &e) {
ESP_LOGE(TAG, "Exception occured during server thread execution %s", e.what());
} catch (...) {
ESP_LOGE(TAG, "Unknown exception");
}
});;
#endif
#ifdef CONFIG_EXAMPLE_CHAT_CLIENT
start_client();
#endif
#ifdef CONFIG_EXAMPLE_CHAT_SERVER
t.join();
#endif
} catch (const std::exception &e) {
ESP_LOGE(TAG, "Exception occured during run %s", e.what());
} catch (...) {
ESP_LOGE(TAG, "Unknown exception");
}
ESP_ERROR_CHECK(example_disconnect());
}

View File

@ -0,0 +1,90 @@
//
// chat_message.hpp
// ~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef CHAT_MESSAGE_HPP
#define CHAT_MESSAGE_HPP
#include <cstdio>
#include <cstdlib>
#include <cstring>
class chat_message {
public:
static constexpr std::size_t header_length = 4;
static constexpr std::size_t max_body_length = 512;
chat_message()
: body_length_(0)
{
}
const char *data() const
{
return data_;
}
char *data()
{
return data_;
}
std::size_t length() const
{
return header_length + body_length_;
}
const char *body() const
{
return data_ + header_length;
}
char *body()
{
return data_ + header_length;
}
std::size_t body_length() const
{
return body_length_;
}
void body_length(std::size_t new_length)
{
body_length_ = new_length;
if (body_length_ > max_body_length) {
body_length_ = max_body_length;
}
}
bool decode_header()
{
char header[header_length + 1] = "";
std::strncat(header, data_, header_length);
body_length_ = std::atoi(header);
if (body_length_ > max_body_length) {
body_length_ = 0;
return false;
}
return true;
}
void encode_header()
{
char header[header_length + 1] = "";
std::sprintf(header, "%4d", static_cast<int>(body_length_));
std::memcpy(data_, header, header_length);
}
private:
char data_[header_length + max_body_length];
std::size_t body_length_;
};
#endif // CHAT_MESSAGE_HPP

View File

@ -0,0 +1,110 @@
//
// client.hpp
// ~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef CHAT_CLIENT_HPP
#define CHAT_CLIENT_HPP
#include <deque>
#include "asio.hpp"
#include "chat_message.hpp"
typedef std::deque<chat_message> chat_message_queue;
class chat_client {
public:
chat_client(asio::io_context &io_context,
const asio::ip::tcp::resolver::results_type &endpoints)
: io_context_(io_context),
socket_(io_context)
{
do_connect(endpoints);
}
void write(const chat_message &msg)
{
asio::post(io_context_,
[this, msg]() {
bool write_in_progress = !write_msgs_.empty();
write_msgs_.push_back(msg);
if (!write_in_progress) {
do_write();
}
});
}
void close()
{
asio::post(io_context_, [this]() {
socket_.close();
});
}
private:
void do_connect(const asio::ip::tcp::resolver::results_type &endpoints)
{
asio::async_connect(socket_, endpoints,
[this](std::error_code ec, asio::ip::tcp::endpoint) {
if (!ec) {
do_read_header();
}
});
}
void do_read_header()
{
asio::async_read(socket_,
asio::buffer(read_msg_.data(), chat_message::header_length),
[this](std::error_code ec, std::size_t /*length*/) {
if (!ec && read_msg_.decode_header()) {
do_read_body();
} else {
socket_.close();
}
});
}
void do_read_body()
{
asio::async_read(socket_,
asio::buffer(read_msg_.body(), read_msg_.body_length()),
[this](std::error_code ec, std::size_t /*length*/) {
if (!ec) {
do_read_header();
} else {
socket_.close();
}
});
}
void do_write()
{
asio::async_write(socket_,
asio::buffer(write_msgs_.front().data(),
write_msgs_.front().length()),
[this](std::error_code ec, std::size_t /*length*/) {
if (!ec) {
write_msgs_.pop_front();
if (!write_msgs_.empty()) {
do_write();
}
} else {
socket_.close();
}
});
}
private:
asio::io_context &io_context_;
asio::ip::tcp::socket socket_;
chat_message read_msg_;
chat_message_queue write_msgs_;
};
#endif // CHAT_CLIENT_HPP

View File

@ -0,0 +1,8 @@
dependencies:
## Required IDF version
idf: ">=5.0"
espressif/asio:
version: "^1.14.1"
override_path: "../../../"
protocol_examples_common:
path: ${IDF_PATH}/examples/common_components/protocol_examples_common

View File

@ -0,0 +1,185 @@
//
// server.hpp
// ~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef CHAT_SERVER_HPP
#define CHAT_SERVER_HPP
#include <list>
#include <set>
#include <deque>
#include <utility>
#include "asio.hpp"
#include "chat_message.hpp"
//----------------------------------------------------------------------
typedef std::deque<chat_message> chat_message_queue;
extern std::mutex server_ready;
//----------------------------------------------------------------------
class chat_participant {
public:
virtual ~chat_participant() {}
virtual void deliver(const chat_message &msg) = 0;
};
typedef std::shared_ptr<chat_participant> chat_participant_ptr;
//----------------------------------------------------------------------
class chat_room {
public:
void join(chat_participant_ptr participant)
{
participants_.insert(participant);
for (auto msg : recent_msgs_) {
participant->deliver(msg);
}
}
void leave(chat_participant_ptr participant)
{
participants_.erase(participant);
}
void deliver(const chat_message &msg)
{
recent_msgs_.push_back(msg);
while (recent_msgs_.size() > max_recent_msgs) {
recent_msgs_.pop_front();
}
for (auto participant : participants_) {
participant->deliver(msg);
}
}
private:
std::set<chat_participant_ptr> participants_;
enum { max_recent_msgs = 100 };
chat_message_queue recent_msgs_;
};
//----------------------------------------------------------------------
class chat_session
: public chat_participant,
public std::enable_shared_from_this<chat_session> {
public:
chat_session(asio::ip::tcp::socket socket, chat_room &room)
: socket_(std::move(socket)),
room_(room)
{
}
void start()
{
room_.join(shared_from_this());
do_read_header();
}
void deliver(const chat_message &msg)
{
bool write_in_progress = !write_msgs_.empty();
write_msgs_.push_back(msg);
if (!write_in_progress) {
do_write();
}
}
private:
void do_read_header()
{
auto self(shared_from_this());
asio::async_read(socket_,
asio::buffer(read_msg_.data(), chat_message::header_length),
[this, self](std::error_code ec, std::size_t /*length*/) {
if (!ec && read_msg_.decode_header()) {
do_read_body();
} else {
room_.leave(shared_from_this());
}
});
}
void do_read_body()
{
auto self(shared_from_this());
asio::async_read(socket_,
asio::buffer(read_msg_.body(), read_msg_.body_length()),
[this, self](std::error_code ec, std::size_t /*length*/) {
if (!ec) {
ESP_LOGD("asio-chat", "%.*s", read_msg_.body_length(), read_msg_.body());
room_.deliver(read_msg_);
do_read_header();
} else {
room_.leave(shared_from_this());
}
});
}
void do_write()
{
auto self(shared_from_this());
asio::async_write(socket_,
asio::buffer(write_msgs_.front().data(),
write_msgs_.front().length()),
[this, self](std::error_code ec, std::size_t /*length*/) {
if (!ec) {
write_msgs_.pop_front();
if (!write_msgs_.empty()) {
do_write();
}
} else {
room_.leave(shared_from_this());
}
});
}
asio::ip::tcp::socket socket_;
chat_room &room_;
chat_message read_msg_;
chat_message_queue write_msgs_;
};
//----------------------------------------------------------------------
class chat_server {
public:
chat_server(asio::io_context &io_context,
const asio::ip::tcp::endpoint &endpoint)
: acceptor_(io_context, endpoint)
{
do_accept();
}
private:
void do_accept()
{
std::lock_guard<std::mutex> guard(server_ready);
acceptor_.async_accept(
[this](std::error_code ec, asio::ip::tcp::socket socket) {
if (!ec) {
std::make_shared<chat_session>(std::move(socket), room_)->start();
}
do_accept();
});
}
asio::ip::tcp::acceptor acceptor_;
chat_room room_;
};
#endif // CHAT_SERVER_HPP

View File

@ -0,0 +1,16 @@
# SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: Unlicense OR CC0-1.0
# -*- coding: utf-8 -*-
import re
def test_examples_asio_chat(dut):
msg = 'asio-chat: received hi'
# start the test and expect the client to receive back it's original data
dut.expect(re.compile(b'Waiting for input'), timeout=30)
dut.write(msg)
dut.write('exit')
msg = bytes(msg, encoding='utf8')
dut.expect(re.compile(msg), timeout=30)

View File

@ -0,0 +1,6 @@
CONFIG_EXAMPLE_CONNECT_WIFI=n
CONFIG_EXAMPLE_CONNECT_ETHERNET=n
CONFIG_EXAMPLE_CHAT_CLIENT=y
CONFIG_EXAMPLE_CHAT_SERVER=y
CONFIG_LOG_DEFAULT_LEVEL_DEBUG=y
CONFIG_EXAMPLE_CHAT_CLIENT_CONNECT_ADDRESS="localhost"

View File

@ -0,0 +1,8 @@
CONFIG_ESP_MAIN_TASK_STACK_SIZE=8192
CONFIG_COMPILER_CXX_EXCEPTIONS=y
#
# Partition Table
#
# Leave some room for larger apps without needing to reduce other features
CONFIG_PARTITION_TABLE_SINGLE_APP_LARGE=y

View File

@ -0,0 +1,6 @@
# The following lines of boilerplate have to be in your project's CMakeLists
# in this exact order for cmake to work correctly
cmake_minimum_required(VERSION 3.16)
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
project(async_http_request)

View File

@ -0,0 +1,54 @@
| Supported Targets | ESP32 |
| ----------------- | ----- |
# Async request using ASIO
(See the README.md file in the upper level 'examples' directory for more information about examples.)
The application aims to show how to compose async operations using ASIO to build network protocols and operations.
# Configure and Building example
This example doesn't require any configuration, just build it with
```
idf.py build
```
# Async operations composition and automatic lifetime control
On this example we compose the operation by starting the next step in the chain inside the completion handler of the
previous operation. Also we pass the `Connection` class itself as the parameter of its final handler to be owned by
the following operation. This is possible due to the control of lifetime by the usage of `std::shared_ptr`.
The control of lifetime of the class, done by `std::shared_ptr` usage, guarantee that the data will be available for
async operations until it's not needed any more. This makes necessary that all of the async operation class must start
its lifetime as a `std::shared_ptr` due to the usage of `std::enable_shared_from_this`.
```
User creates a shared_ptr──┐
of AddressResolution and │
ask for resolve. │
The handler for the ┌▼─────────────────────┐
complete operation is sent│ AddressResolution │ In the completion of resolve a connection is created.
└─────────────────┬────┘ AddressResolution is automaticly destroyed since it's
│ no longer needed
┌─▼────────────────────────────────────┐
│ Connection │
└──────┬───────────────────────────────┘
Http::Session is created once we have a Connection. │
Connection is passed to Http::Session that holds it │
avoiding it's destruction. │
┌─▼───────────────────────────────┐
│ Http::Session │
└────────┬────────────────────────┘
After the HTTP request is │
sent the completion handler │
is called. │
└────►Completion Handler()
```
The previous diagram shows the process and the life span of each of the tasks in this examples. At each stage the
object responsible for the last action inject itself to the completion handler of the next stage for reuse.

View File

@ -0,0 +1,2 @@
idf_component_register(SRCS "async_http_request.cpp"
INCLUDE_DIRS ".")

View File

@ -0,0 +1,369 @@
/*
* SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: CC0-1.0
*
* ASIO HTTP request example
*/
#include <string>
#include <array>
#include <asio.hpp>
#include <memory>
#include <system_error>
#include <utility>
#include "esp_log.h"
#include "nvs_flash.h"
#include "esp_event.h"
#include "protocol_examples_common.h"
constexpr auto TAG = "async_request";
using asio::ip::tcp;
namespace {
void esp_init()
{
ESP_ERROR_CHECK(nvs_flash_init());
ESP_ERROR_CHECK(esp_netif_init());
ESP_ERROR_CHECK(esp_event_loop_create_default());
esp_log_level_set("async_request", ESP_LOG_DEBUG);
/* This helper function configures Wi-Fi or Ethernet, as selected in menuconfig.
* Read "Establishing Wi-Fi or Ethernet Connection" section in
* examples/protocols/README.md for more information about this function.
*/
ESP_ERROR_CHECK(example_connect());
}
/**
* @brief Simple class to add the resolver to a chain of actions
*
*/
class AddressResolution : public std::enable_shared_from_this<AddressResolution> {
public:
explicit AddressResolution(asio::io_context &context) : ctx(context), resolver(ctx) {}
/**
* @brief Initiator function for the address resolution
*
* @tparam CompletionToken callable responsible to use the results.
*
* @param host Host address
* @param port Port for the target, must be number due to a limitation on lwip.
*/
template<class CompletionToken>
void resolve(const std::string &host, const std::string &port, CompletionToken &&completion_handler)
{
auto self(shared_from_this());
resolver.async_resolve(host, port, [self, completion_handler](const asio::error_code & error, tcp::resolver::results_type results) {
if (error) {
ESP_LOGE(TAG, "Failed to resolve: %s", error.message().c_str());
return;
}
completion_handler(self, results);
});
}
private:
asio::io_context &ctx;
tcp::resolver resolver;
};
/**
* @brief Connection class
*
* The lowest level dependency on our asynchronous task, Connection provide an interface to TCP sockets.
* A similar class could be provided for a TLS connection.
*
* @note: All read and write operations are written on an explicit strand, even though an implicit strand
* occurs in this example since we run the io context in a single task.
*
*/
class Connection : public std::enable_shared_from_this<Connection> {
public:
explicit Connection(asio::io_context &context) : ctx(context), strand(context), socket(ctx) {}
/**
* @brief Start the connection
*
* Async operation to start a connection. As the final act of the process the Connection class pass a
* std::shared_ptr of itself to the completion_handler.
* Since it uses std::shared_ptr as an automatic control of its lifetime this class must be created
* through a std::make_shared call.
*
* @tparam completion_handler A callable to act as the final handler for the process.
* @param host host address
* @param port port number - due to a limitation on lwip implementation this should be the number not the
* service name typically seen in ASIO examples.
*
* @note The class could be modified to store the completion handler, as a member variable, instead of
* pass it along asynchronous calls to allow the process to run again completely.
*
*/
template<class CompletionToken>
void start(tcp::resolver::results_type results, CompletionToken &&completion_handler)
{
connect(results, completion_handler);
}
/**
* @brief Start an async write on the socket
*
* @tparam data
* @tparam completion_handler A callable to act as the final handler for the process.
*
*/
template<class DataType, class CompletionToken>
void write_async(const DataType &data, CompletionToken &&completion_handler)
{
asio::async_write(socket, data, asio::bind_executor(strand, completion_handler));
}
/**
* @brief Start an async read on the socket
*
* @tparam data
* @tparam completion_handler A callable to act as the final handler for the process.
*
*/
template<class DataBuffer, class CompletionToken>
void read_async(DataBuffer &&in_data, CompletionToken &&completion_handler)
{
asio::async_read(socket, in_data, asio::bind_executor(strand, completion_handler));
}
private:
template<class CompletionToken>
void connect(tcp::resolver::results_type results, CompletionToken &&completion_handler)
{
auto self(shared_from_this());
asio::async_connect(socket, results, [self, completion_handler](const asio::error_code & error, [[maybe_unused]] const tcp::endpoint & endpoint) {
if (error) {
ESP_LOGE(TAG, "Failed to connect: %s", error.message().c_str());
return;
}
completion_handler(self);
});
}
asio::io_context &ctx;
asio::io_context::strand strand;
tcp::socket socket;
};
} // namespace
namespace Http {
enum class Method { GET };
/**
* @brief Simple HTTP request class
*
* The user needs to write the request information direct to header and body fields.
*
* Only GET verb is provided.
*
*/
class Request {
public:
Request(Method method, std::string host, std::string port, const std::string &target) : host_data(std::move(host)), port_data(std::move(port))
{
header_data.append("GET ");
header_data.append(target);
header_data.append(" HTTP/1.1");
header_data.append("\r\n");
header_data.append("Host: ");
header_data.append(host_data);
header_data.append("\r\n");
header_data.append("\r\n");
};
void set_header_field(std::string const &field)
{
header_data.append(field);
}
void append_to_body(std::string const &data)
{
body_data.append(data);
};
const std::string &host() const
{
return host_data;
}
const std::string &service_port() const
{
return port_data;
}
const std::string &header() const
{
return header_data;
}
const std::string &body() const
{
return body_data;
}
private:
std::string host_data;
std::string port_data;
std::string header_data;
std::string body_data;
};
/**
* @brief Simple HTTP response class
*
* The response is built from received data and only parsed to split header and body.
*
* A copy of the received data is kept.
*
*/
struct Response {
/**
* @brief Construct a response from a contiguous buffer.
*
* Simple http parsing.
*
*/
template<class DataIt>
explicit Response(DataIt data, size_t size)
{
raw_response = std::string(data, size);
auto header_last = raw_response.find("\r\n\r\n");
if (header_last != std::string::npos) {
header = raw_response.substr(0, header_last);
}
body = raw_response.substr(header_last + 3);
}
/**
* @brief Print response content.
*/
void print()
{
ESP_LOGI(TAG, "Header :\n %s", header.c_str());
ESP_LOGI(TAG, "Body : \n %s", body.c_str());
}
std::string raw_response;
std::string header;
std::string body;
};
/** @brief HTTP Session
*
* Session class to handle HTTP protocol implementation.
*
*/
class Session : public std::enable_shared_from_this<Session> {
public:
explicit Session(std::shared_ptr<Connection> connection_in) : connection(std::move(connection_in))
{
}
template<class CompletionToken>
void send_request(const Request &request, CompletionToken &&completion_handler)
{
auto self = shared_from_this();
send_data = { asio::buffer(request.header()), asio::buffer(request.body()) };
connection->write_async(send_data, [self, &completion_handler](std::error_code error, std::size_t bytes_transfered) {
if (error) {
ESP_LOGE(TAG, "Request write error: %s", error.message().c_str());
return;
}
ESP_LOGD(TAG, "Bytes Transfered: %d", bytes_transfered);
self->get_response(completion_handler);
});
}
private:
template<class CompletionToken>
void get_response(CompletionToken &&completion_handler)
{
auto self = shared_from_this();
connection->read_async(asio::buffer(receive_buffer), [self, &completion_handler](std::error_code error, std::size_t bytes_received) {
if (error and error.value() != asio::error::eof) {
return;
}
ESP_LOGD(TAG, "Bytes Received: %d", bytes_received);
if (bytes_received == 0) {
return;
}
Response response(std::begin(self->receive_buffer), bytes_received);
completion_handler(self, response);
});
}
/*
* For this example we assumed 2048 to be enough for the receive_buffer
*/
std::array<char, 2048> receive_buffer;
/*
* The hardcoded 2 below is related to the type we receive the data to send. We gather the parts from Request, header
* and body, to send avoiding the copy.
*/
std::array<asio::const_buffer, 2> send_data;
std::shared_ptr<Connection> connection;
};
/** @brief Execute a fully async HTTP request
*
* @tparam completion_handler
* @param ctx io context
* @param request
*
* @note : We build this function as a simpler interface to compose the operations of connecting to
* the address and running the HTTP session. The Http::Session class is injected to the completion handler
* for further use.
*/
template<class CompletionToken>
void request_async(asio::io_context &context, const Request &request, CompletionToken &&completion_handler)
{
/*
* The first step is to resolve the address we want to connect to.
* The AddressResolution itself is injected to the completion handler.
*
* This shared_ptr is destroyed by the end of the scope. Pay attention that this is a non blocking function
* the lifetime of the object is extended by the resolve call
*/
std::make_shared<AddressResolution>(context)->resolve(request.host(), request.service_port(),
[&context, &request, completion_handler](std::shared_ptr<AddressResolution> resolver, tcp::resolver::results_type results) {
/* After resolution we create a Connection.
* The completion handler gets a shared_ptr<Connection> to receive the connection, once the
* connection process is complete.
*/
std::make_shared<Connection>(context)->start(results,
[&request, completion_handler](std::shared_ptr<Connection> connection) {
// Now we create a HTTP::Session and inject the necessary connection.
std::make_shared<Session>(connection)->send_request(request, completion_handler);
});
});
}
}// namespace Http
extern "C" void app_main(void)
{
// Basic initialization of ESP system
esp_init();
asio::io_context io_context;
Http::Request request(Http::Method::GET, "www.httpbin.org", "80", "/get");
Http::request_async(io_context, request, [](std::shared_ptr<Http::Session> session, Http::Response response) {
/*
* We only print the response here but could reuse session for other requests.
*/
response.print();
});
// io_context.run will block until all the tasks on the context are done.
io_context.run();
ESP_LOGI(TAG, "Context run done");
ESP_ERROR_CHECK(example_disconnect());
}

View File

@ -0,0 +1,8 @@
dependencies:
## Required IDF version
idf: ">=5.0"
espressif/asio:
version: "^1.14.1"
override_path: "../../../"
protocol_examples_common:
path: ${IDF_PATH}/examples/common_components/protocol_examples_common

View File

@ -0,0 +1,8 @@
CONFIG_ESP_MAIN_TASK_STACK_SIZE=8192
CONFIG_COMPILER_CXX_EXCEPTIONS=y
#
# Partition Table
#
# Leave some room for larger apps without needing to reduce other features
CONFIG_PARTITION_TABLE_SINGLE_APP_LARGE=y

View File

@ -0,0 +1,6 @@
# The following lines of boilerplate have to be in your project's CMakeLists
# in this exact order for cmake to work correctly
cmake_minimum_required(VERSION 3.16)
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
project(asio_sock4)

View File

@ -0,0 +1,72 @@
| Supported Targets | ESP32 | ESP32-S2 |
| ----------------- | ----- | ----- |
# Async request using ASIO
(See the README.md file in the upper level 'examples' directory for more information about examples.)
The application aims to show how to connect to a Socks4 proxy using async operations with ASIO. The SOCKS protocol is
briefly described by the diagram below.
┌──────┐ ┌─────┐ ┌──────┐
│Client│ │Proxy│ │Target│
└──┬───┘ └──┬──┘ └──┬───┘
│ │ │
│ ╔═╧══════════════╗ │
══════════════════════╪════════════════════════╣ Initialization ╠═══╪════════════════════════════════════════════
│ ╚═╤══════════════╝ │
│ │ │
╔══════════════════╗│ │ │
║We establish a ░║│ Socket Connection │ │
║TCP connection ║│ <─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ > │
║and get a socket ║│ │ │
╚══════════════════╝│ │ │
│ │ │
│ ╔═╧══════════════╗ │
══════════════════════╪════════════════════════╣ Socks Protocol ╠═══╪════════════════════════════════════════════
│ ╚═╤══════════════╝ │
│ │ │
│ Client Connection Request│ │
│ ─────────────────────────> │
│ │ │
│ │ │
│ ╔════════════╪═══════╤══════════╪════════════════════════════════╗
│ ║ TARGET CONNECTION │ │ ║
│ ╟────────────────────┘ │ ╔═══════════════════╗ ║
│ ║ │ Socket Connection│ ║Proxy establishes ░║ ║
│ ║ │ <─ ─ ─ ─ ─ ─ ─ ─ > ║ TCPconnection ║ ║
│ ║ │ │ ║ with target host ║ ║
│ ╚════════════╪══════════════════╪══╚═══════════════════╝═════════╝
│ │ │
│ Response packet │ │
<───────────────────────── │
│ │ │
│ │ │
│ │ ╔═══════╗ │
══════════════════════╪══════════════════════════╪══╣ Usage ╠═══════╪════════════════════════════════════════════
│ │ ╚═══════╝ │
│ │ │
╔═════════════════╗│ │ │
║Client uses the ░║│ │ │
║ socket opened ║│ │ │
║ with proxy ║│ <─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─>
║to communicate ║│ │ │
║ ║│ │ │
╚═════════════════╝┴───┐ ┌──┴──┐ ┌──┴───┐
│Client│ │Proxy│ │Target│
└──────┘ └─────┘ └──────┘
# Configure and Building example
This example requires the proxy address to be configured. You can do this using the menuconfig option.
Proxy address and port must be configured in order for this example to work.
If using Linux ssh can be used as a proxy for testing.
```
ssh -N -v -D 0.0.0.0:1080 localhost
```
# Async operations composition and automatic lifetime control
For documentation about the structure of this example look into [async\_request README](../async_request/README.md).

View File

@ -0,0 +1,2 @@
idf_component_register(SRCS "socks4.cpp"
INCLUDE_DIRS ".")

View File

@ -0,0 +1,16 @@
menu "Example Configuration"
config EXAMPLE_PROXY_ADDRESS
string "Proxy address"
default "myproxy"
help
Address of the proxy to be used.
config EXAMPLE_PROXY_SERVICE
string "Proxy Service Type"
default "myport"
help
Service type. Due to a limitation of lwip, must
be the port number e.g. "1080".
endmenu

View File

@ -0,0 +1,8 @@
dependencies:
## Required IDF version
idf: ">=5.0"
espressif/asio:
version: "^1.14.1"
override_path: "../../../"
protocol_examples_common:
path: ${IDF_PATH}/examples/common_components/protocol_examples_common

View File

@ -0,0 +1,393 @@
/*
* SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: CC0-1.0
*
*
* ASIO Socks4 example
*/
#include <string>
#include <array>
#include <asio.hpp>
#include <memory>
#include <system_error>
#include <utility>
#include "esp_log.h"
#include "socks4.hpp"
#include "nvs_flash.h"
#include "esp_event.h"
#include "protocol_examples_common.h"
constexpr auto TAG = "asio_socks4";
using asio::ip::tcp;
namespace {
void esp_init()
{
ESP_ERROR_CHECK(nvs_flash_init());
ESP_ERROR_CHECK(esp_netif_init());
ESP_ERROR_CHECK(esp_event_loop_create_default());
esp_log_level_set("async_request", ESP_LOG_DEBUG);
/* This helper function configures Wi-Fi or Ethernet, as selected in menuconfig.
* Read "Establishing Wi-Fi or Ethernet Connection" section in
* examples/protocols/README.md for more information about this function.
*/
ESP_ERROR_CHECK(example_connect());
}
/**
* @brief Simple class to add the resolver to a chain of actions
*
*/
class AddressResolution : public std::enable_shared_from_this<AddressResolution> {
public:
explicit AddressResolution(asio::io_context &context) : ctx(context), resolver(ctx) {}
/**
* @brief Initiator function for the address resolution
*
* @tparam CompletionToken callable responsible to use the results.
*
* @param host Host address
* @param port Port for the target, must be number due to a limitation on lwip.
*/
template<class CompletionToken>
void resolve(const std::string &host, const std::string &port, CompletionToken &&completion_handler)
{
auto self(shared_from_this());
resolver.async_resolve(host, port, [self, completion_handler](const asio::error_code & error, tcp::resolver::results_type results) {
if (error) {
ESP_LOGE(TAG, "Failed to resolve: %s", error.message().c_str());
return;
}
completion_handler(self, results);
});
}
private:
asio::io_context &ctx;
tcp::resolver resolver;
};
/**
* @brief Connection class
*
* The lowest level dependency on our asynchronous task, Connection provide an interface to TCP sockets.
* A similar class could be provided for a TLS connection.
*
* @note: All read and write operations are written on an explicit strand, even though an implicit strand
* occurs in this example since we run the io context in a single task.
*
*/
class Connection : public std::enable_shared_from_this<Connection> {
public:
explicit Connection(asio::io_context &context) : ctx(context), strand(context), socket(ctx) {}
/**
* @brief Start the connection
*
* Async operation to start a connection. As the final act of the process the Connection class pass a
* std::shared_ptr of itself to the completion_handler.
* Since it uses std::shared_ptr as an automatic control of its lifetime this class must be created
* through a std::make_shared call.
*
* @tparam completion_handler A callable to act as the final handler for the process.
* @param host host address
* @param port port number - due to a limitation on lwip implementation this should be the number not the
* service name typically seen in ASIO examples.
*
* @note The class could be modified to store the completion handler, as a member variable, instead of
* pass it along asynchronous calls to allow the process to run again completely.
*
*/
template<class CompletionToken>
void start(tcp::resolver::results_type results, CompletionToken &&completion_handler)
{
connect(results, completion_handler);
}
/**
* @brief Start an async write on the socket
*
* @tparam data
* @tparam completion_handler A callable to act as the final handler for the process.
*
*/
template<class DataType, class CompletionToken>
void write_async(const DataType &data, CompletionToken &&completion_handler)
{
asio::async_write(socket, data, asio::bind_executor(strand, completion_handler));
}
/**
* @brief Start an async read on the socket
*
* @tparam data
* @tparam completion_handler A callable to act as the final handler for the process.
*
*/
template<class DataBuffer, class CompletionToken>
void read_async(DataBuffer &&in_data, CompletionToken &&completion_handler)
{
asio::async_read(socket, in_data, asio::bind_executor(strand, completion_handler));
}
private:
template<class CompletionToken>
void connect(tcp::resolver::results_type results, CompletionToken &&completion_handler)
{
auto self(shared_from_this());
asio::async_connect(socket, results, [self, completion_handler](const asio::error_code & error, [[maybe_unused]] const tcp::endpoint & endpoint) {
if (error) {
ESP_LOGE(TAG, "Failed to connect: %s", error.message().c_str());
return;
}
completion_handler(self);
});
}
asio::io_context &ctx;
asio::io_context::strand strand;
tcp::socket socket;
};
}
namespace Socks {
struct ConnectionData {
ConnectionData(socks4::request::command_type cmd, const asio::ip::tcp::endpoint &endpoint,
const std::string &user_id) : request(cmd, endpoint, user_id) {};
socks4::request request;
socks4::reply reply;
};
template<class CompletionToken>
void async_connect(asio::io_context &context, std::string proxy, std::string proxy_port, std::string host, std::string port, CompletionToken &&completion_handler)
{
/*
* The first step is to resolve the address of the proxy we want to connect to.
* The AddressResolution itself is injected to the completion handler.
*/
// Resolve proxy
std::make_shared<AddressResolution>(context)->resolve(proxy, proxy_port,
[&context, host, port, completion_handler](std::shared_ptr<AddressResolution> resolver, tcp::resolver::results_type proxy_resolution) {
// We also need to resolve the target host address
resolver->resolve(host, port, [&context, proxy_resolution, completion_handler](std::shared_ptr<AddressResolution> resolver, tcp::resolver::results_type host_resolution) {
// Make connection with the proxy
ESP_LOGI(TAG, "Startig Proxy Connection");
std::make_shared<Connection>(context)->start(proxy_resolution,
[resolver, host_resolution, completion_handler](std::shared_ptr<Connection> connection) {
auto connect_data = std::make_shared<ConnectionData>(socks4::request::connect, *host_resolution, "");
ESP_LOGI(TAG, "Sending Request to proxy for host connection.");
connection->write_async(connect_data->request.buffers(), [connection, connect_data, completion_handler](std::error_code error, std::size_t bytes_received) {
if (error) {
ESP_LOGE(TAG, "Proxy request write error: %s", error.message().c_str());
return;
}
connection->read_async(connect_data->reply.buffers(), [connection, connect_data, completion_handler](std::error_code error, std::size_t bytes_received) {
if (error) {
ESP_LOGE(TAG, "Proxy response read error: %s", error.message().c_str());
return;
}
if (!connect_data->reply.success()) {
ESP_LOGE(TAG, "Proxy error: %#x", connect_data->reply.status());
}
completion_handler(connection);
});
});
});
});
});
}
} // namespace Socks
namespace Http {
enum class Method { GET };
/**
* @brief Simple HTTP request class
*
* The user needs to write the request information direct to header and body fields.
*
* Only GET verb is provided.
*
*/
class Request {
public:
Request(Method method, std::string host, std::string port, const std::string &target) : host_data(std::move(host)), port_data(std::move(port))
{
header_data.append("GET ");
header_data.append(target);
header_data.append(" HTTP/1.1");
header_data.append("\r\n");
header_data.append("Host: ");
header_data.append(host_data);
header_data.append("\r\n");
header_data.append("\r\n");
};
void set_header_field(std::string const &field)
{
header_data.append(field);
}
void append_to_body(std::string const &data)
{
body_data.append(data);
};
const std::string &host() const
{
return host_data;
}
const std::string &service_port() const
{
return port_data;
}
const std::string &header() const
{
return header_data;
}
const std::string &body() const
{
return body_data;
}
private:
std::string host_data;
std::string port_data;
std::string header_data;
std::string body_data;
};
/**
* @brief Simple HTTP response class
*
* The response is built from received data and only parsed to split header and body.
*
* A copy of the received data is kept.
*
*/
struct Response {
/**
* @brief Construct a response from a contiguous buffer.
*
* Simple http parsing.
*
*/
template<class DataIt>
explicit Response(DataIt data, size_t size)
{
raw_response = std::string(data, size);
auto header_last = raw_response.find("\r\n\r\n");
if (header_last != std::string::npos) {
header = raw_response.substr(0, header_last);
}
body = raw_response.substr(header_last + 3);
}
/**
* @brief Print response content.
*/
void print()
{
ESP_LOGI(TAG, "Header :\n %s", header.c_str());
ESP_LOGI(TAG, "Body : \n %s", body.c_str());
}
std::string raw_response;
std::string header;
std::string body;
};
/** @brief HTTP Session
*
* Session class to handle HTTP protocol implementation.
*
*/
class Session : public std::enable_shared_from_this<Session> {
public:
explicit Session(std::shared_ptr<Connection> connection_in) : connection(std::move(connection_in))
{
}
template<class CompletionToken>
void send_request(const Request &request, CompletionToken &&completion_handler)
{
auto self = shared_from_this();
send_data = { asio::buffer(request.header()), asio::buffer(request.body()) };
connection->write_async(send_data, [self, &completion_handler](std::error_code error, std::size_t bytes_transfered) {
if (error) {
ESP_LOGE(TAG, "Request write error: %s", error.message().c_str());
return;
}
ESP_LOGD(TAG, "Bytes Transfered: %d", bytes_transfered);
self->get_response(completion_handler);
});
}
private:
template<class CompletionToken>
void get_response(CompletionToken &&completion_handler)
{
auto self = shared_from_this();
connection->read_async(asio::buffer(receive_buffer), [self, &completion_handler](std::error_code error, std::size_t bytes_received) {
if (error and error.value() != asio::error::eof) {
return;
}
ESP_LOGD(TAG, "Bytes Received: %d", bytes_received);
if (bytes_received == 0) {
return;
}
Response response(std::begin(self->receive_buffer), bytes_received);
completion_handler(self, response);
});
}
/*
* For this example we assumed 2048 to be enough for the receive_buffer
*/
std::array<char, 2048> receive_buffer;
/*
* The hardcoded 2 below is related to the type we receive the data to send. We gather the parts from Request, header
* and body, to send avoiding the copy.
*/
std::array<asio::const_buffer, 2> send_data;
std::shared_ptr<Connection> connection;
};
}// namespace Http
extern "C" void app_main(void)
{
// Basic initialization of ESP system
esp_init();
asio::io_context io_context;
Http::Request request(Http::Method::GET, "www.httpbin.org", "80", "/get");
Socks::async_connect(io_context, CONFIG_EXAMPLE_PROXY_ADDRESS, CONFIG_EXAMPLE_PROXY_SERVICE, request.host(), request.service_port(),
[&request](std::shared_ptr<Connection> connection) {
// Now we create a HTTP::Session and inject the necessary connection.
std::make_shared<Http::Session>(connection)->send_request(request, [](std::shared_ptr<Http::Session> session, Http::Response response) {
response.print();
});
});
// io_context.run will block until all the tasks on the context are done.
io_context.run();
ESP_LOGI(TAG, "Context run done");
ESP_ERROR_CHECK(example_disconnect());
}

View File

@ -0,0 +1,136 @@
//
// socks4.hpp
// ~~~~~~~~~~
//
// Copyright (c) 2003-2019 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef SOCKS4_HPP
#define SOCKS4_HPP
#include <array>
#include <string>
#include <asio/buffer.hpp>
#include <asio/ip/tcp.hpp>
namespace socks4 {
const unsigned char version = 0x04;
class request {
public:
enum command_type {
connect = 0x01,
bind = 0x02
};
request(command_type cmd, const asio::ip::tcp::endpoint &endpoint,
const std::string &user_id)
: version_(version),
command_(cmd),
user_id_(user_id),
null_byte_(0)
{
// Only IPv4 is supported by the SOCKS 4 protocol.
if (endpoint.protocol() != asio::ip::tcp::v4()) {
throw asio::system_error(
asio::error::address_family_not_supported);
}
// Convert port number to network byte order.
unsigned short port = endpoint.port();
port_high_byte_ = (port >> 8) & 0xff;
port_low_byte_ = port & 0xff;
// Save IP address in network byte order.
address_ = endpoint.address().to_v4().to_bytes();
}
std::array<asio::const_buffer, 7> buffers() const
{
return {
{
asio::buffer(&version_, 1),
asio::buffer(&command_, 1),
asio::buffer(&port_high_byte_, 1),
asio::buffer(&port_low_byte_, 1),
asio::buffer(address_),
asio::buffer(user_id_),
asio::buffer(&null_byte_, 1)
}
};
}
private:
unsigned char version_;
unsigned char command_;
unsigned char port_high_byte_;
unsigned char port_low_byte_;
asio::ip::address_v4::bytes_type address_;
std::string user_id_;
unsigned char null_byte_;
};
class reply {
public:
enum status_type {
request_granted = 0x5a,
request_failed = 0x5b,
request_failed_no_identd = 0x5c,
request_failed_bad_user_id = 0x5d
};
reply()
: null_byte_(0),
status_()
{
}
std::array<asio::mutable_buffer, 5> buffers()
{
return {
{
asio::buffer(&null_byte_, 1),
asio::buffer(&status_, 1),
asio::buffer(&port_high_byte_, 1),
asio::buffer(&port_low_byte_, 1),
asio::buffer(address_)
}
};
}
bool success() const
{
return null_byte_ == 0 && status_ == request_granted;
}
unsigned char status() const
{
return status_;
}
asio::ip::tcp::endpoint endpoint() const
{
unsigned short port = port_high_byte_;
port = (port << 8) & 0xff00;
port = port | port_low_byte_;
asio::ip::address_v4 address(address_);
return asio::ip::tcp::endpoint(address, port);
}
private:
unsigned char null_byte_;
unsigned char status_;
unsigned char port_high_byte_;
unsigned char port_low_byte_;
asio::ip::address_v4::bytes_type address_;
};
} // namespace socks4
#endif // SOCKS4_HPP

Some files were not shown because too many files have changed in this diff Show More