Skip to content

Instantly share code, notes, and snippets.

@kuc-arc-f
Created August 13, 2015 10:57
Show Gist options
  • Save kuc-arc-f/cf0c7339c964312550f5 to your computer and use it in GitHub Desktop.
Save kuc-arc-f/cf0c7339c964312550f5 to your computer and use it in GitHub Desktop.
//main
int main() {
mPc.baud( 115200 );
mSTAT = mSTAT_CONECT;
mTimer.start();
while(1) {
float sec= mTimer.read();
if(mSTAT == mSTAT_CONECT){
if(sec >= mTmMax){
mTimer.reset();
string msg=get_message();
int len=msg.length();
mPc.printf("AT+CIPSTART=\"TCP\",\"dns1234.com\",80\r\n");
wait(mWait_Debug);
mPc.printf("AT+CIPSEND=%d\r\n" , len);
wait(mWait_Debug);
mPc.printf("%s",msg);
wait(mWait_Debug);
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment