Skip to content
This repository was archived by the owner on Sep 16, 2024. It is now read-only.

Commit 937d4a4

Browse files
Catalin IoanaIslam Wahdan
authored andcommitted
Pymesh Border Router (#22)
* esp32/modmesh: added socket binding to IP, add listing border_router * esp32/modmesh: src and dest port on BR should he Host Swapped * esp32/modmesh: src and dest port set endianess before using them * esp32/modmesh: Mesh.rx_cb() added argument, with the callback * esp32/modmesh: added Mesh.border_router_del(prefix) method, for erasing Border Router entry * esp32/modmesh: added multi-socckets (max 3) * esp32/modmesh: added Border Router socket with header IP and port destination * esp32/modmesh: added socket binding to IP, add listing border_router * esp32/modmesh: src and dest port on BR should he Host Swapped * esp32/modmesh: src and dest port set endianess before using them * esp32/modmesh: Mesh.rx_cb() added argument, with the callback * esp32/modmesh: added Mesh.border_router_del(prefix) method, for erasing Border Router entry * esp32/modmesh: added multi-socckets (max 3) * esp32/modmesh: added Border Router socket with header IP and port destination
1 parent 52da273 commit 937d4a4

File tree

4 files changed

+374
-87
lines changed

4 files changed

+374
-87
lines changed

esp32/mods/modlora.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2359,7 +2359,7 @@ static int lora_socket_socket (mod_network_socket_obj_t *s, int *_errno) {
23592359
#ifdef LORA_OPENTHREAD_ENABLED
23602360
// if mesh is enabled, assume socket is for mesh, not for LoraWAN
23612361
if (lora_mesh_ready()) {
2362-
return mesh_socket_open(_errno);
2362+
return mesh_socket_open(s, _errno);
23632363
}
23642364
#endif // #ifdef LORA_OPENTHREAD_ENABLED
23652365

@@ -2387,7 +2387,7 @@ static int lora_socket_socket (mod_network_socket_obj_t *s, int *_errno) {
23872387
static void lora_socket_close (mod_network_socket_obj_t *s) {
23882388
s->sock_base.u.sd = -1;
23892389
#ifdef LORA_OPENTHREAD_ENABLED
2390-
mesh_socket_close();
2390+
mesh_socket_close(s);
23912391
#endif // #ifdef LORA_OPENTHREAD_ENABLED
23922392
}
23932393

@@ -2457,7 +2457,7 @@ static int lora_socket_recvfrom (mod_network_socket_obj_t *s, byte *buf, mp_uint
24572457

24582458
#ifdef LORA_OPENTHREAD_ENABLED
24592459
if (lora_mesh_ready()) {
2460-
return mesh_socket_recvfrom(buf, len, ip, port, _errno);
2460+
return mesh_socket_recvfrom(s, buf, len, ip, port, _errno);
24612461
}
24622462
#endif // #ifdef LORA_OPENTHREAD_ENABLED
24632463

@@ -2523,7 +2523,7 @@ static int lora_socket_bind(mod_network_socket_obj_t *s, byte *ip, mp_uint_t por
25232523

25242524
#ifdef LORA_OPENTHREAD_ENABLED
25252525
if (lora_mesh_ready()) {
2526-
return mesh_socket_bind(ip, port, _errno);
2526+
return mesh_socket_bind(s, ip, port, _errno);
25272527
}
25282528
#endif // #ifdef LORA_OPENTHREAD_ENABLED
25292529

@@ -2567,7 +2567,7 @@ static int lora_socket_sendto(struct _mod_network_socket_obj_t *s, const byte *b
25672567

25682568
#ifdef LORA_OPENTHREAD_ENABLED
25692569
if (lora_mesh_ready()) {
2570-
return mesh_socket_sendto(buf, len, ip, port, _errno);
2570+
return mesh_socket_sendto(s, buf, len, ip, port, _errno);
25712571
}
25722572
#endif // #ifdef LORA_OPENTHREAD_ENABLED
25732573

0 commit comments

Comments
 (0)