com.dalsemi.onewire.jib
Class SWInterpreter

java.lang.Object
  |
  +--com.dalsemi.onewire.jib.SWInterpreter

public class SWInterpreter
extends Object

This class is intended to help developers translate from status words returned by a Java Powered iButton into a meaningful message. Normal program execution with the Java Powered iButton is performed using APDU classes and OneWireContainer16, and looks something like this:


       //CommandAPDU capdu already defined
       ResponseAPDU response;        
       response = owc16.sendAPDU(capdu);
       int statusword = response.getSW();
       //use the SWInterpreter class to print a message
       System.out.println(SWInterpreter.interpret(statusword));
 
This class allows you to use the statusword to print a message. If the status word returned was 0x6400, indicating not enough memory, the above code would print the message:

       "SW 0x6400 Insufficient Memory"
 

Version:
0.00, 16 Mar 2001
See Also:
OneWireContainer16

Constructor Summary
SWInterpreter()
           
 
Method Summary
static String interpret(int sw)
          Returns an appropriate message for the status word argument.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SWInterpreter

public SWInterpreter()
Method Detail

interpret

public static String interpret(int sw)
Returns an appropriate message for the status word argument. this adapter object will find. This method knows messages for the following status words: If any other status word is passed to this method, the String "Unrecognized SW" is returned.
Parameters:
status - word returned from the Java Powered iButton
Returns:
message suitable for display