G510SSL Application Note
Version:V1.0.2
Date:2014.08.24
Copyright
Copyright?2015Fibocom Wireless Inc.All rights reserved.
Without the prior written permission of the copyright holder,any company or individual is prohibited to excerpt,copy any part of or the entire document,or transmit the document in any form.
Attention
The document is subject to update from time to time owing to the product version upgrade or other reasons.Unless otherwise specified,the document only serves as the user guide.All the statements, information and suggestions contained in the document do not constitute any explicit or implicit guarantee.
Trademark
The trademark is registered and owned by Fibocom Wireless Inc.
Versions
Version Date Remarks
V1.0.02013-11-21Initial Version
V1.0.12015-04-26Update the description of copyright and attention.
V1.0.22015-08-24Update the logo
Applicability Type
No.Type Note 1G510
2
3
Content
1+MIPOPEN,Open a Socket(UDP/TCP/SSL) (5)
1+MIPOPEN,Open a Socket
(UDP/TCP/SSL)
This command causes the G5xx module to initialize a new socket that waits for a connection from a remote machine or opens a common connection with a remote side(according to received parameters). Each socket allocates an accumulating buffer whose size is1372bytes for TCP connection and1024 bytes for UDP connection.If Parameter“Protocol”=2,it opens a secure connection with the remote server which supports Secure Sockets Layer(SSL).
Note:MIPxxx is a complete set of GPRS commands.This set should not be used with other GPRS commands,such as CGATT,CGACT,and so on.The+MIPOPEN command returns a+MIPSTAT unsolicited event if it fails,for example,if it was rejected by the remote side.This command will return in 60sec when DNS is error.
Command Syntax Response/Action Remarks
Set AT+MIPOPEN= et_ID>, e_Port>, or: +MIPOPEN: P>, or: +MIPSTAT: or: ERROR: The Set command returns parameters only for sockets opened in Listen mode. Read AT+MIPOPEN?+MIPOPEN:[ for each socket that can be opened OK or:The Read command returns the numbers of the sockets that can be opened. +MIPOPEN:0 OK if there are no free sockets. Test AT+MIPOPEN=?+MIPOPEN:(list of supported supported supported<"Destination_IP">s), (list of supported OK Example: AT+MIPOPEN? +MIPOPEN:1,2,3,4//All sockets closed OK AT+MIPOPEN? +MIPOPEN:1,3,4//Socket2opened OK The following table shows the+MIPOPEN parameters. Socket_ID A unique number that identifies a connection. Valid socket numbers-1,2,3and4 Source_Port Port of source site. Port range:1-65535(decimal digits) Remote_IP IP:IP of the remote site in the format"https://www.sodocs.net/doc/b18261677.html,C.DDD".The range of each octet is0-255.Value can be written in1,2,or3digits.Host name:of remote site.The host-name convention should meet the rules as describe in RFC-1035section:2.3 Conventions.Syntax is not validated,except the maximum length(255characters). Remote_Port Port of remote site. Port range:1-65535(decimal digits)for outgoing connection. Port0for incoming connection. Protocol Type of protocol stack. 0TCP 1UDP 2SSL State0Inactive 1Active Note:Port numbers below1024are not recommended,as they are used by system processes. Example: AT+MIPOPEN=1,1200,"123.245.213.012",1234,0//Opening socket1,using TCP protocol, from port1200,targeting123.245.213.012port1234 AT+MIPOPEN=2,1300,"123.133.074.192",1242,1//Opening socket2,using UDP protocol, from port1300,targeting123.133.074.192port1242 AT+MIPOPEN=1,1222,"123.245.213.012",1234,0//Opening socket1,using TCP protocol, from port1222,targeting123.245.213.012port1234 AT+MIPOPEN://Invalid command ERROR AT+MIPOPEN?//Terminal checking the free sockets +MIPOPEN:34 OK AT+MIPOPEN=1,0,"https://www.sodocs.net/doc/b18261677.html,",80,0//TCP OK +MIPOPEN:1,1 AT+MIPOPEN=1,11011,”https://www.sodocs.net/doc/b18261677.html,”,443,2//SSL //attention:must web which support SSL OK +MIPOPEN:1,1 AT+MIPOPEN=2,0,"https://www.sodocs.net/doc/b18261677.html,",80,1//UDP OK +MIPOPEN:2,1 //Listen socket over TCP: AT+MIPOPEN=1,1100,"0.0.0.0",0,0//Listens to any port at any IP. OK +MIPOPEN:1,1,122.221.32.64,1200//Remote side connected to the listen socket. AT+MIPOPEN=3,3212,"122.1.222.134",0,0//Listen to any port at specific IP. OK +MIPOPEN:3,1,122.1.222.134,1222//Remote side connected to the listen socket. OK