Skip to content

Feature/autonomous-border-router #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
21 changes: 17 additions & 4 deletions apps/mqtt/mqtt.c
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@ abort_connection(struct mqtt_connection *conn)
tcp_socket_unregister(&conn->socket);

memset(&conn->socket, 0, sizeof(conn->socket));
DBG("Abord connection\n");

conn->state = MQTT_CONN_STATE_NOT_CONNECTED;
}
Expand Down Expand Up @@ -1115,6 +1116,7 @@ tcp_event(struct tcp_socket *s, void *ptr, tcp_socket_event_t event)
DBG("MQTT - Disconnected by tcp event %d\n", event);
process_post(&mqtt_process, mqtt_abort_now_event, conn);
conn->state = MQTT_CONN_STATE_NOT_CONNECTED;
DBG("state not connected\n");
ctimer_stop(&conn->keep_alive_timer);
call_event(conn, MQTT_EVENT_DISCONNECTED, &event);
abort_connection(conn);
Expand Down Expand Up @@ -1370,17 +1372,20 @@ mqtt_status_t
mqtt_subscribe(struct mqtt_connection *conn, uint16_t *mid, char *topic,
mqtt_qos_level_t qos_level)
{
DBG("STATE\n");
DBG("State %u != %u\n", conn->state, MQTT_CONN_STATE_CONNECTED_TO_BROKER);
if(conn->state != MQTT_CONN_STATE_CONNECTED_TO_BROKER) {
return MQTT_STATUS_NOT_CONNECTED_ERROR;
}


DBG("MQTT - Call to mqtt_subscribe...\n");

/* Currently don't have a queue, so only one item at a time */
if(conn->out_queue_full) {
DBG("MQTT - Not accepted!\n");
return MQTT_STATUS_OUT_QUEUE_FULL;
}
// if(conn->out_queue_full) {
// DBG("MQTT - Not accepted!\n");
// return MQTT_STATUS_OUT_QUEUE_FULL;
// }
conn->out_queue_full = 1;
DBG("MQTT - Accepted!\n");

Expand Down Expand Up @@ -1419,11 +1424,13 @@ mqtt_unsubscribe(struct mqtt_connection *conn, uint16_t *mid, char *topic)
return MQTT_STATUS_OK;
}
/*----------------------------------------------------------------------------*/
static int counter = 0;
mqtt_status_t
mqtt_publish(struct mqtt_connection *conn, uint16_t *mid, char *topic,
uint8_t *payload, uint32_t payload_size,
mqtt_qos_level_t qos_level, mqtt_retain_t retain)
{
DBG("STATEPUB : %u != %u", conn->state, MQTT_CONN_STATE_CONNECTED_TO_BROKER);
if(conn->state != MQTT_CONN_STATE_CONNECTED_TO_BROKER) {
return MQTT_STATUS_NOT_CONNECTED_ERROR;
}
Expand All @@ -1433,6 +1440,12 @@ mqtt_publish(struct mqtt_connection *conn, uint16_t *mid, char *topic,
/* Currently don't have a queue, so only one item at a time */
if(conn->out_queue_full) {
DBG("MQTT - Not accepted!\n");
counter++;
if(counter > 1) {
conn->out_queue_full = 0;
counter = 0;
DBG("Counter : %u", counter);
}
return MQTT_STATUS_OUT_QUEUE_FULL;
}
conn->out_queue_full = 1;
Expand Down
7,055 changes: 0 additions & 7,055 deletions examples/ipv6/rpl-border-router/border-router-zoul.map

This file was deleted.

Binary file removed examples/ipv6/rpl-border-router/border-router.bin
Binary file not shown.
Binary file removed examples/ipv6/rpl-border-router/border-router.elf
Binary file not shown.
50 changes: 0 additions & 50 deletions examples/ipv6/rpl-border-router/obj_zoul/adc-zoul.d

This file was deleted.

Binary file removed examples/ipv6/rpl-border-router/obj_zoul/adc-zoul.o
Binary file not shown.
40 changes: 0 additions & 40 deletions examples/ipv6/rpl-border-router/obj_zoul/adc.d

This file was deleted.

Binary file removed examples/ipv6/rpl-border-router/obj_zoul/adc.o
Binary file not shown.
38 changes: 0 additions & 38 deletions examples/ipv6/rpl-border-router/obj_zoul/aes-128.d

This file was deleted.

Binary file removed examples/ipv6/rpl-border-router/obj_zoul/aes-128.o
Binary file not shown.
40 changes: 0 additions & 40 deletions examples/ipv6/rpl-border-router/obj_zoul/aes.d

This file was deleted.

Binary file removed examples/ipv6/rpl-border-router/obj_zoul/aes.o
Binary file not shown.
36 changes: 0 additions & 36 deletions examples/ipv6/rpl-border-router/obj_zoul/antenna-sw.d

This file was deleted.

Binary file not shown.
46 changes: 0 additions & 46 deletions examples/ipv6/rpl-border-router/obj_zoul/anti-replay.d

This file was deleted.

Binary file removed examples/ipv6/rpl-border-router/obj_zoul/anti-replay.o
Binary file not shown.
36 changes: 0 additions & 36 deletions examples/ipv6/rpl-border-router/obj_zoul/arg.d

This file was deleted.

Binary file removed examples/ipv6/rpl-border-router/obj_zoul/arg.o
Binary file not shown.
2 changes: 0 additions & 2 deletions examples/ipv6/rpl-border-router/obj_zoul/assert.d

This file was deleted.

Binary file not shown.
Loading