Refactor destiny.h

This commit is contained in:
Martin Lenders 2013-09-20 14:29:00 +02:00
parent fa01202b65
commit de33fcd31b
4 changed files with 31 additions and 18 deletions

View File

@ -1,4 +1,4 @@
MODULE:=$(shell basename $(CURDIR))
INCLUDES = -I$(RIOTBASE)/sys/include -I$(RIOTBASE)/core/include -I$(RIOTBASE)/drivers/include -I$(RIOTBASE)/sys/net/destiny -I$(RIOTBASE)/sys/net/sixlowpan/include -I$(RIOTBASE)/sys/net/net_help/ -I$(RIOTBASE)/drivers/cc110x_ng/include -I$(RIOTBASE)/drivers/cc110x
INCLUDES = -I$(RIOTBASE)/sys/include -I$(RIOTBASE)/core/include -I$(RIOTBASE)/drivers/include -I$(RIOTBASE)/sys/net/destiny/include -I$(RIOTBASE)/sys/net/sixlowpan/include -I$(RIOTBASE)/sys/net/net_help/ -I$(RIOTBASE)/drivers/cc110x_ng/include -I$(RIOTBASE)/drivers/cc110x
include $(RIOTBASE)/Makefile.base

View File

@ -29,7 +29,7 @@
char tcp_stack_buffer[TCP_STACK_SIZE];
char udp_stack_buffer[UDP_STACK_SIZE];
void init_transport_layer(void)
int destiny_init_transport_layer(void)
{
printf("Initializing transport layer packages. Size of socket_type: %u\n",
sizeof(socket_internal_t));
@ -39,7 +39,12 @@ void init_transport_layer(void)
/* UDP */
int udp_thread_pid = thread_create(udp_stack_buffer, UDP_STACK_SIZE,
PRIORITY_MAIN, CREATE_STACKTEST,
udp_packet_handler,"udp_packet_handler");
udp_packet_handler, "udp_packet_handler");
if (udp_thread_pid < 0) {
return -1;
}
ipv6_register_next_header_handler(IPV6_PROTO_NUM_UDP, udp_thread_pid);
/* TCP */
@ -55,9 +60,17 @@ void init_transport_layer(void)
int tcp_thread_pid = thread_create(tcp_stack_buffer, TCP_STACK_SIZE,
PRIORITY_MAIN, CREATE_STACKTEST,
tcp_packet_handler, "tcp_packet_handler");
if (udp_thread_pid < 0) {
return -1;
}
ipv6_register_next_header_handler(IPV6_PROTO_NUM_TCP, tcp_thread_pid);
thread_create(tcp_timer_stack, TCP_TIMER_STACKSIZE, PRIORITY_MAIN + 1,
CREATE_STACKTEST, tcp_general_timer, "tcp_general_timer");
if (thread_create(tcp_timer_stack, TCP_TIMER_STACKSIZE, PRIORITY_MAIN + 1,
CREATE_STACKTEST, tcp_general_timer, "tcp_general_timer") < 0) {
return -1;
}
return 0;
}

View File

@ -1,13 +0,0 @@
/*
* destiny.h
*
* Created on: 03.09.2011
* Author: Oliver
*/
#ifndef DESTINY_H_
#define DESTINY_H_
void init_transport_layer(void);
#endif /* DESTINY_H_ */

View File

@ -0,0 +1,13 @@
/*
* destiny.h
*
* Created on: 03.09.2011
* Author: Oliver
*/
#ifndef DESTINY_H
#define DESTINY_H
int destiny_init_transport_layer(void);
#endif /* DESTINY_H */