comparison OSTCFrogOperations.h @ 1:0b3630a29ad8

Initial version based on previous repository. Project was ported to QT6 and in now cmake based.
author Ideenmodellierer <tiefenrauscher@web.de>
date Thu, 27 Nov 2025 18:40:28 +0100
parents
children
comparison
equal deleted inserted replaced
0:76ccd6ce50c0 1:0b3630a29ad8
1 //////////////////////////////////////////////////////////////////////////////
2 /// \file OSTCFrogOperations.h
3 /// \brief Implementing various operations for H&W Frog dive computer
4 /// \author JD Gascuel.
5 ///
6 /// \copyright (c) 2011-2016 JD Gascuel. All rights reserved.
7 /// $Id$
8 //////////////////////////////////////////////////////////////////////////////
9 //
10 // BSD 2-Clause License:
11 //
12 // Redistribution and use in source and binary forms, with or without
13 // modification, are permitted provided that the following conditions
14 // are met:
15 //
16 // 1. Redistributions of source code must retain the above copyright notice,
17 // this list of conditions and the following disclaimer.
18 //
19 // 2. Redistributions in binary form must reproduce the above copyright notice,
20 // this list of conditions and the following disclaimer in the documentation
21 // and/or other materials provided with the distribution.
22 //
23 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
24 // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26 // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
27 // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
28 // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
29 // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
30 // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
31 // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
32 // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
33 // THE POSSIBILITY OF SUCH DAMAGE.
34 //
35 //////////////////////////////////////////////////////////////////////////////
36 // HISTORY
37 // 2011-10-01 : Separate from FrogTools main.cpp
38 // 2014-10-23 : Mix with OSTC Companion code.
39
40 #ifndef OSTC_FROG_OPERATIONS_H
41 #define OSTC_FROG_OPERATIONS_H
42
43 #include "HardwareOperations.h"
44
45 class OSTCFrogOperations
46 : public HardwareOperations
47 {
48 int _firmware;
49 int _serialNumber;
50 QString _description;
51 bool _isOpen;
52 bool _commandMode;
53
54 //---- Low level commands
55 void beginCommands();
56 void endCommands();
57 void eraseRange(unsigned int addr, unsigned int size);
58 void startWrite(unsigned int addr);
59 void stopWrite();
60 void readBytes(unsigned int addr, unsigned char *ptr, unsigned int size);
61
62
63 //---- Port management
64 //QRegExp portTemplate() const override;
65 QRegularExpression portTemplate() const override;
66 QStringList listPorts() const override;
67 HardwareOperations::CompanionFeatures supported() const override;
68
69 //---- High level commands reimplemented
70 bool connect() override;
71 void connectServiceMode() override;
72 void getIdentity() override;
73 void writeText(const QString &_msg) override;
74 void setDate(const QDateTime& date) override;
75 QSize nameSize() const override;
76 void setName(const QString& newName) override;
77 void setIcons(const QString& fileName) override;
78 int firmware() const override;
79 int serialNumber() const override;
80 QString customText() const override;
81 void loadFirmware(HexFile& hex, const QString& fileName) const override;
82 void upgradeFW(const QString& fileName) override;
83 QString firmwareTemplate() const override;
84 bool disconnect(bool closing = false) override;
85 QString model() const override;
86 QString description() override;
87 QImage dumpScreen() const override;
88
89 public:
90 OSTCFrogOperations();
91 ~OSTCFrogOperations();
92 };
93
94 #endif // OSTC_FROG_OPERATIONS_H