Camera is null after enabled from Management.

Hi, i write a server-client component.

This component do the export video task for a stand alone application.

My problem is that if the service starts and the cameras are enabled all is well, as soon as the camera is disabled, as it is right that happens, the camera is null. If the camera is enabled by the Management, the camera is still null until the service is restarted with the consequent login to the server.

/// Login to the server code

VideoOS.Platform.SDK.Environment.Initialize();

VideoOS.Platform.SDK.Export.Environment.Initialize();

String server = (string)appSettings[“MilestoneEventReciver.Url”], username = (string)appSettings[“MilestoneEventReciver.User”], password = (string)appSettings[“MilestoneEventReciver.Password”];

    String authorization = (string)appSettings\["MilestoneEventReciver.AutType"\];

    Uri uri = new Uri(server);

    CredentialCache \_credentialCache = VideoOS.Platform.Login.Util.BuildCredentialCache(uri, username, password, authorization);

    Item siteItem = VideoOS.Platform.SDK.Environment.LoadSiteItem(uri, \_credentialCache);

    VideoOS.Platform.SDK.Environment.AddServer(uri, \_credentialCache);

    try

    {

      Logger.log("Attempt to LOGIN ...");

      VideoOS.Platform.SDK.Environment.Login(uri);

      Logger.log("LOGIN OK.");

    }

    catch (ServerNotFoundMIPException snfe)

    {

      Logger.log("Server non trovato: " + snfe.Message);

      VideoOS.Platform.SDK.Environment.RemoveServer(uri);

      return;

    }

    catch (InvalidCredentialsMIPException ice)

    {

      Logger.log("Credenziali non valide: " + ice.Message);

      VideoOS.Platform.SDK.Environment.RemoveServer(uri);

      return;

    }

    catch (Exception)

    {

      Logger.log("Internal error connecting to: " + uri.DnsSafeHost);

      VideoOS.Platform.SDK.Environment.RemoveServer(uri);

      return;

    }

//// Code to get the camera

Item camera = Configuration.Instance.GetItem(new Guid(Uuid), Kind.Camera);

This line of code returns null, if the camera is disabled or has been re-enabled after being disabled.

Any suggestions?

thanks

When a camera is disabled it is removed from the configuration the clients get. In c-code XProtect you can get disabled devices separately, explore the ConfigAccessViaSDK sample to see this.

http://doc.developer.milestonesys.com/html/index.html?base=samples/configaccess_sample.html&tree=tree_2.html

In e-code XProtect there is no way to ask for a disabled camera, deleted or disabled has the same effect.

If you want to update the configuration after login explore the ConfigUpdated sample.

http://doc.developer.milestonesys.com/html/index.html?base=samples/configupdate.html&tree=tree_2.html