|
1 /* |
|
2 * Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * System Includes |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 #include <stdio.h> |
|
23 #include <assert.h> |
|
24 #include <rpc/types.h> |
|
25 |
|
26 |
|
27 /**************************************************************************************** |
|
28 * |
|
29 * Local Includes |
|
30 * |
|
31 ***************************************************************************************/ |
|
32 #include "CCGpssimulator.h" |
|
33 |
|
34 |
|
35 /**************************************************************************************** |
|
36 * |
|
37 * Implementation |
|
38 * |
|
39 ***************************************************************************************/ |
|
40 CCGpssimulator::CCGpssimulator() |
|
41 { |
|
42 cl = NULL; |
|
43 iLastRPCError.re_status = RPC_SUCCESS; |
|
44 } |
|
45 |
|
46 CCGpssimulator::~CCGpssimulator() |
|
47 { |
|
48 assert( cl == NULL ); |
|
49 } |
|
50 |
|
51 char *CCGpssimulator::GetLastRPCError( int *aIntErr ) |
|
52 { |
|
53 struct rpc_err rpcerr; |
|
54 |
|
55 // check that the handle is valid |
|
56 if( cl == NULL ) { |
|
57 return NULL; |
|
58 } |
|
59 |
|
60 // pass the aIntErr |
|
61 if( aIntErr != NULL ) { |
|
62 clnt_geterr( cl, &rpcerr ); |
|
63 *aIntErr = rpcerr.re_status; |
|
64 } |
|
65 |
|
66 // return the errorstring |
|
67 return clnt_sperror( cl, NULL ); |
|
68 } |
|
69 |
|
70 int CCGpssimulator::Connect( string aRemoteHost ) |
|
71 { |
|
72 // check that we are not already connected |
|
73 if( cl != NULL ) { |
|
74 return ERR_STUB_ALREADY_CONNECTED; |
|
75 } |
|
76 |
|
77 // start the rpc library |
|
78 rpc_nt_init(); |
|
79 |
|
80 // connect to the service |
|
81 cl = clnt_create( aRemoteHost.c_str(), GPSSIMULATOR, GPSSIMULATOR_VERSION, "tcp" ); |
|
82 if( cl == NULL ) { |
|
83 rpc_nt_exit(); |
|
84 return ERR_FAILED_TO_CONNECT; |
|
85 } |
|
86 |
|
87 // done |
|
88 return ERR_NONE; |
|
89 } |
|
90 |
|
91 int CCGpssimulator::Disconnect( ) |
|
92 { |
|
93 // check that we are connected |
|
94 if( cl == NULL ) { |
|
95 return ERR_STUB_NOT_CONNECTED; |
|
96 } |
|
97 |
|
98 // cleanup the client handle |
|
99 clnt_destroy( cl ); |
|
100 cl = NULL; |
|
101 rpc_nt_exit(); |
|
102 |
|
103 // done |
|
104 return ERR_NONE; |
|
105 } |
|
106 |
|
107 |
|
108 /**************************************************************************************** |
|
109 * |
|
110 * PUBLIC FUNCTION: ss_startuprpcservice |
|
111 * |
|
112 ***************************************************************************************/ |
|
113 int CCGpssimulator::ss_startuprpcservice( TStartupInfo aArgs, int *rv ) |
|
114 { |
|
115 struct rpc_err rerr; |
|
116 |
|
117 // check the rv pointer |
|
118 if( rv == NULL ) { |
|
119 return ERR_INVALID_RV_POINTER; |
|
120 } |
|
121 |
|
122 // check that we have a connection |
|
123 if( cl == NULL ) { |
|
124 return ERR_STUB_NOT_CONNECTED; |
|
125 } |
|
126 |
|
127 // do the call |
|
128 *rv = *ss_startuprpcservice_10( &aArgs, cl ); |
|
129 |
|
130 // check for rpc errors and return the result |
|
131 clnt_geterr( cl, &rerr ); |
|
132 if( rerr.re_status != RPC_SUCCESS ) { |
|
133 iLastRPCError = rerr; |
|
134 return ERR_RPC_ERROR; |
|
135 } |
|
136 return ERR_NONE; |
|
137 } |
|
138 |
|
139 |
|
140 /**************************************************************************************** |
|
141 * |
|
142 * PUBLIC FUNCTION: sc_shutdownrpcservice |
|
143 * |
|
144 ***************************************************************************************/ |
|
145 int CCGpssimulator::sc_shutdownrpcservice( int aArgs, int *rv ) |
|
146 { |
|
147 struct rpc_err rerr; |
|
148 |
|
149 // check the rv pointer |
|
150 if( rv == NULL ) { |
|
151 return ERR_INVALID_RV_POINTER; |
|
152 } |
|
153 |
|
154 // check that we have a connection |
|
155 if( cl == NULL ) { |
|
156 return ERR_STUB_NOT_CONNECTED; |
|
157 } |
|
158 |
|
159 // do the call |
|
160 *rv = *sc_shutdownrpcservice_10( &aArgs, cl ); |
|
161 |
|
162 // check for rpc errors and return the result |
|
163 clnt_geterr( cl, &rerr ); |
|
164 if( rerr.re_status != RPC_SUCCESS ) { |
|
165 iLastRPCError = rerr; |
|
166 return ERR_RPC_ERROR; |
|
167 } |
|
168 return ERR_NONE; |
|
169 } |
|
170 |
|
171 |
|
172 /**************************************************************************************** |
|
173 * |
|
174 * PUBLIC FUNCTION: list_connections |
|
175 * |
|
176 ***************************************************************************************/ |
|
177 int CCGpssimulator::list_connections( TComponentList *rv ) |
|
178 { |
|
179 struct rpc_err rerr; |
|
180 int aArgs = 0; |
|
181 |
|
182 // check the rv pointer |
|
183 if( rv == NULL ) { |
|
184 return ERR_INVALID_RV_POINTER; |
|
185 } |
|
186 |
|
187 // check that we have a connection |
|
188 if( cl == NULL ) { |
|
189 return ERR_STUB_NOT_CONNECTED; |
|
190 } |
|
191 |
|
192 // do the call |
|
193 *rv = *list_connections_1( &aArgs, cl ); |
|
194 |
|
195 // check for rpc errors and return the result |
|
196 clnt_geterr( cl, &rerr ); |
|
197 if( rerr.re_status != RPC_SUCCESS ) { |
|
198 iLastRPCError = rerr; |
|
199 return ERR_RPC_ERROR; |
|
200 } |
|
201 return ERR_NONE; |
|
202 } |
|
203 |
|
204 |
|
205 /**************************************************************************************** |
|
206 * |
|
207 * PUBLIC FUNCTION: cstr_startprocess |
|
208 * |
|
209 ***************************************************************************************/ |
|
210 int CCGpssimulator::cstr_startprocess( char *aArgs, int *rv ) |
|
211 { |
|
212 struct rpc_err rerr; |
|
213 |
|
214 // check the rv pointer |
|
215 if( rv == NULL ) { |
|
216 return ERR_INVALID_RV_POINTER; |
|
217 } |
|
218 |
|
219 // check that we have a connection |
|
220 if( cl == NULL ) { |
|
221 return ERR_STUB_NOT_CONNECTED; |
|
222 } |
|
223 |
|
224 // do the call |
|
225 *rv = *cstr_startprocess_1( &aArgs, cl ); |
|
226 |
|
227 // check for rpc errors and return the result |
|
228 clnt_geterr( cl, &rerr ); |
|
229 if( rerr.re_status != RPC_SUCCESS ) { |
|
230 iLastRPCError = rerr; |
|
231 return ERR_RPC_ERROR; |
|
232 } |
|
233 return ERR_NONE; |
|
234 } |
|
235 |
|
236 |
|
237 /**************************************************************************************** |
|
238 * |
|
239 * PUBLIC FUNCTION: dstr_removeprocess |
|
240 * |
|
241 ***************************************************************************************/ |
|
242 int CCGpssimulator::dstr_removeprocess( int aArgs, int *rv ) |
|
243 { |
|
244 struct rpc_err rerr; |
|
245 |
|
246 // check the rv pointer |
|
247 if( rv == NULL ) { |
|
248 return ERR_INVALID_RV_POINTER; |
|
249 } |
|
250 |
|
251 // check that we have a connection |
|
252 if( cl == NULL ) { |
|
253 return ERR_STUB_NOT_CONNECTED; |
|
254 } |
|
255 |
|
256 // do the call |
|
257 *rv = *dstr_removeprocess_1( &aArgs, cl ); |
|
258 |
|
259 // check for rpc errors and return the result |
|
260 clnt_geterr( cl, &rerr ); |
|
261 if( rerr.re_status != RPC_SUCCESS ) { |
|
262 iLastRPCError = rerr; |
|
263 return ERR_RPC_ERROR; |
|
264 } |
|
265 return ERR_NONE; |
|
266 } |
|
267 |
|
268 |
|
269 /**************************************************************************************** |
|
270 * |
|
271 * PUBLIC FUNCTION: startsimulator |
|
272 * |
|
273 ***************************************************************************************/ |
|
274 int CCGpssimulator::startsimulator( int *rv ) |
|
275 { |
|
276 struct rpc_err rerr; |
|
277 int aArgs = 0; |
|
278 |
|
279 // check the rv pointer |
|
280 if( rv == NULL ) { |
|
281 return ERR_INVALID_RV_POINTER; |
|
282 } |
|
283 |
|
284 // check that we have a connection |
|
285 if( cl == NULL ) { |
|
286 return ERR_STUB_NOT_CONNECTED; |
|
287 } |
|
288 |
|
289 // do the call |
|
290 *rv = *startsimulator_1( &aArgs, cl ); |
|
291 |
|
292 // check for rpc errors and return the result |
|
293 clnt_geterr( cl, &rerr ); |
|
294 if( rerr.re_status != RPC_SUCCESS ) { |
|
295 iLastRPCError = rerr; |
|
296 return ERR_RPC_ERROR; |
|
297 } |
|
298 return ERR_NONE; |
|
299 } |
|
300 |
|
301 |
|
302 /**************************************************************************************** |
|
303 * |
|
304 * PUBLIC FUNCTION: stopsimulator |
|
305 * |
|
306 ***************************************************************************************/ |
|
307 int CCGpssimulator::stopsimulator( int *rv ) |
|
308 { |
|
309 struct rpc_err rerr; |
|
310 int aArgs = 0; |
|
311 |
|
312 // check the rv pointer |
|
313 if( rv == NULL ) { |
|
314 return ERR_INVALID_RV_POINTER; |
|
315 } |
|
316 |
|
317 // check that we have a connection |
|
318 if( cl == NULL ) { |
|
319 return ERR_STUB_NOT_CONNECTED; |
|
320 } |
|
321 |
|
322 // do the call |
|
323 *rv = *stopsimulator_1( &aArgs, cl ); |
|
324 |
|
325 // check for rpc errors and return the result |
|
326 clnt_geterr( cl, &rerr ); |
|
327 if( rerr.re_status != RPC_SUCCESS ) { |
|
328 iLastRPCError = rerr; |
|
329 return ERR_RPC_ERROR; |
|
330 } |
|
331 return ERR_NONE; |
|
332 } |
|
333 |
|
334 |
|
335 /**************************************************************************************** |
|
336 * |
|
337 * PUBLIC FUNCTION: setfielddefault |
|
338 * |
|
339 ***************************************************************************************/ |
|
340 int CCGpssimulator::setfielddefault( TField aArgs, int *rv ) |
|
341 { |
|
342 struct rpc_err rerr; |
|
343 |
|
344 // check the rv pointer |
|
345 if( rv == NULL ) { |
|
346 return ERR_INVALID_RV_POINTER; |
|
347 } |
|
348 |
|
349 // check that we have a connection |
|
350 if( cl == NULL ) { |
|
351 return ERR_STUB_NOT_CONNECTED; |
|
352 } |
|
353 |
|
354 // do the call |
|
355 *rv = *setfielddefault_1( &aArgs, cl ); |
|
356 |
|
357 // check for rpc errors and return the result |
|
358 clnt_geterr( cl, &rerr ); |
|
359 if( rerr.re_status != RPC_SUCCESS ) { |
|
360 iLastRPCError = rerr; |
|
361 return ERR_RPC_ERROR; |
|
362 } |
|
363 return ERR_NONE; |
|
364 } |
|
365 |
|
366 |
|
367 /**************************************************************************************** |
|
368 * |
|
369 * PUBLIC FUNCTION: setsatellitedefault |
|
370 * |
|
371 ***************************************************************************************/ |
|
372 int CCGpssimulator::setsatellitedefault( TSatellite aArgs, int *rv ) |
|
373 { |
|
374 struct rpc_err rerr; |
|
375 |
|
376 // check the rv pointer |
|
377 if( rv == NULL ) { |
|
378 return ERR_INVALID_RV_POINTER; |
|
379 } |
|
380 |
|
381 // check that we have a connection |
|
382 if( cl == NULL ) { |
|
383 return ERR_STUB_NOT_CONNECTED; |
|
384 } |
|
385 |
|
386 // do the call |
|
387 *rv = *setsatellitedefault_1( &aArgs, cl ); |
|
388 |
|
389 // check for rpc errors and return the result |
|
390 clnt_geterr( cl, &rerr ); |
|
391 if( rerr.re_status != RPC_SUCCESS ) { |
|
392 iLastRPCError = rerr; |
|
393 return ERR_RPC_ERROR; |
|
394 } |
|
395 return ERR_NONE; |
|
396 } |
|
397 |
|
398 |
|
399 /**************************************************************************************** |
|
400 * |
|
401 * PUBLIC FUNCTION: positionset |
|
402 * |
|
403 ***************************************************************************************/ |
|
404 int CCGpssimulator::positionset( TPositionInfo aArgs, int *rv ) |
|
405 { |
|
406 struct rpc_err rerr; |
|
407 |
|
408 // check the rv pointer |
|
409 if( rv == NULL ) { |
|
410 return ERR_INVALID_RV_POINTER; |
|
411 } |
|
412 |
|
413 // check that we have a connection |
|
414 if( cl == NULL ) { |
|
415 return ERR_STUB_NOT_CONNECTED; |
|
416 } |
|
417 |
|
418 // do the call |
|
419 *rv = *positionset_1( &aArgs, cl ); |
|
420 |
|
421 // check for rpc errors and return the result |
|
422 clnt_geterr( cl, &rerr ); |
|
423 if( rerr.re_status != RPC_SUCCESS ) { |
|
424 iLastRPCError = rerr; |
|
425 return ERR_RPC_ERROR; |
|
426 } |
|
427 return ERR_NONE; |
|
428 } |
|
429 |
|
430 |
|
431 /**************************************************************************************** |
|
432 * |
|
433 * PUBLIC FUNCTION: courseset |
|
434 * |
|
435 ***************************************************************************************/ |
|
436 int CCGpssimulator::courseset( TCourse aArgs, int *rv ) |
|
437 { |
|
438 struct rpc_err rerr; |
|
439 |
|
440 // check the rv pointer |
|
441 if( rv == NULL ) { |
|
442 return ERR_INVALID_RV_POINTER; |
|
443 } |
|
444 |
|
445 // check that we have a connection |
|
446 if( cl == NULL ) { |
|
447 return ERR_STUB_NOT_CONNECTED; |
|
448 } |
|
449 |
|
450 // do the call |
|
451 *rv = *courseset_1( &aArgs, cl ); |
|
452 |
|
453 // check for rpc errors and return the result |
|
454 clnt_geterr( cl, &rerr ); |
|
455 if( rerr.re_status != RPC_SUCCESS ) { |
|
456 iLastRPCError = rerr; |
|
457 return ERR_RPC_ERROR; |
|
458 } |
|
459 return ERR_NONE; |
|
460 } |
|
461 |
|
462 |
|
463 /**************************************************************************************** |
|
464 * |
|
465 * PUBLIC FUNCTION: accuracyset |
|
466 * |
|
467 ***************************************************************************************/ |
|
468 int CCGpssimulator::accuracyset( TAccuracy aArgs, int *rv ) |
|
469 { |
|
470 struct rpc_err rerr; |
|
471 |
|
472 // check the rv pointer |
|
473 if( rv == NULL ) { |
|
474 return ERR_INVALID_RV_POINTER; |
|
475 } |
|
476 |
|
477 // check that we have a connection |
|
478 if( cl == NULL ) { |
|
479 return ERR_STUB_NOT_CONNECTED; |
|
480 } |
|
481 |
|
482 // do the call |
|
483 *rv = *accuracyset_1( &aArgs, cl ); |
|
484 |
|
485 // check for rpc errors and return the result |
|
486 clnt_geterr( cl, &rerr ); |
|
487 if( rerr.re_status != RPC_SUCCESS ) { |
|
488 iLastRPCError = rerr; |
|
489 return ERR_RPC_ERROR; |
|
490 } |
|
491 return ERR_NONE; |
|
492 } |
|
493 |
|
494 |
|
495 /**************************************************************************************** |
|
496 * |
|
497 * PUBLIC FUNCTION: satelliteset |
|
498 * |
|
499 ***************************************************************************************/ |
|
500 int CCGpssimulator::satelliteset( TSatellite aArgs, int *rv ) |
|
501 { |
|
502 struct rpc_err rerr; |
|
503 |
|
504 // check the rv pointer |
|
505 if( rv == NULL ) { |
|
506 return ERR_INVALID_RV_POINTER; |
|
507 } |
|
508 |
|
509 // check that we have a connection |
|
510 if( cl == NULL ) { |
|
511 return ERR_STUB_NOT_CONNECTED; |
|
512 } |
|
513 |
|
514 // do the call |
|
515 *rv = *satelliteset_1( &aArgs, cl ); |
|
516 |
|
517 // check for rpc errors and return the result |
|
518 clnt_geterr( cl, &rerr ); |
|
519 if( rerr.re_status != RPC_SUCCESS ) { |
|
520 iLastRPCError = rerr; |
|
521 return ERR_RPC_ERROR; |
|
522 } |
|
523 return ERR_NONE; |
|
524 } |
|
525 |
|
526 |
|
527 /**************************************************************************************** |
|
528 * |
|
529 * PUBLIC FUNCTION: batchappendsentence |
|
530 * |
|
531 ***************************************************************************************/ |
|
532 int CCGpssimulator::batchappendsentence( TAppendSentence aArgs, int *rv ) |
|
533 { |
|
534 struct rpc_err rerr; |
|
535 |
|
536 // check the rv pointer |
|
537 if( rv == NULL ) { |
|
538 return ERR_INVALID_RV_POINTER; |
|
539 } |
|
540 |
|
541 // check that we have a connection |
|
542 if( cl == NULL ) { |
|
543 return ERR_STUB_NOT_CONNECTED; |
|
544 } |
|
545 |
|
546 // do the call |
|
547 *rv = *batchappendsentence_1( &aArgs, cl ); |
|
548 |
|
549 // check for rpc errors and return the result |
|
550 clnt_geterr( cl, &rerr ); |
|
551 if( rerr.re_status != RPC_SUCCESS ) { |
|
552 iLastRPCError = rerr; |
|
553 return ERR_RPC_ERROR; |
|
554 } |
|
555 return ERR_NONE; |
|
556 } |
|
557 |
|
558 |
|
559 /**************************************************************************************** |
|
560 * |
|
561 * PUBLIC FUNCTION: batchappendusersentence |
|
562 * |
|
563 ***************************************************************************************/ |
|
564 int CCGpssimulator::batchappendusersentence( TAppendUserSentence aArgs, int *rv ) |
|
565 { |
|
566 struct rpc_err rerr; |
|
567 |
|
568 // check the rv pointer |
|
569 if( rv == NULL ) { |
|
570 return ERR_INVALID_RV_POINTER; |
|
571 } |
|
572 |
|
573 // check that we have a connection |
|
574 if( cl == NULL ) { |
|
575 return ERR_STUB_NOT_CONNECTED; |
|
576 } |
|
577 |
|
578 // do the call |
|
579 *rv = *batchappendusersentence_1( &aArgs, cl ); |
|
580 |
|
581 // check for rpc errors and return the result |
|
582 clnt_geterr( cl, &rerr ); |
|
583 if( rerr.re_status != RPC_SUCCESS ) { |
|
584 iLastRPCError = rerr; |
|
585 return ERR_RPC_ERROR; |
|
586 } |
|
587 return ERR_NONE; |
|
588 } |
|
589 |
|
590 |
|
591 /**************************************************************************************** |
|
592 * |
|
593 * PUBLIC FUNCTION: batchsetdelay |
|
594 * |
|
595 ***************************************************************************************/ |
|
596 int CCGpssimulator::batchsetdelay( int aArgs, int *rv ) |
|
597 { |
|
598 struct rpc_err rerr; |
|
599 |
|
600 // check the rv pointer |
|
601 if( rv == NULL ) { |
|
602 return ERR_INVALID_RV_POINTER; |
|
603 } |
|
604 |
|
605 // check that we have a connection |
|
606 if( cl == NULL ) { |
|
607 return ERR_STUB_NOT_CONNECTED; |
|
608 } |
|
609 |
|
610 // do the call |
|
611 *rv = *batchsetdelay_1( &aArgs, cl ); |
|
612 |
|
613 // check for rpc errors and return the result |
|
614 clnt_geterr( cl, &rerr ); |
|
615 if( rerr.re_status != RPC_SUCCESS ) { |
|
616 iLastRPCError = rerr; |
|
617 return ERR_RPC_ERROR; |
|
618 } |
|
619 return ERR_NONE; |
|
620 } |
|
621 |
|
622 |
|
623 /**************************************************************************************** |
|
624 * |
|
625 * PUBLIC FUNCTION: batchreset |
|
626 * |
|
627 ***************************************************************************************/ |
|
628 int CCGpssimulator::batchreset( int *rv ) |
|
629 { |
|
630 struct rpc_err rerr; |
|
631 int aArgs = 0; |
|
632 |
|
633 // check the rv pointer |
|
634 if( rv == NULL ) { |
|
635 return ERR_INVALID_RV_POINTER; |
|
636 } |
|
637 |
|
638 // check that we have a connection |
|
639 if( cl == NULL ) { |
|
640 return ERR_STUB_NOT_CONNECTED; |
|
641 } |
|
642 |
|
643 // do the call |
|
644 *rv = *batchreset_1( &aArgs, cl ); |
|
645 |
|
646 // check for rpc errors and return the result |
|
647 clnt_geterr( cl, &rerr ); |
|
648 if( rerr.re_status != RPC_SUCCESS ) { |
|
649 iLastRPCError = rerr; |
|
650 return ERR_RPC_ERROR; |
|
651 } |
|
652 return ERR_NONE; |
|
653 } |
|
654 |
|
655 |
|
656 /**************************************************************************************** |
|
657 * |
|
658 * PUBLIC FUNCTION: setcomport |
|
659 * |
|
660 ***************************************************************************************/ |
|
661 int CCGpssimulator::setcomport( char *aArgs, int *rv ) |
|
662 { |
|
663 struct rpc_err rerr; |
|
664 |
|
665 // check the rv pointer |
|
666 if( rv == NULL ) { |
|
667 return ERR_INVALID_RV_POINTER; |
|
668 } |
|
669 |
|
670 // check that we have a connection |
|
671 if( cl == NULL ) { |
|
672 return ERR_STUB_NOT_CONNECTED; |
|
673 } |
|
674 |
|
675 // do the call |
|
676 *rv = *setcomport_1( &aArgs, cl ); |
|
677 |
|
678 // check for rpc errors and return the result |
|
679 clnt_geterr( cl, &rerr ); |
|
680 if( rerr.re_status != RPC_SUCCESS ) { |
|
681 iLastRPCError = rerr; |
|
682 return ERR_RPC_ERROR; |
|
683 } |
|
684 return ERR_NONE; |
|
685 } |
|
686 |
|
687 |
|
688 /**************************************************************************************** |
|
689 * |
|
690 * PUBLIC FUNCTION: setchunkmode |
|
691 * |
|
692 ***************************************************************************************/ |
|
693 int CCGpssimulator::setchunkmode( bool_t aArgs, int *rv ) |
|
694 { |
|
695 struct rpc_err rerr; |
|
696 |
|
697 // check the rv pointer |
|
698 if( rv == NULL ) { |
|
699 return ERR_INVALID_RV_POINTER; |
|
700 } |
|
701 |
|
702 // check that we have a connection |
|
703 if( cl == NULL ) { |
|
704 return ERR_STUB_NOT_CONNECTED; |
|
705 } |
|
706 |
|
707 // do the call |
|
708 *rv = *setchunkmode_1( &aArgs, cl ); |
|
709 |
|
710 // check for rpc errors and return the result |
|
711 clnt_geterr( cl, &rerr ); |
|
712 if( rerr.re_status != RPC_SUCCESS ) { |
|
713 iLastRPCError = rerr; |
|
714 return ERR_RPC_ERROR; |
|
715 } |
|
716 return ERR_NONE; |
|
717 } |
|
718 |
|
719 |
|
720 /**************************************************************************************** |
|
721 * |
|
722 * PUBLIC FUNCTION: setchunksize |
|
723 * |
|
724 ***************************************************************************************/ |
|
725 int CCGpssimulator::setchunksize( int aArgs, int *rv ) |
|
726 { |
|
727 struct rpc_err rerr; |
|
728 |
|
729 // check the rv pointer |
|
730 if( rv == NULL ) { |
|
731 return ERR_INVALID_RV_POINTER; |
|
732 } |
|
733 |
|
734 // check that we have a connection |
|
735 if( cl == NULL ) { |
|
736 return ERR_STUB_NOT_CONNECTED; |
|
737 } |
|
738 |
|
739 // do the call |
|
740 *rv = *setchunksize_1( &aArgs, cl ); |
|
741 |
|
742 // check for rpc errors and return the result |
|
743 clnt_geterr( cl, &rerr ); |
|
744 if( rerr.re_status != RPC_SUCCESS ) { |
|
745 iLastRPCError = rerr; |
|
746 return ERR_RPC_ERROR; |
|
747 } |
|
748 return ERR_NONE; |
|
749 } |
|
750 |
|
751 |
|
752 /**************************************************************************************** |
|
753 * |
|
754 * PUBLIC FUNCTION: setchunkdelay |
|
755 * |
|
756 ***************************************************************************************/ |
|
757 int CCGpssimulator::setchunkdelay( int aArgs, int *rv ) |
|
758 { |
|
759 struct rpc_err rerr; |
|
760 |
|
761 // check the rv pointer |
|
762 if( rv == NULL ) { |
|
763 return ERR_INVALID_RV_POINTER; |
|
764 } |
|
765 |
|
766 // check that we have a connection |
|
767 if( cl == NULL ) { |
|
768 return ERR_STUB_NOT_CONNECTED; |
|
769 } |
|
770 |
|
771 // do the call |
|
772 *rv = *setchunkdelay_1( &aArgs, cl ); |
|
773 |
|
774 // check for rpc errors and return the result |
|
775 clnt_geterr( cl, &rerr ); |
|
776 if( rerr.re_status != RPC_SUCCESS ) { |
|
777 iLastRPCError = rerr; |
|
778 return ERR_RPC_ERROR; |
|
779 } |
|
780 return ERR_NONE; |
|
781 } |
|
782 |
|
783 |
|
784 /**************************************************************************************** |
|
785 * |
|
786 * PUBLIC FUNCTION: startcomms |
|
787 * |
|
788 ***************************************************************************************/ |
|
789 int CCGpssimulator::startcomms( int *rv ) |
|
790 { |
|
791 struct rpc_err rerr; |
|
792 int aArgs = 0; |
|
793 |
|
794 // check the rv pointer |
|
795 if( rv == NULL ) { |
|
796 return ERR_INVALID_RV_POINTER; |
|
797 } |
|
798 |
|
799 // check that we have a connection |
|
800 if( cl == NULL ) { |
|
801 return ERR_STUB_NOT_CONNECTED; |
|
802 } |
|
803 |
|
804 // do the call |
|
805 *rv = *startcomms_1( &aArgs, cl ); |
|
806 |
|
807 // check for rpc errors and return the result |
|
808 clnt_geterr( cl, &rerr ); |
|
809 if( rerr.re_status != RPC_SUCCESS ) { |
|
810 iLastRPCError = rerr; |
|
811 return ERR_RPC_ERROR; |
|
812 } |
|
813 return ERR_NONE; |
|
814 } |
|
815 |
|
816 |
|
817 /**************************************************************************************** |
|
818 * |
|
819 * PUBLIC FUNCTION: stopcomms |
|
820 * |
|
821 ***************************************************************************************/ |
|
822 int CCGpssimulator::stopcomms( int *rv ) |
|
823 { |
|
824 struct rpc_err rerr; |
|
825 int aArgs = 0; |
|
826 |
|
827 // check the rv pointer |
|
828 if( rv == NULL ) { |
|
829 return ERR_INVALID_RV_POINTER; |
|
830 } |
|
831 |
|
832 // check that we have a connection |
|
833 if( cl == NULL ) { |
|
834 return ERR_STUB_NOT_CONNECTED; |
|
835 } |
|
836 |
|
837 // do the call |
|
838 *rv = *stopcomms_1( &aArgs, cl ); |
|
839 |
|
840 // check for rpc errors and return the result |
|
841 clnt_geterr( cl, &rerr ); |
|
842 if( rerr.re_status != RPC_SUCCESS ) { |
|
843 iLastRPCError = rerr; |
|
844 return ERR_RPC_ERROR; |
|
845 } |
|
846 return ERR_NONE; |
|
847 } |
|
848 |
|
849 |
|
850 /**************************************************************************************** |
|
851 * |
|
852 * PUBLIC FUNCTION: batchappenduserstring |
|
853 * |
|
854 ***************************************************************************************/ |
|
855 int CCGpssimulator::batchappenduserstring( TAppendString aArgs, int *rv ) |
|
856 { |
|
857 struct rpc_err rerr; |
|
858 |
|
859 // check the rv pointer |
|
860 if( rv == NULL ) { |
|
861 return ERR_INVALID_RV_POINTER; |
|
862 } |
|
863 |
|
864 // check that we have a connection |
|
865 if( cl == NULL ) { |
|
866 return ERR_STUB_NOT_CONNECTED; |
|
867 } |
|
868 |
|
869 // do the call |
|
870 *rv = *batchappenduserstring_1( &aArgs, cl ); |
|
871 |
|
872 // check for rpc errors and return the result |
|
873 clnt_geterr( cl, &rerr ); |
|
874 if( rerr.re_status != RPC_SUCCESS ) { |
|
875 iLastRPCError = rerr; |
|
876 return ERR_RPC_ERROR; |
|
877 } |
|
878 return ERR_NONE; |
|
879 } |