00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #include "tools/errorhandler.hpp"
00027 #include "BasicDatatypes.hpp"
00028 #include "manager.hpp"
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042 int mrsNtpTimeApp()
00043 {
00044
00045
00046 printInfoMessage("mrsNtpTimeApp: Creating the manager.", true);
00047 Manager manager;
00048
00049 Sourcetype type;
00050 std::string name;
00051 UINT16 id;
00052 bool result = false;
00053
00054
00055 printInfoMessage("mrsNtpTimeApp: Adding the LDMRS device.", true);
00056 type = Sourcetype_LDMRS;
00057 name = "LDMRS-1";
00058 id = 1;
00059 result = manager.addAndRunDevice(type, name, id);
00060 if (result == false)
00061 {
00062 printError("mrsNtpTimeApp: Failed to add device " + name + ", aborting!");
00063 return 0;
00064 }
00065
00066
00067
00068
00069 printInfoMessage("mrsNtpTimeApp: Adding the application MrsNtpTimeApp.", true);
00070 type = Sourcetype_MrsNtpTimeApp;
00071 name = "MRS Example NTP time App";
00072 id = 51;
00073 result = manager.addApplication(type, name, id);
00074 if (result == false)
00075 {
00076 printError("mrsNtpTimeApp: Failed to add application " + name + ", aborting!");
00077 return 0;
00078 }
00079 printInfoMessage("mrsNtpTimeApp: Application NTP-time is running.", true);
00080
00081
00082
00083 while (1)
00084 {
00085
00086 usleep(100000);
00087 }
00088
00089 return 0;
00090 }
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103 int sectorChangeApp()
00104 {
00105
00106
00107 printInfoMessage("sectorChangeApp: Creating the manager.", true);
00108 Manager manager;
00109
00110 Sourcetype type;
00111 std::string name;
00112 UINT16 id;
00113 bool result = false;
00114
00115
00116 printInfoMessage("sectorChangeApp: Adding the LDMRS device.", true);
00117 type = Sourcetype_LDMRS;
00118 name = "LDMRS-1";
00119 id = 1;
00120 result = manager.addAndRunDevice(type, name, id);
00121 if (result == false)
00122 {
00123 printError("sectorChangeApp: Failed to add device " + name + ", aborting!");
00124 return 0;
00125 }
00126
00127
00128
00129
00130 printInfoMessage("sectorChangeApp: Adding the application MrsSectorChangeApp.", true);
00131 type = Sourcetype_MrsChangeApp;
00132 name = "MRS Example Sector Change App";
00133 id = 51;
00134 result = manager.addApplication(type, name, id);
00135 if (result == false)
00136 {
00137 printError("sectorChangeApp: Failed to add application " + name + ", aborting!");
00138 return 0;
00139 }
00140 printInfoMessage("sectorChangeApp: Application SectorChange is running.", true);
00141
00142
00143
00144 while (1)
00145 {
00146
00147 usleep(100000);
00148 }
00149
00150 return 0;
00151 }
00152
00153
00154
00155
00156
00157
00158
00159
00160
00161
00162
00163
00164
00165
00166 int mrsSopasScandataApp()
00167 {
00168
00169
00170 printInfoMessage("mrsSopasScandataApp: Creating the manager.", true);
00171 Manager manager;
00172
00173
00174
00175
00176
00177 Sourcetype type;
00178 std::string name;
00179 UINT16 id;
00180 bool result = false;
00181
00182 printInfoMessage("mrsSopasScandataApp: Adding the application MrsApp.", true);
00183 type = Sourcetype_MrsApp;
00184 name = "MRS ExampleApp";
00185 id = 50;
00186 result = manager.addApplication(type, name, id);
00187 if (result == false)
00188 {
00189 printError("mrsSopasScandataApp: Failed to add application " + name + ", aborting!");
00190 return 0;
00191 }
00192 printInfoMessage("mrsSopasScandataApp: Application is running.", true);
00193
00194
00195
00196
00197 printInfoMessage("mrsSopasScandataApp: Adding the LDMRS device.", true);
00198 type = Sourcetype_LDMRS;
00199 name = "LDMRS-1";
00200 id = 1;
00201 result = manager.addAndRunDevice(type, name, id);
00202 if (result == false)
00203 {
00204 printError("mrsSopasScandataApp: Failed to add device " + name + ", aborting!");
00205 return 0;
00206 }
00207
00208
00209 while (1)
00210 {
00211
00212 usleep(100000);
00213 }
00214
00215 return 0;
00216 }
00217
00218
00219
00220
00221
00222
00223
00224
00225
00226
00227
00228 int mrsFieldApp()
00229 {
00230
00231
00232 printInfoMessage("mrsFieldApp: Creating the manager.", true);
00233 Manager manager;
00234
00235
00236
00237
00238 Sourcetype type;
00239 std::string name;
00240 UINT16 id;
00241 bool result = false;
00242
00243 printInfoMessage("mrsFieldApp: Adding the application MrsFieldApp.", true);
00244 type = Sourcetype_MrsFieldApp;
00245 name = "MRS FieldApp";
00246 id = 50;
00247 result = manager.addApplication(type, name, id);
00248 if (result == false)
00249 {
00250 printError("mrsFieldApp: Failed to add application " + name + ", aborting!");
00251 return 0;
00252 }
00253 printInfoMessage("mrsFieldApp: Application is running.", true);
00254
00255
00256
00257
00258 printInfoMessage("mrsFieldApp: Adding the LDMRS device.", true);
00259 type = Sourcetype_LDMRS;
00260 name = "LDMRS-1";
00261 id = 1;
00262 result = manager.addAndRunDevice(type, name, id);
00263 if (result == false)
00264 {
00265 printError("mrsFieldApp: Failed to add device " + name + ", aborting!");
00266 return 0;
00267 }
00268
00269
00270 while (1)
00271 {
00272
00273 usleep(100000);
00274 }
00275
00276 return 0;
00277 }
00278
00279
00280
00281
00282
00283
00284
00285
00286
00287
00288
00289
00290 int mrsScanpointCoordinateApp()
00291 {
00292
00293
00294 printInfoMessage("mrsScanpointCoordinateApp: Creating the manager.", true);
00295 Manager manager;
00296
00297
00298
00299
00300 Sourcetype type;
00301 std::string name;
00302 UINT16 id;
00303 bool result = false;
00304
00305 printInfoMessage("mrsScanpointCoordinateApp: Adding the application MrsScanpointCoordinateApp.", true);
00306 type = Sourcetype_MrsScanpointCoordinateApp;
00307 name = "MRS CoordinateApp";
00308 id = 50;
00309 result = manager.addApplication(type, name, id);
00310 if (result == false)
00311 {
00312 printError("mrsScanpointCoordinateApp: Failed to add application " + name + ", aborting!");
00313 return 0;
00314 }
00315 printInfoMessage("mrsScanpointCoordinateApp: Application is running.", true);
00316
00317
00318
00319
00320 printInfoMessage("mrsScanpointCoordinateApp: Adding the LDMRS device.", true);
00321 type = Sourcetype_LDMRS;
00322 name = "LDMRS-1";
00323 id = 1;
00324 result = manager.addAndRunDevice(type, name, id);
00325 if (result == false)
00326 {
00327 printError("mrsScanpointCoordinateApp: Failed to add device " + name + ", aborting!");
00328 return 0;
00329 }
00330
00331
00332 while (1)
00333 {
00334
00335 usleep(100000);
00336 }
00337
00338 return 0;
00339 }
00340
00341
00342
00343
00344
00345
00346
00347
00348
00349
00350
00351
00352 int mrsApp()
00353 {
00354
00355
00356 printInfoMessage("mrsApp: Creating the manager.", true);
00357 Manager manager;
00358
00359
00360
00361
00362 Sourcetype type;
00363 std::string name;
00364 UINT16 id;
00365 bool result = false;
00366
00367 printInfoMessage("mrsApp: Adding the application MrsApp.", true);
00368 type = Sourcetype_MrsApp;
00369 name = "MRS ExampleApp";
00370 id = 50;
00371 result = manager.addApplication(type, name, id);
00372 if (result == false)
00373 {
00374 printError("mrsApp: Failed to add application " + name + ", aborting!");
00375 return 0;
00376 }
00377 printInfoMessage("mrsApp: Application is running.", true);
00378
00379
00380
00381
00382 printInfoMessage("mrsApp: Adding the LDMRS device.", true);
00383 type = Sourcetype_LDMRS;
00384 name = "LDMRS-1";
00385 id = 1;
00386 result = manager.addAndRunDevice(type, name, id);
00387 if (result == false)
00388 {
00389 printError("mrsApp: Failed to add device " + name + ", aborting!");
00390 return 0;
00391 }
00392
00393
00394 while (1)
00395 {
00396
00397 usleep(100000);
00398 }
00399
00400 return 0;
00401 }
00402
00403
00404
00405
00406
00407
00408 int main(int argc, char **argv)
00409 {
00410
00411
00412
00413 int result;
00414
00415
00416 result = mrsApp();
00417
00418
00419
00420
00421
00422
00423
00424
00425
00426
00427
00428
00429
00430
00431
00432
00433
00434
00435 return result;
00436 }