question regarding servertime method in mDotEvent Class

Home Forums mDot/xDot question regarding servertime method in mDotEvent Class

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #31625
    Ajay K
    Participant

    I was looking at the dot-examples repository in github and particularly RadioEvent.h file. In the file I see the below lines of code related to overriding the ServerTime method and its obvious the code is compiled for FOTA examples.

    #if ACTIVE_EXAMPLE == FOTA_EXAMPLE
        virtual void ServerTime(uint32_t seconds, uint8_t sub_seconds) {
            mDotEvent::ServerTime(seconds, sub_seconds);
    
            Fota::getInstance()->setClockOffset(seconds);
        }
    #endif

    However my question is why do we have to override this method, if in the overridden PacketRx method we are listening to packets arriving on port 202 (APP_PORT_CLOCK_SYNC) and as shown in the PacketRx method, we seem to be passing the packets we receive on that port to to the FOTA Class and I am guessing to synchronize the time with the conduit?

    virtual void PacketRx(uint8_t port, uint8_t *payload, uint16_t size, int16_t rssi, int16_t snr, lora::DownlinkControl ctrl, uint8_t slot, uint8_t retries, uint32_t address, uint32_t fcnt, bool dupRx) {
            mDotEvent::PacketRx(port, payload, size, rssi, snr, ctrl, slot, retries, address, fcnt, dupRx);
    
    #if ACTIVE_EXAMPLE == FOTA_EXAMPLE
            if(port == 200 || port == 201 || port == 202) {
                Fota::getInstance()->processCmd(payload, port, size);
            }
    #endif
        }

    Thanks,
    Ajay

    #31634
    Ajay K
    Participant

    Any thoughts Multitech team?

    #31636
    Jason Reiss
    Keymaster

    The Conduit does not have an application that sends the APP TIME SYNC.

    The handling is there for cases where DEVICE TIME is not available. Then an application can provide the time sync.

    The application on the Dot would also need to send APP TIME requests.

    #31637
    Ajay K
    Participant

    Thanks Jason for taking the time to respond. So bottom line I would need to override both the methods to support FOTA implementation, is that assumption correct?

    Thanks,
    Ajay

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.