??? 01/09/08 09:20 Read: times |
#149165 - You need a Server Responding to: ???'s previous message |
Stefan Kanev said:
In this case to connect device (toaster or other type, without HTTP server, but with some serial port) to computer You will need some computer-side code between platform independent Java applet and serial cable. The whole point of embedding the HTTP server is to obviate the need for any special "computer-side" code! You can send HTTP over a simple serial port - using PPP, SLIP, or whatever (in fact, you do exactly this when using a dial-up modem). In principle, sending a web page could be as simple as: printf( "<html>" ); printf( "<head>" ); printf( "</head>" ); printf( "<body>" ); printf( "Hello, World!" ); printf( "</body>" ); printf( "</html>" ); Of course, you'd also need the TCP/IP stack. For a toaster, the HTTP+TCP/IP would probably be 98% of the total code! How far from OS-dependency can be this code? Something like Java subset for hardware access?! The Java runtime for the specific platform would provide that - so your Java Application would be entirely platform-independent. The problem is still that each device needs its own Java application; by embedding a webserver, you don't need any special "computer-side" code - just a standard browser! And it's also entirely independent of the actual connection medium used - your browser is totally oblivious to whether you are using RS232, USB, Ethernet, a dial-up modem or whatever! |