C027_Support library test

Dependencies:   C027_Support

Dependents:   C027_SupportTest_xively_location software_test_v1

Fork of Seeed_GPRS_Library_HelloWorld by wei zou

When running this example make sure you have:

  • edited the SIM PIN, APN, USER and PASSWORD for you network operator
  • have inserted a SIM card with enough credits
  • the antennas connected
  • have good reception (especially for GPS)
  • installed the mbed CDC drivers if you run windows
  • connected a terminal program, such as teraterm

The example will connect the modem to the network and attach it. I will place a post request to download a file from mbed website. It will do a USSD request and finally wait for incoming SMS. It will try to answer your SMS (try asking "where are you").

You should see a similar output in your preferred console program:

C027 Support Example
Device Init
Device Status:
  Device:       SARA-G350
  Power Save:   Active
  SIM:          Ready
  CCID:         xxxxxxxxxxxxxxxxxxxxxxxxxxx
  IMEI:         xxxxxxxxxxxxxxxxxxx
  IMSI:         xxxxxxxxxxxxxxxxxxx
  Manufacturer: u-blox
  Model:        SARA-G350
  Version:      08.49
Network Check
Network Status:
  Registration:       Home
  Signal Strength:    -87 dBm
  Operator:           Swisscom
  Phone Number:       +41xxxxxxxxxxx
Network Join
  IP Address: xx.xx.xx.xx
Socket Create
Socket Connect
Make a Http Post Request
Socket Send
Socket Recving
Socket 0: 337 bytes pending
Socket 0: 145 bytes pending
Socket 0: closed by remote host
Socket Recv "HTTP/1.1 200 OK
Server: nginx/1.1.19
Date: Thu, 10 Apr 2014 13:09:02 GMT
Content-Type: text/plain
Connection: close
Last-Modified: Fri, 27 Jul 2012 13:30:34 GMT
Cache-Control: max-age=36000
Expires: Thu, 10 Apr 2014 20:43:53 GMT
Vary: Accept-Encoding
X-Mystery-Header: 260358892
X-be: web0_prod_sjc
Age: 8709

Hello world!
"
Socket Close
Socket Free
Network Disconnect
Send Ussd Command *#134#
Got Ussd Answer: "UNKNOWN APPLICATION"
Checking SMS and GPS
GPS Location: 47.28xxx 8.56xxx
GPS Location: 47.28xxx 8.56xxx
...
GPS Location: 47.28xxx 8.56xxx
GPS Location: 47.28xxx 8.56xxx
Network Status:
  Registration:       Home
  Signal Strength:    -89 dBm
  Operator:           Swisscom
  Phone Number:       +41xxxxxxxxx
GPS Location: 47.28xxx 8.56xxx
GPS Location: 47.28xxx 8.56xxx
...
Committer:
mazgch
Date:
Fri Dec 12 07:54:19 2014 +0000
Revision:
28:334263983fcd
Parent:
27:fe3b383dd4ec
Child:
29:16f1037626e3
Child:
30:062717f25e41
remove debug

Who changed what in which revision?

UserRevisionLine numberNew contents of line
lawliet 0:4e3cb26f6019 1 #include "mbed.h"
mazgch 9:26f694bc31b4 2
mazgch 19:f022ff746eb8 3 //------------------------------------------------------------------------------------
mazgch 11:b8505cbbd55c 4 /* This example was tested on C027-U20 and C027-G35 with the on board modem.
mazgch 11:b8505cbbd55c 5
mazgch 18:50e6c4ed8a4a 6 Additionally it was tested with a shield where the SARA-G350/U260/U270 RX/TX/PWRON
mazgch 11:b8505cbbd55c 7 is connected to D0/D1/D4 and the GPS SCL/SDA is connected D15/D15. In this
mazgch 11:b8505cbbd55c 8 configuration the following platforms were tested (it is likely that others
mazgch 11:b8505cbbd55c 9 will work as well)
mazgch 19:f022ff746eb8 10 - U-BLOX: C027-G35, C027-U20, C027-C20 (for shield set define C027_FORCE_SHIELD)
mazgch 18:50e6c4ed8a4a 11 - NXP: LPC1549v2, LPC4088qsb
mazgch 18:50e6c4ed8a4a 12 - Freescale: FRDM-KL05Z, FRDM-KL25Z, FRDM-KL46Z, FRDM-K64F
mazgch 12:96c7b62c7aaf 13 - STM: NUCLEO-F401RE, NUCLEO-F030R8
mazgch 18:50e6c4ed8a4a 14 mount resistors SB13/14 1k, SB62/63 0R
mazgch 11:b8505cbbd55c 15 */
mazgch 19:f022ff746eb8 16 #include "GPS.h"
mazgch 19:f022ff746eb8 17 #include "MDM.h"
mazgch 19:f022ff746eb8 18 //------------------------------------------------------------------------------------
mazgch 19:f022ff746eb8 19 // You need to configure these cellular modem / SIM parameters.
mazgch 19:f022ff746eb8 20 // These parameters are ignored for LISA-C200 variants and can be left NULL.
mazgch 19:f022ff746eb8 21 //------------------------------------------------------------------------------------
mazgch 19:f022ff746eb8 22 //! Set your secret SIM pin here (e.g. "1234"). Check your SIM manual.
mazgch 19:f022ff746eb8 23 #define SIMPIN NULL
mazgch 19:f022ff746eb8 24 /*! The APN of your network operator SIM, sometimes it is "internet" check your
mazgch 19:f022ff746eb8 25 contract with the network operator. You can also try to look-up your settings in
mazgch 19:f022ff746eb8 26 google: https://www.google.de/search?q=APN+list */
mazgch 21:a090a5043e23 27 #define APN NULL
mazgch 19:f022ff746eb8 28 //! Set the user name for your APN, or NULL if not needed
mazgch 19:f022ff746eb8 29 #define USERNAME NULL
mazgch 19:f022ff746eb8 30 //! Set the password for your APN, or NULL if not needed
mazgch 19:f022ff746eb8 31 #define PASSWORD NULL
mazgch 19:f022ff746eb8 32 //------------------------------------------------------------------------------------
lawliet 0:4e3cb26f6019 33
lawliet 0:4e3cb26f6019 34 int main(void)
lawliet 0:4e3cb26f6019 35 {
mazgch 2:b77151f111a9 36 int ret;
mazgch 19:f022ff746eb8 37 #ifdef LARGE_DATA
mazgch 16:43f6de7bc38b 38 char buf[2048] = "";
mazgch 17:c293780a40ac 39 #else
mazgch 17:c293780a40ac 40 char buf[512] = "";
mazgch 17:c293780a40ac 41 #endif
lawliet 0:4e3cb26f6019 42
mazgch 19:f022ff746eb8 43 // Create the GPS object
mazgch 19:f022ff746eb8 44 #if 1 // use GPSI2C class
mazgch 19:f022ff746eb8 45 GPSI2C gps;
mazgch 19:f022ff746eb8 46 #else // or GPSSerial class
mazgch 19:f022ff746eb8 47 GPSSerial gps;
mazgch 10:d2da2028a233 48 #endif
mazgch 10:d2da2028a233 49 // Create the modem object
mazgch 19:f022ff746eb8 50 MDMSerial mdm;
mazgch 28:334263983fcd 51 //mdm.setDebug(4); // enable this for debugging issues
mazgch 2:b77151f111a9 52 // initialize the modem
mazgch 19:f022ff746eb8 53 MDMParser::DevStatus devStatus = {};
mazgch 19:f022ff746eb8 54 MDMParser::NetStatus netStatus = {};
mazgch 10:d2da2028a233 55 bool mdmOk = mdm.init(SIMPIN, &devStatus);
mazgch 19:f022ff746eb8 56 mdm.dumpDevStatus(&devStatus);
mazgch 19:f022ff746eb8 57 if (mdmOk) {
mazgch 20:52f0e5de8c3d 58 #if 0
mazgch 20:52f0e5de8c3d 59 // file system API
mazgch 19:f022ff746eb8 60 const char* filename = "File";
mazgch 19:f022ff746eb8 61 char buf[] = "Hello World";
mazgch 19:f022ff746eb8 62 printf("writeFile \"%s\"\r\n", buf);
mazgch 19:f022ff746eb8 63 if (mdm.writeFile(filename, buf, sizeof(buf)))
mazgch 19:f022ff746eb8 64 {
mazgch 19:f022ff746eb8 65 memset(buf, 0, sizeof(buf));
mazgch 19:f022ff746eb8 66 int len = mdm.readFile(filename, buf, sizeof(buf));
mazgch 24:81f5b43a6585 67 if (len >= 0)
mazgch 19:f022ff746eb8 68 printf("readFile %d \"%.*s\"\r\n", len, len, buf);
mazgch 19:f022ff746eb8 69 mdm.delFile(filename);
mazgch 19:f022ff746eb8 70 }
mazgch 20:52f0e5de8c3d 71 #endif
mazgch 20:52f0e5de8c3d 72
mazgch 20:52f0e5de8c3d 73 // wait until we are connected
mazgch 20:52f0e5de8c3d 74 mdmOk = mdm.registerNet(&netStatus);
mazgch 20:52f0e5de8c3d 75 mdm.dumpNetStatus(&netStatus);
mazgch 20:52f0e5de8c3d 76 }
mazgch 20:52f0e5de8c3d 77 if (mdmOk)
mazgch 20:52f0e5de8c3d 78 {
mazgch 19:f022ff746eb8 79 // http://www.geckobeach.com/cellular/secrets/gsmcodes.php
mazgch 19:f022ff746eb8 80 // http://de.wikipedia.org/wiki/USSD-Codes
mazgch 19:f022ff746eb8 81 const char* ussd = "*130#"; // You may get answer "UNKNOWN APPLICATION"
mazgch 19:f022ff746eb8 82 printf("Ussd Send Command %s\r\n", ussd);
mazgch 19:f022ff746eb8 83 ret = mdm.ussdCommand(ussd, buf);
mazgch 19:f022ff746eb8 84 if (ret > 0)
mazgch 19:f022ff746eb8 85 printf("Ussd Got Answer: \"%*s\"\r\n", ret, buf);
mazgch 19:f022ff746eb8 86
mazgch 4:90ab1ec64b0e 87 // join the internet connection
mazgch 19:f022ff746eb8 88 MDMParser::IP ip = mdm.join(APN,USERNAME,PASSWORD);
mazgch 28:334263983fcd 89 if (ip != NOIP)
mazgch 2:b77151f111a9 90 {
mazgch 19:f022ff746eb8 91 mdm.dumpIp(ip);
mazgch 19:f022ff746eb8 92 printf("Make a Http Post Request\r\n");
mazgch 4:90ab1ec64b0e 93 int socket = mdm.socketSocket(MDMParser::IPPROTO_TCP);
mazgch 4:90ab1ec64b0e 94 if (socket >= 0)
mazgch 2:b77151f111a9 95 {
mazgch 16:43f6de7bc38b 96 mdm.socketSetBlocking(socket, 10000);
mazgch 4:90ab1ec64b0e 97 if (mdm.socketConnect(socket, "mbed.org", 80))
mazgch 4:90ab1ec64b0e 98 {
mazgch 4:90ab1ec64b0e 99 const char http[] = "GET /media/uploads/mbed_official/hello.txt HTTP/1.0\r\n\r\n";
mazgch 4:90ab1ec64b0e 100 mdm.socketSend(socket, http, sizeof(http)-1);
mazgch 4:90ab1ec64b0e 101
mazgch 19:f022ff746eb8 102 ret = mdm.socketRecv(socket, buf, sizeof(buf)-1);
mazgch 19:f022ff746eb8 103 if (ret > 0)
mazgch 19:f022ff746eb8 104 printf("Socket Recv \"%*s\"\r\n", ret, buf);
mazgch 4:90ab1ec64b0e 105 mdm.socketClose(socket);
mazgch 4:90ab1ec64b0e 106 }
mazgch 4:90ab1ec64b0e 107 mdm.socketFree(socket);
mazgch 4:90ab1ec64b0e 108 }
mazgch 2:b77151f111a9 109
mazgch 16:43f6de7bc38b 110 int port = 7;
mazgch 16:43f6de7bc38b 111 const char* host = "echo.u-blox.com";
mazgch 16:43f6de7bc38b 112 MDMParser::IP ip = mdm.gethostbyname(host);
mazgch 16:43f6de7bc38b 113 char data[] = "\r\nxxx Socket Hello World\r\n"
mazgch 19:f022ff746eb8 114 #ifdef LARGE_DATA
mazgch 17:c293780a40ac 115 "00 0123456789 0123456789 0123456789 0123456789 0123456789 \r\n"
mazgch 17:c293780a40ac 116 "01 0123456789 0123456789 0123456789 0123456789 0123456789 \r\n"
mazgch 17:c293780a40ac 117 "02 0123456789 0123456789 0123456789 0123456789 0123456789 \r\n"
mazgch 17:c293780a40ac 118 "03 0123456789 0123456789 0123456789 0123456789 0123456789 \r\n"
mazgch 17:c293780a40ac 119 "04 0123456789 0123456789 0123456789 0123456789 0123456789 \r\n"
mazgch 17:c293780a40ac 120
mazgch 17:c293780a40ac 121 "05 0123456789 0123456789 0123456789 0123456789 0123456789 \r\n"
mazgch 17:c293780a40ac 122 "06 0123456789 0123456789 0123456789 0123456789 0123456789 \r\n"
mazgch 17:c293780a40ac 123 "07 0123456789 0123456789 0123456789 0123456789 0123456789 \r\n"
mazgch 17:c293780a40ac 124 "08 0123456789 0123456789 0123456789 0123456789 0123456789 \r\n"
mazgch 17:c293780a40ac 125 "09 0123456789 0123456789 0123456789 0123456789 0123456789 \r\n"
mazgch 16:43f6de7bc38b 126
mazgch 17:c293780a40ac 127 "10 0123456789 0123456789 0123456789 0123456789 0123456789 \r\n"
mazgch 17:c293780a40ac 128 "11 0123456789 0123456789 0123456789 0123456789 0123456789 \r\n"
mazgch 17:c293780a40ac 129 "12 0123456789 0123456789 0123456789 0123456789 0123456789 \r\n"
mazgch 17:c293780a40ac 130 "13 0123456789 0123456789 0123456789 0123456789 0123456789 \r\n"
mazgch 17:c293780a40ac 131 "14 0123456789 0123456789 0123456789 0123456789 0123456789 \r\n"
mazgch 17:c293780a40ac 132
mazgch 17:c293780a40ac 133 "15 0123456789 0123456789 0123456789 0123456789 0123456789 \r\n"
mazgch 17:c293780a40ac 134 "16 0123456789 0123456789 0123456789 0123456789 0123456789 \r\n"
mazgch 17:c293780a40ac 135 "17 0123456789 0123456789 0123456789 0123456789 0123456789 \r\n"
mazgch 17:c293780a40ac 136 "18 0123456789 0123456789 0123456789 0123456789 0123456789 \r\n"
mazgch 17:c293780a40ac 137 "19 0123456789 0123456789 0123456789 0123456789 0123456789 \r\n"
mazgch 16:43f6de7bc38b 138 #endif
mazgch 17:c293780a40ac 139 "End\r\n";
mazgch 16:43f6de7bc38b 140
mazgch 19:f022ff746eb8 141 printf("Testing TCP sockets with ECHO server\r\n");
mazgch 16:43f6de7bc38b 142 socket = mdm.socketSocket(MDMParser::IPPROTO_TCP);
mazgch 16:43f6de7bc38b 143 if (socket >= 0)
mazgch 16:43f6de7bc38b 144 {
mazgch 16:43f6de7bc38b 145 mdm.socketSetBlocking(socket, 10000);
mazgch 16:43f6de7bc38b 146 if (mdm.socketConnect(socket, host, port)) {
mazgch 16:43f6de7bc38b 147 memcpy(data, "\r\nTCP", 5);
mazgch 16:43f6de7bc38b 148 ret = mdm.socketSend(socket, data, sizeof(data)-1);
mazgch 16:43f6de7bc38b 149 if (ret == sizeof(data)-1) {
mazgch 19:f022ff746eb8 150 printf("Socket Send %d \"%s\"\r\n", ret, data);
mazgch 16:43f6de7bc38b 151 }
mazgch 16:43f6de7bc38b 152 ret = mdm.socketRecv(socket, buf, sizeof(buf)-1);
mazgch 16:43f6de7bc38b 153 if (ret >= 0) {
mazgch 19:f022ff746eb8 154 printf("Socket Recv %d \"%.*s\"\r\n", ret, ret, buf);
mazgch 16:43f6de7bc38b 155 }
mazgch 16:43f6de7bc38b 156 mdm.socketClose(socket);
mazgch 16:43f6de7bc38b 157 }
mazgch 16:43f6de7bc38b 158 mdm.socketFree(socket);
mazgch 16:43f6de7bc38b 159 }
mazgch 16:43f6de7bc38b 160
mazgch 19:f022ff746eb8 161 printf("Testing UDP sockets with ECHO server\r\n");
mazgch 16:43f6de7bc38b 162 socket = mdm.socketSocket(MDMParser::IPPROTO_UDP, port);
mazgch 16:43f6de7bc38b 163 if (socket >= 0)
mazgch 16:43f6de7bc38b 164 {
mazgch 16:43f6de7bc38b 165 mdm.socketSetBlocking(socket, 10000);
mazgch 16:43f6de7bc38b 166 memcpy(data, "\r\nUDP", 5);
mazgch 16:43f6de7bc38b 167 ret = mdm.socketSendTo(socket, ip, port, data, sizeof(data)-1);
mazgch 16:43f6de7bc38b 168 if (ret == sizeof(data)-1) {
mazgch 19:f022ff746eb8 169 printf("Socket SendTo %s:%d " IPSTR " %d \"%s\"\r\n", host, port, IPNUM(ip), ret, data);
mazgch 16:43f6de7bc38b 170 }
mazgch 16:43f6de7bc38b 171 ret = mdm.socketRecvFrom(socket, &ip, &port, buf, sizeof(buf)-1);
mazgch 16:43f6de7bc38b 172 if (ret >= 0) {
mazgch 19:f022ff746eb8 173 printf("Socket RecvFrom " IPSTR ":%d %d \"%.*s\" \r\n", IPNUM(ip),port, ret, ret,buf);
mazgch 16:43f6de7bc38b 174 }
mazgch 16:43f6de7bc38b 175 mdm.socketFree(socket);
mazgch 16:43f6de7bc38b 176 }
mazgch 16:43f6de7bc38b 177
mazgch 4:90ab1ec64b0e 178 // disconnect
mazgch 4:90ab1ec64b0e 179 mdm.disconnect();
mazgch 2:b77151f111a9 180 }
mazgch 10:d2da2028a233 181 }
mazgch 19:f022ff746eb8 182 printf("SMS and GPS Loop\r\n");
mazgch 10:d2da2028a233 183 char link[128] = "";
mazgch 10:d2da2028a233 184 unsigned int i = 0xFFFFFFFF;
mazgch 10:d2da2028a233 185 const int wait = 100;
mazgch 10:d2da2028a233 186 bool abort = false;
mazgch 11:b8505cbbd55c 187 //DigitalOut led(LED1);
mazgch 10:d2da2028a233 188 while (!abort) {
mazgch 19:f022ff746eb8 189 // led = !led;
mazgch 10:d2da2028a233 190 while ((ret = gps.getMessage(buf, sizeof(buf))) > 0)
mazgch 10:d2da2028a233 191 {
mazgch 10:d2da2028a233 192 int len = LENGTH(ret);
mazgch 19:f022ff746eb8 193 //printf("NMEA: %.*s\r\n", len-2, msg);
mazgch 19:f022ff746eb8 194 if ((PROTOCOL(ret) == GPSParser::NMEA) && (len > 6))
mazgch 4:90ab1ec64b0e 195 {
mazgch 27:fe3b383dd4ec 196 // talker is $GA=Galileo $GB=Beidou $GL=Glonass $GN=Combined $GP=GPS
mazgch 27:fe3b383dd4ec 197 if ((buf[0] == '$') || buf[1] == 'G') {
mazgch 27:fe3b383dd4ec 198 #define _CHECK_TALKER(s) ((buf[3] == s[0]) && (buf[4] == s[1]) && (buf[5] == s[2]))
mazgch 27:fe3b383dd4ec 199 if (_CHECK_TALKER("GLL")) {
mazgch 27:fe3b383dd4ec 200 double la = 0, lo = 0;
mazgch 27:fe3b383dd4ec 201 char ch;
mazgch 27:fe3b383dd4ec 202 if (gps.getNmeaAngle(1,buf,len,la) &&
mazgch 27:fe3b383dd4ec 203 gps.getNmeaAngle(3,buf,len,lo) &&
mazgch 27:fe3b383dd4ec 204 gps.getNmeaItem(6,buf,len,ch) && ch == 'A')
mazgch 27:fe3b383dd4ec 205 {
mazgch 27:fe3b383dd4ec 206 printf("GPS Location: %.5f %.5f\r\n", la, lo);
mazgch 27:fe3b383dd4ec 207 sprintf(link, "I am here!\n"
mazgch 27:fe3b383dd4ec 208 "https://maps.google.com/?q=%.5f,%.5f", la, lo);
mazgch 27:fe3b383dd4ec 209 }
mazgch 27:fe3b383dd4ec 210 } else if (_CHECK_TALKER("GGA") || _CHECK_TALKER("GNS") ) {
mazgch 27:fe3b383dd4ec 211 double a = 0;
mazgch 27:fe3b383dd4ec 212 if (gps.getNmeaItem(9,buf,len,a)) // altitude msl [m]
mazgch 27:fe3b383dd4ec 213 printf("GPS Altitude: %.1f\r\n", a);
mazgch 27:fe3b383dd4ec 214 } else if (_CHECK_TALKER("VTG")) {
mazgch 27:fe3b383dd4ec 215 double s = 0;
mazgch 27:fe3b383dd4ec 216 if (gps.getNmeaItem(7,buf,len,s)) // speed [km/h]
mazgch 27:fe3b383dd4ec 217 printf("GPS Speed: %.1f\r\n", s);
mazgch 19:f022ff746eb8 218 }
mazgch 4:90ab1ec64b0e 219 }
mazgch 4:90ab1ec64b0e 220 }
mazgch 10:d2da2028a233 221 }
mazgch 19:f022ff746eb8 222 if (mdmOk && (i++ == 5000/wait)) {
mazgch 10:d2da2028a233 223 i = 0;
mazgch 10:d2da2028a233 224 // check the network status
mazgch 15:ea10b6cf8c85 225 if (mdm.checkNetStatus(&netStatus)) {
mazgch 19:f022ff746eb8 226 mdm.dumpNetStatus(&netStatus, fprintf, stdout);
mazgch 15:ea10b6cf8c85 227 }
mazgch 10:d2da2028a233 228
mazgch 10:d2da2028a233 229 // checking unread sms
mazgch 10:d2da2028a233 230 int ix[8];
mazgch 10:d2da2028a233 231 int n = mdm.smsList("REC UNREAD", ix, 8);
mazgch 10:d2da2028a233 232 if (8 < n) n = 8;
mazgch 10:d2da2028a233 233 while (0 < n--)
mazgch 10:d2da2028a233 234 {
mazgch 10:d2da2028a233 235 char num[32];
mazgch 19:f022ff746eb8 236 printf("Unread SMS at index %d\r\n", ix[n]);
mazgch 10:d2da2028a233 237 if (mdm.smsRead(ix[n], num, buf, sizeof(buf))) {
mazgch 19:f022ff746eb8 238 printf("Got SMS from \"%s\" with text \"%s\"\r\n", num, buf);
mazgch 19:f022ff746eb8 239 printf("Delete SMS at index %d\r\n", ix[n]);
mazgch 10:d2da2028a233 240 mdm.smsDelete(ix[n]);
mazgch 10:d2da2028a233 241 // provide a reply
mazgch 10:d2da2028a233 242 const char* reply = "Hello my friend";
mazgch 10:d2da2028a233 243 if (strstr(buf, /*w*/"here are you"))
mazgch 10:d2da2028a233 244 reply = *link ? link : "I don't know"; // reply wil location link
mazgch 19:f022ff746eb8 245 else if (strstr(buf, /*s*/"hutdown"))
mazgch 19:f022ff746eb8 246 abort = true, reply = "bye bye";
mazgch 19:f022ff746eb8 247 printf("Send SMS reply \"%s\" to \"%s\"\r\n", reply, num);
mazgch 10:d2da2028a233 248 mdm.smsSend(num, reply);
mazgch 4:90ab1ec64b0e 249 }
mazgch 4:90ab1ec64b0e 250 }
mazgch 9:26f694bc31b4 251 }
mazgch 10:d2da2028a233 252 wait_ms(wait);
lawliet 0:4e3cb26f6019 253 }
mazgch 19:f022ff746eb8 254 gps.powerOff();
mazgch 10:d2da2028a233 255 mdm.powerOff();
lawliet 0:4e3cb26f6019 256 return 0;
lawliet 0:4e3cb26f6019 257 }