READERNAME CATEGORY Handler.java

From RifidiWiki

Revision as of 02:01, 7 February 2008 by Kyle (Talk | contribs)

Jump to: navigation, search

The Handler method class is made up of handler methods. These are special methods designed to take care of one specific reader level command. For example, when you send a 'get taglist' command to the alien reader, it does the actual work of scanning the radio and getting tags in the taglist command handler. A handler method class usually has more than one command handler in it, and readers normally have more than one handler method class. The handler methods can usually be divided up by the type of the command. For example, in the LLRP reader, the command that deal with ROSpecs are in a different file from the commands dealing with AccessSpecs.

Command Handler Method

public CommandObject commandName(CommandObject arg, AbstractReaderSharedResources asr)

Arguments

  1. arg - The incoming command
  2. asr - abstract shared resources

Return Value

A command object where the first object in the commandObject's return value array is the return value of the funtion

Reference Implementation

This is the commandNotFoundError in the alien reader

	public ArrayList<Object> commandNotFoundError(ArrayList<Object> arg,
			CommandObject obj) {
		String message = "";
		for (Object i : arg) {
			message += i.toString();
		}
		message = "Error 1: Command not understood" + message;
		ArrayList<Object> returnValue = new ArrayList<Object>();
		returnValue.add(message);
                return returnValue;

	}

Personal tools