Add power support to the Polatis SNMP driver
Change-Id: I8f80f66df39120d6cd6319f65d4b7528ab03cf2e
diff --git a/drivers/polatis/snmp/src/main/java/org/onosproject/drivers/polatis/snmp/PolatisSnmpUtility.java b/drivers/polatis/snmp/src/main/java/org/onosproject/drivers/polatis/snmp/PolatisSnmpUtility.java
index 50bc254..4102a07 100644
--- a/drivers/polatis/snmp/src/main/java/org/onosproject/drivers/polatis/snmp/PolatisSnmpUtility.java
+++ b/drivers/polatis/snmp/src/main/java/org/onosproject/drivers/polatis/snmp/PolatisSnmpUtility.java
@@ -28,6 +28,7 @@
import org.snmp4j.smi.GenericAddress;
import org.snmp4j.smi.OctetString;
import org.snmp4j.smi.OID;
+import org.snmp4j.smi.Variable;
import org.snmp4j.smi.VariableBinding;
import org.snmp4j.util.DefaultPDUFactory;
import org.snmp4j.util.TableEvent;
@@ -99,17 +100,17 @@
*
* @param handler parent driver handler
* @param oid object identifier
- * @return the string value
+ * @return the variable
* @throws IOException if unable to retrieve the object value
*/
- public static String getOid(DriverHandler handler, String oid) throws IOException {
+ public static Variable get(DriverHandler handler, String oid) throws IOException {
List<VariableBinding> vbs = new ArrayList<>();
vbs.add(new VariableBinding(new OID(oid)));
PDU pdu = new PDU(PDU.GET, vbs);
Snmp session = getSession(handler);
CommunityTarget target = getTarget(handler);
ResponseEvent event = session.send(pdu, target);
- return event.getResponse().get(0).getVariable().toString();
+ return event.getResponse().get(0).getVariable();
}
/**