--[[ 
====================================================================================
Script to determine if the USB service introduced in v4.0 is running.
====================================================================================
]]--

fDebug("\r\n\Detecting if USB service is running...");
IsUSBSeviceRunning = false;  -- returned to the calling script
local ServiceDisplayName = "DXP01 USB Event Watcher";
local ServiceKeyName = "DXP01USBWatcher";

-- check if the service is running, if it is stop it

local nServiceState = Service.Query(ServiceDisplayName, ServiceKeyName);
if (nServiceState > 1) then -- service is running.Set flag and stop service.
	fDebug("INFO: USB service detected and running. State returned: "..nServiceState);
	IsUSBSeviceRunning = true;
end
