Просмотр исходного кода

Diustou relay tested(playerV5).

qiuyang 7 месяцев назад
Родитель
Сommit
d86150b8ac

+ 1 - 0
framework/request/include/ExpelDevice.h

@@ -23,6 +23,7 @@ using namespace toolkit;
 using namespace std;
 using namespace gsd;
 
+//DeviceType enum use in Expel.cpp getControl(). Read from config.ini
 enum DeviceType { 
     DevicePlayerV1 = 0,
     DeviceGasV1 = 1,

BIN
lib/libgsd_core.so


BIN
lib/libgsd_modules.so


BIN
lib/libgsd_plugins.so


+ 1 - 1
modules/Expel/include/DevicePlayerV5.hpp

@@ -32,7 +32,7 @@ namespace gsd
     public:
         DevicePlayerV5(): ContorlSerialBase()
         {
-            this->DeviceInfo = "三亚继电器协议";
+            this->DeviceInfo = "diustou继电器协议";
             this->tool = DeviceTools::serial;
             this->baudRate = 9600;
         }

+ 1 - 2
modules/Expel/include/Expel.hpp

@@ -41,12 +41,11 @@ namespace gsd{
     private:
         Expel(): ModuleBase(){
             this->pool = std::make_shared<ThreadPool>(1,ThreadPool::PRIORITY_HIGHEST, false);
-            InfoL;
+            //InfoL;
         }
 
     public:
         using Ptr = std::shared_ptr<Expel>;
-
         ~Expel(){
             this->Destroy();
         }

+ 3 - 2
modules/Expel/src/Expel.cpp

@@ -196,7 +196,6 @@ namespace gsd
      * @return {*}
      */    
     bool Expel::Init(){
-        InfoL;
         return true;
     }
     
@@ -205,7 +204,6 @@ namespace gsd
      * @return {*}
      */    
     void Expel::Destroy(){
-        InfoL;
     }
 
     /**
@@ -248,6 +246,9 @@ namespace gsd
         case DeviceType::DevicePlayerV5:
             deviceControl = std::make_shared<gsd::DevicePlayerV5>();
             break;
+        default:
+            InfoL<<"Unrecognized device type."<<endl;
+            return nullptr;
         }
         deviceControl->setTypeId(expelDevice.deviceType);
         return deviceControl;

+ 3 - 3
plugins/HttpPlugin/src/HttpPlugin.cpp

@@ -111,7 +111,7 @@ namespace gsd
                 // 同步数据
                 for(auto iter = nettyHttpResultMsg.datas.begin(); iter != nettyHttpResultMsg.datas.end(); iter++){
                     expelDevice.DeviceId = iter->birdDeviceCode;
-                    switch ((int)iter->deviceControlType)
+                    switch ((int)iter->deviceControlType) // device type defined by the netty. Not applied in config.ini
                     {
                     case 2:
                         // 上海民航1 
@@ -141,8 +141,8 @@ namespace gsd
                         expelDevice.deviceType = DeviceType::DeviceGasV2;
                         break;
 
-                    case 8:
-                        //sanya
+                    case 9:
+                        //diustou
                         expelDevice.deviceType = DeviceType::DevicePlayerV5;
                         break;
                     default: