Mercurial > public > ostc_companion
comparison OSTC4Operations.cpp @ 4:e30f00f760d3 default tip
Cleanup OSTC label and removed url
The computer type will now show OSTC 4/5 instead of only 4. The url has
been removed because it is no longer maintained. The ui header have been
deleted because they are generated files shich should not be under
version controll. Delete locally if you want to force an update of the
dialog layout.
| author | Ideenmodellierer |
|---|---|
| date | Sun, 30 Nov 2025 18:37:32 +0100 |
| parents | 4ace58a7c03c |
| children |
comparison
equal
deleted
inserted
replaced
| 3:4ace58a7c03c | 4:e30f00f760d3 |
|---|---|
| 57 | 57 |
| 58 ////////////////////////////////////////////////////////////////////////////// | 58 ////////////////////////////////////////////////////////////////////////////// |
| 59 | 59 |
| 60 QString OSTC4Operations::model() const | 60 QString OSTC4Operations::model() const |
| 61 { | 61 { |
| 62 return "OSTC4"; | 62 return "OSTC 4/5"; |
| 63 } | 63 } |
| 64 | 64 |
| 65 HardwareOperations::CompanionFeatures OSTC4Operations::supported() const | 65 HardwareOperations::CompanionFeatures OSTC4Operations::supported() const |
| 66 { | 66 { |
| 67 // No ICON, no DUMPSCREEN | 67 // No ICON, no DUMPSCREEN |
| 112 descriptionString.clear(); | 112 descriptionString.clear(); |
| 113 | 113 |
| 114 LOG_TRACE("Getting model..."); | 114 LOG_TRACE("Getting model..."); |
| 115 HardwareDescriptor hw = hardwareDescriptor(); | 115 HardwareDescriptor hw = hardwareDescriptor(); |
| 116 if( hw != HW_OSTC4 ) | 116 if( hw != HW_OSTC4 ) |
| 117 LOG_THROW("Not an OSTC4."); | 117 LOG_THROW("Not an OSTC4/5."); |
| 118 | 118 |
| 119 LOG_TRACE("Getting identity..."); | 119 LOG_TRACE("Getting identity..."); |
| 120 getCommonIdentity(); | 120 getCommonIdentity(); |
| 121 | 121 |
| 122 //---- Main firmware ----------------------------------------------------- | 122 //---- Main firmware ----------------------------------------------------- |
| 185 ////////////////////////////////////////////////////////////////////////////// | 185 ////////////////////////////////////////////////////////////////////////////// |
| 186 | 186 |
| 187 OSTC4Operations::OSTC4Operations() | 187 OSTC4Operations::OSTC4Operations() |
| 188 : fileChecksum(0,0) | 188 : fileChecksum(0,0) |
| 189 { | 189 { |
| 190 emulatorName = "OSTC4"; | 190 emulatorName = "OSTC4/5"; |
| 191 } | 191 } |
| 192 | 192 |
| 193 ////////////////////////////////////////////////////////////////////////////// | 193 ////////////////////////////////////////////////////////////////////////////// |
| 194 | 194 |
| 195 void OSTC4Operations::upgradeFW(const QString &fileName) | 195 void OSTC4Operations::upgradeFW(const QString &fileName) |
| 196 { | 196 { |
| 197 LOG_INFO("Starting OSTC4 firmware upgrade..."); | 197 LOG_INFO("Starting OSTC4/5 firmware upgrade..."); |
| 198 | 198 |
| 199 openFirmware(fileName, true); | 199 openFirmware(fileName, true); |
| 200 openFirmware(fileName, false); | 200 openFirmware(fileName, false); |
| 201 | 201 |
| 202 LOG_INFO("Please wait for OSTC4 to complete installation..."); | 202 LOG_INFO("Please wait for OSTC4/5 to complete installation..."); |
| 203 } | 203 } |
| 204 | 204 |
| 205 ////////////////////////////////////////////////////////////////////////////// | 205 ////////////////////////////////////////////////////////////////////////////// |
| 206 ////////////////////////////////////////////////////////////////////////////// | 206 ////////////////////////////////////////////////////////////////////////////// |
| 207 /// FIRMWARE UPGRADE /// | 207 /// FIRMWARE UPGRADE /// |
| 216 | 216 |
| 217 ////////////////////////////////////////////////////////////////////////////// | 217 ////////////////////////////////////////////////////////////////////////////// |
| 218 | 218 |
| 219 void OSTC4Operations::openFirmware(const QString &fileName, bool dryRun) | 219 void OSTC4Operations::openFirmware(const QString &fileName, bool dryRun) |
| 220 { | 220 { |
| 221 LOG_TRACE("Opening OSTC4 firmware '" << fileName << "'..."); | 221 LOG_TRACE("Opening OSTC4/5 firmware '" << fileName << "'..."); |
| 222 | 222 |
| 223 bool forceFirmwareUpdate; | 223 bool forceFirmwareUpdate; |
| 224 bool forceRTEUpdate; | 224 bool forceRTEUpdate; |
| 225 bool forceFontlibUpdate; | 225 bool forceFontlibUpdate; |
| 226 bool useFastMode; | 226 bool useFastMode; |
| 273 | 273 |
| 274 //---- On second pass, do upload new stuff --------------------------- | 274 //---- On second pass, do upload new stuff --------------------------- |
| 275 if( _connectMode != SERVICE_MODE ) | 275 if( _connectMode != SERVICE_MODE ) |
| 276 connectServiceMode(); | 276 connectServiceMode(); |
| 277 if( _connectMode != SERVICE_MODE ) | 277 if( _connectMode != SERVICE_MODE ) |
| 278 LOG_THROW("Cannot connect OSTC4 service mode..."); | 278 LOG_THROW("Cannot connect OSTC 4/5 service mode..."); |
| 279 | 279 |
| 280 //---- Check if needed ? --------------------------------------------- | 280 //---- Check if needed ? --------------------------------------------- |
| 281 LOG_TRACE("Check part " << part << " is needed ?"); | 281 LOG_TRACE("Check part " << part << " is needed ?"); |
| 282 unsigned char echo = retryCommand(_serial, 'k'); // 0x69 OSTC4 FW Details. | 282 unsigned char echo = retryCommand(_serial, 'k'); // 0x6B OSTC4 FW Details. |
| 283 if( echo != 'k' ) | 283 if( echo != 'k' ) |
| 284 LOG_THROW("Bad firmware details."); | 284 LOG_THROW("Bad firmware details."); |
| 285 | 285 |
| 286 unsigned char reply[4+1]; | 286 unsigned char reply[4+1]; |
| 287 _serial.writeByte(header.type); // type of firmware part | 287 _serial.writeByte(header.type); // type of firmware part |
| 326 | 326 |
| 327 //---- Command | 327 //---- Command |
| 328 PROGRESS(step++, steps); | 328 PROGRESS(step++, steps); |
| 329 echo = retryCommand(_serial, 's'); // 0x73 OSTC4 FW Upgrade | 329 echo = retryCommand(_serial, 's'); // 0x73 OSTC4 FW Upgrade |
| 330 if( echo != 's' ) | 330 if( echo != 's' ) |
| 331 LOG_THROW("Bad OSTC4 FW upgrade commande."); | 331 LOG_THROW("Bad OSTC4/5 FW upgrade commande."); |
| 332 | 332 |
| 333 //---- Header | 333 //---- Header |
| 334 PROGRESS(step++, steps); | 334 PROGRESS(step++, steps); |
| 335 _serial.writeBlock((uchar*)&header, sizeof header); | 335 _serial.writeBlock((uchar*)&header, sizeof header); |
| 336 _serial.sleep(500); | 336 _serial.sleep(500); |
