FLIR One Developer / Blog / Topics / FLIRBattery, percentageChanged / "percentageChanged" is not called

"percentageChanged" is not called

Home Forums FLIR Mobile SDK Development iOS Development "percentageChanged" is not called

This topic contains 11 replies, has 5 voices, and was last updated by Profile photo of Naoko Naoko 3 weeks ago.

Viewing 12 posts - 1 through 12 (of 12 total)

  • Author

    Posts

  • #11396

    Profile photo of Naoko
    Naoko

    Participant

    Hello,

    I want to monitor the battery and display it in real time.
    So I took the following actions.
    ・Implement FLIRRemoteDelegate in Controller
    ・Execute subscribePercentage of FLIRBattery
    ・Implement “percentageChanged”

    “percentageChanged” is not called even though the console shows a change like “Battery percentage changed: 22”.
    How do I get “percentageChanged” to be called?

    Best regards,

    #11412

    Profile photo of Gavin
    Gavin

    Keymaster

    Hello OeNaoko,

    Could you please report this issue here in as much detail as possible so our team can look at it further.

    Thanks so much,
    Gavin
    FLIR Community Support

    #11442

    Profile photo of Naoko
    Naoko

    Participant

    Hi Gavin,

    Thank you for your reply.

    It may be a thread problem.
    It works by checking the battery level every 5 seconds.
    For now, let’s proceed with this.

    Regards,
    Naoko

    #11499

    Profile photo of Jordan
    Jordan

    Participant

    We have this same problem. I notice that it’s just printing the change percentage rather than invoking my overridden method. I reported this a while ago, and it was said to have been fixed in V1.1. Here’s the gist of what I’m doing:

    class ThermalImageView : UIImageView, FLIRDiscoveryEventDelegate, FLIRDataReceivedDelegate, FLIRRemoteDelegate {

    func methodWhereItConnects()
    // camera is connected at this point
    self?.camera.getRemoteControl()?.delegate = self;
    self?.camera.getRemoteControl()?.getBattery()?.subscribePercentage();
    }

    // method that doesn’t get called
    func percentageChanged(_ percent: Int32) {
    print(“HERE”)
    }
    }

    What’s the proper way to subscribe to the percentage? From my understanding, you cannot grab the remote control and subscribe until the camera is connected, but my current approach is not working. A similar approach works perfectly fine with Android.

    #11627

    Profile photo of Rui
    Rui

    Participant

    I have the same issue, percentage change is logged but the method is’t called.

    Thank you,
    Rui

    #11746

    Profile photo of Gavin
    Gavin

    Keymaster

    Hi Rui,

    This has been re escalated to our technical support team.

    Thanks so much,
    Gavin
    FLIR Community Support

    #11826

    Profile photo of Gavin
    Gavin

    Keymaster

    We have been unable to replicate this issue in 1.1.1. If you want me to share our code with you I can hopefully make that available.

    Gavin
    FLIR Community Support

    #11931

    Profile photo of Jeff
    Jeff

    Participant

    I’m seeing the same issue in 1.1.1. I’m unable to use the FLIRRemoteDelegate to subscribe to any notifications. It seems like instead of invoking the delegate methods it just logs info to the debug console:

    Battery percentage changed: 22
    Finished calibrating
    Started calibrating
    Battery percentage changed: 21
    Finished calibrating
    Battery percentage changed: 21
    Battery percentage changed: 21
    Battery percentage changed: 21
    Battery percentage changed: 20
    Started calibrating
    Finished calibrating
    Battery percentage changed: 19
    Battery percentage changed: 19
    Battery percentage changed: 19
    Battery percentage changed: 19
    Battery percentage changed: 18
    Started calibrating
    Finished calibrating
    Battery percentage changed: 17

    I’m doing something like this:

    remoteControl and calibration are instance variables since the getXXX methods seem to return a new instance each time.

    remoteControl = flirCamera.getRemoteControl()
    remoteControl?.delegate = self
    calibration = remoteControl?.getCalibration()
    calibration?.subscribeCalibrationState()

    The same issue happens with battery and percentage changed. How do I get notifications about these states and have the delegate methods actually get called? Thanks.

    #11944

    Profile photo of Gavin
    Gavin

    Keymaster

    Hi Jeff,

    I’m checking in with our technical support staff and will try to get back to you by tomorrow.

    Thanks,
    Gavin
    FLIR Community Support

    #11945

    Profile photo of Gavin
    Gavin

    Keymaster

    Hi Jeff,

    I’m checking in with our technical support staff and will try to get back to you by tomorrow.

    Thanks,
    Gavin
    FLIR Community Support

    #13378

    Profile photo of Jordan
    Jordan

    Participant

    Any updates on this?

    #15083

    Profile photo of Naoko
    Naoko

    Participant

    Hi,

    I checked version 1.3.0 but didn’t call “percentageChanged”.
    Will it be fixed?

    Regards,
    Naoko

Viewing 12 posts - 1 through 12 (of 12 total)

You must be logged in to reply to this topic.