[Tinyos-contrib-commits] CVS: tinyos-1.x/contrib/rincon/tools/java/com/rincon/blackbook/bboot BBootEvents.class, NONE, 1.1 BBoot.java, NONE, 1.1 BBoot.class, NONE, 1.1 BBootEvents.java, NONE, 1.1

dmm rincon at users.sourceforge.net
Thu Apr 20 16:02:54 PDT 2006


Update of /cvsroot/tinyos/tinyos-1.x/contrib/rincon/tools/java/com/rincon/blackbook/bboot
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15414/contrib/rincon/tools/java/com/rincon/blackbook/bboot

Added Files:
	BBootEvents.class BBoot.java BBoot.class BBootEvents.java 
Log Message:
Fixed the java/com directory, and added in two more packages:  Blackbook, and EavesLogger.

--- NEW FILE: BBootEvents.class ---
Êþº¾
SourceFile
--- NEW FILE: BBoot.java ---
package com.rincon.blackbook.bboot;

/*
 * Copyright (c) 2004-2006 Rincon Research Corporation.  
 * All rights reserved.
 * 
 * Rincon Research will permit distribution and use by others subject to
 * the restrictions of a licensing agreement which contains (among other things)
 * the following restrictions:
 * 
 *  1. No credit will be taken for the Work of others.
 *  2. It will not be resold for a price in excess of reproduction and 
 *      distribution costs.
 *  3. Others are not restricted from copying it or using it except as 
 *      set forward in the licensing agreement.
 *  4. Commented source code of any modifications or additions will be 
 *      made available to Rincon Research on the same terms.
 *  5. This notice will remain intact and displayed prominently.
 * 
 * Copies of the complete licensing agreement may be obtained by contacting 
 * Rincon Research, 101 N. Wilmot, Suite 101, Tucson, AZ 85711.
 * 
 * There is no warranty with this product, either expressed or implied.  
 * Use at your own risk.  Rincon Research is not liable or responsible for 
 * damage or loss incurred or resulting from the use or misuse of this software.
 */

import java.io.IOException;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

import com.rincon.blackbook.Commands;
import com.rincon.blackbook.messages.BlackbookConnectMsg;

import net.tinyos.message.Message;
import net.tinyos.message.MessageListener;
import net.tinyos.message.MoteIF;
import net.tinyos.util.Messenger;

public class BBoot implements MessageListener {

	/** Communication with the mote */
	private MoteIF comm = new MoteIF((Messenger) null);
		
	/** List of FileTransferEvents listeners */
	private static List listeners = new ArrayList();
	
	
	/**
	 * Constructor
	 *
	 */
	public BBoot() {
		comm.registerListener(new BlackbookConnectMsg(), this);
	}

	/**
	 * Add a FileTransferEvents listener
	 * @param listener
	 */
	public void addListener(BBootEvents listener) {
		if(!listeners.contains(listener)) {
			listeners.add(listener);
		}
	}
	
	/**
	 * Remove a FileTransferEvents listener
	 * @param listener
	 */
	public void removeListener(BBootEvents listener) {
		listeners.remove(listener);
	}

	public void messageReceived(int to, Message m) {
		BlackbookConnectMsg inMsg = (BlackbookConnectMsg) m;
		
		switch(inMsg.get_cmd()) {
		case Commands.REPLY_BOOT:
			for(Iterator it = listeners.iterator(); it.hasNext(); ) {
				((BBootEvents) it.next()).booted((int) inMsg.get_length(), inMsg.get_data()[0], inMsg.get_result() == Commands.SUCCESS);
			}
		}
	}
	
}

--- NEW FILE: BBoot.class ---
Êþº¾

	





get_length


get_result

SourceFile
BBoot.java






--- NEW FILE: BBootEvents.java ---
package com.rincon.blackbook.bboot;

/*
 * Copyright (c) 2004-2006 Rincon Research Corporation.  
 * All rights reserved.
 * 
 * Rincon Research will permit distribution and use by others subject to
 * the restrictions of a licensing agreement which contains (among other things)
 * the following restrictions:
 * 
 *  1. No credit will be taken for the Work of others.
 *  2. It will not be resold for a price in excess of reproduction and 
 *      distribution costs.
 *  3. Others are not restricted from copying it or using it except as 
 *      set forward in the licensing agreement.
 *  4. Commented source code of any modifications or additions will be 
 *      made available to Rincon Research on the same terms.
 *  5. This notice will remain intact and displayed prominently.
 * 
 * Copies of the complete licensing agreement may be obtained by contacting 
 * Rincon Research, 101 N. Wilmot, Suite 101, Tucson, AZ 85711.
 * 
 * There is no warranty with this product, either expressed or implied.  
 * Use at your own risk.  Rincon Research is not liable or responsible for 
 * damage or loss incurred or resulting from the use or misuse of this software.
 */

public interface BBootEvents {


	/**
	 * The file system finished booting
	 * @param totalNodes - the total number of nodes found on flash
	 * @param result - SUCCESS if the file system is ready for use.
	 */
	public void booted(int totalNodes, short totalFiles, boolean result);

	
}



More information about the Tinyos-contrib-commits mailing list