1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

net/emcute : Move 'EMCUTE_DEFAULT_PORT' to 'CONFIG_'

tests/emcute : Change the macro for default port
r/MQTTSN_DEFAULT_PORT/CONFIG_EMCUTE_DEFAULT_PORT

examples/emcute : Update UDP port definition
r/MQTTSN_DEFAULT_PORT/CONFIG_EMCUTE_DEFAULT_PORT
This commit is contained in:
Akshai M 2020-10-18 17:24:37 +05:30 committed by Akshai M
parent 348a8cb45a
commit fb465db26f
3 changed files with 6 additions and 7 deletions

View File

@ -31,7 +31,6 @@
#ifndef EMCUTE_ID
#define EMCUTE_ID ("gertrud")
#endif
#define EMCUTE_PORT (1883U)
#define EMCUTE_PRIO (THREAD_PRIORITY_MAIN - 1)
#define NUMOFSUBS (16U)
@ -46,7 +45,7 @@ static char topics[NUMOFSUBS][TOPIC_MAXLEN];
static void *emcute_thread(void *arg)
{
(void)arg;
emcute_run(EMCUTE_PORT, EMCUTE_ID);
emcute_run(CONFIG_EMCUTE_DEFAULT_PORT, EMCUTE_ID);
return NULL; /* should never be reached */
}
@ -74,7 +73,7 @@ static unsigned get_qos(const char *str)
static int cmd_con(int argc, char **argv)
{
sock_udp_ep_t gw = { .family = AF_INET6, .port = EMCUTE_PORT };
sock_udp_ep_t gw = { .family = AF_INET6, .port = CONFIG_EMCUTE_DEFAULT_PORT };
char *topic = NULL;
char *message = NULL;
size_t len = 0;

View File

@ -95,11 +95,11 @@
extern "C" {
#endif
#ifndef EMCUTE_DEFAULT_PORT
#ifndef CONFIG_EMCUTE_DEFAULT_PORT
/**
* @brief Default UDP port to listen on (also used as SRC port)
*/
#define EMCUTE_DEFAULT_PORT (1883U)
#define CONFIG_EMCUTE_DEFAULT_PORT (1883U)
#endif
#ifndef CONFIG_EMCUTE_BUFSIZE

View File

@ -72,7 +72,7 @@ static const shell_command_t _shell_commands[] = {
static void *_emcute_thread(void *arg)
{
(void)arg;
emcute_run(MQTTSN_DEFAULT_PORT, EMCUTE_ID);
emcute_run(CONFIG_EMCUTE_DEFAULT_PORT, EMCUTE_ID);
return NULL; /* should never be reached */
}
@ -111,7 +111,7 @@ static int _con(int argc, char **argv)
return 1;
}
if (_gw.port == 0) {
_gw.port = MQTTSN_DEFAULT_PORT;
_gw.port = CONFIG_EMCUTE_DEFAULT_PORT;
}
if (argc >= 4) {
topic = argv[2];