Справочник Пользователя для Motorola G24

Скачать
Страница из 642
Chapter 4:  Using the Commands
 December  31, 2007
AT Commands Reference Manual
4-29
TCP/IP
TCP Data Transfer Example
AT+MIPCALL=1,"orange","test","test"
OK
+MIPCALL: 172.17.242.86
AT+MIPOPEN=1,1222,"123.245.213.012",1234,0 //Opening socket 1 using TCP protocol, from port 1222, 
targeting 123.245.213.012 port 1234
OK
+MIPOPEN: 1,1
AT+MIPOPEN? 
//Terminal checking the status of socket to be opened (socket 1 opened 
OK)
+MIPOPEN:  2 3 4  
+MIPSETS=1,340
 //Asking the G24 to accumulate 340 bytes on socket 1 prior to sending
+MIPSETS: 0
OK
AT+MIPSETS?
+MIPSETS: 1 340
OK
AT+MIPSEND=1,"444444"   
//Sent coded "DDD" string
+MIPSEND: 1,1497   
//Free storage in the accumulating buffer
OK
Note:
This step can be repeated several times until the buffer is full or until the amount of data 
reaches 340 bytes and data pushed into the stack.
AT+MIPSEND?
//Checking the size remaining (optional)
+MIPSEND: 1 1497
OK
+MIPPUSH=1
//Terminal asks G24 to flush the buffer in socket 1
+MIPPUSH:  0
+MIPCLOSE=1 
//Terminal closes the socket
+MIPCLOSE: 1
OK
+MIPCALL=0
//Terminal hangs up the link
OK
TCP Raw Data Transfer Example (Online Data Mode)
// create a wireless link:
AT+MIPCALL=1,"internetg"
OK
+MIPCALL: 172.17.242.86
// open a socket in Online Data Mode:
AT+MIPODM=1,1204,"123.245.213.12",1205,0
OK
+MIPODM: 1,1