DME: cosmetics
diff --git a/src/com/projectara/araepm/DME.java b/src/com/projectara/araepm/DME.java
index b92cd98..3937324 100644
--- a/src/com/projectara/araepm/DME.java
+++ b/src/com/projectara/araepm/DME.java
@@ -151,7 +151,7 @@
for (byte b: arr) {
builder.append(String.format(" %02x", b));
}
- Log.i(TAG, builder.toString());
+ Log.d(TAG, builder.toString());
}
// api_write_switch_config
@@ -166,24 +166,29 @@
setReq.attrId = attrId;
setReq.selectorIndex = selectorIndex;
setReq.attrVal = attrVal;
+ byte[] raw = setReq.getBytes();
+ logByteArray("writeDMEConfig: setReq, raw:", raw);
Log.d(TAG, "writeDMEConfig: setReq: portID: " + setReq.portId);
Log.d(TAG, "writeDMEConfig: setReq: functionId: " + setReq.functionId);
Log.d(TAG, "writeDMEConfig: setReq: attrId: " + setReq.attrId);
Log.d(TAG, "writeDMEConfig: setReq: selectorIndex: " + setReq.selectorIndex);
- Log.d(TAG, "writeDMEConfig: setReq: attrVal: " + setReq.attrVal);
+ Log.d(TAG, "writeDMEConfig: setReq: attrVal: " + setReq.attrVal +
+ String.format(" (0x%08x)", setReq.attrVal));
- byte[] raw = setReq.getBytes();
- logByteArray("writeDMEConfig: setReq, raw: ", raw);
txn = I2cTransaction.newWrite(raw);
I2cTransaction[] results;
results = i2c.performTransactions(i2cBus, slaveAddress, txn);
txn = I2cTransaction.newRead(SetCnf.MSG_SIZE);
results = i2c.performTransactions(i2cBus, slaveAddress, txn);
- logByteArray("writeDMEConfig: setCnf, raw: ", results[0].data);
SetCnf setCnf = new SetCnf(results[0].data);
+ logByteArray("writeDMEConfig: setCnf, raw:", results[0].data);
+ Log.d(TAG, "writeDMEConfig: setCnf portId: " + setCnf.portId);
+ Log.d(TAG, "writeDMEConfig: setCnf functionId: " + setCnf.functionId);
+ Log.d(TAG, "writeDMEConfig: setCnf resultCode: " + setCnf.resultCode);
+
FunctionId expectedFunctionId =
(peer ? FunctionId.C0_PEERSETCNF : FunctionId.C0_SETCNF);
if (setCnf.resultCode != expectedResultCode) {
@@ -196,9 +201,6 @@
setCnf.functionId);
}
- Log.d(TAG, "writeDMEConfig: setCnf portId: " + setCnf.portId);
- Log.d(TAG, "writeDMEConfig: setCnf functionId: " + setCnf.functionId);
- Log.d(TAG, "writeDMEConfig: setCnf resultCode: " + setCnf.resultCode);
return;
}
@@ -214,14 +216,14 @@
getReq.functionId = peer ? FunctionId.C0_PEERGETREQ : FunctionId.C0_GETREQ;
getReq.attrId = attrId;
getReq.selectorIndex = selectorIndex;
+ byte[] raw = getReq.getBytes();
+ logByteArray("readDMEConfig: getReq, raw:", raw);
Log.d(TAG, "readDMEConfig: getReq: portID: " + getReq.portId);
Log.d(TAG, "readDMEConfig: getReq: functionId: " + getReq.functionId);
Log.d(TAG, "readDMEConfig: getReq: attrId: " + getReq.attrId);
Log.d(TAG, "readDMEConfig: getReq: selectorIndex: " + getReq.selectorIndex);
- byte[] raw = getReq.getBytes();
- logByteArray("readDMEConfig: getReq, raw: ", raw);
txn = I2cTransaction.newWrite(raw);
I2cTransaction[] results;
@@ -229,9 +231,15 @@
txn = I2cTransaction.newRead(GetCnf.MSG_SIZE);
results = i2c.performTransactions(i2cBus, slaveAddress, txn);
- logByteArray("readDMEConfig: getCnf, raw: ", results[0].data);
GetCnf getCnf = new GetCnf(results[0].data);
+ logByteArray("readDMEConfig: getCnf, raw:", results[0].data);
+ Log.d(TAG, "readDMEConfig: getCnf portId: " + getCnf.portId);
+ Log.d(TAG, "readDMEConfig: getCnf functionId: " + getCnf.functionId);
+ Log.d(TAG, "readDMEConfig: getCnf resultCode: " + getCnf.resultCode);
+ Log.d(TAG, "readDMEConfig: getCnf attrVal: " + getCnf.attrVal +
+ String.format(" (0x%08x)", getCnf.attrVal));
+
FunctionId expectedFunctionId =
(peer ? FunctionId.C0_PEERGETCNF : FunctionId.C0_GETCNF);
if (getCnf.resultCode != expectedResultCode) {
@@ -244,10 +252,6 @@
getCnf.functionId);
}
- Log.d(TAG, "readDMEConfig: getCnf portId: " + getCnf.portId);
- Log.d(TAG, "readDMEConfig: getCnf functionId: " + getCnf.functionId);
- Log.d(TAG, "readDMEConfig: getCnf resultCode: " + getCnf.resultCode);
- Log.d(TAG, "readDMEConfig: getCnf attrVal: " + getCnf.attrVal);
return getCnf.attrVal;
}