package com.device.comm.mylibrary.NativeDevice.cgmadi.bean;


import com.device.comm.mylibrary.NativeDevice.cgmadi.enums.OBJCode;
import com.device.comm.mylibrary.NativeDevice.cgmadi.enums.OPCode;
import com.device.comm.mylibrary.NativeDevice.cgmadi.util.DataFormatUtil;
import com.device.comm.mylibrary.NativeDevice.cgmadi.enums.Data;

import java.io.Serializable;

public class ResponseBean
  implements Serializable
{
  private static final long serialVersionUID = 1L;
  protected byte[] event;
  protected OPCode opCode;
  protected OBJCode objCode;
  protected byte[] data;
  protected int requestCode;
  
  public ResponseBean() {}
  
  public byte[] getEvent()
  {
    return this.event;
  }
  
  public void setEvent(byte[] event)
  {
    this.event = event;
  }
  
  public OPCode getOpCode()
  {
    return this.opCode;
  }
  
  public void setOpCode(OPCode opCode)
  {
    this.opCode = opCode;
  }
  
  public OBJCode getObjCode()
  {
    return this.objCode;
  }
  
  public void setObjCode(OBJCode objCode)
  {
    this.objCode = objCode;
  }
  
  public byte[] getData()
  {
    return this.data;
  }
  
  public void setData(byte[] data)
  {
    this.data = data;
  }
  
  public int getRequestCode()
  {
    return this.requestCode;
  }
  
  public void setRequestCode(int requestCode)
  {
    this.requestCode = requestCode;
  }
  
  public void setRequestCode()
  {
    if ((getOpCode() == OPCode.SET) && (getObjCode() == OBJCode.MONITOR) && 
      (getData()[0] == Data.START.getValue().byteValue())) {
      setRequestCode(1);
    } else if ((getOpCode() == OPCode.SET) && (getObjCode() == OBJCode.MONITOR) && 
      (getData()[0] == Data.STOP.getValue().byteValue())) {
      setRequestCode(2);
    } else if ((getOpCode() == OPCode.GET) && (getObjCode() == OBJCode.AC)) {
      setRequestCode(3);
    } else if ((getOpCode() == OPCode.GET) && (getObjCode() == OBJCode.AD)) {
      setRequestCode(4);
    } else if ((getOpCode() == OPCode.GET) && (getObjCode() == OBJCode.NAME)) {
      setRequestCode(5);
    } else if ((getOpCode() == OPCode.GET) && (getObjCode() == OBJCode.MAXNUM)) {
      setRequestCode(6);
    } else if ((getOpCode() == OPCode.SET) && (getObjCode() == OBJCode.CON_DIS)) {
      setRequestCode(7);
    } else if ((getOpCode() == OPCode.GET) && (getObjCode() == OBJCode.SN)) {
      setRequestCode(8);
    } else if ((getOpCode() == OPCode.GET) && (getObjCode() == OBJCode.VERSION)) {
      setRequestCode(9);
    } else if ((getOpCode() == OPCode.GET) && (getObjCode() == OBJCode.AUTHO)) {
      setRequestCode(10);
    } else if ((getOpCode() == OPCode.GET) && (getObjCode() == OBJCode.RECORD)) {
      setRequestCode(11);
    }
  }
  
  public String toString()
  {
    return 
    
      "ResponseBean [event=" + DataFormatUtil.bytes2HexString(this.event) + ", opCode=" + DataFormatUtil.bytes2HexString(new byte[] { this.opCode.getValue().byteValue() }) + ", objCode=" + DataFormatUtil.bytes2HexString(new byte[] { this.objCode.getValue().byteValue() }) + ", data=" + DataFormatUtil.bytes2HexString(this.data) + "]";
  }
}


/* Location:              /Users/lvwang2002/Desktop/CodeSource/work/DY_GLUCOSE/thapi_test/libs/cgmthapi.jar!/com/sanme/cgmadi/bluetooth4/bean/ResponseBean.class
 * Java compiler version: 6 (50.0)
 * JD-Core Version:       0.7.1
 */