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
1 change: 1 addition & 0 deletions libraries/uIP/src/MicroIp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ extern "C" {
#include <net/ip/uip-debug.h>
}

#include "wiring_private.h"
#include "MicroIp.h"

struct resolv_params {
Expand Down
5 changes: 5 additions & 0 deletions libraries/uIP/src/MicroIpClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ extern "C" {
}

#include "Arduino.h"
#include "wiring_private.h"
#include "MicroIp.h"
#include "MicroIpClient.h"

Expand Down Expand Up @@ -226,6 +227,8 @@ void MicroIPClient::do_tcp_socket_connect(void* ptr)
int MicroIPClient::wait_tcp_socket_event(process_event_t ev, process_data_t data, void* ptr) {
struct tcp_socket_params* params = reinterpret_cast<struct tcp_socket_params*>(ptr);
MicroIPClient* client = const_cast<MicroIPClient*>(params->client);
(void)ev;
(void)data;

PRINTF("wait_tcp_socket_event client->state=%d\n", client->state);
if(client->event_wait) {
Expand Down Expand Up @@ -287,13 +290,15 @@ int MicroIPClient::listen(uint16_t port)
int MicroIPClient::data_callback(struct tcp_socket *s, void *ptr, const uint8_t *input_data_ptr, int input_data_len) {
PRINTF("MicroIPClient::data_callback %d\n", input_data_len);
MicroIPClient* client = reinterpret_cast<MicroIPClient*>(ptr);
(void)s;
int wb = client->receive(input_data_ptr, input_data_len);
return (input_data_len - wb);
}

void MicroIPClient::event_callback(struct tcp_socket *s, void *ptr, tcp_socket_event_t event) {
PRINTF("MicroIPClient::event_callback %d\n", event);
MicroIPClient* client = reinterpret_cast<MicroIPClient*>(ptr);
(void)s;
client->state = event;
client->event_wait= false;
post_continue();
Expand Down
4 changes: 4 additions & 0 deletions libraries/uIP/src/MicroIpUdp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ extern "C" {
}

#include "Arduino.h"
#include "wiring_private.h"
#include "Udp.h"
#include "MicroIP.h"
#include "MicroIPUDP.h"
Expand Down Expand Up @@ -228,6 +229,8 @@ void MicroIPUDP::receive(const uip_ipaddr_t *source_addr, uint16_t source_port,
{
const uint16_t store_size =static_cast<uint16_t>(datalen+sz_pack);
struct receive_pack pack = { store_size, *source_addr, source_port };
(void) dest_addr;
(void) dest_port;
PRINTF("MicroIPUDP::receive %d %d %d\n", sz_pack, store_size, datalen );

if( store_size > ringbuf_size(&rxbuf) ) {
Expand Down Expand Up @@ -276,6 +279,7 @@ void MicroIPUDP::input_callback(struct udp_socket *c, void *ptr,
const uint8_t *data, uint16_t datalen)
{
MicroIPUDP* udp = reinterpret_cast<MicroIPUDP*>(ptr);
(void)c;
udp->receive(source_addr, source_port, dest_addr, dest_port, data, datalen);
}

Expand Down