Write a GSM/GPRS library for CrossWorks [Imported Thread]
Idea originally posted by: Jonathan Elliott 21/04/2009
Suggestions on a postcard please.
Comments
18/10/2010 Jonathan Elliott (Admin)
Nah, that code didn't work as a comment, did it? Use Great Code or astyle or some code formatting utility...
18/10/2010 Jonathan Elliott (Admin)
I'm not sure this will work as a comment: static void handle_hget(void) { CTL_ERROR_t err; CTL_NET_IP_ADDR_t addr; CTL_SOCKET_t s; CTL_TCP_SOCKET_OPTIONS_t options; int verbose = 0; const char *arg; char data[33]; for (;;) { arg = strtok(0, " "); if (arg == 0) break; if (strcmp(arg, "-v") == 0) verbose = 1; else { err = ctl_dns_get_host_by_name(arg, &addr, 1000); if (err != CTL_NO_ERROR) { ccp_print_error(err); return; } // Open a socket to the host on port 80. s = ctl_tcp_socket(); if (s == 0) { ccp_printf("No sockets available\n"); return; } ctl_tcp_get_socket_options(s, &options); options.idleSocketShutdown = 10; // 10 seconds of idleness before we give up options.maxReceiveSegmentSize = 1460; // For Ethernet transport options.maxOwnedReceiveBytes = 2*1460; //2 * options.maxReceiveSegmentSize; ctl_tcp_set_socket_options(s, &options); ccp_printf("Connecting to %s (%I)...\n", arg, addr); if (ctl_tcp_connect(s, addr, HTONS(80), 1000) >= CTL_OK) { unsigned len; // Send the request ctl_tcp_printf(s, "GET / HTTP/1.0\r\nHost: %s\r\n\r\n", arg); ctl_tcp_send(s, 0, 0, 0, CTL_TCP_SEND_PUSH); // Read the data. len = 0; for (;;) { CTL_STATUS_t stat; stat = ctl_tcp_recv(s, data, sizeof(data)-1, 1000); if (stat == CTL_NET_ERR_TIMEDOUT) { // Didn't get anything, loiter... // ccp_print_status(stat); } else if (stat < 0) { // Error reading the socket or the socket closed. ccp_print_status(stat); ccp_printf("Got %d bytes\n", len); break; } else { len += stat; data[stat] = 0; if (verbose) ccp_printf("%s", data); } } } else ccp_printf("Couldn't connect to %I port 80\n", addr); } } }
18/10/2010 Peter McC
I would like to issue GET/POST requests - ie connect to a remote server
18/10/2010 Jonathan Elliott (Admin)
Current development hardware: http://www.sparkfun.com/commerce/product_info.php?products_id=9607 and http://www.soldercore.com/ When you say "to do POST/GET" do you mean you wish to issue GET or respond to GET requests? Same for POST.
18/10/2010 Peter McC
CTL is no problem - what hardware are you using? Are you planning to write routines to do HTTP POST/GET ?
18/10/2010 Jonathan Elliott (Admin)
Well, I can only test on the GPRS hardware I have that supports this. You may well be able to use it for your own modem. However, it's all tied up with CTL therefore you must have a CTL project. If you are not comfortable with CTL then you'll need to look somewhere else. TCP/IP is pretty stable at present, so it's just a matter of cleaning up the documentation and so on. You will probably be able to cut quite a lot of of the generic code if you need to (ho http server, no ftp server, and so on...) Just don't initialize them...
18/10/2010 Peter McC
Based on your current schedules is this likely to be available before Christmas? I'm not after a promise just a general vague idea...
18/10/2010 Jonathan Elliott (Admin)
I have the hardware to do this, and am working on TCP/Ip and PPP at present. It's not going to be available immediately. I'd hate to promise something and then not deliver.
18/10/2010 Peter McC
Hi. Is this likely to happen any time soon? We're about to start writing something ourselves but if we can get it from somewhere else already done... that would be great!
15/02/2010 peter_mcc
This would be great - but it would have to work across a series of modems.
17/09/2009 Akos Buzogany
Gerwin is right. GSM/GPRS devices have different syntax, especially on the GPRS side. Making or dropping a call is easy and implemented the same way on almost every model, but the more complex features differs a lot. The procedure of making, and maintaining a TCP/IP connection, sending data and interpreting its result is VERY different between vendors.
07/08/2009 Peter S.
The world goes wireless. A wireless http, ftp, pop3 and smtp connection via GRPS for mobile devices will be great.
27/05/2009 Gerwin Van Der Kruis
We have quite some experience with gsm libs , because not all gsm/gprs modems use the same standards this is going to difficult
21/04/2009 Frank Seidel
The GSM/GRPS library should be developed for data transfer. My Wishes: SMS and MMS support; Internet services like HTTP, FTP, POP3, SMTP; Modem and FAX functions. Because some GSM actions are time intensive, it must be embedded in an RTOS. Commands like: GsmLogin(PinCode); SendEmail(To, CC, EmailData, AttachedFile); GsmLogout(); send a complete Email via Internet services. These three commands only starts the actions, so the GsmLogout command is called at a time, when the GSM login is actually not started.
Please sign in to leave a comment.
Comments
0 comments