diff --git a/doc/example-psock-client.c b/doc/example-psock-client.c index c2a5a56f4..1fa5ad47c 100644 --- a/doc/example-psock-client.c +++ b/doc/example-psock-client.c @@ -1,10 +1,11 @@ - +#include #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); diff --git a/doc/example-psock-server.c b/doc/example-psock-server.c index 45db462da..59e45f147 100644 --- a/doc/example-psock-server.c +++ b/doc/example-psock-server.c @@ -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.