Rememberall
Class Serial

java.lang.Object
  extended by Rememberall.Serial

public class Serial
extends java.lang.Object

Uses the blue cove open source java bluetooth stack wrapper to hide the details of establishing an RFCOMM connection given a previously discovered ServiceRecord.


Constructor Summary
Serial(java.lang.String url)
          Constructs a serial port given an appropriate device url for an SPP service on the Rememberall device.
 
Method Summary
 void close()
          Closes the currently open serial connection.
 void sendSchedule(Slab[] led)
          Sends a schedule consisting of data packets and granularity and length.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Serial

public Serial(java.lang.String url)
       throws java.io.IOException
Constructs a serial port given an appropriate device url for an SPP service on the Rememberall device.

Throws:
java.io.IOException - If the connection or any of its associated stream operations fail. Sockets may be left open -- please call close if you handle this exception.
Method Detail

close

public void close()
           throws java.io.IOException
Closes the currently open serial connection. All buffers are flushed.

Throws:
java.io.IOException

sendSchedule

public void sendSchedule(Slab[] led)
                  throws java.io.IOException
Sends a schedule consisting of data packets and granularity and length. Current format Majick bits granularity0 in 1 second intervals (2 byte) | header number of entried being sent over (2 byte) | color intensity bytes The color intensity format is _________________ |r|g|b|intensity| -7-6-5-4-3-2-1-0- The device must acknowledge receipt with a magic reply of its own or must send request to enable 'DEMON MODE' and then provide diagnostic output.

Parameters:
led0 - The slab (schedule) for the first led
led1 - The slab (schedule) for the second led
Throws:
java.io.IOException - an I/O error occured or the port is not open.
java.lang.IllegalArgumentException - there is a granularity, time span or length mismatch in the slabs provided. Currently the LEDs can only be programmed to the same granularity.