Class CarConnection

java.lang.Object
  extended byCarConnection

public class CarConnection
extends java.lang.Object

Copyright (c) 2003 Sony Ericsson Mobile Communications AB
All Rights Reserved.

CarConnection is the interface between the car and the MIDlet. All car commands is stored in this class. This object will retrieve user commands and send them to the car. It will also set the car status, such as when the car is not connected, charging or ready to run.

Version:
2.1
Author:
Christopher Wong, Åke Rydgren

Constructor Summary
CarConnection(CarAPI carAPI)
          The constructor for creating a CarConnection object, which sends command to the car and listen for data from the car.
 
Method Summary
 boolean processEvents(java.io.InputStream is, java.io.OutputStream os)
          Processes all messages from the car (AT-commands) and all user events from the GUI (via the CarAPI).
 void quitCarLink(java.io.OutputStream os)
          Tell the car that we want to quit by sending the NO keypress.
 void resetCarData()
          Resets the internal car data to the state it's supposed to be in when it first connects to the phone.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CarConnection

public CarConnection(CarAPI carAPI)
The constructor for creating a CarConnection object, which sends command to the car and listen for data from the car. CarAPI is needed to be able to retrieve user input.

Parameters:
carAPI - the CarAPI object needed to retrieve user input
Method Detail

resetCarData

public void resetCarData()
Resets the internal car data to the state it's supposed to be in when it first connects to the phone.


quitCarLink

public void quitCarLink(java.io.OutputStream os)
Tell the car that we want to quit by sending the NO keypress.


processEvents

public boolean processEvents(java.io.InputStream is,
                             java.io.OutputStream os)
Processes all messages from the car (AT-commands) and all user events from the GUI (via the CarAPI).

Parameters:
is - The InputStream from the car connection
os - The OutputStream to the car connection