--- smsdaemon/plugins/TogPlugin.cpp 2008/06/12 12:43:29 63 +++ smsdaemon/plugins/TogPlugin.cpp 2008/11/02 20:14:20 114 @@ -1,5 +1,6 @@ #include "TogPlugin.h" -#include "GsmModem.h" +#include "IGsmModem.h" +#include "Sms.h" #include "TrainInfo.h" #include "util.h" @@ -7,17 +8,20 @@ #include #include +#include "common.h" + using namespace std; TogPlugin::TogPlugin() : Plugin("tog", "Henter tog info fra bane.dk") { + _stationInfo["ar"] = StationInfo("AR","Århus"); _stationInfo["la"] = StationInfo("LG","Langå"); _stationInfo["ul"] = StationInfo("UP","Ulstrup"); _stationInfo["bj"] = StationInfo("BJ","Bjerringbro"); _stationInfo["vi"] = StationInfo("VG","Viborg"); - _stationInfo["hø"] = StationInfo("HØ","Højslev"); + _stationInfo["ho"] = StationInfo("HØ","Højslev"); _stationInfo["sk"] = StationInfo("SK","Skive"); } @@ -57,7 +61,7 @@ data = Util::str_gsm2latin(data);; data = Util::str_tolower(data); - + if (data == "") { modem.SendSms(sms.sender, "Usage: tog \ntog list - liste over stationer", false); @@ -84,9 +88,9 @@ { infos = GetTrainInfo( code , "" ); } - catch(...) + catch(std::exception& e) { - modem.SendSms(sms.sender, "Connection timeout", false ); + modem.SendSms(sms.sender, e.what(), false ); return; }