1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
RIOT/examples
bors[bot] a28f4383da
Merge #19024
19024: pkg/paho-mqtt: add support for DNS r=aabadie a=benpicco

<!--
The RIOT community cares a lot about code quality.
Therefore, before describing what your contribution is about, we would like
you to make sure that your modifications are compliant with the RIOT
coding conventions, see https://github.com/RIOT-OS/RIOT/blob/master/CODING_CONVENTIONS.md.
-->

### Contribution description

This is pretty straightforward, we only need to hook up `dns_query()`.

Since paho supports both IPv4 and IPv6 we use `AF_UNSPEC` in the query.
This can however give us a A record if we only have IPv6 enabled, so translate the request based on what IP address module is enabled in `dns_query()`.
### Testing procedure

connecting by name works

```
> con test.mosquitto.org 1883
mqtt_example: Connecting to MQTT Broker from test.mosquitto.org 1883
mqtt_example: Trying to connect to test.mosquitto.org , port: 1883
user: clientId: password:
mqtt_example: Connection successfully
```

connecting by IP still works

```
> con 2001:41d0:1:925e::1 1883
mqtt_example: Connecting to MQTT Broker from 2001:41d0:1:925e::1 1883
mqtt_example: Trying to connect to 2001:41d0:1:925e::1 , port: 1883
user: clientId: password:
mqtt_example: Connection successfully
```

<!--
Details steps to test your contribution:
- which test/example to compile for which board and is there a 'test' command
- how to know that it was not working/available in master
- the expected success test output
-->


### Issues/PRs references

<!--
Examples: Fixes #1234. See also #5678. Depends on PR #9876.

Please use keywords (e.g., fixes, resolve) with the links to the issues you
resolved, this way they will be automatically closed when your pull request
is merged. See https://help.github.com/articles/closing-issues-using-keywords/.
-->


Co-authored-by: Benjamin Valentin <benjamin.valentin@bht-berlin.de>
2022-12-08 15:38:32 +00:00
..
arduino_hello-world example/arduino_hello-wold: add building BOARD default 2022-02-28 22:00:21 +01:00
asymcute_mqttsn examples,tests: replace deprecated module names by new names 2022-09-16 13:15:46 +02:00
benchmark_udp examples,tests: replace deprecated module names by new names 2022-09-16 13:15:46 +02:00
bindist examples/bindist: cleanup and fix formatting in README 2019-01-22 07:37:36 +01:00
blinky examples/blinky: use coreclk() instead of CLOCK_CORECLOCK 2021-12-15 13:14:19 +01:00
ccn-lite-relay examples,tests: replace deprecated module names by new names 2022-09-16 13:15:46 +02:00
cord_ep gnrc_netreg: Use locks around netreg 2022-10-14 03:35:15 +02:00
cord_epsim nanocoap: make coap_request_ctx_t members internal 2022-07-17 14:32:16 +02:00
cord_lc examples,tests: replace deprecated module names by new names 2022-09-16 13:15:46 +02:00
default examples,tests: replace deprecated module names by new names 2022-09-16 13:15:46 +02:00
dtls-echo tests: update Makefile.ci for blxxxpill-128kib with CDC ACM 2022-10-15 23:33:41 +02:00
dtls-sock examples,tests: replace deprecated module names by new names 2022-09-16 13:15:46 +02:00
dtls-wolfssl examples,tests: replace deprecated module names by new names 2022-09-16 13:15:46 +02:00
emcute_mqttsn examples: Remove macOS references in README 2022-11-05 11:54:51 +00:00
filesystem examples,tests: replace deprecated module names by new names 2022-09-16 13:15:46 +02:00
gcoap examples/gcoap: replace _parse_endpoint by sock_udp_name2ep 2022-11-14 17:14:10 +01:00
gcoap_block_server examples,tests: replace deprecated module names by new names 2022-09-16 13:15:46 +02:00
gcoap_dtls examples/gcoap_dtls: add IPv4 support 2022-10-18 10:59:45 +02:00
gcoap_fileserver examples,tests: replace deprecated module names by new names 2022-09-16 13:15:46 +02:00
gnrc_border_router Merge pull request #18836 from benpicco/gnrc_border_router-native 2022-12-07 22:34:01 +01:00
gnrc_lorawan gnrc/lorawan: add support for GNRC LoRaWAN 1.1 2022-09-29 11:25:56 +02:00
gnrc_minimal examples/gnrc_minimal: use netifs_print_ipv6() 2022-06-06 20:46:48 +02:00
gnrc_networking examples/gnrc_networking: adopt Makefile.ci for new RAM size 2022-10-27 17:28:02 +02:00
gnrc_networking_mac examples,tests: replace deprecated module names by new names 2022-09-16 13:15:46 +02:00
gnrc_networking_subnets examples,tests: replace deprecated module names by new names 2022-09-16 13:15:46 +02:00
hello-world examples: adapt DEVELHELP switch 2017-11-28 19:25:10 +01:00
ipc_pingpong examples: skip nucleo-l011k4 where it doesn't fit 2020-10-15 18:52:51 +02:00
javascript examples/javascript: add Kconfig configuration 2022-04-27 11:08:27 +02:00
lorawan gnrc/lorawan: uncrustify files 2022-09-29 11:26:04 +02:00
lua_basic examples: tests: lua: add Kconfig configuration 2022-04-27 11:12:27 +02:00
lua_REPL examples: tests: lua: add Kconfig configuration 2022-04-27 11:12:27 +02:00
micropython tests: update Makefile.ci for blxxxpill-128kib with CDC ACM 2022-10-15 23:33:41 +02:00
nanocoap_server examples: check return value of coap_build_reply() 2022-11-04 20:00:51 +01:00
ndn-ping examples,tests: replace deprecated module names by new names 2022-09-16 13:15:46 +02:00
nimble_gatt pkg/nimble/autoadv: add support for ext_adv 2022-04-27 08:22:58 +02:00
nimble_heart_rate_sensor pkg/nimble/autoadv: add support for ext_adv 2022-04-27 08:22:58 +02:00
nimble_scanner sys/shell_commands: convert to SHELL_COMMAND() 2022-06-07 09:25:04 +02:00
openthread examples/openthread: adapt to update in package support 2021-11-22 15:22:27 +01:00
paho-mqtt examples/paho-mqtt: remove superflous space 2022-12-07 22:32:19 +01:00
posix_select boards/stm32g031-disco,examples,tests: Added STM32G031-DISCO board 2021-10-13 12:14:45 -04:00
posix_sockets examples,tests: replace deprecated module names by new names 2022-09-16 13:15:46 +02:00
riot_and_cpp treewide: Remove excessive newlines 2021-08-13 19:50:38 +02:00
rust-gcoap rust: Run all examples on stable 2022-11-24 11:07:45 +01:00
rust-hello-world rust: Run all examples on stable 2022-11-24 11:07:45 +01:00
saul examples,tests: replace deprecated module names by new names 2022-09-16 13:15:46 +02:00
senml_saul sys/senml: add SenML modules 2022-02-11 12:38:21 +01:00
skald_eddystone examples/skald_eddystone: explicitly config itvl 2022-05-24 13:02:10 +02:00
skald_ibeacon examples/skald_ibeacon: explicitly configure itvl 2022-05-24 13:02:10 +02:00
sniffer examples/sniffer: fix deprecated shell_commands 2022-10-17 15:46:23 -04:00
spectrum-scanner examples/spectrum-scanner: Fix building on PIC32 and RISC-V 2022-09-20 13:46:07 +02:00
suit_update examples/suit: blacklist blxxxpill boards due to insufficient memory 2022-11-30 19:28:14 +01:00
telnet_server examples/telnet_server: add stm32f7508-dk to BOARD_INSUFFICIENT_MEMORY 2022-10-10 14:06:23 +02:00
thread_duel examples/thread-duel: improve duelling threads example 2021-12-08 13:13:48 +01:00
timer_periodic_wakeup examples/timer_periodic_wakeup: switch to ztimer 2022-12-01 18:37:01 +01:00
twr_aloha boards/xg23-pk6068a: initial commit 2022-10-26 11:27:22 +02:00
usbus_minimal examples/usbus_minimal/Makefile: remove unneeded SHOULD_RUN_KCONFIG 2020-11-04 09:35:35 +01:00
wakaama tests: update Makefile.ci for blxxxpill-128kib with CDC ACM 2022-10-15 23:33:41 +02:00
wasm examples/wasm/wasm_sample: fix linking with new wasm-ld 2022-11-09 20:12:32 +01:00
.gitignore examples,tests: ignore core dumps via .gitignore 2022-08-31 15:05:14 +02:00