Skip to content
Merged
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/data_logger/VERSION
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
VERSION_MAJOR = 0
VERSION_MINOR = 3
PATCHLEVEL = 0
PATCHLEVEL = 1
VERSION_TWEAK = 0
EXTRAVERSION = dev
22 changes: 13 additions & 9 deletions subsys/epacket/interfaces/epacket_bt_adv.c
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,7 @@ static void bt_adv_broadcast(const struct device *dev, struct net_buf *pkt)

static void adv_set_complete_worker(struct k_work *work)
{
uint8_t set_idx = bt_le_ext_adv_get_index(adv_set);
struct net_buf *curr, *next;
struct net_buf *next;

if (k_sem_take(&queue_lock, K_NO_WAIT) != 0) {
/* If we can't immediately access the queue, reschedule so we aren't blocking the
Expand All @@ -144,26 +143,31 @@ static void adv_set_complete_worker(struct k_work *work)
return;
}

curr = adv_set_bufs[set_idx];
adv_set_bufs[set_idx] = NULL;

next = net_buf_get(&tx_buf_queue, K_NO_WAIT);
if (next) {
LOG_DBG("Chaining next buf: %p", next);
bt_adv_broadcast(DEVICE_DT_INST_GET(0), next);
} else {
LOG_DBG("Adv chain complete: %d", set_idx);
LOG_DBG("Adv chain complete");
adv_set_active = false;
}
k_sem_give(&queue_lock);
}

static void adv_set_complete(struct bt_le_ext_adv *adv, struct bt_le_ext_adv_sent_info *info)
{
uint8_t set_idx = bt_le_ext_adv_get_index(adv);
struct net_buf *curr;

/* Release the finished buffer immediately */
curr = adv_set_bufs[set_idx];
adv_set_bufs[set_idx] = NULL;

/* Notify TX result */
epacket_notify_tx_result(DEVICE_DT_INST_GET(0), curr, 0);
net_buf_unref(curr);
}

static void adv_set_complete(struct bt_le_ext_adv *adv, struct bt_le_ext_adv_sent_info *info)
{
/* Handle chaining advertising sets in other thread context */
k_work_submit_to_queue(TASK_WORKQ, &adv_set_complete_work);
}

Expand Down
2 changes: 1 addition & 1 deletion subsys/epacket/interfaces/epacket_udp.c
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ static int epacket_udp_loop(void *a, void *b, void *c)

/* Create the UDP socket */
udp_state.sock = zsock_socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
if (udp_state.sock == -1) {
if (udp_state.sock < 0) {
LOG_ERR("Failed to open socket (%d)", errno);
goto socket_error;
}
Expand Down
2 changes: 1 addition & 1 deletion subsys/net/dns/infuse_dns.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ int infuse_sync_dns(const char *host, uint16_t port, int family, int socktype,
/* Perform DNS query */
rc = zsock_getaddrinfo(host, NULL, &hints, &res);
if (rc < 0) {
LOG_WRN("%s -> Lookup failed", host);
LOG_WRN("%s -> Lookup failed (%d)", host, errno);
#ifdef CONFIG_DNS_RESOLVER
k_sem_give(&dns_ctx);
#endif /* CONFIG_DNS_RESOLVER */
Expand Down
Loading