mirror of
https://github.com/intrepidcs/libicsneo.git
synced 2026-08-05 09:28:40 +02:00
Fix an issue where the FIRE could not be opened
This commit is contained in:
@@ -166,6 +166,10 @@ protected:
|
||||
|
||||
virtual void setupExtensions() {}
|
||||
void addExtension(std::shared_ptr<DeviceExtension>&& extension);
|
||||
|
||||
// Hook for devices such as FIRE which need to inject traffic before RequestSerialNumber
|
||||
// Return false to bail
|
||||
virtual bool afterCommunicationOpen() { return true; }
|
||||
|
||||
template<typename Extension>
|
||||
std::shared_ptr<Extension> getExtension() const {
|
||||
|
||||
@@ -45,18 +45,12 @@ public:
|
||||
Bootloader = 'B'
|
||||
};
|
||||
|
||||
bool open() override {
|
||||
if(!com)
|
||||
return false;
|
||||
|
||||
if(!com->open())
|
||||
bool afterCommunicationOpen() override {
|
||||
if(!Device::afterCommunicationOpen()) // Doesn't do anything right now but just in case it gets added to later
|
||||
return false;
|
||||
|
||||
// Enter mode is only needed on very old FIRE devices (white board), will be ignored by newer devices
|
||||
if(!enterMode(Mode::Application))
|
||||
return false;
|
||||
|
||||
return Device::open();
|
||||
return enterMode(Mode::Application);
|
||||
}
|
||||
|
||||
bool enterMode(Mode mode) {
|
||||
|
||||
Reference in New Issue
Block a user