summaryrefslogtreecommitdiff
path: root/include/mts/MTS_IO_ME910C1WWRadio.h
blob: 96058626cd5e765ef2ec400328722afdb356ba70 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
/*
 * Copyright (C) 2019 by Multi-Tech Systems
 *
 * This file is part of libmts-io.
 *
 * libmts-io is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 2 of the License, or
 * (at your option) any later version.
 *
 * libmts-io is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with libmts-io.  If not, see <http://www.gnu.org/licenses/>.
 *
 */

#ifndef MTS_IO_ME910C1WWRADIO_H_
#define MTS_IO_ME910C1WWRADIO_H_

#include <mts/MTS_IO_ME910Radio.h>

namespace MTS {
    namespace IO {

        class ME910C1WWRadio : public ME910Radio {

            public:
                static const std::string MODEL_NAME;

                ME910C1WWRadio(const std::string& sPort);
                virtual ~ME910C1WWRadio(){};
                ICellularRadio::CODE setActiveFirmware(const Json::Value& jArgs);
                ICellularRadio::CODE getActiveFirmware(std::string& sFwId);

                virtual CODE updateFumo(const Json::Value& jArgs, UpdateCb& stepCb);

            protected:

                CODE doGetFirmwareNumbers(std::string &sFirmware, std::string &sFirmwareBuild);

            private:
                static const std::string KEY_FUMO_PDPID;     //!< PDP context id (default 3)
                static const std::string KEY_FUMO_PDPTYPE;   //!< PDP context type (default IPV4V6)
                static const std::string KEY_FUMO_APN;       //!< APN (default empty)
                static const std::string KEY_FUMO_ADDRESS;   //!< FTP server address
                static const std::string KEY_FUMO_DIR;       //!< Directory
                static const std::string KEY_FUMO_FILE;      //!< Name of the upgrade file
                static const std::string KEY_FUMO_USER;      //!< Username
                static const std::string KEY_FUMO_PASSWORD;  //!< Password
                static const std::string KEY_FUMO_DRYRUN;    //!< If set, do not apply the downloaded firmware

                CODE doFumoPerform(const Json::Value &jConfig, UpdateCb& stepCb);
                CODE doFumoReadConfig(const Json::Value& jArgs, Json::Value &jConfig);
                CODE doFumoSetup(const Json::Value &jConfig, UpdateCb& stepCb);
                CODE doFumoFtp(const Json::Value &jConfig, UpdateCb& stepCb);
                CODE doFumoCleanup(const Json::Value &jConfig, UpdateCb& stepCb);
                CODE doFumoApplyFirmware(const Json::Value &jConfig, UpdateCb& stepCb);
                CODE doFumoWaitNewFirmware(const Json::Value &jConfig, UpdateCb& stepCb);

                std::string m_sFw;
                std::string m_sFwBuild;
        };
    }
}

#endif /* MTS_IO_ME910C1WWRADIO_H_ */