LPWA Module Series
BG96 TCP/IP Application Note
BG96_TCP/IP_Application_Note 36 / 53
3 Examples
3.1. Configure and Activate a Context
3.1.1. Configure a Context
3.1.2. Activate a Context
3.1.3. Deactivate a Context
3.2. TCP Client Works in Buffer Access Mode under IPv4
3.2.1. Set up a TCP Client Connection and Enter Buffer Access Mode
AT+QICSGP=1,1,"UNINET","","",1 //Configure context 1. APN is "UNINET" for China Unicom.
OK
AT+QIACT=1 //Activate context 1. Depending on the network, the
maximum response time is 150 s.
OK //Activated the context successfully.
AT+QIACT? //Query the context state, protocol type and IP address of
context 1.
+QIACT: 1,1,1,"10.7.157.1"
OK
AT+QIDEACT=1 //Deactivate context 1.
OK //Deactivated the context successfully. Depending on the
network, the maximum response time is 40 s.
AT+QIOPEN=1,0,"TCP","220.180.239.212",8009,0,0 //Context is 1 and <connectID> is 0. Before
using AT+QIOPEN, the host should activate
the context with AT+QIACT first.