/* Copyright 2009 Palm, Inc.  All rights reserved. */

var PowerdCommands = {
	requestHandler : null,
	
	getBatteryPowerLevel: function(callback){
		// Subscribe to Battery Power Notifications
		this.requestHandler = new Mojo.Service.Request('palm://com.palm.bus/signal/', {
			method: 'addmatch',
			parameters: {"category":"/com/palm/power","method":"batteryStatus"},
			onSuccess: callback,
		});
		
		// Get the Initial Value for Battery Power and charger (returned as signals)
		new Mojo.Service.Request('palm://com.palm.power/com/palm/power/', {
			method: 'batteryStatusQuery',});
	},
	
	powerSubscriptionCancel: function() {
		this.requestHandler.cancel();
	}
};
