Mercurial > public > ostc_companion
comparison OSTC3Operations.h @ 8:21ce6187d32e
Minor changes done by automatic style checker
| author | Ideenmodellierer |
|---|---|
| date | Mon, 12 Jan 2026 13:51:17 +0000 |
| parents | 0b3630a29ad8 |
| children |
comparison
equal
deleted
inserted
replaced
| 7:0969ef86c42d | 8:21ce6187d32e |
|---|---|
| 47 ////////////////////////////////////////////////////////////////////////////// | 47 ////////////////////////////////////////////////////////////////////////////// |
| 48 /// \brief Implementing various low-level operations for OSTC3 dive computer | 48 /// \brief Implementing various low-level operations for OSTC3 dive computer |
| 49 /// | 49 /// |
| 50 /// \sa OSTCSportOperations, OSTC2Operations, OSTC3pOperations, | 50 /// \sa OSTCSportOperations, OSTC2Operations, OSTC3pOperations, |
| 51 /// OSTC4Operations, OSTCcROperations. | 51 /// OSTC4Operations, OSTCcROperations. |
| 52 class OSTC3Operations | 52 class OSTC3Operations : public HardwareOperations |
| 53 : public HardwareOperations | |
| 54 { | 53 { |
| 55 ////////////////////////////////////////////////////////////////////////// | 54 ////////////////////////////////////////////////////////////////////////// |
| 56 /// \{ \section Configuration management. | 55 /// \{ \section Configuration management. |
| 57 | 56 |
| 58 // QRegExp portTemplate() const override; | 57 // QRegExp portTemplate() const override; |
| 59 QRegularExpression portTemplate() const override; | 58 QRegularExpression portTemplate() const override; |
| 60 QStringList listPorts() const override; | 59 QStringList listPorts() const override; |
| 61 QString model() const override; | 60 QString model() const override; |
| 62 QString description() override; | 61 QString description() override; |
| 63 CompanionFeatures supported() const override; | 62 CompanionFeatures supported() const override; |
| 64 | 63 |
| 65 /// \} | 64 /// \} |
| 66 ////////////////////////////////////////////////////////////////////////// | 65 ////////////////////////////////////////////////////////////////////////// |
| 67 protected: | 66 protected: |
| 68 | |
| 69 //------------------------------------------------------------------------ | 67 //------------------------------------------------------------------------ |
| 70 /// \brief Erase OSTC3 PROM memory. | 68 /// \brief Erase OSTC3 PROM memory. |
| 71 /// PROM memory should be erased beforeprogramming the new firmware. | 69 /// PROM memory should be erased beforeprogramming the new firmware. |
| 72 /// This command is used to erase a set of 4KB pages. | 70 /// This command is used to erase a set of 4KB pages. |
| 73 /// \param[in] addr: First address (24bits) to erase. Should be a multiple of 4096. | 71 /// \param[in] addr: First address (24bits) to erase. Should be a multiple of 4096. |
| 80 /// | 78 /// |
| 81 /// \param[in] addr: First address (24bits) to write to. | 79 /// \param[in] addr: First address (24bits) to write to. |
| 82 /// \param[in] data: Bytes to write. | 80 /// \param[in] data: Bytes to write. |
| 83 /// \param[in] size: Number of bytes to write. | 81 /// \param[in] size: Number of bytes to write. |
| 84 /// \throws if something goes wrong. | 82 /// \throws if something goes wrong. |
| 85 void writeBlock(unsigned int addr, | 83 void writeBlock(unsigned int addr, const unsigned char *data, unsigned int size); |
| 86 const unsigned char *data, unsigned int size); | |
| 87 | 84 |
| 88 //------------------------------------------------------------------------ | 85 //------------------------------------------------------------------------ |
| 89 /// \brief Read-back a big block of bytes from OSTC3 RAM memory. | 86 /// \brief Read-back a big block of bytes from OSTC3 RAM memory. |
| 90 /// | 87 /// |
| 91 /// \param[in] addr: First address (24bits) to read from. | 88 /// \param[in] addr: First address (24bits) to read from. |
| 92 /// \param[in] ptr : Where to store bytes read. | 89 /// \param[in] ptr : Where to store bytes read. |
| 93 /// \param[in] size: Number of bytes to read. | 90 /// \param[in] size: Number of bytes to read. |
| 94 /// \throws if something goes wrong. | 91 /// \throws if something goes wrong. |
| 95 void readBlock (unsigned int addr, unsigned char *ptr, unsigned int size); | 92 void readBlock(unsigned int addr, unsigned char *ptr, unsigned int size); |
| 96 | 93 |
| 97 //------------------------------------------------------------------------ | 94 //------------------------------------------------------------------------ |
| 98 /// \brief Burn firmare. | 95 /// \brief Burn firmare. |
| 99 /// | 96 /// |
| 100 /// Firmware should be first uploaded to RAM memory (\sa writeBlock() ), | 97 /// Firmware should be first uploaded to RAM memory (\sa writeBlock() ), |
| 150 ////////////////////////////////////////////////////////////////////////// | 147 ////////////////////////////////////////////////////////////////////////// |
| 151 /// \{ \section OSTC3 high-level commands. | 148 /// \{ \section OSTC3 high-level commands. |
| 152 | 149 |
| 153 bool connect() override; | 150 bool connect() override; |
| 154 bool disconnect(bool closing = false) override; | 151 bool disconnect(bool closing = false) override; |
| 155 void setDate(const QDateTime& date) override; | 152 void setDate(const QDateTime &date) override; |
| 156 void setName(const QString& newName) override; | 153 void setName(const QString &newName) override; |
| 157 void getSignal() override; | 154 void getSignal() override; |
| 158 void getAllHeader(unsigned char* pBuffer) override; | 155 void getAllHeader(unsigned char *pBuffer) override; |
| 159 void writeAllHeader(unsigned char* pBuffer) override; | 156 void writeAllHeader(unsigned char *pBuffer) override; |
| 160 void getAllSamples(unsigned char* pBuffer) override; | 157 void getAllSamples(unsigned char *pBuffer) override; |
| 161 void writeAllSamples(unsigned char* pBuffer) override; | 158 void writeAllSamples(unsigned char *pBuffer) override; |
| 162 void setIcons(const QString& fileName) override; | 159 void setIcons(const QString &fileName) override; |
| 163 QImage dumpScreen() const override; | 160 QImage dumpScreen() const override; |
| 164 void upgradeFW(const QString& fileName) override; | 161 void upgradeFW(const QString &fileName) override; |
| 165 | 162 |
| 166 void loadFirmware(HexFile& hex, const QString& fileName) const override; | 163 void loadFirmware(HexFile &hex, const QString &fileName) const override; |
| 167 | 164 |
| 168 /// \} | 165 /// \} |
| 169 | 166 |
| 170 ////////////////////////////////////////////////////////////////////////// | 167 ////////////////////////////////////////////////////////////////////////// |
| 171 protected: | 168 protected: |
| 172 QString descriptionString; | 169 QString descriptionString; |
| 173 QString emulatorName; | 170 QString emulatorName; |
| 174 char computerText[60]; | 171 char computerText[60]; |
| 175 | 172 |
| 176 virtual void getCommonIdentity(); | 173 virtual void getCommonIdentity(); |
| 177 | 174 |
| 178 void connectServiceMode() override; | 175 void connectServiceMode() override; |
| 179 | 176 |
| 182 unsigned short _computerFirmware; | 179 unsigned short _computerFirmware; |
| 183 unsigned short _computerSerial; | 180 unsigned short _computerSerial; |
| 184 | 181 |
| 185 protected: | 182 protected: |
| 186 enum Mode { | 183 enum Mode { |
| 187 CLOSED_MODE = 0, ///< Not yet open. | 184 CLOSED_MODE = 0, ///< Not yet open. |
| 188 DOWNLOAD_MODE, ///< Open in normal mode. | 185 DOWNLOAD_MODE, ///< Open in normal mode. |
| 189 SERVICE_MODE ///< Open in FIRMWARE UPGRADE mode. | 186 SERVICE_MODE ///< Open in FIRMWARE UPGRADE mode. |
| 190 } _connectMode; | 187 } _connectMode; |
| 191 }; | 188 }; |
| 192 | 189 |
| 193 #endif // OSTC3OPERATIONS_H | 190 #endif // OSTC3OPERATIONS_H |
