added initialization for uip6

This commit is contained in:
nvt-se 2008-11-05 15:34:04 +00:00
parent d1d09ea1fd
commit c5d9795f92
1 changed files with 20 additions and 11 deletions

View File

@ -26,7 +26,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * SUCH DAMAGE.
* *
* @(#)$Id: contiki-sky-main.c,v 1.37 2008/09/18 21:29:06 joxe Exp $ * @(#)$Id: contiki-sky-main.c,v 1.38 2008/11/05 15:34:04 nvt-se Exp $
*/ */
#include <signal.h> #include <signal.h>
@ -56,6 +56,8 @@
#include "net/rime.h" #include "net/rime.h"
#include "node-id.h" #include "node-id.h"
#include "cfs-coffee-arch.h"
#include "cfs/cfs-coffee.h"
#include "sys/autostart.h" #include "sys/autostart.h"
#include "sys/profile.h" #include "sys/profile.h"
@ -66,6 +68,11 @@ SENSORS(&button_sensor);
#define WITH_UIP 0 #define WITH_UIP 0
#endif #endif
#if WITH_UIP6
#include "net/sicslowpan.h"
#include "net/uip-netif.h"
#endif
#if WITH_UIP #if WITH_UIP
#include "net/uip.h" #include "net/uip.h"
#include "net/uip-fw.h" #include "net/uip-fw.h"
@ -76,11 +83,11 @@ static struct uip_fw_netif slipif =
static struct uip_fw_netif meshif = static struct uip_fw_netif meshif =
{UIP_FW_NETIF(172,16,0,0, 255,255,0,0, uip_over_mesh_send)}; {UIP_FW_NETIF(172,16,0,0, 255,255,0,0, uip_over_mesh_send)};
#endif /* WITH_UIP */
#define SLIP_TRICKLE_CHANNEL 8 #define SLIP_TRICKLE_CHANNEL 8
#define UIP_OVER_MESH_CHANNEL 9 #define UIP_OVER_MESH_CHANNEL 9
#endif /* WITH_UIP */
#ifdef EXPERIMENT_SETUP #ifdef EXPERIMENT_SETUP
#include "experiment-setup.h" #include "experiment-setup.h"
#endif #endif
@ -260,6 +267,12 @@ main(int argc, char **argv)
ds2411_id[0], ds2411_id[1], ds2411_id[2], ds2411_id[3], ds2411_id[0], ds2411_id[1], ds2411_id[2], ds2411_id[3],
ds2411_id[4], ds2411_id[5], ds2411_id[6], ds2411_id[7]); ds2411_id[4], ds2411_id[5], ds2411_id[6], ds2411_id[7]);
#if WITH_UIP6
memcpy(&uip_lladdr.addr, ds2411_id, sizeof(uip_lladdr.addr));
sicslowpan_init(rime_mac);
process_start(&tcpip_process, NULL);
#endif /* WITH_UIP6 */
#if WITH_UIP #if WITH_UIP
{ {
uip_ipaddr_t hostaddr, netmask; uip_ipaddr_t hostaddr, netmask;
@ -283,7 +296,7 @@ main(int argc, char **argv)
} }
#endif /* WITH_UIP */ #endif /* WITH_UIP */
#if !WITH_UIP #if !WITH_UIP && !WITH_UIP6
uart1_set_input(serial_input_byte); uart1_set_input(serial_input_byte);
serial_init(); serial_init();
#endif #endif
@ -294,10 +307,7 @@ main(int argc, char **argv)
leds_off(LEDS_GREEN); leds_off(LEDS_GREEN);
timesynch_init(); timesynch_init();
timesynch_set_authority_level(rimeaddr_node_addr.u8[0]); timesynch_set_authority_level(rimeaddr_node_addr.u8[0]);
#if WITH_UIP #if WITH_UIP
@ -308,7 +318,6 @@ main(int argc, char **argv)
trickle_open(&trickle, CLOCK_SECOND * 4, SLIP_TRICKLE_CHANNEL, trickle_open(&trickle, CLOCK_SECOND * 4, SLIP_TRICKLE_CHANNEL,
&trickle_call); &trickle_call);
slip_set_input_callback(set_gateway); slip_set_input_callback(set_gateway);
#endif /* WITH_UIP */ #endif /* WITH_UIP */
button_sensor.activate(); button_sensor.activate();
@ -324,7 +333,7 @@ main(int argc, char **argv)
*/ */
watchdog_start(); watchdog_start();
/* watchdog_stop();*/ /* watchdog_stop();*/
while (1) { while(1) {
int r; int r;
#if PROFILE_CONF_ON #if PROFILE_CONF_ON
profile_episode_start(); profile_episode_start();