
WIZnet-IoTShield-AMM592-TCP example
Revision 1:35abb05061e0, committed 2019-03-16
- Comitter:
- hkjung
- Date:
- Sat Mar 16 09:04:43 2019 +0000
- Parent:
- 0:8f339a252825
- Child:
- 2:46cc35700e0e
- Commit message:
- Added the variables for destination IP address and port
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Sat Mar 16 07:38:26 2019 +0000 +++ b/main.cpp Sat Mar 16 09:04:43 2019 +0000 @@ -75,6 +75,12 @@ ATCmdParser *_parser; +// Destination (Remote Host) +// IP address and Port number +char dest_ip[] = "222.98.173.214"; +int dest_port = 50001; + + void serialPcInit(void) { pc.baud(115200); @@ -153,9 +159,9 @@ setContextActivate_BG96(); // TCP Client: Send and Receive - myprintf("TCP Client Start\r\n"); + myprintf("TCP Client Start - Connect to %s:%d\r\n", dest_ip, dest_port); - if(sockOpenConnect_BG96("TCP", "222.98.173.214", 50001) == RET_OK) { + if(sockOpenConnect_BG96("TCP", dest_ip, dest_port) == RET_OK) { myprintf("sockOpenConnect: success\r\n"); char sendbuf[] = "Hello Cat.M1\r\n";