func (d DiscoveryImpl) DeleteDeviceWithID(ID string) {
	deviceID, err := dbIns.GetDeviceID()
	if err != nil {
		log.Println(err.Error())
		return
	}
	if deviceID != ID {
		deleteDevice(ID)
	}
}
DeleteDeviceWithID delete device using deviceID
package discoverymgr
import (
	"gopkg.in/yaml.v2"
	"io/ioutil"
	"net"
	"os"
	"reflect"
	"strings"
	"sync"
	"time"
	errors "github.com/lf-edge/edge-home-orchestration-go/internal/common/errors"
	"github.com/lf-edge/edge-home-orchestration-go/internal/common/logmgr"
	networkhelper "github.com/lf-edge/edge-home-orchestration-go/internal/common/networkhelper"
	mnedc "github.com/lf-edge/edge-home-orchestration-go/internal/controller/discoverymgr/mnedc"
	wrapper "github.com/lf-edge/edge-home-orchestration-go/internal/controller/discoverymgr/wrapper"
	"github.com/lf-edge/edge-home-orchestration-go/internal/controller/storagemgr"
	configurationdb "github.com/lf-edge/edge-home-orchestration-go/internal/db/bolt/configuration"
	networkdb "github.com/lf-edge/edge-home-orchestration-go/internal/db/bolt/network"
	servicedb "github.com/lf-edge/edge-home-orchestration-go/internal/db/bolt/service"
	systemdb "github.com/lf-edge/edge-home-orchestration-go/internal/db/bolt/system"
	dbhelper "github.com/lf-edge/edge-home-orchestration-go/internal/db/helper"
	"github.com/lf-edge/edge-home-orchestration-go/internal/restinterface/cipher"
	"github.com/lf-edge/edge-home-orchestration-go/internal/restinterface/client"
	uuid "github.com/satori/go.uuid"
)
type Discovery interface {
	StartDiscovery(UUIDpath string, platform string, executionType string) error
	StopDiscovery()
	DeleteDeviceWithIP(targetIP string)
	DeleteDeviceWithID(ID string)
	AddNewServiceName(serviceName string) error
	RemoveServiceName(serviceName string) error
	ResetServiceName()
	AddDeviceInfo(deviceID string, virtualAddr string, privateAddr string)
	GetOrchestrationInfo() (platform string, executionType string, serviceList []string, err error)
	SetRestResource()
	MNEDCClosedCallback()
	NotifyMNEDCBroadcastServer() error
	MNEDCReconciledCallback()
	StartMNEDCClient(string, string)
	StartMNEDCServer(string)
	client.Setter
	cipher.Setter
}
type DiscoveryImpl struct {
	client.HasClient
	cipher.HasCipher
}
var (
	discoveryIns *DiscoveryImpl
	dbIns        dbhelper.MultipleBucketQuery
	networkIns   networkhelper.Network
	storageIns   storagemgr.Storage
	mutexLock    sync.Mutex
	log          = logmgr.GetInstance()
)
func init() {
	discoveryIns = &DiscoveryImpl{}
	wrapperIns = wrapper.GetZeroconfImpl()
	shutdownChan = make(chan struct{})
	dbIns = dbhelper.GetInstance()
	networkIns = networkhelper.GetInstance()
	storageIns = storagemgr.GetInstance()
	sysQuery = systemdb.Query{}
	confQuery = configurationdb.Query{}
	netQuery = networkdb.Query{}
	serviceQuery = servicedb.Query{}
}
func GetInstance() Discovery {
	return discoveryIns
}
func (d *DiscoveryImpl) SetRestResource() {
	d.SetClient(d.Clienter)
}
func (DiscoveryImpl) StartDiscovery(UUIDpath string, platform string, executionType string) (err error) {
	mutexLock.Lock()
	clearAllDeviceInfo()
	mutexLock.Unlock()
	networkIns.StartNetwork()
	UUIDStr, err := setDeviceID(UUIDpath)
	if err != nil {
		log.Print(logPrefix, "[StartDiscovery]", "UUID ", UUIDStr, " is Temporary")
	}
	startServer(UUIDStr, platform, executionType)
	go detectNetworkChgRoutine()
	go func() {
		for {
			time.Sleep(time.Minute)
			activeDiscovery()
		}
	}()
	return
}
func (DiscoveryImpl) StopDiscovery() {
	err := serverPresenceChecker()
	if err != nil {
		log.Println(logPrefix, "[StopDiscovery]", err)
		return
	}
	shutdownDiscoverymgr()
	wrapperIns.Shutdown()
}
func (DiscoveryImpl) DeleteDeviceWithIP(targetIP string) {
}