Summary of the invention
For solving the problems of the technologies described above, the invention provides a kind of method utilizing AT order to receive Email.
The method utilizing AT order to receive Email provided by the invention, comprising: be configured for the AT order receiving Email at wireless communication module, wherein said wireless communication module is built-in with POP3/POP protocol stack; The basic log-on message of Email is set at described wireless communication module by AT order; Utilize the Socket interface of the POP3/POP protocol stack of wireless communication module inside described in AT command calls and mail server to connect, and receive Email from described mail server; After described wireless communication module receives described Email, utilize AT order to read described Email and get e-mail data content.
Utilize AT order to receive in a kind of preferred embodiment of the method for Email provided by the invention, described mail server is POP3/POP server.
AT order is utilized to receive in a kind of preferred embodiment of the method for Email provided by the invention, the described AT order for receiving Email comprises the AT order of the AT order of the first type, the AT order of the second type and the third type, the AT order of the first type wherein said is the AT order that basic log-on message arranged and logged in mail, the AT order of described the second type is the AT order corresponding with the order of POP3 standard agreement, and the AT order of the third type described is the AT order of the user's application interface taken out according to POP3 standard agreement.
Utilize AT order to receive in a kind of preferred embodiment of the method for Email provided by the invention, the AT order of the first type described comprise AT order for arranging mail server information, for arrange user account and password AT order, for logging in the AT order of mail and the AT order for closing mail.
Utilize AT order to receive in a kind of preferred embodiment of the method for Email provided by the invention, the AT order of described the second type has relation one to one with the order of POP3 standard agreement respectively.
Utilize AT order to receive in a kind of preferred embodiment of the method for Email provided by the invention, the AT order of described the second type comprises the AT order corresponding respectively with the STAT order of POP3 agreement, UIDL order, LIST order, RETR order, DELE order, RSET order, TOP order, NOOP order and QUIT order.
Utilize AT order to receive in a kind of preferred embodiment of the method for Email provided by the invention, the AT order of the third type described comprises the AT order being respectively used to the mail header, mail text message, accessory information, annex name information, e-mail sender's information, mail CC information and the mail recipient's information that obtain between all mail header, designated with numeral.
Utilize AT order to receive in a kind of preferred embodiment of the method for Email provided by the invention, the described AT order for receiving Email also comprises the AT order for checking debug information.
Utilize AT order to receive in a kind of preferred embodiment of the method for Email provided by the invention, the described AT order for receiving Email also comprises the AT order supporting to obtain original data stream.
Utilize AT order to receive in a kind of preferred embodiment of the method for Email provided by the invention, the described AT order for receiving Email has 23.
Compared to prior art, adopt the method utilizing AT order to receive Email provided by the invention, wireless communication module is after above-mentioned relevant AT command configuration, can simply by calling AT order to realize the reception of Email, can not be subject to the restriction of wireless communication module internal memory, therefore the scope of application widely.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, be clearly and completely described the technical scheme in the embodiment of the present invention, obviously, described embodiment is only a part of embodiment of the present invention, instead of whole embodiments.Based on the embodiment in the present invention, those of ordinary skill in the art, not making other embodiments all obtained under creative work prerequisite, belong to the scope of protection of the invention.
In technical scheme provided by the invention, wireless communication module can utilize AT (Attention) to order, and realizes the reception of Email simply and easily.Particularly, for supporting e-mail reception, technical scheme provided by the invention can increase the related protocol stack that Email sends in wireless communication module inside, such as POP (Post Office Protocol, post office protocol) protocol stack or POP3 (Post Office Protocol Version 3, post office protocol the 3rd version) protocol stack, and pre-configured multiple AT command interface for carrying out mail reception, wireless communication module only needs to call the transmission that corresponding AT order just can complete Email quickly and easily.
Particularly, the wireless communication module that the present embodiment relates to can Generation Mobile Telecommunication System module, such as global system for mobile communications (Global System for Mobile Communications, GSM) module or general packet radio service technology (General Packet Radio Service, GPRS) module, or the GSM/GPRS module of this simultaneously integrated GSM and GPRS function.Further, described wireless communication module can define the AT order of following three types:
The first type: basic log-on message arranges and logs in the AT order of mail;
The second type: the AT order corresponding with the order of POP3 standard agreement;
The third type: according to the AT order of user's application interface that POP3 standard agreement takes out.
Wherein, the AT order of the first type can comprise 4 AT orders, respectively:
(1) for arranging the AT order of mail server information, described mail server information can comprise server address information, port number information, mode selecting information (being namely select POP3 or POP3S pattern) etc.;
(2) for arranging the AT order of user account and password;
(3) for logging in the AT order of mail;
(4) for closing the AT order of mail.
The AT order of the second type can comprise 9 AT orders, and it is relation one to one respectively with the order of POP3 standard agreement, and the AT order of described the second type can so that user can encapsulate specific interface as required.Particularly, 9 AT orders of described the second type are respectively:
(1) corresponding with the STAT order of POP3 agreement AT order, its functional meaning is total length and the mail sum of mail in inquiry client mailbox;
(2) corresponding with the UIDL order of POP3 agreement AT order, its functional meaning is the unique identification returning mail;
(3) corresponding with the LIST order of POP3 agreement AT order, its functional meaning is that command server provides each length;
(4) corresponding with the RETR order of POP3 agreement AT order, its functional meaning takes out mail from mailbox;
(5) corresponding with the DELE order of POP3 agreement AT order, its functional meaning does delete flag to the mail of specifying;
(6) corresponding with the RSET order of POP3 agreement AT order, its functional meaning is reset POP3 session;
(7) corresponding with the TOP order of POP3 agreement AT order, its functional meaning takes out to believe that the front N of head and mail is capable;
(8) corresponding with the NOOP order of POP3 agreement AT order, its functional meaning is do-nothing operation, returns an effective response, does not do any operation;
(9) corresponding with the QUIT order of POP3 agreement AT order, its functional meaning is that server physics is deleted the file that logic deletes and then closed connection.
The AT order of the third type can comprise 8 AT orders, and it can so that user directly gets the specifying information of mail; Particularly, 8 AT orders of the third type described are respectively:
(1) for obtaining the AT order of all mail header SUB in mailbox;
(2) for obtaining the AT order of the mail header (SUB) between designated with numeral;
(3) for obtaining the AT order of mail text (TEXT) information;
(4) for obtaining the AT order of Email attachment information;
(5) for obtaining the AT order of Email attachment name information;
(6) for obtaining the AT order of e-mail sender's information;
(7) for obtaining the AT order of mail CC information;
(8) for obtaining the AT order of mail recipient's information.
On the other hand, in specific implementation, described wireless communication module can define other AT order as required, and in the present embodiment, described wireless communication module can also define other two AT orders, respectively:
(1) for checking the AT order of debug information;
(2) support to obtain the AT order of original data stream, in the AT order of the second type, such as in LIST and UDIL, check original data stream etc., such benefit is the specification not only supported the agreement of standard but also met AT coomand mode information.
As can be seen here, in the present embodiment, described wireless communication module, for supporting mail reception, can define above-mentioned 23 AT orders altogether.
Refer to Fig. 1, it is the schematic flow sheet utilizing AT order to receive a kind of embodiment of method of Email provided by the invention.The method that the described AT of utilization order receives Email comprises the following steps:
Step S1, by the basic log-on message of AT command set Email;
Particularly, in this step, the basic log-on message of Email can be set at described wireless communication module by the AT order of the first type described, Email Connecting quantity required for POP agreement is set, comprises server address information, port number information, mode selecting information, user account information and encrypted message etc.
Step S2, utilizes the Socket interface of the inner POP3/POP protocol stack of AT command calls and mail server to connect, and receives Email from described mail server;
Particularly, described wireless communication module can by the Socket interface of the POP3/POP protocol stack of the AT command calls inside of above-mentioned the second type, connect with mail server (such as POP3/POP server), and after connection establishment between described wireless communication module and described mail server, receive Email by the AT order of above-mentioned the second type from described mail server.
Step S3, utilizes AT order to get e-mail data content from described Email;
Particularly, described wireless communication module is after receiving described Email from described mail server, corresponding e-mail data content can be read further by the AT order of the third type above-mentioned from described Email, comprise mail header, message body text, annex, addressee, sender information etc.
Compared to prior art, adopt the method utilizing AT order to receive Email provided by the invention, wireless communication module is after above-mentioned relevant AT command configuration, can simply by calling AT order to realize the reception of Email, can not be subject to the restriction of wireless communication module internal memory, therefore the scope of application widely.
The foregoing is only embodiments of the invention; not thereby the scope of the claims of the present invention is limited; every utilize specification of the present invention and accompanying drawing content to do equivalent structure or equivalent flow process conversion; or be directly or indirectly used in other relevant technical field, be all in like manner included in scope of patent protection of the present invention.