OLD
OLD
Diff: GSwifi.h
- Revision:
- 1:b127c6c5241d
- Parent:
- 0:2f6062c6d018
- Child:
- 2:c6e0e97901b3
--- a/GSwifi.h Mon Jul 09 14:36:06 2012 +0000 +++ b/GSwifi.h Thu Jul 12 08:19:50 2012 +0000 @@ -16,6 +16,7 @@ #include "ipaddr.h" #define GS_BAUD 115200 +#define GS_UART_DIRECT #define GS_BULK @@ -69,6 +70,7 @@ GSRES_DHCP, GSRES_DNSLOOKUP, GSRES_HTTP, + GSRES_RSSI, }; enum GSMODE { @@ -90,7 +92,7 @@ /** * data receive callback function */ -typedef void (*onGsReceiveFunc)(int cid, int acid, int len); +typedef void (*onGsReceiveFunc)(int cid, int len); struct GS_Socket { GSTYPE type; @@ -98,7 +100,7 @@ bool connect; Host host; RingBuffer *data; - int acid; + int lcid; int received; onGsReceiveFunc onGsReceive; }; @@ -162,6 +164,10 @@ */ int setAddress (IpAddr ipaddr, IpAddr netmask, IpAddr gateway, IpAddr nameserver); /** + * get ip address + */ + int getAddress (IpAddr &ipaddr, IpAddr &netmask, IpAddr &gateway, IpAddr &nameserver); + /** * resolv hostname */ int getHostByName (const char* name, IpAddr &addr); @@ -201,6 +207,10 @@ * status */ GSSTATUS getStatus (); + /** + * RSSI dBm + */ + int getRssi (); /** * polling @@ -258,6 +268,7 @@ int x2i (char c); char i2x (int i); void isr_recv (); + int newSock (int cid, GSTYPE type, GSPROTOCOL pro, onGsReceiveFunc ponGsReceive); private: Serial _gs; @@ -267,7 +278,7 @@ volatile int _gs_ok, _gs_failure, _gs_enter; GSMODE _gs_mode; int _escape; - int _cid; + int _cid, _rssi; IpAddr _ipaddr, _netmask, _gateway, _nameserver, _resolv; Host _from, _to; char mac[6];