Subversion Repositories tpanel

Rev

Rev 326 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 326 Rev 406
Line 1... Line 1...
1
/*
1
/*
2
 * Copyright (C) 2018 to 2022 by Andreas Theofilu <andreas@theosys.at>
2
 * Copyright (C) 2018 to 2023 by Andreas Theofilu <andreas@theosys.at>
3
 *
3
 *
4
 * This program is free software; you can redistribute it and/or modify
4
 * This program is free software; you can redistribute it and/or modify
5
 * it under the terms of the GNU General Public License as published by
5
 * it under the terms of the GNU General Public License as published by
6
 * the Free Software Foundation; either version 3 of the License, or
6
 * the Free Software Foundation; either version 3 of the License, or
7
 * (at your option) any later version.
7
 * (at your option) any later version.
Line 43... Line 43...
43
{
43
{
44
#define MAX_CHUNK   0x07d0  // Maximum size a part of a file can have. The file will be splitted into this size of chunks.
44
#define MAX_CHUNK   0x07d0  // Maximum size a part of a file can have. The file will be splitted into this size of chunks.
45
#define BUF_SIZE    0x1000  // 4096 bytes
45
#define BUF_SIZE    0x1000  // 4096 bytes
46
 
46
 
47
#define NSTATE_OFFLINE      0
47
#define NSTATE_OFFLINE      0
-
 
48
#define NSTATE_OFFLINE1     1
48
#define NSTATE_ONLINE       6
49
#define NSTATE_ONLINE       6
-
 
50
#define NSTATE_ONLINE1      5
49
#define NSTATE_CONNECTING   9
51
#define NSTATE_CONNECTING   9
50
 
52
 
51
#define WAIT_RESET          3   // Number of seconds to wait in case of connecting to another controller
53
#define WAIT_RESET          3   // Number of seconds to wait in case of connecting to another controller
52
#define WAIT_RECONNECT      15  // Number of seconds to wait in case of reconnecting to the same controller
54
#define WAIT_RECONNECT      15  // Number of seconds to wait in case of reconnecting to the same controller
53
 
55
 
Line 438... Line 440...
438
            int countFiles();
440
            int countFiles();
439
            void sendAllFuncNetwork(int state);
441
            void sendAllFuncNetwork(int state);
440
            void sendAllFuncTimer(const ANET_BLINK& blink);
442
            void sendAllFuncTimer(const ANET_BLINK& blink);
441
 
443
 
442
            std::function<void(const ANET_COMMAND&)> callback;
444
            std::function<void(const ANET_COMMAND&)> callback;
443
            std::function<bool(TAmxNet *)> cbWebConn;
-
 
444
 
445
 
445
            TSocket *mSocket{nullptr};  // Pointer to socket class needed for communication
446
            TSocket *mSocket{nullptr};  // Pointer to socket class needed for communication
446
            FILE *rcvFile{nullptr};
447
            FILE *rcvFile{nullptr};
447
            FILE *sndFile{nullptr};
448
            FILE *sndFile{nullptr};
448
            size_t posRcv{0};
449
            size_t posRcv{0};
Line 476... Line 477...
476
            std::atomic<bool> receiveSetup{false};
477
            std::atomic<bool> receiveSetup{false};
477
            bool isOpenSnd{false};
478
            bool isOpenSnd{false};
478
            bool isOpenRcv{false};
479
            bool isOpenRcv{false};
479
            bool _retry{false};
480
            bool _retry{false};
480
            char buff_[BUF_SIZE];       // Internal used buffer for network communication
481
            char buff_[BUF_SIZE];       // Internal used buffer for network communication
-
 
482
            int mLastOnlineState{NSTATE_OFFLINE};
481
    };
483
    };
482
}
484
}
483
 
485
 
484
#endif
486
#endif