This assignment is the first of two, and deals with what devices might look like in Java programs, and how they might call methods on each other. This is simplified to the situation in which all devices already know about each other and exist as Java objects in the same Virtual Machine. Issues about how devices find each other and how they communicate is left to extensions and the second assignment.
This assignment looks at how home devices such as TVs, etc can be controlled by a simple wireless device using Java MIDP. This shows how dedicated infrared TV/video/CD/etc controllers can be replaced by a single programmable device, where you write the program.
This assignment has graded levels. The simplest version will be given a Pass if done satisfactorily, but to gain higher grades more features will have to be added.
Assume all devices are Java objects running on a MIDP device. This assignment is about controlling these devices using a program written for a MIDP device. All devices will be "fake" devices, not actually controlling anything at all.
In the networked home of the future, all devices should be controllable from any of a number of control centres: your main PC, the TV, any remote control, the car, etc. This assignment is about controlling some common devices from a MIDP device. It will control the
The TV tuner can be switched on or off, or select channels (by up/down or channel number entry). If on, it can also be queried for current channel.
The CD player can be switched on off, play a CD, skip tracks, restart, or eject the current CD. It can be queried to see if it contains a CD, is playing a CD and if so, which track
The amplifier can be switched on off, have its volume increased or decreased. It can also be switched between TV and CD input
You will need to define Java interfaces for the three classes of device
You will need to write a MIDP application that creates a TV, CD player and Amplifier object. It should display a menu of choices between the three devices. When one is selected, it should display the current status of the device and allow this to be changed.
You should hand in the following
You will be asked to demonstrate your system during your tutorial, in addition to handing in the above materials.
The specification given above will gain a Pass grade if done satisfactorily. Higher grades will be given on completion of additional functionality. Each additional function will gain an extra grade. The additional levels will be added to, but at present are
http://192.168.1.10?get_channel
api/src/com/sun/cldc/io/j2me/comm/Protocol.java
in the CLDC package. This will probably not be portable to
other KVMs. A Connection
object to a serial port
can be opened by e.g.
Connector.open("comm:0;baudrate=9600;bitsperchar=7")
The options are separated by semicolons ";" and are of the form
option=value
. The possible options are (with sample
values)
baudrate=2400
bitsperchar=8
stopbits=1
parity=none
autorts=off
autocts=on
blocking=on
Ticker
class. The thermometer can be
implemented using a null-modem connection to another computer
which writes values to the serial port.
This assignment (and the next one) may be done in groups of two. Requests to form a group of three or more will not be accepted, even if your partner disappears the day before the assignment is due, having done no work. While the assignment may be done individually, the same level of achievement of a two-person group will be expected.
The assignment is due at the lecture, Tuesday 26 April, the beginning of week 8.