Make the Protosockets examples possible to compile.
This commit is contained in:
parent
97037763ad
commit
4c4c468907
2 changed files with 8 additions and 8 deletions
|
@ -1,10 +1,11 @@
|
|||
|
||||
#include <stdio.h>
|
||||
#include "contiki-net.h"
|
||||
|
||||
static struct psock ps;
|
||||
static char buffer[100];
|
||||
static uint8_t buffer[100];
|
||||
|
||||
PROCESS(example_psock_client_process, "Example protosocket client");
|
||||
AUTOSTART_PROCESSES(&example_psock_client_process);
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
static int
|
||||
|
@ -28,12 +29,10 @@ PROCESS_THREAD(example_psock_client_process, ev, data)
|
|||
{
|
||||
uip_ipaddr_t addr;
|
||||
|
||||
printf("%d\n", TEST);
|
||||
|
||||
PROCESS_BEGIN();
|
||||
|
||||
uip_ipaddr(addr, 192,168,2,1);
|
||||
tcp_connect(addr, UIP_HTONS(80), NULL);
|
||||
uip_ipaddr(&addr, 192,168,2,1);
|
||||
tcp_connect(&addr, UIP_HTONS(80), NULL);
|
||||
|
||||
printf("Connecting...\n");
|
||||
PROCESS_WAIT_EVENT_UNTIL(ev == tcpip_event);
|
||||
|
|
|
@ -28,7 +28,7 @@ static struct psock ps;
|
|||
* We must have somewhere to put incoming data, and we use a 10 byte
|
||||
* buffer for this purpose.
|
||||
*/
|
||||
static char buffer[10];
|
||||
static uint8_t buffer[10];
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/*
|
||||
|
@ -90,9 +90,10 @@ PT_THREAD(handle_connection(struct psock *p))
|
|||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/*
|
||||
* We declare the process.
|
||||
* We declare the process and specify that it should be automatically started.
|
||||
*/
|
||||
PROCESS(example_psock_server_process, "Example protosocket server");
|
||||
AUTOSTART_PROCESSES(&example_psock_server_process);
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/*
|
||||
* The definition of the process.
|
||||
|
|
Loading…
Reference in a new issue