16 package com.sonycsl.echo.eoj.profile;
18 import java.util.HashSet;
19 import java.util.Iterator;
27 import com.sonycsl.echo.eoj.EchoObject.Getter;
28 import com.sonycsl.echo.eoj.EchoObject.Informer;
29 import com.sonycsl.echo.eoj.device.DeviceObject.Setter;
46 super.setupPropertyMaps();
57 Echo.getEventListener().onNewProfileObject(
this);
63 boolean success = super.setProperty(property);
64 if(success)
return success;
66 switch(property.
epc) {
67 default :
return false;
73 byte[] edt = super.getProperty(epc);
74 if(edt != null)
return edt;
86 default :
return null;
92 boolean valid = super.isValidProperty(property);
93 if(valid)
return valid;
95 switch(property.
epc) {
105 default :
return false;
129 private void onReceiveStatusChangeAnnouncementPropertyMap(byte[] edt) {
130 byte[] properties = EchoUtils.propertyMapToProperties(edt);
131 if(properties == null || properties.length == 0)
return;
133 for(byte p : properties) {
138 private void onReceiveSetPropertyMap(byte[] edt) {
139 byte[] properties = EchoUtils.propertyMapToProperties(edt);
140 if(properties == null || properties.length == 0)
return;
142 for(byte p : properties) {
147 private void onReceiveGetPropertyMap(byte[] edt) {
148 byte[] properties = EchoUtils.propertyMapToProperties(edt);
149 if(properties == null || properties.length == 0)
return;
151 for(byte p : properties) {
170 if(edt == null || !(edt.length == 1))
return false;
184 if(edt == null || !(edt.length == 3))
return false;
201 if(edt == null || !(edt.length == 3))
return false;
218 if(edt == null || !(edt.length == 12))
return false;
235 if(edt == null || !(edt.length == 12))
return false;
254 if(edt == null || !(edt.length == 4))
return false;
270 if(edt == null || !(edt.length <= 17))
return false;
285 if(edt == null || !(edt.length <= 17))
return false;
300 if(edt == null || !(edt.length <= 17))
return false;
311 public Setter
set(
boolean responseRequired) {
313 ,
getNode().getAddressStr(), responseRequired);
317 public Getter
get() {
328 protected Informer
inform(
boolean multicast) {
333 address =
getNode().getAddressStr();
339 public static class Receiver
extends EchoObject.Receiver {
342 protected boolean onSetProperty(
EchoObject eoj,
short tid, byte esv,
344 boolean ret = super.onSetProperty(eoj, tid, esv, property, success);
355 protected boolean onGetProperty(
EchoObject eoj,
short tid, byte esv,
357 boolean ret = super.onGetProperty(eoj, tid, esv, property, success);
360 switch(property.epc) {
362 onGetFaultStatus(eoj, tid, esv, property, success);
365 onGetManufacturerCode(eoj, tid, esv, property, success);
368 onGetPlaceOfBusinessCode(eoj, tid, esv, property, success);
371 onGetProductCode(eoj, tid, esv, property, success);
374 onGetSerialNumber(eoj, tid, esv, property, success);
377 onGetDateOfManufacture(eoj, tid, esv, property, success);
380 onGetStatusChangeAnnouncementPropertyMap(eoj, tid, esv, property, success);
383 onGetSetPropertyMap(eoj, tid, esv, property, success);
386 onGetGetPropertyMap(eoj, tid, esv, property, success);
394 protected boolean onInformProperty(
EchoObject eoj,
short tid, byte esv,
395 EchoProperty property) {
396 boolean ret = super.onInformProperty(eoj, tid, esv, property);
414 protected void onGetFaultStatus(
EchoObject eoj,
short tid, byte esv, EchoProperty property,
boolean success) {}
423 protected void onGetManufacturerCode(
EchoObject eoj,
short tid, byte esv, EchoProperty property,
boolean success) {}
432 protected void onGetPlaceOfBusinessCode(
EchoObject eoj,
short tid, byte esv, EchoProperty property,
boolean success) {}
441 protected void onGetProductCode(
EchoObject eoj,
short tid, byte esv, EchoProperty property,
boolean success) {}
450 protected void onGetSerialNumber(
EchoObject eoj,
short tid, byte esv, EchoProperty property,
boolean success) {}
461 protected void onGetDateOfManufacture(
EchoObject eoj,
short tid, byte esv, EchoProperty property,
boolean success) {}
469 protected void onGetStatusChangeAnnouncementPropertyMap(
EchoObject eoj,
short tid, byte esv, EchoProperty property,
boolean success) {
471 byte[] properties = EchoUtils.propertyMapToProperties(property.edt);
472 for(byte p : properties) {
484 protected void onGetSetPropertyMap(
EchoObject eoj,
short tid, byte esv, EchoProperty property,
boolean success) {
494 protected void onGetGetPropertyMap(
EchoObject eoj,
short tid, byte esv, EchoProperty property,
boolean success) {
499 public static class Setter
extends EchoObject.Setter {
501 public Setter(
short dstEchoClassCode, byte dstEchoInstanceCode
502 , String dstEchoAddress,
boolean responseRequired) {
503 super(dstEchoClassCode, dstEchoInstanceCode
504 , dstEchoAddress, responseRequired);
508 public Setter reqSetProperty(byte epc,
510 return (Setter)super.reqSetProperty(epc, edt);
515 public static class Getter
extends EchoObject.Getter {
516 public Getter(
short dstEchoClassCode, byte dstEchoInstanceCode
517 , String dstEchoAddress) {
518 super(dstEchoClassCode, dstEchoInstanceCode
523 public Getter reqGetProperty(byte epc) {
524 return (Getter)super.reqGetProperty(epc);
535 public Getter reqGetFaultStatus() {
547 public Getter reqGetManufacturerCode() {
559 public Getter reqGetPlaceOfBusinessCode() {
571 public Getter reqGetProductCode() {
583 public Getter reqGetSerialNumber() {
597 public Getter reqGetDateOfManufacture() {
608 public Getter reqGetStatusChangeAnnouncementPropertyMap() {
619 public Getter reqGetSetPropertyMap() {
630 public Getter reqGetGetPropertyMap() {
636 public static class Informer
extends EchoObject.Informer {
638 public Informer(
short echoClassCode, byte echoInstanceCode
640 super(echoClassCode, echoInstanceCode
641 , dstEchoAddress, isSelfObject);
645 public Informer reqInformProperty(byte epc) {
646 return (Informer)super.reqInformProperty(epc);
657 public Informer reqInformFaultStatus() {
669 public Informer reqInformManufacturerCode() {
681 public Informer reqInformPlaceOfBusinessCode() {
693 public Informer reqInformProductCode() {
705 public Informer reqInformSerialNumber() {
719 public Informer reqInformDateOfManufacture() {
730 public Informer reqInformStatusChangeAnnouncementPropertyMap() {
741 public Informer reqInformSetPropertyMap() {
752 public Informer reqInformGetPropertyMap() {
static final byte EPC_FAULT_STATUS
final byte[] getGetProperties()
boolean isValidDateOfManufacture(byte[] edt)
byte[] getPlaceOfBusinessCode()
static final byte EPC_SET_PROPERTY_MAP
static final byte EPC_GET_PROPERTY_MAP
boolean isValidGetPropertyMap(byte[] edt)
final byte[] getStatusChangeAnnouncementProperties()
boolean isValidSerialNumber(byte[] edt)
final void addStatusChangeAnnouncementProperty(byte epc)
byte[] getGetPropertyMap()
static final byte EPC_PLACE_OF_BUSINESS_CODE
final void addGetProperty(byte epc)
static final byte EPC_SERIAL_NUMBER
boolean isValidSetPropertyMap(byte[] edt)
abstract byte[] getManufacturerCode()
final void addSetProperty(byte epc)
Informer inform(boolean multicast)
final void clearGetProperties()
synchronized boolean setProperty(EchoProperty property)
synchronized byte[] getProperty(byte epc)
boolean isValidProductCode(byte[] edt)
abstract byte getInstanceCode()
synchronized boolean isValidProperty(EchoProperty property)
boolean isValidStatusChangeAnnouncementPropertyMap(byte[] edt)
byte[] getDateOfManufacture()
static final byte EPC_DATE_OF_MANUFACTURE
static final byte EPC_MANUFACTURER_CODE
byte[] getSetPropertyMap()
byte[] getStatusChangeAnnouncementPropertyMap()
boolean isValidFaultStatus(byte[] edt)
final void clearStatusChangeAnnouncementProperties()
final void clearSetProperties()
final byte[] getSetProperties()
static final byte EPC_STATUS_CHANGE_ANNOUNCEMENT_PROPERTY_MAP
static final String MULTICAST_ADDRESS
Setter set(boolean responseRequired)
boolean isValidPlaceOfBusinessCode(byte[] edt)
boolean isValidManufacturerCode(byte[] edt)
static final byte EPC_PRODUCT_CODE
final boolean isSelfObject()
abstract short getEchoClassCode()