1 |
#include "TogPlugin.h" |
#include "TogPlugin.h" |
2 |
#include "GsmModem.h" |
#include "IGsmModem.h" |
3 |
|
#include "Sms.h" |
4 |
|
|
5 |
#include "TrainInfo.h" |
#include "TrainInfo.h" |
6 |
#include "util.h" |
#include "util.h" |
8 |
#include <iostream> |
#include <iostream> |
9 |
#include <sstream> |
#include <sstream> |
10 |
|
|
11 |
|
#include "common.h" |
12 |
|
|
13 |
using namespace std; |
using namespace std; |
14 |
|
|
15 |
|
|
20 |
_stationInfo["ul"] = StationInfo("UP","Ulstrup"); |
_stationInfo["ul"] = StationInfo("UP","Ulstrup"); |
21 |
_stationInfo["bj"] = StationInfo("BJ","Bjerringbro"); |
_stationInfo["bj"] = StationInfo("BJ","Bjerringbro"); |
22 |
_stationInfo["vi"] = StationInfo("VG","Viborg"); |
_stationInfo["vi"] = StationInfo("VG","Viborg"); |
23 |
_stationInfo["hø"] = StationInfo("HØ","Højslev"); |
_stationInfo["ho"] = StationInfo("HØ","Højslev"); |
24 |
_stationInfo["sk"] = StationInfo("SK","Skive"); |
_stationInfo["sk"] = StationInfo("SK","Skive"); |
25 |
} |
} |
26 |
|
|
60 |
data = Util::str_gsm2latin(data);; |
data = Util::str_gsm2latin(data);; |
61 |
data = Util::str_tolower(data); |
data = Util::str_tolower(data); |
62 |
|
|
63 |
|
|
64 |
if (data == "") |
if (data == "") |
65 |
{ |
{ |
66 |
modem.SendSms(sms.sender, "Usage: tog <stationskode>\ntog list - liste over stationer", false); |
modem.SendSms(sms.sender, "Usage: tog <stationskode>\ntog list - liste over stationer", false); |
87 |
{ |
{ |
88 |
infos = GetTrainInfo( code , "" ); |
infos = GetTrainInfo( code , "" ); |
89 |
} |
} |
90 |
catch(...) |
catch(std::exception& e) |
91 |
{ |
{ |
92 |
modem.SendSms(sms.sender, "Connection timeout", false ); |
modem.SendSms(sms.sender, e.what(), false ); |
93 |
return; |
return; |
94 |
} |
} |
95 |
|
|