OLD
OLD
Diff: GSwifi.h
- Revision:
- 20:151b5a4fdd29
- Parent:
- 19:cad912f5a6ba
diff -r cad912f5a6ba -r 151b5a4fdd29 GSwifi.h --- a/GSwifi.h Tue Nov 06 08:54:19 2012 +0000 +++ b/GSwifi.h Thu Nov 08 01:28:45 2012 +0000 @@ -165,7 +165,7 @@ * @retval -1 failure * firmware: s2w-secureweb, s2w-web, s2w-wpsweb */ - int limitedap (GSSECURITY sec, const char *ssid, const char *pass, IpAddr ipaddr, IpAddr netmask); + int limitedap (GSSECURITY sec, const char *ssid, const char *pass, IpAddr ipaddr, IpAddr netmask, bool prov = false); /** * unassociate */ @@ -324,6 +324,7 @@ */ int certAdd (const char *name, const char *cert, int len); +#ifdef GS_USE_SMTP /** * send mail (smtp) * @param host SMTP server @@ -337,7 +338,9 @@ * @retval -1 failure */ int mail (Host &host, const char *to, const char *from, const char *subject, const char *mesg, const char *user = NULL, const char *pwd = NULL); +#endif +#ifdef GS_USE_HTTPD /** * start http server * @param port @@ -355,6 +358,7 @@ * attach uri to cgi handler */ int attach_httpd (const char *uri, onHttpdCgiFunc ponHttpCgi); +#endif /** * base64 encode @@ -364,6 +368,10 @@ * url encode */ int urlencode (char *str, char *buf, int len); + /** + * url decode + */ + int urldecode (char *str, char *buf, int len); #ifdef DEBUF void test (); @@ -378,16 +386,19 @@ char i2x (int i); void isr_recv (); void newSock (int cid, GSTYPE type, GSPROTOCOL pro, onGsReceiveFunc ponGsReceive); + int from_hex (int ch); + int to_hex (int code); - // send mail (smtp) +#ifdef GS_USE_SMTP int wait_smtp (int cid, int code); +#endif - // http server +#ifdef GS_USE_HTTPD int httpd_request (int cid, GS_httpd *gshttpd, char *dir); char *mimetype (char *file); +#endif private: - void poll_httpd (int cid, int len); Serial _gs; bool _rts; volatile bool _connect; @@ -404,9 +415,13 @@ struct GS_Socket _gs_sock[16]; time_t _time; +#ifdef GS_USE_HTTPD struct GS_httpd _httpd[16]; struct GS_httpd_handler _handler[10]; int _handler_count; + + void poll_httpd (int cid, int len); +#endif }; #endif