|
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 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 #ifndef STATCOMMS_H |
|
22 #define STATCOMMS_H |
|
23 |
|
24 #include "statcommon.h" |
|
25 #include "stattransport.h" |
|
26 |
|
27 class STATComms : public CSTATTransport |
|
28 { |
|
29 public: |
|
30 STATComms(); |
|
31 ~STATComms(); |
|
32 |
|
33 int SetTransport(const STATCONNECTTYPE eConnect); |
|
34 int Initialise(void); |
|
35 int Connect(const char *pAddress = NULL); |
|
36 int Send(const char cIdentifier, const char *pData = NULL, const unsigned long ulLength = 0); |
|
37 int Receive(char *cIdentifier, char **ppData = NULL, unsigned long *pLength = NULL); |
|
38 int Disconnect(void); |
|
39 int Release(void); |
|
40 char * Error(void); |
|
41 unsigned int GetMaxPacketSize(void) const; // Get the maximum size |
|
42 // of each data paacket we transfer |
|
43 // in one go. |
|
44 // Sub-classes will override this |
|
45 // if tey support breaking up of |
|
46 // packets. |
|
47 |
|
48 private: |
|
49 CSTATTransport *pTransport; // pointer to the selected transport |
|
50 }; |
|
51 |
|
52 ///////////////////////////////////////////////////////////////////////////// |
|
53 // STATComms::GetMaxPacketSize |
|
54 // Our implementation checks if we have a transport component |
|
55 // and delegates to that object or returns the base class |
|
56 // implementation. |
|
57 inline unsigned int STATComms::GetMaxPacketSize(void) const |
|
58 { |
|
59 return (pTransport->GetMaxPacketSize()); |
|
60 } |
|
61 |
|
62 #endif |