![]() |
OSTC Companion
3.0
Companion sofftware for H&W dive computers
|
Implementing various low-level operations for OSTC3 dive computer. More...
#include <OSTC3Operations.h>

Public Member Functions | |
| OSTC3Operations () | |
| ~OSTC3Operations () | |
| int | firmware () const override |
| The fw version found during the last getIdentty(). More... | |
| int | serialNumber () const override |
| The serial number found during the last getIdentty(). More... | |
| QString | customText () const override |
| The user-defined string found during the last getIdentty(). More... | |
| QSize | nameSize () const override |
| Custom text size (lines and columns). More... | |
| void | getIdentity () override |
| Read OSTC3 computer firmware, serial and custom text. Everything is formated for the description() string. More... | |
| void | writeText (const QString &msg) override |
| Display a short text on OSTC3 while on service mode. OSTC3 can handle 16 chars. So the string is automatically padded with spaces to clean any leftover. More... | |
| QString | firmwareTemplate () const override |
| filename matching template for compatible firmware. More... | |
| bool | connect () override |
| bool | disconnect (bool closing=false) override |
| Close connection. More... | |
| void | setDate (const QDateTime &date) override |
| Set HW dive computer date and time. More... | |
| void | setName (const QString &newName) override |
| Set HW dive computer user text. More... | |
| void | setIcons (const QString &fileName) override |
| Set HW dive computer icon set. More... | |
| QImage | dumpScreen () const override |
| Take a snapshot of the connected computer's screen. More... | |
| void | upgradeFW (const QString &fileName) override |
| Upgrade HW dive computer firmware. More... | |
| void | loadFirmware (HexFile &hex, const QString &fileName) const override |
| Read in the specific firmware file format. More... | |
Public Member Functions inherited from HardwareOperations | |
| virtual | ~HardwareOperations () |
| mandatory (and empty) virtual descructor in the base class. More... | |
| Serial & | serial () |
| Gives access to serial port in use. Used for other high and low level operations, eg. in OSTC Planner. More... | |
| HardwareDescriptor | hardwareDescriptor () |
| Ask the connect device for its hardware options. More... | |
Protected Types | |
| enum | Mode { CLOSED_MODE = 0, DOWNLOAD_MODE, SERVICE_MODE } |
Protected Member Functions | |
| void | eraseRange (unsigned int addr, unsigned int size) |
| Erase OSTC3 PROM memory. PROM memory should be erased beforeprogramming the new firmware. This command is used to erase a set of 4KB pages. More... | |
| void | writeBlock (unsigned int addr, const unsigned char *data, unsigned int size) |
| Write a big block of bytes to OSTC3 RAM memory. More... | |
| void | readBlock (unsigned int addr, unsigned char *ptr, unsigned int size) |
| Read-back a big block of bytes from OSTC3 RAM memory. More... | |
| void | upgradeFirmware (unsigned int checksum) |
| Burn firmare. More... | |
| virtual void | getCommonIdentity () |
| void | connectServiceMode () override |
| Open service mode communication to the dive computer. More... | |
Protected Member Functions inherited from HardwareOperations | |
| QStringList | listBluetoothPorts () const |
| List serial ports for Bluetooth based devices. More... | |
| QStringList | listUSBPorts () const |
| List serial ports for USB based devices. More... | |
Protected Attributes | |
| QString | descriptionString |
| QString | emulatorName |
| char | computerText [60] |
| enum OSTC3Operations::Mode | _connectMode |
Protected Attributes inherited from HardwareOperations | |
| Serial | _serial |
| Communication port used for all I/O operations. More... | |
Additional Inherited Members | |
Public Types inherited from HardwareOperations | |
| enum | HardwareOption { HW_CHARGEABLE_BATTERY = 0x01, HW_LIGHT_SENSOR = 0x02, HW_S8_COM = 0x04, HW_OPTICAL_COM = 0x08, HW_BLUETOOTH_COM = 0x10, HW_DUALCORE = 0x20 } |
| Optional features present in the dive computer hardware. More... | |
| enum | HardwareDescriptor { HW_UNKNOWN_OSTC = 0, HW_Frog = HW_BLUETOOTH_COM, HW_OSTCSport_a = HW_LIGHT_SENSOR | HW_BLUETOOTH_COM, HW_OSTCSport_b = HW_OSTCSport_a | HW_CHARGEABLE_BATTERY, HW_OSTC2c = HW_CHARGEABLE_BATTERY, HW_OSTC2_a = HW_CHARGEABLE_BATTERY | HW_BLUETOOTH_COM, HW_OSTC2_b = HW_OSTCSport_b, HW_OSTC2_c = HW_OSTC2_b | HW_OPTICAL_COM, HW_OSTC3 = HW_LIGHT_SENSOR | HW_OPTICAL_COM, HW_OSTC3p_a = HW_LIGHT_SENSOR | HW_OPTICAL_COM | HW_BLUETOOTH_COM, HW_OSTC3p_b = HW_OSTCSport_b, HW_OSTCcR_a = HW_CHARGEABLE_BATTERY | HW_S8_COM, HW_OSTCcR_b = HW_OSTCcR_a | HW_LIGHT_SENSOR, HW_OSTC4 } |
| Dive computer set of features. More... | |
| enum | CompanionFeatures { PARAMETERS = (1<<0), DATE = (1<<1), NAME = (1<<2), ICON = (1<<3), DUMPSCREEN = (1<<4), FIRMWARE = (1<<5), HELIUM_DIVE = (1<<6), CCR_DIVE = (1<<7), BLUETOOTH = (1<<8), VPM_MODEL = (1<<9) } |
| Features supported by OSTC Companion on the connected device. More... | |
Static Public Member Functions inherited from HardwareOperations | |
| static EXPORT unsigned char | retryCommand (Serial &serial, unsigned char cmd, int retries=10) |
| Send a command, wait ack, and retry on error. More... | |
Implementing various low-level operations for OSTC3 dive computer.
|
protected |
| OSTC3Operations::OSTC3Operations | ( | ) |
| OSTC3Operations::~OSTC3Operations | ( | ) |
|
overridevirtual |
Implements HardwareOperations.
|
overrideprotectedvirtual |
Open service mode communication to the dive computer.
Open comm port, start service mode, check the blessed reply.
Implements HardwareOperations.
|
overridevirtual |
The user-defined string found during the last getIdentty().
Implements HardwareOperations.
|
overridevirtual |
Close connection.
Exit service mode, and close everything. closing should be set when ending Companion, so an error make a won't crash if the interface is already deleted.
Implements HardwareOperations.
|
overridevirtual |
Take a snapshot of the connected computer's screen.
Currently only supported by OSTC mk2/2n/2c dive computers.
Implements HardwareOperations.
|
protected |
Erase OSTC3 PROM memory. PROM memory should be erased beforeprogramming the new firmware. This command is used to erase a set of 4KB pages.
| [in] | addr | First address (24bits) to erase. Should be a multiple of 4096. |
| [in] | size | Number of bytes to erase. Will be rounded (up) to a multiple of 4096. |
| if | something goes wrong. |
|
overridevirtual |
The fw version found during the last getIdentty().
Implements HardwareOperations.
|
overridevirtual |
filename matching template for compatible firmware.
Used by the Upgrade Firmware... command to propose only firmwares designed for the connected device.
Implements HardwareOperations.
|
protectedvirtual |
|
overridevirtual |
Read OSTC3 computer firmware, serial and custom text. Everything is formated for the description() string.
| if | something goes wrong. |
Implements HardwareOperations.
|
overridevirtual |
Read in the specific firmware file format.
History is a bit complex here, and the published firmware have different file formats (due to support tool, and/or need for encryption). So each driver have to implement its specific loader.
Implements HardwareOperations.
|
overridevirtual |
Custom text size (lines and columns).
Low level commands are used to directly speak to the OSTC3 firmware. They all throw an Exception if some error occurs.
Implements HardwareOperations.
|
protected |
Read-back a big block of bytes from OSTC3 RAM memory.
| [in] | addr | First address (24bits) to read from. |
| [in] | ptr | : Where to store bytes read. |
| [in] | size | Number of bytes to read. |
| if | something goes wrong. |
|
overridevirtual |
The serial number found during the last getIdentty().
Implements HardwareOperations.
|
overridevirtual |
Set HW dive computer date and time.
Implements HardwareOperations.
|
overridevirtual |
Set HW dive computer icon set.
Currently only supported by Frog dive computer.
Implements HardwareOperations.
|
overridevirtual |
Set HW dive computer user text.
Implements HardwareOperations.
|
protected |
Burn firmare.
Firmware should be first uploaded to RAM memory (
| [in] | checksum | Adler32 checksum of the new firmware. |
| if | something goes wrong. |
|
overridevirtual |
Upgrade HW dive computer firmware.
Implements HardwareOperations.
|
protected |
Write a big block of bytes to OSTC3 RAM memory.
| [in] | addr | First address (24bits) to write to. |
| [in] | data | Bytes to write. |
| [in] | size | Number of bytes to write. |
| if | something goes wrong. |
|
overridevirtual |
Display a short text on OSTC3 while on service mode. OSTC3 can handle 16 chars. So the string is automatically padded with spaces to clean any leftover.
| if | something goes wrong. |
Implements HardwareOperations.
|
protected |
|
protected |
|
protected |
|
protected |
1.8.8