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 4 replies, has 4 voices, and was last updated by Profile photo of Rui Rui 1 week ago.

Viewing 5 posts - 1 through 5 (of 5 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

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

You must be logged in to reply to this topic.