func (c *ClientImpl) SetClient(clientAPI restclient.Clienter) {
	c.clientAPI = clientAPI
}
SetClient sets the client API
package mnedcmgr
import (
	"github.com/lf-edge/edge-home-orchestration-go/internal/restinterface/tls"
	"io/ioutil"
	"time"
	restclient "github.com/lf-edge/edge-home-orchestration-go/internal/restinterface/client"
	"github.com/lf-edge/edge-home-orchestration-go/internal/controller/discoverymgr/mnedc/client"
)
type ClientImpl struct {
	clientAPI restclient.Clienter
	tls.HasCertificate
}
var (
	clientIns      *ClientImpl
	mnedcClientIns client.MNEDCClient
)
func init() {
	clientIns = new(ClientImpl)
	mnedcClientIns = client.GetInstance()
}
func GetClientInstance() *ClientImpl {
	return clientIns
}
func (c *ClientImpl) StartMNEDCClient(deviceIDPath string, configPath string) {
	deviceID, err := getDeviceID(deviceIDPath)
	if err != nil {
		log.Println(logPrefix, "Couldn't start MNEDC client", err.Error())
		return
	}
	mnedcClientIns.SetClient(c.clientAPI)
	err = c.RegisterToMNEDCServer(deviceID, configPath)
	if err != nil {
		log.Println(logPrefix, "Couldn't start MNEDC client", err.Error())
		return
	}
	for attempts := 0; attempts <= maxAttempts; attempts++ {
		err := mnedcClientIns.NotifyBroadcastServer(configPath)
		if err != nil {
			log.Println(logPrefix, "Registering to Broadcast server Error", err.Error(), ", retrying")
			time.Sleep(2 * time.Second)
			continue
		}
		return
	}
}
func (c *ClientImpl) RegisterToMNEDCServer(deviceID string, configPath string) error {
	_, err := mnedcClientIns.CreateClient(deviceID, configPath, clientIns.IsSetCert)
	if err != nil {
		return err
	}
	mnedcClientIns.Run()
	return nil
}