From 0999d3e9499c6f8ded540eed79764f49323aaf8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=ABl=20G=C3=A4hwiler?= Date: Wed, 6 Jan 2021 14:36:57 +0100 Subject: [PATCH] use new shiftr.io public instance --- examples/async.c | 6 +++--- examples/sync.c | 6 +++--- tests/client.cpp | 42 +++++++++++++++++++++--------------------- 3 files changed, 27 insertions(+), 27 deletions(-) diff --git a/examples/async.c b/examples/async.c index eea2454..fdf5899 100644 --- a/examples/async.c +++ b/examples/async.c @@ -77,7 +77,7 @@ int main() { lwmqtt_set_callback(&client, NULL, message_arrived); // connect to broker - lwmqtt_err_t err = lwmqtt_unix_network_connect(&network, "broker.shiftr.io", 1883); + lwmqtt_err_t err = lwmqtt_unix_network_connect(&network, "public.cloud.shiftr.io", 1883); if (err != LWMQTT_SUCCESS) { printf("failed lwmqtt_unix_network_connect: %d\n", err); exit(1); @@ -86,8 +86,8 @@ int main() { // set options lwmqtt_options_t options = lwmqtt_default_options; options.client_id = lwmqtt_string("lwmqtt"); - options.username = lwmqtt_string("try"); - options.password = lwmqtt_string("try"); + options.username = lwmqtt_string("public"); + options.password = lwmqtt_string("public"); options.keep_alive = 10; // send connect packet diff --git a/examples/sync.c b/examples/sync.c index 0ca9041..16fdb36 100644 --- a/examples/sync.c +++ b/examples/sync.c @@ -31,7 +31,7 @@ int main() { lwmqtt_unix_timer_set(&timer3, MESSAGE_TIMEOUT); // connect to broker - lwmqtt_err_t err = lwmqtt_unix_network_connect(&network, "broker.shiftr.io", 1883); + lwmqtt_err_t err = lwmqtt_unix_network_connect(&network, "public.cloud.shiftr.io", 1883); if (err != LWMQTT_SUCCESS) { printf("failed lwmqtt_unix_network_connect: %d\n", err); exit(1); @@ -40,8 +40,8 @@ int main() { // prepare options lwmqtt_options_t options = lwmqtt_default_options; options.client_id = lwmqtt_string("lwmqtt"); - options.username = lwmqtt_string("try"); - options.password = lwmqtt_string("try"); + options.username = lwmqtt_string("public"); + options.password = lwmqtt_string("public"); options.keep_alive = 5; // send connect packet diff --git a/tests/client.cpp b/tests/client.cpp index d0d00a6..a90e43b 100644 --- a/tests/client.cpp +++ b/tests/client.cpp @@ -55,13 +55,13 @@ TEST(Client, PublishSubscribeQOS0) { lwmqtt_set_timers(&client, &timer1, &timer2, lwmqtt_unix_timer_set, lwmqtt_unix_timer_get); lwmqtt_set_callback(&client, (void *)custom_ref, message_arrived); - lwmqtt_err_t err = lwmqtt_unix_network_connect(&network, (char *)"broker.shiftr.io", 1883); + lwmqtt_err_t err = lwmqtt_unix_network_connect(&network, (char *)"public.cloud.shiftr.io", 1883); ASSERT_EQ(err, LWMQTT_SUCCESS); lwmqtt_options_t data = lwmqtt_default_options; data.client_id = lwmqtt_string("lwmqtt"); - data.username = lwmqtt_string("try"); - data.password = lwmqtt_string("try"); + data.username = lwmqtt_string("public"); + data.password = lwmqtt_string("public"); lwmqtt_return_code_t return_code; err = lwmqtt_connect(&client, data, nullptr, &return_code, COMMAND_TIMEOUT); @@ -114,13 +114,13 @@ TEST(Client, PublishSubscribeQOS1) { lwmqtt_set_timers(&client, &timer1, &timer2, lwmqtt_unix_timer_set, lwmqtt_unix_timer_get); lwmqtt_set_callback(&client, (void *)custom_ref, message_arrived); - lwmqtt_err_t err = lwmqtt_unix_network_connect(&network, (char *)"broker.shiftr.io", 1883); + lwmqtt_err_t err = lwmqtt_unix_network_connect(&network, (char *)"public.cloud.shiftr.io", 1883); ASSERT_EQ(err, LWMQTT_SUCCESS); lwmqtt_options_t options = lwmqtt_default_options; options.client_id = lwmqtt_string("lwmqtt"); - options.username = lwmqtt_string("try"); - options.password = lwmqtt_string("try"); + options.username = lwmqtt_string("public"); + options.password = lwmqtt_string("public"); lwmqtt_return_code_t return_code; err = lwmqtt_connect(&client, options, nullptr, &return_code, COMMAND_TIMEOUT); @@ -173,13 +173,13 @@ TEST(Client, PublishSubscribeQOS2) { lwmqtt_set_timers(&client, &timer1, &timer2, lwmqtt_unix_timer_set, lwmqtt_unix_timer_get); lwmqtt_set_callback(&client, (void *)custom_ref, message_arrived); - lwmqtt_err_t err = lwmqtt_unix_network_connect(&network, (char *)"broker.shiftr.io", 1883); + lwmqtt_err_t err = lwmqtt_unix_network_connect(&network, (char *)"public.cloud.shiftr.io", 1883); ASSERT_EQ(err, LWMQTT_SUCCESS); lwmqtt_options_t options = lwmqtt_default_options; options.client_id = lwmqtt_string("lwmqtt"); - options.username = lwmqtt_string("try"); - options.password = lwmqtt_string("try"); + options.username = lwmqtt_string("public"); + options.password = lwmqtt_string("public"); lwmqtt_return_code_t return_code; err = lwmqtt_connect(&client, options, nullptr, &return_code, COMMAND_TIMEOUT); @@ -232,13 +232,13 @@ TEST(Client, BufferOverflow) { lwmqtt_set_timers(&client, &timer1, &timer2, lwmqtt_unix_timer_set, lwmqtt_unix_timer_get); lwmqtt_set_callback(&client, (void *)custom_ref, message_arrived); - lwmqtt_err_t err = lwmqtt_unix_network_connect(&network, (char *)"broker.shiftr.io", 1883); + lwmqtt_err_t err = lwmqtt_unix_network_connect(&network, (char *)"public.cloud.shiftr.io", 1883); ASSERT_EQ(err, LWMQTT_SUCCESS); lwmqtt_options_t options = lwmqtt_default_options; options.client_id = lwmqtt_string("lwmqtt"); - options.username = lwmqtt_string("try"); - options.password = lwmqtt_string("try"); + options.username = lwmqtt_string("public"); + options.password = lwmqtt_string("public"); lwmqtt_return_code_t return_code; err = lwmqtt_connect(&client, options, nullptr, &return_code, COMMAND_TIMEOUT); @@ -298,13 +298,13 @@ TEST(Client, OverflowDropping) { uint32_t dropped = 0; lwmqtt_drop_overflow(&client, true, &dropped); - lwmqtt_err_t err = lwmqtt_unix_network_connect(&network, (char *)"broker.shiftr.io", 1883); + lwmqtt_err_t err = lwmqtt_unix_network_connect(&network, (char *)"public.cloud.shiftr.io", 1883); ASSERT_EQ(err, LWMQTT_SUCCESS); lwmqtt_options_t options = lwmqtt_default_options; options.client_id = lwmqtt_string("lwmqtt"); - options.username = lwmqtt_string("try"); - options.password = lwmqtt_string("try"); + options.username = lwmqtt_string("public"); + options.password = lwmqtt_string("public"); lwmqtt_return_code_t return_code; err = lwmqtt_connect(&client, options, nullptr, &return_code, COMMAND_TIMEOUT); @@ -358,13 +358,13 @@ TEST(Client, BigBuffersAndPayload) { lwmqtt_set_timers(&client, &timer1, &timer2, lwmqtt_unix_timer_set, lwmqtt_unix_timer_get); lwmqtt_set_callback(&client, (void *)custom_ref, big_message_arrived); - lwmqtt_err_t err = lwmqtt_unix_network_connect(&network, (char *)"broker.shiftr.io", 1883); + lwmqtt_err_t err = lwmqtt_unix_network_connect(&network, (char *)"public.cloud.shiftr.io", 1883); ASSERT_EQ(err, LWMQTT_SUCCESS); lwmqtt_options_t options = lwmqtt_default_options; options.client_id = lwmqtt_string("lwmqtt"); - options.username = lwmqtt_string("try"); - options.password = lwmqtt_string("try"); + options.username = lwmqtt_string("public"); + options.password = lwmqtt_string("public"); lwmqtt_return_code_t return_code; err = lwmqtt_connect(&client, options, nullptr, &return_code, COMMAND_TIMEOUT); @@ -417,13 +417,13 @@ TEST(Client, MultipleSubscriptions) { lwmqtt_set_timers(&client, &timer1, &timer2, lwmqtt_unix_timer_set, lwmqtt_unix_timer_get); lwmqtt_set_callback(&client, (void *)custom_ref, message_arrived); - lwmqtt_err_t err = lwmqtt_unix_network_connect(&network, (char *)"broker.shiftr.io", 1883); + lwmqtt_err_t err = lwmqtt_unix_network_connect(&network, (char *)"public.cloud.shiftr.io", 1883); ASSERT_EQ(err, LWMQTT_SUCCESS); lwmqtt_options_t options = lwmqtt_default_options; options.client_id = lwmqtt_string("lwmqtt"); - options.username = lwmqtt_string("try"); - options.password = lwmqtt_string("try"); + options.username = lwmqtt_string("public"); + options.password = lwmqtt_string("public"); lwmqtt_return_code_t return_code; err = lwmqtt_connect(&client, options, nullptr, &return_code, COMMAND_TIMEOUT);