[VOL-1034, VOL-1035, VOL-1037] This commit consists of:
1) Implementation of inter-adapter communication using flows
as proxy message between an ONU and its parent OLT.
2) Update the protos to reflect the inter-adapter message structure
3) Cleanup the ponsim adapters to removed unsued references and
general cleanup.
Change-Id: Ibe913a80a96d601fed946d9b9db55bb8d4f2c15a
diff --git a/rw_core/core/device_manager.go b/rw_core/core/device_manager.go
index 936e945..b2ab478 100644
--- a/rw_core/core/device_manager.go
+++ b/rw_core/core/device_manager.go
@@ -323,7 +323,15 @@
childDevice.ParentId = parentDeviceId
childDevice.ParentPortNo = uint32(parentPortNo)
childDevice.Root = false
- childDevice.ProxyAddress = &voltha.Device_ProxyAddress{ChannelId: uint32(channelId)}
+
+ //Get parent device type
+ parent, err := dMgr.GetDevice(parentDeviceId)
+ if err != nil {
+ log.Error("no-parent-found", log.Fields{"parentId":parentDeviceId})
+ return status.Errorf(codes.NotFound, "%s", parentDeviceId)
+ }
+
+ childDevice.ProxyAddress = &voltha.Device_ProxyAddress{DeviceId: parentDeviceId, DeviceType: parent.Type, ChannelId: uint32(channelId)}
// Create and start a device agent for that device
agent := newDeviceAgent(dMgr.adapterProxy, childDevice, dMgr, dMgr.clusterDataProxy)
@@ -386,7 +394,7 @@
// Get the logical port associated with this device
var lPortId *voltha.LogicalPortId
if lPortId, err = dMgr.logicalDeviceMgr.getLogicalPortId(device); err != nil {
- log.Warnw("getLogical-port-error", log.Fields{"deviceId": device.Id})
+ log.Warnw("getLogical-port-error", log.Fields{"deviceId": device.Id, "error": err})
return err
}
if err = dMgr.logicalDeviceMgr.deleteLogicalPort(nil, lPortId); err != nil {