New Configuration Data
authorTobias <tm@tm3d.de>
Thu, 21 Apr 2022 13:12:02 +0000 (15:12 +0200)
committerTobias <tm@tm3d.de>
Thu, 21 Apr 2022 13:12:02 +0000 (15:12 +0200)
AUTHORS [changed mode: 0755->0644]
src/owDevice.cpp
src/owDeviceConfig.cpp
src/owInterface.cpp
src/owInterface.h
windows/owTools/owTools.vcxproj

diff --git a/AUTHORS b/AUTHORS
old mode 100755 (executable)
new mode 100644 (file)
index 2c1ee64..096d6f5 100644 (file)
@@ -248,6 +248,13 @@ int owDeviceDS18B20::convertAll() {
        return 0;\r
 }\r
 \r
+int owDeviceDS18B20::readMemory(int page,int start, int count,std::vector<uint8_t> *data) {\r
+       std::vector<uint8_t> d;\r
+       readScratchpad(&d);\r
+       data->insert(data->begin(),d.begin()+start,d.end());\r
+       return 8;\r
+}\r
+\r
 \r
 void owDeviceDS2438::setDefaultConfig() {\r
        config->setConfig({1,6, 6,8, 4,7, 6,17, 0,2,3,12,4,0,0,0,0,0,0,0,0,0,0,0});\r
index 0e4b391..c3e4301 100644 (file)
@@ -243,6 +243,51 @@ std::vector<std::string> owDeviceConfig::getQuantityFromNumber(uint8_t code) {
                        l.push_back("illuminance blue");
                        l.push_back("Beleuchtungsstärke Blau");
                        l.push_back("lx");
+
+               case 19:
+                       l.push_back("particulate mass concentration PM1");
+                       l.push_back("Feinstaubkonzentration PM1");
+                       l.push_back("µg/m³");
+               case 20:
+                       l.push_back("particulate mass concentration PM2.5");
+                       l.push_back("Feinstaubkonzentration PM2.5");
+                       l.push_back("µg/m³");
+               case 21:
+                       l.push_back("particulate mass concentration PM4");
+                       l.push_back("Feinstaubkonzentration PM4");
+                       l.push_back("µg/m³");
+               case 22:
+                       l.push_back("particulate mass concentration PM10");
+                       l.push_back("Feinstaubkonzentration PM10");
+                       l.push_back("µg/m³");
+               case 23:
+                       l.push_back("number concentration PM0.5");
+                       l.push_back("Partikelzahl PM0.5");
+                       l.push_back("#/cm³");
+               case 24:
+                       l.push_back("number concentration PM1");
+                       l.push_back("Partikelzahl PM1");
+                       l.push_back("#/cm³");
+               case 25:
+                       l.push_back("number concentration PM2.5");
+                       l.push_back("Partikelzahl PM2.5");
+                       l.push_back("#/cm³");
+               case 26:
+                       l.push_back("number concentration PM4");
+                       l.push_back("Partikelzahl PM4");
+                       l.push_back("#/cm³");
+               case 27:
+                       l.push_back("number concentration PM10");
+                       l.push_back("Partikelzahl PM10");
+                       l.push_back("#/cm³");
+               case 28:
+                       l.push_back("typical particle size");
+                       l.push_back("Durchschnittliche Partikelgröße");
+                       l.push_back("µm");
+
+
+
+
                default:
                        l.push_back("");
                        l.push_back("");
@@ -286,6 +331,10 @@ double owDeviceConfig::calculateValueFromNumber(int code, int vn, std::vector<in
                        case 26:return V[vn]*5.0/1024.0;break;
                        case 27:return ((double)V[2]+(double)V[1]/1000.0)/8.0;break;
                        case 28:return exp(V[vn]/2560.0);break;
+                       case 29:return ((double)V[1]*10.0+(double)V[2]/100.0);break;
+                       case 30: return V[vn] / 2.0; break;
+                       case 31: return V[vn] / 4.0; break;
+                       case 32: return V[vn] / 5.0; break;
                        default:return V[vn];
                }
 }
@@ -322,6 +371,13 @@ std::string owDeviceConfig::getSensorChip(uint8_t ch) {
                case 26: s="SGPC3";break;
                case 27: s="iAQ-core C";break;
                case 28: s="HDC2010";break;
+               case 29: s="LPS225HB";break;
+               case 30: s="SHTC3";break;
+               case 31: s="SPS30";break;
+               case 32: s="DHT11";break;
+               case 33: s="SCD30";break;
+               case 34: s="SCD40";break;
+               
                default: return "";
        }
        return s;
index 3da8460..e412f85 100644 (file)
@@ -568,6 +568,7 @@ int owInterface::Find() {
                                case 0x26:d=new owDeviceDS2438(this,snum);break;\r
                                case 0x20:d=new owDeviceDS2450(this,snum);break;\r
                                case 0x1D:d=new owDeviceDS2423(this,snum);break;\r
+                               case 0x29:d=new owDeviceDS2408(this,snum);break;\r
                                default:d=new owDevice(this,snum);\r
                        }\r
                        devices.push_back(d);\r
index 0a568df..736d767 100644 (file)
@@ -301,6 +301,7 @@ public:
        int readScratchpad(std::vector<uint8_t> *sp);
        virtual int convertAll();
        virtual int getPageSize() {return 8;}
+    virtual int readMemory(int page,int start, int count,std::vector<uint8_t> *data);
 } ;
 
 
@@ -345,6 +346,22 @@ public:
        virtual int getPageSize() {return 32;}
 
 
+} ;
+
+class owDeviceDS2408:public owDevice {
+public:
+       owDeviceDS2408(owInterface *owi_,snum_t num):owDevice(owi_,num) {}
+
+       virtual void setDefaultConfig();
+       virtual int convertAll();
+       virtual int readMemory(int page,int start, int count,std::vector<uint8_t> *data);
+       virtual int writeMemory(int page,int start, int count,std::vector<uint8_t> *data);
+       int readChannelAccess(int count,std::vector<uint8_t> *data);
+       int writeChannelAccess(int count, std::vector<uint8_t> *data);
+       int resetActivityLatches();
+       virtual int getPageSize() {return 32;}
+
+
 } ;
 
 
index 6987402..b34e1dd 100644 (file)
     <ProjectGuid>{7BC76CAE-ECA9-4C9B-9DE0-3F8449F815B4}</ProjectGuid>\r
     <Keyword>Win32Proj</Keyword>\r
     <RootNamespace>owTools</RootNamespace>\r
-    <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>\r
+    <WindowsTargetPlatformVersion>10.0.19041.0</WindowsTargetPlatformVersion>\r
   </PropertyGroup>\r
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />\r
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">\r
     <ConfigurationType>Application</ConfigurationType>\r
     <UseDebugLibraries>true</UseDebugLibraries>\r
-    <PlatformToolset>v140</PlatformToolset>\r
+    <PlatformToolset>v142</PlatformToolset>\r
     <CharacterSet>Unicode</CharacterSet>\r
   </PropertyGroup>\r
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">\r
     <ConfigurationType>Application</ConfigurationType>\r
     <UseDebugLibraries>false</UseDebugLibraries>\r
-    <PlatformToolset>v140</PlatformToolset>\r
+    <PlatformToolset>v142</PlatformToolset>\r
     <WholeProgramOptimization>true</WholeProgramOptimization>\r
     <CharacterSet>Unicode</CharacterSet>\r
   </PropertyGroup>\r