TCP send example

Dependencies:   FXOS8700CQ mbed

Fork of StarterKit by Rick McConney

Wnc.h

Committer:
elmkom
Date:
2017-02-02
Revision:
48:401a797a695f
Parent:
45:fe90f1fcb4e0

File content as of revision 48:401a797a695f:


#ifndef Wnc_
#define Wnc_

#define WNC_WAIT_TIME_MS 500


extern void SetLedColor(unsigned char ucColor);


class Wnc {
public:
    Wnc(void);
    bool init(void);
    bool isModemResponding();

    char* read(int timeout_ms);
    char* send(const char *cmd, int timeout_ms);
    
    
    void setPowerSave(bool on,int t3412,int t3324);
    void resumePowerSave();
    bool isPowerSaveOn();
    int gett3412Timer();
    int gett3324Timer();
    void wakeFromPowerSave();
    
    char* getIccid();
    bool startInternet();
    bool connect(char* ip, int port);
    void disconnect();
    bool writeSocket(const char * s);
    char* readSocket();
    char* ping(char* ip);
    void setIn();
    void passthrough();
    void checkPassthrough();
    void toggleWake();
    char* resolveDn(const char* name);
    bool cmdFailed(char* reply,char* msg);
    
private:
    int secToTau(int time);
    int secToActivity(int time);
    int hex_to_int(char c);
    int hex_to_ascii(char h, char l);
    int indexOf(char* str, char c);
    char* encode(int value, char* result, int base);
};

#endif