VOL-3248 Support for SetExtValue API

         This commits adds a new SetExtValue API in the VOLTHA
         core and also the handling of the request.

Change-Id: I45b76e4bcc3234842c8404514f5220573ac33211
diff --git a/rw_core/core/device/agent.go b/rw_core/core/device/agent.go
index 03cc3b8..053d9f3 100755
--- a/rw_core/core/device/agent.go
+++ b/rw_core/core/device/agent.go
@@ -26,6 +26,7 @@
 	"time"
 
 	"github.com/golang/protobuf/ptypes"
+	"github.com/golang/protobuf/ptypes/empty"
 	"github.com/opencord/voltha-go/rw_core/core/adapter"
 	"github.com/opencord/voltha-go/rw_core/core/device/flow"
 	"github.com/opencord/voltha-go/rw_core/core/device/group"
@@ -792,3 +793,30 @@
 	logger.Debugw(ctx, "getExtValue-Success-device-agent", log.Fields{"Resp": Resp})
 	return Resp, nil
 }
+
+func (agent *Agent) setExtValue(ctx context.Context, device *voltha.Device, value *voltha.ValueSet) (*empty.Empty, error) {
+	logger.Debugw(ctx, "setExtValue", log.Fields{"device-id": value.Id})
+	if err := agent.requestQueue.WaitForGreenLight(ctx); err != nil {
+		return nil, err
+	}
+
+	//send request to adapter
+	ch, err := agent.adapterProxy.SetExtValue(ctx, device, value)
+	agent.requestQueue.RequestComplete()
+	if err != nil {
+		return nil, err
+	}
+
+	// Wait for the adapter response
+	rpcResponse, ok := <-ch
+	if !ok {
+		return nil, status.Errorf(codes.Aborted, "channel-closed-device-id-%s", agent.deviceID)
+	}
+	if rpcResponse.Err != nil {
+		return nil, rpcResponse.Err
+	}
+
+	// Unmarshal and return the response
+	logger.Debug(ctx, "setExtValue-Success-device-agent")
+	return &empty.Empty{}, nil
+}