This commit cleans up the python directory to ensure the adapters
and the cli runs properly.
Change-Id: Ic68a3ecd1f16a5af44296e3c020c808b185f4c18
diff --git a/rw_core/core/device_agent.go b/rw_core/core/device_agent.go
index e045fc9..92f00bf 100644
--- a/rw_core/core/device_agent.go
+++ b/rw_core/core/device_agent.go
@@ -33,6 +33,7 @@
type DeviceAgent struct {
deviceId string
+ deviceType string
lastData *voltha.Device
adapterProxy *AdapterProxy
deviceMgr *DeviceManager
@@ -60,6 +61,7 @@
cloned.Vlan = device.ProxyAddress.ChannelId
}
agent.deviceId = cloned.Id
+ agent.deviceType = cloned.Type
agent.lastData = cloned
agent.deviceMgr = deviceMgr
agent.exitChannel = make(chan int, 1)
@@ -368,6 +370,16 @@
}
}
+func (agent *DeviceAgent) packetOut(outPort uint32, packet *ofp.OfpPacketOut) error {
+ // Send packet to adapter
+ if err := agent.adapterProxy.packetOut(agent.deviceType, agent.deviceId, outPort, packet); err != nil {
+ log.Debugw("packet-out-error", log.Fields{"id": agent.lastData.Id, "error": err})
+ return err
+ }
+ return nil
+}
+
+
// TODO: implement when callback from the data model is ready
// processUpdate is a callback invoked whenever there is a change on the device manages by this device agent
func (agent *DeviceAgent) processUpdate(args ...interface{}) interface{} {