Compare commits
23 Commits
master
...
2021.07-RC
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1a4b35a503 | ||
|
|
38c987354d | ||
|
|
2714035e03 | ||
|
|
e024d6dadc | ||
|
|
db69969df2 | ||
|
|
67374dacac | ||
|
|
60364b256f | ||
|
|
26afb55700 | ||
|
|
0c586d86ac | ||
|
|
a20bd7cba6 | ||
| efd80adc84 | |||
|
|
ddeca04823 | ||
|
|
ecbafcdaab | ||
|
|
0262c36960 | ||
|
|
3978f51166 | ||
|
|
b490a66e9e | ||
|
|
71cdbd5501 | ||
|
|
34cb17d531 | ||
|
|
a0c9828b20 | ||
|
|
e7dd2e0fc0 | ||
|
|
4963df259a | ||
| 6a871b1fd2 | |||
| 8a1da6ffde |
@ -88,7 +88,7 @@ LINKFLAGS += -nostdlib -Wl,-gc-sections -Wl,-static
|
|||||||
ifeq (,$(filter esp_idf_heap,$(USEMODULE)))
|
ifeq (,$(filter esp_idf_heap,$(USEMODULE)))
|
||||||
# use the wrapper functions for calloc to add correct overflow detection missing
|
# use the wrapper functions for calloc to add correct overflow detection missing
|
||||||
# in the newlib's version.
|
# in the newlib's version.
|
||||||
LINKFLAGS += -Wl,-wrap=calloc
|
LINKFLAGS += -Wl,-wrap=_calloc_r
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# LINKFLAGS += -Wl,--verbose
|
# LINKFLAGS += -Wl,--verbose
|
||||||
|
|||||||
@ -289,7 +289,7 @@ void* IRAM_ATTR __wrap__calloc_r(struct _reent *r, size_t count, size_t size)
|
|||||||
|
|
||||||
#else /* MODULE_ESP_IDF_HEAP */
|
#else /* MODULE_ESP_IDF_HEAP */
|
||||||
|
|
||||||
void *__wrap_calloc(size_t nmemb, size_t size)
|
void* IRAM_ATTR __wrap__calloc_r(struct _reent *r, size_t nmemb, size_t size)
|
||||||
{
|
{
|
||||||
/* The xtensa support has not yet upstreamed to newlib. Hence, the fixed
|
/* The xtensa support has not yet upstreamed to newlib. Hence, the fixed
|
||||||
* calloc implementation of newlib >= 4.0.0 is not available to the ESP
|
* calloc implementation of newlib >= 4.0.0 is not available to the ESP
|
||||||
@ -299,7 +299,7 @@ void *__wrap_calloc(size_t nmemb, size_t size)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void *res = malloc(total_size);
|
void *res = _malloc_r(r, total_size);
|
||||||
|
|
||||||
if (res) {
|
if (res) {
|
||||||
memset(res, 0, total_size);
|
memset(res, 0, total_size);
|
||||||
|
|||||||
@ -51,23 +51,24 @@ static int _send(netdev_t *netdev, const iolist_t *iolist)
|
|||||||
return -ENOTSUP;
|
return -ENOTSUP;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t size = iolist_size(iolist);
|
size_t pos = 0;
|
||||||
|
|
||||||
/* Ignore send if packet size is 0 */
|
|
||||||
if (!size) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
DEBUG("[sx126x] netdev: sending packet now (size: %d).\n", size);
|
|
||||||
/* Write payload buffer */
|
/* Write payload buffer */
|
||||||
for (const iolist_t *iol = iolist; iol; iol = iol->iol_next) {
|
for (const iolist_t *iol = iolist; iol; iol = iol->iol_next) {
|
||||||
if (iol->iol_len > 0) {
|
if (iol->iol_len > 0) {
|
||||||
sx126x_set_lora_payload_length(dev, iol->iol_len);
|
sx126x_write_buffer(dev, pos, iol->iol_base, iol->iol_len);
|
||||||
sx126x_write_buffer(dev, 0, iol->iol_base, iol->iol_len);
|
|
||||||
DEBUG("[sx126x] netdev: send: wrote data to payload buffer.\n");
|
DEBUG("[sx126x] netdev: send: wrote data to payload buffer.\n");
|
||||||
|
pos += iol->iol_len;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Ignore send if packet size is 0 */
|
||||||
|
if (!pos) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
DEBUG("[sx126x] netdev: sending packet now (size: %d).\n", pos);
|
||||||
|
sx126x_set_lora_payload_length(dev, pos);
|
||||||
|
|
||||||
state = NETOPT_STATE_TX;
|
state = NETOPT_STATE_TX;
|
||||||
netdev->driver->set(netdev, NETOPT_STATE, &state, sizeof(uint8_t));
|
netdev->driver->set(netdev, NETOPT_STATE, &state, sizeof(uint8_t));
|
||||||
DEBUG("[sx126x] netdev: send: transmission in progress.\n");
|
DEBUG("[sx126x] netdev: send: transmission in progress.\n");
|
||||||
@ -107,7 +108,7 @@ static int _recv(netdev_t *netdev, void *buf, size_t len, void *info)
|
|||||||
|
|
||||||
sx126x_read_buffer(dev, rx_buffer_status.buffer_start_pointer, buf, size);
|
sx126x_read_buffer(dev, rx_buffer_status.buffer_start_pointer, buf, size);
|
||||||
|
|
||||||
return 0;
|
return size;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int _init(netdev_t *netdev)
|
static int _init(netdev_t *netdev)
|
||||||
|
|||||||
@ -748,7 +748,7 @@ typedef enum {
|
|||||||
NETOPT_RANDOM,
|
NETOPT_RANDOM,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief (uint8_t) Get or set the number of PHY symbols before assuming there's no data
|
* @brief (uint16_t) Get or set the number of PHY symbols before assuming there's no data
|
||||||
*/
|
*/
|
||||||
NETOPT_RX_SYMBOL_TIMEOUT,
|
NETOPT_RX_SYMBOL_TIMEOUT,
|
||||||
|
|
||||||
|
|||||||
@ -300,10 +300,11 @@ static int _send(gnrc_netif_t *netif, gnrc_pktsnip_t *payload)
|
|||||||
mlme_request_t mlme_request;
|
mlme_request_t mlme_request;
|
||||||
mlme_confirm_t mlme_confirm;
|
mlme_confirm_t mlme_confirm;
|
||||||
|
|
||||||
gnrc_pktsnip_t *head;
|
|
||||||
uint8_t port;
|
uint8_t port;
|
||||||
int res = -EINVAL;
|
int res = -EINVAL;
|
||||||
|
|
||||||
|
assert(payload);
|
||||||
|
|
||||||
if (IS_ACTIVE(CONFIG_GNRC_NETIF_LORAWAN_NETIF_HDR)) {
|
if (IS_ACTIVE(CONFIG_GNRC_NETIF_LORAWAN_NETIF_HDR)) {
|
||||||
gnrc_netif_hdr_t *netif_hdr;
|
gnrc_netif_hdr_t *netif_hdr;
|
||||||
const uint8_t *dst;
|
const uint8_t *dst;
|
||||||
@ -318,11 +319,10 @@ static int _send(gnrc_netif_t *netif, gnrc_pktsnip_t *payload)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Remove the netif hdr snip and point to the MSDU */
|
/* Remove the netif hdr snip and point to the MSDU */
|
||||||
head = gnrc_pktbuf_remove_snip(payload, payload);
|
payload = gnrc_pktbuf_remove_snip(payload, payload);
|
||||||
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
head = payload;
|
|
||||||
port = netif->lorawan.port;
|
port = netif->lorawan.port;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -335,18 +335,18 @@ static int _send(gnrc_netif_t *netif, gnrc_pktsnip_t *payload)
|
|||||||
mcps_request_t req =
|
mcps_request_t req =
|
||||||
{ .type = netif->lorawan.ack_req ? MCPS_CONFIRMED : MCPS_UNCONFIRMED,
|
{ .type = netif->lorawan.ack_req ? MCPS_CONFIRMED : MCPS_UNCONFIRMED,
|
||||||
.data =
|
.data =
|
||||||
{ .pkt = (iolist_t *)head, .port = port,
|
{ .pkt = (iolist_t *)payload, .port = port,
|
||||||
.dr = netif->lorawan.datarate } };
|
.dr = netif->lorawan.datarate } };
|
||||||
mcps_confirm_t conf;
|
mcps_confirm_t conf;
|
||||||
|
|
||||||
gnrc_lorawan_mcps_request(&netif->lorawan.mac, &req, &conf);
|
gnrc_lorawan_mcps_request(&netif->lorawan.mac, &req, &conf);
|
||||||
res = conf.status;
|
res = conf.status;
|
||||||
|
|
||||||
end:
|
|
||||||
if (res < 0) {
|
if (res < 0) {
|
||||||
gnrc_pktbuf_release_error(payload, res);
|
gnrc_pktbuf_release_error(payload, res);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
end:
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -125,7 +125,7 @@ static inline void gnrc_ep_set(sock_ip_ep_t *out, const sock_ip_ep_t *in,
|
|||||||
size_t in_size)
|
size_t in_size)
|
||||||
{
|
{
|
||||||
memcpy(out, in, in_size);
|
memcpy(out, in, in_size);
|
||||||
if (gnrc_netif_highlander()) {
|
if (gnrc_netif_highlander() && (out->netif == 0)) {
|
||||||
/* set interface implicitly */
|
/* set interface implicitly */
|
||||||
gnrc_netif_t *netif = gnrc_netif_iter(NULL);
|
gnrc_netif_t *netif = gnrc_netif_iter(NULL);
|
||||||
|
|
||||||
|
|||||||
@ -54,7 +54,7 @@ static void test_ipv4_addr_to_str__addr_NULL(void)
|
|||||||
|
|
||||||
static void test_ipv4_addr_to_str__result_NULL(void)
|
static void test_ipv4_addr_to_str__result_NULL(void)
|
||||||
{
|
{
|
||||||
ipv4_addr_t a;
|
ipv4_addr_t a = {0};
|
||||||
|
|
||||||
TEST_ASSERT_NULL(ipv4_addr_to_str(NULL, &a, IPV4_ADDR_MAX_STR_LEN));
|
TEST_ASSERT_NULL(ipv4_addr_to_str(NULL, &a, IPV4_ADDR_MAX_STR_LEN));
|
||||||
}
|
}
|
||||||
|
|||||||
@ -826,7 +826,7 @@ static void test_ipv6_addr_to_str__addr_NULL(void)
|
|||||||
|
|
||||||
static void test_ipv6_addr_to_str__result_NULL(void)
|
static void test_ipv6_addr_to_str__result_NULL(void)
|
||||||
{
|
{
|
||||||
ipv6_addr_t a;
|
ipv6_addr_t a = {0};
|
||||||
|
|
||||||
TEST_ASSERT_NULL(ipv6_addr_to_str(NULL, &a, IPV6_ADDR_MAX_STR_LEN));
|
TEST_ASSERT_NULL(ipv6_addr_to_str(NULL, &a, IPV6_ADDR_MAX_STR_LEN));
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user