If the Internet had been become popular in the 80s.

Background

It’s 1985 in a parallel universe where Europeon telecoms companies have understood the need to bring down costs and install a new digital communications network based on ISDN.

In parallel Minicomputers and Mainframes are being joined together to better share information between companies and academic institutions using packet switch. They all agree on a information sharing agreemement that mirrors the current internet where costs are shared and the system is opened up to indviduals.

This is a small project to imagine what the reader would experience if this had happened and their newly purchased LOUCORP9000 ISDN modem arrives through the door ready to be connected to their BBC Microcomputer.

In order to connect a real PC to your local PAD (which is what RustTex does) you will need to run the tcpser program and the Beebem BBC micro emulator.

How to install

Download beebem from http://www.mkw.me.uk/beebem/ and install it on your PC. Versions are also available for Unix and I think mac.

You will then need to install tcpser to allow you to emulate a modem. You can download it from http://www.mkw.me.uk/beebem/tcpser.zip . Unpack the tcpser zip file and launch the GO.bat file.

Then run BeebEm. From the comms menu select RS232 destination and select localhost:25232 I’ve not had much luck connecting directly to RustTex yet so for now your have to use tcpser to connect to RustTex.

Then follow the instructions in the pamphlet below. Your phone no. is the IP address or hostname of the machine running RustTex (localhost if it’s the same PC as your running BeebEm).

Your LOUCORP9000 ISDN modem.

Congratulations on purchasing your LOUCORP9000 ISDN modem. Your ISDN modem provides the very latest technology which will allow you to connect to your local PAD (packet assembler/disassembler) and experience the internet at speeds of up to 9600 baud.

How to connect your ISDN modem to the Internet

Connect your modem to you ISDN line and connect it’s serial port to the back of the BBC micro. Once the modem is connected then you will need a terminal emulator running on your BBC micro. Below is a simple BBC basic terminal emulator your can type into your BBC micro.

10*FX2 2
20*FX7 4
30*FX8 4
40*FX229 1
50REPEAT
60  A%=138:X%=2
70  IF ADVAL(-1)>0 AND ADVAL(-3)>0 THEN Y%=GET:CALL&FFF4
80  *FX2 1
90  IF ADVAL(-2)>0 THEN VDUGET
100  *FX2 2
110UNTIL0   

Enter the code above and don’t forget to save it to a disc or tape using the SAVE “filename” command! You can now run the terminal emulator using the RUN command.

How to connect to your local PAD

In the terminal emulator type AT and press the return key. The ISDN modem should return with OK. To connect to your local pad type the following, where phone number is the phone number of your local PAD.

ATDT <phone number>

For example you could type ATDT localhost

This will connect to the PAD and you will get a screen similar to the one below.

From here you can get help by typing help! Refer to the documentation of the PAD you are dialing into for more information.

Socket coding in Android

So I’ve recently been playing about with Android for ‘Not So Super Secret Startup Idea’ and needed some code to communicate data such as Phone Calls/Text messages and other things from my phone to another device using TCP/IP. This is a bit harder on Android then it is on a PC as Android is bassed on apps having something called Activities and Services.
An Activity is the part of the Application which handles user input and can be destroyed at any time by the OS. This makes it pretty much useless for running anything which will communicate with the outside world without user intervention.
The other part part of an Android app is called a service which can be used to perform tasks in the background, process events from Activities, etc.
So what I currently have is an Android app which has a Service to handle TCP/IP communications from a telnet client on a PC. The service will also send data such as GPS location, phone calls and text messages (currently work in progress) over the socket to the PC.
One problem with the default TCP/IP functions is that they block (do not return until the right amount of data is received). I choose to use threads to handle blocking I/O and post Intents (a form of IPC) to the main activity to update it’s UI.
There is however one problem with using Threads in that when the Service is stopped there is no clean way to Kill a thread. This can be gotten around by closing the socket and setting a variable inside the threads main loop to tell it that it needs to shutdown cleanly.
So here’s some quick and dirty code which output’s GPS location and the phone no. of any calls received to a socket:

GPSTest