1 | /*
|
---|
2 | This file is part of the GSM3 communications library for Arduino
|
---|
3 | -- Multi-transport communications platform
|
---|
4 | -- Fully asynchronous
|
---|
5 | -- Includes code for the Arduino-Telefonica GSM/GPRS Shield V1
|
---|
6 | -- Voice calls
|
---|
7 | -- SMS
|
---|
8 | -- TCP/IP connections
|
---|
9 | -- HTTP basic clients
|
---|
10 |
|
---|
11 | This library has been developed by Telefónica Digital - PDI -
|
---|
12 | - Physical Internet Lab, as part as its collaboration with
|
---|
13 | Arduino and the Open Hardware Community.
|
---|
14 |
|
---|
15 | September-December 2012
|
---|
16 |
|
---|
17 | This library is free software; you can redistribute it and/or
|
---|
18 | modify it under the terms of the GNU Lesser General Public
|
---|
19 | License as published by the Free Software Foundation; either
|
---|
20 | version 2.1 of the License, or (at your option) any later version.
|
---|
21 |
|
---|
22 | This library is distributed in the hope that it will be useful,
|
---|
23 | but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
24 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
---|
25 | Lesser General Public License for more details.
|
---|
26 |
|
---|
27 | You should have received a copy of the GNU Lesser General Public
|
---|
28 | License along with this library; if not, write to the Free Software
|
---|
29 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
---|
30 |
|
---|
31 | The latest version of this library can always be found at
|
---|
32 | https://github.com/BlueVia/Official-Arduino
|
---|
33 | */
|
---|
34 | #ifndef __GSM3_MOBILESERVERPROVIDER__
|
---|
35 | #define __GSM3_MOBILESERVERPROVIDER__
|
---|
36 |
|
---|
37 |
|
---|
38 | #include <GSM3MobileAccessProvider.h>
|
---|
39 | #include <inttypes.h>
|
---|
40 | #include <stddef.h>
|
---|
41 |
|
---|
42 |
|
---|
43 | class GSM3MobileServerProvider
|
---|
44 | {
|
---|
45 | /** Get socket status
|
---|
46 | @param s Socket
|
---|
47 | @return modem status (true if connected)
|
---|
48 | */
|
---|
49 | virtual bool getSocketAsServerModemStatus(int s)=0;
|
---|
50 |
|
---|
51 | public:
|
---|
52 |
|
---|
53 | /** minSocketAsServer
|
---|
54 | @return socket
|
---|
55 | */
|
---|
56 | virtual int minSocketAsServer()=0;
|
---|
57 |
|
---|
58 | /** maxSocketAsServer
|
---|
59 | @return socket
|
---|
60 | */
|
---|
61 | virtual int maxSocketAsServer()=0;
|
---|
62 |
|
---|
63 | /** Get last command status
|
---|
64 | @return returns 0 if last command is still executing, 1 success, >1 error
|
---|
65 | */
|
---|
66 | virtual int ready()=0;
|
---|
67 |
|
---|
68 | /** Constructor */
|
---|
69 | GSM3MobileServerProvider(){};
|
---|
70 |
|
---|
71 | /** Connect server to TCP port
|
---|
72 | @param port TCP port
|
---|
73 | @return command error if exists
|
---|
74 | */
|
---|
75 | virtual int connectTCPServer(int port)=0;
|
---|
76 | //virtual int getIP(char* LocalIP, int LocalIPlength)=0;
|
---|
77 |
|
---|
78 | /** Get new occupied socket as server
|
---|
79 | @return return -1 if no new socket has been occupied
|
---|
80 | */
|
---|
81 | virtual int getNewOccupiedSocketAsServer()=0;
|
---|
82 |
|
---|
83 | /** Get socket status
|
---|
84 | @param socket Socket
|
---|
85 | @return socket status (true if connected)
|
---|
86 | */
|
---|
87 | virtual bool getStatusSocketAsServer(uint8_t socket)=0;
|
---|
88 |
|
---|
89 | // virtual int disconnectTCP(bool client1Server0, int idsocket)=0;
|
---|
90 |
|
---|
91 | };
|
---|
92 |
|
---|
93 | extern GSM3MobileServerProvider* theGSM3MobileServerProvider;
|
---|
94 |
|
---|
95 | #endif
|
---|