/[H9]/trunk/FlisServer/FlisServerDlg.cpp
ViewVC logotype

Diff of /trunk/FlisServer/FlisServerDlg.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 144 by kevin, Tue Dec 4 13:26:00 2007 UTC revision 149 by torben, Tue Dec 4 17:32:44 2007 UTC
# Line 471  void CFlisServerDlg::OnBnClickedGsmpin() Line 471  void CFlisServerDlg::OnBnClickedGsmpin()
471                                  AppendText(tekst);                                  AppendText(tekst);
472                          }                          }
473                  }                  }
474                    Sleep(5); //Small delay to avoid busy wait
475          }          }
476          Sleep(100); //Give the modem a chance to send the last data          Sleep(100); //Give the modem a chance to send the last data
477          while(Serial.getComstat().cbInQue > 0)          while(Serial.getComstat().cbInQue > 0)
# Line 923  vector<keepalive> CFlisServerDlg::keepal Line 924  vector<keepalive> CFlisServerDlg::keepal
924          CString SQL, name, value;          CString SQL, name, value;
925          SQL = "select name, value from config;";          SQL = "select name, value from config;";
926          CRecordset rs(&db);          CRecordset rs(&db);
927          rs.Open(AFX_DB_USE_DEFAULT_TYPE, SQL);          try
         if (rs.GetRecordCount()>0)  
928          {          {
929                  rs.MoveFirst();                  rs.Open(AFX_DB_USE_DEFAULT_TYPE, SQL);
930                    if (rs.GetRecordCount()>0)
931                    {
932                            rs.MoveFirst();
933                                                    
934                  rs.GetFieldValue((short)0, name);                          rs.GetFieldValue((short)0, name);
935                  rs.GetFieldValue(1,value);                          rs.GetFieldValue(1,value);
936                                    
937                  Alive.name = name;                          Alive.name = name;
938                  Alive.value = value;                          Alive.value = value;
939                  Alive.tid = CTime::GetCurrentTime();                          Alive.tid = CTime::GetCurrentTime();
940                  if(Alive.name == "phonenr")                          if(Alive.name == "phonenr")
941                  {                          {
942                          Alive.Phonenr = value;                                  Alive.Phonenr = value;
943                  }                          }
944    
945                  buffer.push_back(Alive);                          buffer.push_back(Alive);
946                  rs.MoveNext();                          rs.MoveNext();
947    
948                    }
949                    rs.Close();
950                    return buffer;
951          }          }
952          rs.Close();          catch (char * str)
953          return buffer;          {
954                    AppendText("Keepalive failed, closing and opening the db connection again");
955                    if(db.IsOpen())
956                    {
957                            db.Close();
958                            AppendText("DB connection closed");
959                    }
960                    if(!db.IsOpen())
961                    {
962                            DBConnect();
963                            AppendText("DB connection started again");
964                    }
965            }
966    
967                    
968  }  }

Legend:
Removed from v.144  
changed lines
  Added in v.149

  ViewVC Help
Powered by ViewVC 1.1.20