Skip to content

Commit

Permalink
use new shiftr.io public instance
Browse files Browse the repository at this point in the history
  • Loading branch information
256dpi committed Jan 6, 2021
1 parent 5610647 commit 0999d3e
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 27 deletions.
6 changes: 3 additions & 3 deletions examples/async.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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
Expand Down
6 changes: 3 additions & 3 deletions examples/sync.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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
Expand Down
42 changes: 21 additions & 21 deletions tests/client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 0999d3e

Please sign in to comment.