Refactor destiny.h
This commit is contained in:
parent
fa01202b65
commit
de33fcd31b
@ -1,4 +1,4 @@
|
|||||||
MODULE:=$(shell basename $(CURDIR))
|
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
|
include $(RIOTBASE)/Makefile.base
|
||||||
|
|||||||
@ -29,7 +29,7 @@
|
|||||||
char tcp_stack_buffer[TCP_STACK_SIZE];
|
char tcp_stack_buffer[TCP_STACK_SIZE];
|
||||||
char udp_stack_buffer[UDP_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",
|
printf("Initializing transport layer packages. Size of socket_type: %u\n",
|
||||||
sizeof(socket_internal_t));
|
sizeof(socket_internal_t));
|
||||||
@ -39,7 +39,12 @@ void init_transport_layer(void)
|
|||||||
/* UDP */
|
/* UDP */
|
||||||
int udp_thread_pid = thread_create(udp_stack_buffer, UDP_STACK_SIZE,
|
int udp_thread_pid = thread_create(udp_stack_buffer, UDP_STACK_SIZE,
|
||||||
PRIORITY_MAIN, CREATE_STACKTEST,
|
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);
|
ipv6_register_next_header_handler(IPV6_PROTO_NUM_UDP, udp_thread_pid);
|
||||||
|
|
||||||
/* TCP */
|
/* TCP */
|
||||||
@ -55,9 +60,17 @@ void init_transport_layer(void)
|
|||||||
int tcp_thread_pid = thread_create(tcp_stack_buffer, TCP_STACK_SIZE,
|
int tcp_thread_pid = thread_create(tcp_stack_buffer, TCP_STACK_SIZE,
|
||||||
PRIORITY_MAIN, CREATE_STACKTEST,
|
PRIORITY_MAIN, CREATE_STACKTEST,
|
||||||
tcp_packet_handler, "tcp_packet_handler");
|
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);
|
ipv6_register_next_header_handler(IPV6_PROTO_NUM_TCP, tcp_thread_pid);
|
||||||
|
|
||||||
thread_create(tcp_timer_stack, TCP_TIMER_STACKSIZE, PRIORITY_MAIN + 1,
|
if (thread_create(tcp_timer_stack, TCP_TIMER_STACKSIZE, PRIORITY_MAIN + 1,
|
||||||
CREATE_STACKTEST, tcp_general_timer, "tcp_general_timer");
|
CREATE_STACKTEST, tcp_general_timer, "tcp_general_timer") < 0) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -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_ */
|
|
||||||
13
sys/net/destiny/include/destiny.h
Normal file
13
sys/net/destiny/include/destiny.h
Normal 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 */
|
||||||
Loading…
x
Reference in New Issue
Block a user