1
0
mirror of https://github.com/thooge/esp32-nmea2000-obp60.git synced 2025-12-14 06:23:07 +01:00

intermediate, untested: move creator to SensorBase

This commit is contained in:
andreas
2024-11-19 18:58:29 +01:00
parent d904d15ece
commit 0200352f91
13 changed files with 51 additions and 37 deletions

View File

@@ -83,7 +83,7 @@ class GWDMS22B : public SSISensor{
bool invt=false;
String zeroConfigName;
public:
GWDMS22B(GwApi *api,const String &prfx, int host):SSISensor("DMS22B",api,prfx,host){}
GWDMS22B(GwApi *api,const String &prfx, int host):SSISensor(api,prfx,host){}
virtual bool preinit(GwApi * api){
GwLog *logger=api->getLogger();
LOG_DEBUG(GwLog::LOG,"DMS22B configured, prefix=%s, intv=%f, active=%d",prefix.c_str(),fintv,(int)act);

View File

@@ -90,7 +90,7 @@ class SSIDevice{
};
class SSISensor : public SensorTemplate<BUSTYPE,SensorBase::SPI>{
class SSISensor : public SensorTemplate<BUSTYPE,SensorBase::SPI, SSISensor>{
std::unique_ptr<SSIDevice> device;
protected:
int bits=12;
@@ -125,7 +125,7 @@ class SSISensor : public SensorTemplate<BUSTYPE,SensorBase::SPI>{
}
public:
SSISensor(const String &type,GwApi *api,const String &prfx, int host):SensorTemplate<BUSTYPE,SensorBase::SPI>(type,api,prfx)
SSISensor(GwApi *api,const String &prfx, int host):SensorTemplate<BUSTYPE,SensorBase::SPI,SSISensor>(api,prfx)
{
busId=host;
}