Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return from Standby mode #125

Open
mdisg opened this issue Sep 1, 2021 · 3 comments
Open

Return from Standby mode #125

mdisg opened this issue Sep 1, 2021 · 3 comments

Comments

@mdisg
Copy link

mdisg commented Sep 1, 2021

Recently I have played around with the standby mode using the C# Wrapper Class Authenticator.
After activating the standby mode enabling the camera preview via Preview.Start returns true but no preview image is received. The callback will not be called in that case. I then tried to do an authentication right after the reconnect and after that the preview works so I think the camera is still in standby mode even after the reconnect to the device. The start result for the preview should be false in that case in my opinion. Could you also please add a way/method to wakeup the unit without starting a dummy authentication e.g. by adding a Method e.g. WakeUp()?

My initial approach was:

  • Call Connect() on my Authenticator instance.
  • Call Standby() and Disconnect()
  • Wait few seconds
  • Call Connect() again on the same authenticator instance.
  • Wait few seconds
  • Call Start() on a newly created Preview instance.

The code:

var serialConfig = new SerialConfig { port = "COM2" };
var authenticator = new Authenticator();
if (authenticator.Connect(serialConfig) == Status.Ok)
{
    authenticator.Standby();
    authenticator.Disconnect();
    Thread.Sleep(3000);
    if (authenticator.Connect(serialConfig) == Status.Ok)
    {
        Thread.Sleep(3000);
        var preview = new Preview(new PreviewConfig
                                      {
                                          cameraNumber = 0,
                                          previewMode = PreviewMode.MJPEG_720P,
                                          portraitMode = true
                                      });
        if (!preview.Start(PreviewImageReceived))
        {
            Console.WriteLine("Start preview failed");
        }
    }
}

The following code with call to authenticator.Authenticate(new AuthArgs()); works:

var serialConfig = new SerialConfig { port = "COM2" };
var authenticator = new Authenticator();
if (authenticator.Connect(serialConfig) == Status.Ok)
{
    authenticator.Standby();
    authenticator.Disconnect();
    Thread.Sleep(3000);
    if (authenticator.Connect(serialConfig) == Status.Ok)
    {
        Thread.Sleep(3000);
        authenticator.Authenticate(new AuthArgs());
        var preview = new Preview(new PreviewConfig
                                      {
                                          cameraNumber = 0,
                                          previewMode = PreviewMode.MJPEG_720P,
                                          portraitMode = true
                                      });
        if (!preview.Start(PreviewImageReceived))
        {
            Console.WriteLine("Start preview failed");
        }
    }
}
@RealSenseSupport
Copy link

Have you try cameraNumber with different value? I guess you can use cameraNumber = -1

@mdisg
Copy link
Author

mdisg commented Sep 10, 2021

@RealSenseSupport no I did not because there is no documentation or information about that behavior.

@RealSenseSupport
Copy link

Please keep the object "preview" live. the preview will be stop outside of the inner scope.
This is my sample.
https://gist.github.com/mengyui/84b0b47c1909c9fc4e6815d9e62fe987

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants