READERNAME CATEGORY Handler.java
From RifidiWiki
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
- arg - The incoming command
- 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; }