blob: 812f9a4b90021bb2905019f4c76c1c29b9b44563 [file] [log] [blame]
adamdunkels9fcf9d62003-09-04 19:46:32 +00001/*
2 * Copyright (c) 2003, Adam Dunkels.
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above
11 * copyright notice, this list of conditions and the following
12 * disclaimer in the documentation and/or other materials provided
13 * with the distribution.
14 * 3. The name of the author may not be used to endorse or promote
15 * products derived from this software without specific prior
16 * written permission.
17 *
18 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
19 * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
22 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
24 * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
26 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
27 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
28 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 *
30 * This file is part of the Contiki desktop environment
31 *
adamdunkels72d32482003-11-27 15:56:57 +000032 * $Id: contiki-main.c,v 1.3 2003/11/27 15:56:57 adamdunkels Exp $
adamdunkels9fcf9d62003-09-04 19:46:32 +000033 *
34 */
35
36#include <io.h>
37#include <signal.h>
38
39
40#include "ctk.h"
41#include "ctk-draw.h"
42#include "ctk-vncserver.h"
43#include "dispatcher.h"
44
45
46#include "uip_main.h"
47#include "uip.h"
48#include "uip_arp.h"
49#include "resolv.h"
50
51#include "webserver.h"
52#include "program-handler.h"
53#include "about-dsc.h"
54#include "netconf-dsc.h"
55#include "processes-dsc.h"
adamdunkels9fcf9d62003-09-04 19:46:32 +000056#include "www-dsc.h"
57#include "webserver-dsc.h"
58
59#include "sensorview-dsc.h"
60
adamdunkels9fcf9d62003-09-04 19:46:32 +000061#include "sensors.h"
62
63#include "uip.h"
64#include "uip_arp.h"
65
adamdunkels72d32482003-11-27 15:56:57 +000066#include "msp430.h"
67
adamdunkels9fcf9d62003-09-04 19:46:32 +000068
69#include "rs232.h"
70void slip_drv_init(char *arg);
71
72
73
adamdunkels9fcf9d62003-09-04 19:46:32 +000074static u16_t addr[2];
adamdunkels9fcf9d62003-09-04 19:46:32 +000075/*-----------------------------------------------------------------------------------*/
adamdunkels9fcf9d62003-09-04 19:46:32 +000076
adamdunkels9fcf9d62003-09-04 19:46:32 +000077int
78main(int argc, char **argv)
79{
80
adamdunkels72d32482003-11-27 15:56:57 +000081 msp430_init();
adamdunkels9fcf9d62003-09-04 19:46:32 +000082
adamdunkels36a92662003-09-05 21:22:48 +000083 rs232_init(0);
84
adamdunkels9fcf9d62003-09-04 19:46:32 +000085 sensors_init();
86
87 rs232_print("uip_init()...\n");
88 uip_init();
89
adamdunkels72d32482003-11-27 15:56:57 +000090 /* rs232_print("resolv_init()...\n");
91 resolv_init();*/
adamdunkels9fcf9d62003-09-04 19:46:32 +000092
93
94
adamdunkels72d32482003-11-27 15:56:57 +000095#if 0
adamdunkels9fcf9d62003-09-04 19:46:32 +000096 uip_ipaddr(addr, 193,10,67,150);
97 uip_sethostaddr(addr);
98
adamdunkels72d32482003-11-27 15:56:57 +000099 /* uip_ipaddr(addr, 193,10,66,195);
100 resolv_conf(addr);*/
adamdunkels9fcf9d62003-09-04 19:46:32 +0000101
102#else
103
104 uip_ipaddr(addr, 172,16,0,2);
105 uip_sethostaddr(addr);
106
adamdunkels72d32482003-11-27 15:56:57 +0000107 /* uip_ipaddr(addr, 193,10,66,195);
108 resolv_conf(addr);*/
adamdunkels9fcf9d62003-09-04 19:46:32 +0000109#endif
110
111
112 rs232_print("dispatcher_init()...\n");
113 dispatcher_init();
114
115
116 rs232_print("slip_drv_init()...\n");
117 slip_drv_init(NULL);
118
119
120 rs232_print("ctk_init()...\n");
adamdunkels72d32482003-11-27 15:56:57 +0000121 /* ctk_init();*/
adamdunkels9fcf9d62003-09-04 19:46:32 +0000122
123 rs232_print("ctk_vncserver_init()...\n");
adamdunkels72d32482003-11-27 15:56:57 +0000124 /* ctk_vncserver_init(NULL); */
adamdunkels9fcf9d62003-09-04 19:46:32 +0000125
126 rs232_print("program_handler_init()...\n");
adamdunkels72d32482003-11-27 15:56:57 +0000127 /* program_handler_init();*/
adamdunkels9fcf9d62003-09-04 19:46:32 +0000128
129 /* rs232_print("processes_init()...\n");
130 processes_init(NULL);*/
131
132 rs232_print("webserver_init()...\n");
adamdunkels72d32482003-11-27 15:56:57 +0000133 /* webserver_init(NULL);*/
adamdunkels9fcf9d62003-09-04 19:46:32 +0000134
adamdunkels72d32482003-11-27 15:56:57 +0000135 sensorcheck_init(NULL);
136
adamdunkels9fcf9d62003-09-04 19:46:32 +0000137
138 /* program_handler_add(&directory_dsc, "Directory", 1);*/
139 /* program_handler_add(&about_dsc, "About", 1);*/
140 /* program_handler_add(&webserver_dsc, "Web server", 1);*/
141 /* program_handler_add(&www_dsc, "Web browser", 1);*/
142 /* program_handler_add(&calc_dsc, "Calculator", 0);*/
143 /* program_handler_add(&processes_dsc, "Processes", 0);*/
144
145 rs232_print("program_handler_addd()...\n");
adamdunkels72d32482003-11-27 15:56:57 +0000146 /* program_handler_add(&sensorview_dsc, "Sensors", 1);*/
adamdunkels9fcf9d62003-09-04 19:46:32 +0000147
148
149 rs232_print("dispatcher_run()...\n");
150 beep();
151 dispatcher_run();
152
153 return 0;
154
155 argv = argv;
156 argc = argc;
157
158
159
160}
161/*-----------------------------------------------------------------------------------*/
162char *arg_alloc(char size) {return NULL;}
163void arg_init(void) {}
164void arg_free(char *arg) {}
165/*-----------------------------------------------------------------------------------*/