--- smsdaemon/plugins/TogPlugin.cpp 2008/11/02 20:14:20 114 +++ smsdaemon/plugins/TogPlugin.cpp 2008/12/07 20:58:41 149 @@ -1,5 +1,5 @@ #include "TogPlugin.h" -#include "IGsmModem.h" +#include "ISmsTransceiver.h" #include "Sms.h" #include "TrainInfo.h" @@ -16,12 +16,12 @@ TogPlugin::TogPlugin() : Plugin("tog", "Henter tog info fra bane.dk") { - _stationInfo["ar"] = StationInfo("AR","Århus"); - _stationInfo["la"] = StationInfo("LG","Langå"); + _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["ho"] = StationInfo("HØ","Højslev"); + _stationInfo["ho"] = StationInfo("H�","H�jslev"); _stationInfo["sk"] = StationInfo("SK","Skive"); } @@ -51,12 +51,12 @@ os << (*it).first << " - " << (*it).second.name << "\n"; } - return Util::str_latin2gsm(os.str()); + return os.str(); } -void TogPlugin::Execute(IGsmModem& modem, SMS& sms) +void TogPlugin::Execute(ISmsTransceiver& modem, SMS& sms) { - string data = GetSmsData(sms); + string data = sms.ExtractParameters(); data = Util::str_gsm2latin(data);; data = Util::str_tolower(data); @@ -64,13 +64,13 @@ if (data == "") { - modem.SendSms(sms.sender, "Usage: tog \ntog list - liste over stationer", false); + modem.SendSms(sms.GetSender(), "Usage: tog \ntog list - liste over stationer", false); return; } if (data == "list") { - modem.SendSms(sms.sender, CreateStationList(), true); + modem.SendSms(sms.GetSender(), CreateStationList(), true); return; } @@ -79,7 +79,7 @@ if (code == "") { - modem.SendSms(sms.sender, "Unknown station", false); + modem.SendSms(sms.GetSender(), "Unknown station", false); return; } @@ -90,7 +90,7 @@ } catch(std::exception& e) { - modem.SendSms(sms.sender, e.what(), false ); + modem.SendSms(sms.GetSender(), e.what(), false ); return; } @@ -106,7 +106,7 @@ os << train.note << "\n"; } - modem.SendSms(sms.sender, Util::str_latin2gsm(os.str()), true); + modem.SendSms(sms.GetSender(), os.str(), true);