| /** |
| * @file at_utils.h |
| * @brief Ìṩ¸øÓ¦ÓÃʹÓõÄsoftapƽ̨¹«¹²½Ó¿Ú |
| * |
| * Copyright (C) 2017 Sanechips Technology Co., Ltd. |
| * @author |
| * |
| * This program is free software; you can redistribute it and/or modify |
| * it under the terms of the GNU General Public License version 2 as |
| * published by the Free Software Foundation. |
| * |
| */ |
| #ifndef __AT_UTILS_H__ |
| #define __AT_UTILS_H__ |
| #include "os_type_def.h" |
| #include "softap_api.h" |
| |
| /******************************************************************************* |
| * Type definitions * |
| ******************************************************************************/ |
| |
| |
| /******************************************************************************* |
| * Global function declarations * |
| ******************************************************************************/ |
| /** |
| * @brief ¶¨ÒåATÉÏÏÂÎĵ±Ç°´¦ÀíµÄ״̬»ú£¬ÒÔ¾ö¶¨ÏÂÒ»²½´¦Àí |
| * @param AT_END ATÁ÷³Ì½áÊø£¬¿Í»§¶Ë¿ÉÒÔÏòÉϲãapp·¢ËÍÏìÓ¦ÏûÏ¢£¬·þÎñ¶ËÐèÒªÏòatͨµÀ·¢ËÍatÏìÓ¦ÃüÁî |
| * @param AT_CONTINUE AT½»»¥Á÷³Ì¼ÌÐø |
| * @param AT_END_AND_MSG ÓÃÓÚ·þÎñ¶ËÊÕµ½ATÇëÇóºó£¬Á¢¼´»Ø¸´OK½á¹ûÂ룬ͬʱ»¹Ðè·¢ËÍÏûÏ¢¸ø·þÎñ¶ËAPP |
| * @param AT_STATE_MAX ÉÏÏÞºê |
| */ |
| #ifndef DOXYGEN_SHOULD_SKIP_THIS |
| enum at_context_state { |
| AT_END = 0, //ATÁ÷³Ì½áÊø£¬¿Í»§¶Ë¿ÉÒÔÏòÉϲãapp·¢ËÍÏìÓ¦ÏûÏ¢£¬·þÎñ¶ËÐèÒªÏòatͨµÀ·¢ËÍatÏìÓ¦ÃüÁî |
| AT_CONTINUE,//AT½»»¥Á÷³Ì¼ÌÐø |
| AT_END_AND_MSG,//ÓÃÓÚ·þÎñ¶ËÊÕµ½ATÇëÇóºó£¬Á¢¼´»Ø¸´OK½á¹ûÂ룬ͬʱ»¹Ðè·¢ËÍÏûÏ¢¸ø·þÎñ¶ËAPP |
| AT_WAIT_AUTO,//ÓÃÓÚÊÕµ½Ó¦´ðºó£¬ÉÐδ»ñÈ¡µ½ÏëÒªµÄÖ÷¶¯Éϱ¨Ê±£¬·µ»Ø¸ÃÖµ£»Ä¿Ç°½öÓÃÓÚPDP¼¤»îµÄzgipdnsÖ÷¶¯Éϱ¨³ÙÓÚOKºóÉϱ¨µÄÇé¿ö |
| AT_STATE_MAX,//ÉÏÏÞºê |
| }; |
| #endif |
| |
| /** |
| * @brief ´¦Àí×÷Ϊ·þÎñ¶ËµÄÊÕµ½µÄÇëÇóÃüÁî¡£¶ÔÓÚat_ctl±¾µØµÄ·þÎñ¶Ë£¬ÊÕµ½ÇëÇóÖ®ºó£¬×÷Ϊͬ²½´¦Àí·½Ê½Ö±½ÓÔڸú¯ÊýÖд¦Àí£¬²¢·µ»Øok |
| *¶ÔÓÚDEMO·þÎñ¶Ë(¿Í»§¶þ´Î¿ª·¢×¢²áµÄ·þÎñ¶Ë)ÊÕµ½µÄÇëÇ󣬱ØÐëͨ¹ýÒì²½ÏûÏ¢µÄ·½Ê½£¬ÓÉDEMOµÄAPP·þÎñ¶Ëͨ¹ýÏûÏ¢½øÐÐÓ¦´ð |
| * @param at_fd ½ÓÊÕATÃüÁîµÄͨµÀ |
| * @param at_paras ATÃüÁî²ÎÊý |
| * @param res_msg ÈôΪͬ²½´¦Àí·½Ê½£¬res_msgΪ»Ø¸´µÄ½á¹ûÂ룻ÈôΪÒì²½´¦Àí·½Ê½£¬res_msgΪATÃüÁîת»»ºóµÄÏûÏ¢½á¹¹Ìå |
| * @param res_msglen ²ÎÊýres_msgµÄ³¤¶È |
| * @return intÐͽá¹ûÂë ·µ»Øenum at_context_stateö¾ÙÖµ£¬AT_END±íʾͬ²½Ó¦´ð·½Ê½£»AT_CONTINUE±íʾÒì²½Ó¦´ð·½Ê½,ÓÉ¿ò¼Ü¾ö¶¨ÏÂÒ»²½´¦Àí |
| * @note ¿É²Î¿¼Ê¾Àý´úÂë: user_regist.c |
| */ |
| typedef int (*ser_req_func2)(int at_fd, char *at_paras, void ** res_msg, int *res_msglen); |
| |
| |
| /** |
| * @brief ·þÎñ¶ËAPP·¢Ë͵ÄÓ¦´ðÏûÏ¢µÄATÃüÁî·â×°£¬×îÖÕ×é×°³ÉATÓ¦´ðÃüÁîºó£¬´Óat_fdͨµÀ·¢Ë͸øÔ¶¶Ë¿Í»§¶Ë |
| * @param rsp_msg APP·¢Ë͵ÄÓ¦´ðÏûÏ¢ÄÚÈÝ |
| * @param ret ATÃüÁî |
| * @param retlen ATÃüÁ¶È |
| * @return intÐͽá¹ûÂë ·µ»Øenum at_context_stateö¾ÙÖµ |
| * @note ¿É²Î¿¼Ê¾Àý´úÂë: user_regist.c |
| */ |
| typedef int (*app_rsp_proc)(void *rsp_msg, void**ret, int *retlen); |
| |
| /** |
| * @brief ¶ÔÓÚÉϱ¨atÃüÁî´¦Àíº¯Êý£¬°üº¬²éѯÖмä½á¹ûºÍÖ÷¶¯Éϱ¨µÄatÃüÁî´¦Àí |
| * ¶ÔÓÚpsÏà¹ØµÄÖ÷¶¯Éϱ¨ºÍ²éѯÖмä½á¹ûÉϱ¨£¬Ò»°ãÎÞÐ轫Éϱ¨ÄÚÈÝ·¢Ë͸øÆäËûÄ£¿éÓ¦Óã¬Òò´Ë¾¡Á¿Ê¹ÓÃnvºÍÈ«¾Ö±äÁ¿µÄ·½Ê½´æ·Å |
| * ¶ÔÓÚÀ©Õ¹atµÄÖмä½á¹ûÉϱ¨£¬Ò»°ãÐèÒª½«²éѯ½á¹û·¢Ë͸øÆäËûÄ£¿éÓ¦Ó㬶¯Ì¬ÉêÇëÄڴ棬·ÅÔÚcontextÉÏÏÂÎÄÖеÄapp_para±äÁ¿ÖÐ |
| * @param at_paras ATÃüÁî×Ö·û´® |
| * @return charÐÍ×Ö·û´®£¬±íʾת»»ºóµÄatÃüÁî²ÎÊý |
| * @note |
| * at_paraÖ¸ÏòÈ¥µôATÃüÁîÍ·²¿ºóµÄµÚÒ»¸ö×Ö·û£¬¼´¡®£º¡¯ |
| * ·µ»ØµÄATÃüÁîÒ²ÊÇ': '¿ªÍ·µÄATÃüÁî²ÎÊý£¬ |
| * Àý£º+CSQ: <rssi>,<ber>,<act>, at_paraΪ: <rssi>,<ber>,<act>, ·µ»Ø: <rssi>,<ber> |
| */ |
| |
| typedef char * (*format_inform_func)(char *at_paras); |
| |
| |
| /** |
| * @brief Éú³Éat¶¯×÷ÇëÇóÃüÁî |
| * @param cmd ATÃüÁîÇëÇóÃû³Æ |
| * @param param ATÃüÁîÇëÇó²ÎÊý |
| * @return at¶¯×÷ÇëÇó×Ö·û´®µÄÖ¸Õë |
| * @note ÓÉat_ctl¸ºÔðÊÍ·ÅÄÚ´æ |
| */ |
| char* at_act_build(char* cmd, char* param); |
| |
| /** |
| * @brief Éú³Éat²éѯÇëÇóÃüÁî |
| * @param cmd ATÃüÁîÇëÇóÃû³Æ |
| * @return at²éѯÇëÇó×Ö·û´®µÄÖ¸Õë |
| * @note ÓÉat_ctl¸ºÔðÊÍ·ÅÄÚ´æ |
| */ |
| char* at_query_build(char* cmd); |
| |
| |
| /** |
| * @brief Éú³Éat²éѯÇëÇóÃüÁîµÄÏìÓ¦ÃüÁµ±ÓÐÖмä½á¹ûÉϱ¨Ê±£¬ÔÚser_ops_t2µÄrsp_actµ÷Ó㬠|
| * ¸Ãº¯ÊýÖн«ÖмäÉϱ¨½á¹ûºÍokatÃüÁî×é×°ÔÚÒ»Æð£¬Í¨¹ýmallocÉêÇëʹÓõÄÄڴ棬²¢·µ»Ø |
| * ¸ÃÖ¸Õë¸øÍâ²ãµ÷Óú¯ÊýʹÓã¬×îÖÕÓÉÍâ²ãµ÷Óú¯ÊýÊͷŸÃÄÚ´æ |
| * @param cmd ATÃüÁîÏìÓ¦Ãû³Æ |
| * @param param ATÃüÁîÏìÓ¦²ÎÊý |
| * @return at¶¯×÷ÏìÓ¦×Ö·û´®µÄÖ¸Õë |
| * @note input: cmd "xx" |
| * param "yy,zz" |
| * output: \r\n+xx:yy,zz\r\n |
| */ |
| char* at_query_result_build(char* cmd, char* param); |
| |
| |
| |
| /** |
| * @brief Éú³ÉatÏìÓ¦½á¹ûOKº¯Êý |
| * @return atÏìÓ¦½á¹ûOK×Ö·û´®µÄÖ¸Õë |
| * @note ÓÉat_ctl¸ºÔðÊÍ·ÅÄÚ´æ |
| */ |
| char* at_ok_build(); |
| |
| |
| /** |
| * @brief atÃüÁî½âÎö |
| * @param fmt ÿ¸ö²ÎÊýÊä³öµÄÊý¾Ý¸ñʽ |
| * @param buf ÔʼÊý¾Ý |
| * @param pval Êä³ö¸ñʽ»¯ºóÊý¾ÝÖµ |
| * @return ¿ÉÒÔÕýÈ·½âÎö²ÎÊýµÄ¸öÊý |
| * @note ¸ñʽ½öÖ§³Ö%dºÍ%s,ͬʱ¿ÉÒÔÔÚÿ¸ö¸ñʽǰ¼ÓÉÏÊý×ÖÒÔÖ¸¶¨ |
| ±äÁ¿¿ÉÒÔ¸³ÖµµÄ¿Õ¼ä´óС£¬µ¥Î»Îª×Ö½Ú£¬ÀýÈç%2d±íʾ½ÓÊÜ´æ´¢¿Õ¼äΪ2×Ö½Ú£»%5s±íʾËãÉÏ'\0'£¬×î¶à¿ÉÒÔ |
| ½ÓÊÜ5¸ö×Ö·û¡£µ±%d²»Ö¸¶¨Êý×Öʱ£¬°´ÕÕ4×Ö½Ú½øÐи³Öµ£¬%sÔò°´ÕÕʵ¼Ê½âÎöµÄ×Ö·û´®³¤¶ÈÍêÈ«¸³Öµ£¬ÓпÉÄÜ |
| »áÓÐÔ½½ç¡£ |
| *ʾÀý |
| <pre> |
| char buf[]="1,2,\"test\""; |
| int n1 = 0; |
| int n2 = 0; |
| char *n3 = malloc(strlen(buf)); |
| char *p[] = {&n1,&n2,n3}; |
| ret = parse_param2("%d,%d,%s", buf, (void**)p); |
| //½âÎöºón1==1 n2==2 n3=="test" |
| ret = parse_param2("%4d,%d,%3s", buf, (void**)p); |
| //½âÎöºón1==1 n2==2 n3=="te" |
| retµÄֵΪ3 |
| </pre> |
| */ |
| int parse_param2(char *fmt, char *buf, void **pval); |
| |
| |
| /** |
| * @brief ATÃüÁî½âÎö½Ó¿Ú |
| * @param fmt ATÇëÇó»òÏìÓ¦µÄ¸ñʽ»¯·½Ê½ |
| * @param buf ATÇëÇó»òÏìÓ¦µÄ×Ö·û´®Ö¸Õë²»º¬Í·²¿ºÍ¿Õ¸ñ |
| * @param pval ¸ñʽ»¯ºóµÄATÃüÁî |
| * @return 0±íʾ½âÎö²ÎÊýÕý³££¬ÄÚ²¿½øÐÐÑϸñµÄ²ÎÊý¼ì²é£¬°üÀ¨²ÎÊý¸öÊýÒ»ÖÂÐÔ¼ì²é£¬¶ÔÓÚ¿ÉÑ¡²ÎÊý£¬ÐèÒªµ÷ÓÃÕß×ÔÐп¼ÂÇ |
| * @note |
| * 1. ½âÎöµÄATÃüÁî±ØÐë°´ÕÕ3GPP27007±ê×¼ÐÒ飬²ÎÊýÒÔ¶ººÅ¸ô¿ª£¬×Ö·û´®Ðè´øË«ÒýºÅ£¬·ñÔò»á¶ÏÑÔ |
| * 2. ×Ö·û´®½âÎöʱµÄÈë²Î³¤¶È±ØÐë´óÓÚ¿ÉÄܽâ³öµÄ×Ö·û´®³¤¶È£¬·ñÔò»áÔ½½ç |
| * 3. ·µ»ØÖµÇë²Î¿¼Ã¶¾Ùenum SAP_ERR£¬º¬¿ÉÑ¡²ÎÊýÒ»ÖÂÐÔ¼ì²é |
| * 4. ÈôfmtÖ¸¶¨µÄ²ÎÊýÀàÐͱØÐëÓëpvalÖÐÖ¸ÕëµÄÒ»Ò»¶ÔÓ¦ |
| * 5. ʾÀý |
| <pre> |
| char buf[]="1,2,\"test\""; |
| int n1 = 0; |
| int n2 = 0; |
| char *n3 = malloc(strlen(buf)); |
| char *p[] = {&n1,&n2,n3}; |
| ret = parse_param_safe("%d,%d,%s", buf, (void**)p); |
| //½âÎöºón1==1 n2==2 n3=="test" |
| ret = parse_param_safe("%4d,%d,%3s", buf, (void**)p); |
| //½âÎöºón1==1 n2==2 n3=="te" |
| </pre> |
| * @warning |
| */ |
| int parse_param_safe(char *fmt, char *buf, void **pval); |
| |
| |
| /** |
| * @brief Ó¦Ó÷¢ËͶ¯×÷Àà»ò²éѯÀàATÇëÇó¸ø3GPPÐÒéÕ»£¬²¢³¬Ê±µÈ´ý¶¯×÷½á¹û£»×¢Ò⣺¸Ã½Ó¿ÚÖ»ÄÜÓÃÓÚ²éѯºÍÉèÖúÍÖ´ÐÐÇëÇó£¬Í¨¹ýÈë²Î½øÐÐÖмä½á¹ûµÄÄÚ²¿½âÎö´¦Àí£¬²¢ÇÒ |
| ÓÐÖмä½á¹ûÉϱ¨Ê±£¬Ö»Ö§³ÖÒ»ÌõÖмä½á¹ûµÄÉϱ¨½âÎö£» |
| * @param req_at ÇëÇóATÃüÁ´óСдÃô¸Ð£¬±ØÐë´óд |
| * @param info_fmt ATÏìÓ¦µÄ¸ñʽ»¯·½Ê½ |
| * @param pval ¸ñʽ»¯ºóµÄATÏìÓ¦£¬¾ßÌåʹÓòο´parse_param½Ó¿Ú |
| * @param safe_parm_check ָʾÊÇ·ñ¶Ô²ÎÊý¸öÊý½øÐÐÒ»ÖÂÐÔ¼ì²é£¬0±íʾº¬¿ÉÑ¡²ÎÊý£¬²»¶Ô²ÎÊý¸öÊý½øÐмì²é;1±íʾ¶Ô²ÎÊý¸öÊý½øÐÐÑϸñ¼ì²é |
| * @param timeout timeout==0 ±íʾÓÀ¾ÃµÈ´ý½á¹ûÂ룬·ñÔòµÈ´ýʱ¼äΪ[timeout]Ãë |
| * @return 0±íʾ·µ»Ø³É¹¦£¬ÆäËûÖµ±íʾʧ°Ü´íÎóÂë |
| * @note |
| * 1. Óû§Ê¹ÓÃʱ£¬Èô²»ÏëÓɸýӿÚÄÚ²¿½øÐвÎÊýµÄ¸ñʽ»¯½âÎö£¬¿ÉÒÔ½«info_fmt¸³ÖµÎª"%s"£¬pval¸³ÖµÎªchar **p˫ָÕ룬ÕâÑù²ÎÊý½«×÷ΪÕûÌå×Ö·û´®·µ»Ø¸øµ÷ÓÃÕß |
| * 2. ¶ÔÓÚZMGL,CPBR, COPS=?µÈÒ»ÌõÇëÇó»áÓжàÌõÖмä½á¹ûÇé¿ö£¬¸Ãº¯Êý²»ÊÊÓà |
| * 3. ×Ö·û´®½âÎöʱµÄÈë²Î³¤¶È±ØÐë´óÓÚ¿ÉÄܽâ³öµÄ×Ö·û´®³¤¶È£¬·ñÔò»áÔ½½ç |
| * 4. µ±´æÔÚÖмäÉϱ¨Ê±£¬pvalºÍinfo_fmt²»Îª¿Õ£»µ±ÎªÖмäÉϱ¨Ê±£¬Á½¸ö±ØÐë½ÔΪ¿Õ |
| * 5. pvalºÍinfo_fmtÁ½ÕßҪô¶¼ÎªNULL,Ҫô¶¼²»ÎªNULL£¬²»ÄÜ´æÔÚÆäÖÐÒ»¸öΪNULL£¬ÁíÒ»¸ö²»ÎªNULLµÄÇé¿ö |
| * 6. ʾÀý |
| <pre> |
| int ret = 0; |
| ret = get_modem_info2("AT+CFUN=1\r", NULL, NULL); |
| //·µ»Ø¼´±íʾִÐгɹ¦ |
| |
| char *pstr = malloc(50); |
| memset(pstr,0,50); |
| ret = get_modem_info2("AT+CIMI\r", "%s", (void**)&pstr,0,10); |
| //·µ»Øºópstr==111111111111111 |
| |
| int n1 = 0; |
| int n2 = 0; |
| int n3 = 0; |
| char *p2[] = {&n1,&n2,&n3}; |
| ret = get_modem_info2("AT+CCIOTOPT?\r", "%d,%d,%d", (void**)p2,0,10); |
| //+CCIOTOPT: 1,2,3½âÎöºón1==1 n2==2 n3==3 |
| </pre> |
| * @warning |
| */ |
| int get_modem_info2(char *req_at,char *info_fmt,void **pval, int safe_parm_check, int timeout); |
| |
| |
| /** |
| * @brief ÓÃÓÚ¿ª»ú×¢²áËùÓеķþÎñ¶Ë¾ßÌåATÃüÁîʼþ£¬³£ÓÃÓÚÉϲ㼰¿Í»§¶¨ÖÆ£¬²»×¼ÓÃÓÚPSÐÒéÕ»¡£ |
| * @param at_cmd_prefix ATÃüÁîǰ׺ָÕë |
| * @param module_id Ô´Ä£¿é¶ÓÁÐid |
| * @param req_msg_id ÇëÇóÏûÏ¢id |
| * @param rsp_msg_id ÏìÓ¦ÏûÏ¢id |
| * @param req_rcv_act ÊÕµ½ÇëÇóÏûϢʱµÄ´¦Àíº¯Êý |
| * @param rsp_act ÊÕµ½ÏìÓ¦½á¹ûʱµÄ´¦Àíº¯Êý |
| * @return intÐͽá¹ûÂë |
| * @retval ³É¹¦ 0 |
| * @note ¿É²Î¿¼Ê¾Àý´úÂë: user_regist.c |
| */ |
| int register_serv_func2(char *at_cmd_prefix, int module_id, int req_msg_id, int rsp_msg_id, ser_req_func2 req_rcv_act, app_rsp_proc rsp_act); |
| |
| /** |
| * @brief ×¢²áÉϱ¨ATÃüÁîµÄ¸ñʽ»¯´¦Àíº¯Êý£¬ÍⲿMCU·¢ËÍATÃüÁmodem·µ»ØµÄÖмä½á¹û²»Âú×ãÍⲿMCUµÄ¸ñʽҪÇó£¬ |
| ÐèÒªat_ctl½øÐÐת»» |
| * @param at_cmd_prefix ATÃüÁîǰ׺ָÕë |
| * @param inform_act ½ÓÊÕµ½ATÃüÁîÖмä½á¹ûµÄת»»´¦Àíº¯Êý |
| * @return intÐͽá¹ûÂë |
| * @retval ³É¹¦ 0 |
| * @note |
| */ |
| int register_formatInform_func(char *at_cmd_prefix, format_inform_func inform_act); |
| |
| #ifndef DOXYGEN_SHOULD_SKIP_THIS |
| /** |
| * @brief ¿É´òÓ¡×Ö·û´®×ª»»Îª×Ö½ÚÊý¾Ý £¬È磺 |
| "C8329BFD0E01" --> {0xC8, 0x32, 0x9B, 0xFD, 0x0E, 0x01} |
| * @param pSrc Ô´×Ö·û´®Ö¸Õë |
| * @param pDst Ä¿±êÊý¾ÝÖ¸Õë |
| * @param nSrcLength Ô´×Ö·û´®³¤¶È |
| * @return Ä¿±êÊý¾Ý³¤¶È |
| * @note |
| * @warning |
| */ |
| int string2bytes(const char* pSrc, unsigned char* pDst, int nSrcLength); |
| /** |
| * @brief ×Ö½ÚÊý¾Ýת»»Îª¿É´òÓ¡×Ö·û´® £¬È磺 |
| {0xC8, 0x32, 0x9B, 0xFD, 0x0E, 0x01} --> "C8329BFD0E01" |
| * @param pSrc Ô´Êý¾ÝÖ¸Õë |
| * @param pDst Ä¿±ê×Ö·û´®Ö¸Õë |
| * @param nSrcLength Ô´Êý¾Ý³¤¶È |
| * @return Ä¿±êÊý¾Ý³¤¶È£» |
| * @note |
| * @warning |
| */ |
| int bytes2string(const unsigned char* pSrc, char* pDst, int nSrcLength); |
| |
| |
| |
| /** |
| * @brief ÔÚºöÂÔ´óСдµÄÇé¿öÏ£¬±È½ÏÁ½¸öat×Ö·û´®ÊÇ·ñÏàͬ |
| * @param dest Ä¿±ê×Ö·û´® |
| * @param source Ô´×Ö·û´® |
| * @return 0±íʾÁ½×Ö·û´®ÍêÈ«Ïàͬ£¬Èç¹ûµÚÒ»¸öÈë²Î´óÓÚµÚ¶þ¸öÈë²Î£¬·µ»ØÕýÖµ£¬·ñÔò·µ»Ø¸ºÖµ£» |
| * @note |
| * @warning |
| */ |
| int at_strcmp(const char *dest, const char *source); |
| |
| |
| /** |
| * @brief ÔÚºöÂÔ´óСдµÄÇé¿öÏ£¬±È½ÏÁ½¸öat×Ö·û´®Ç°size³¤¶ÈÊÇ·ñÏàͬ |
| * @param dest Ä¿±ê×Ö·û´® |
| * @param source Ô´×Ö·û´® |
| * @param size ±È½ÏµÄ×Ö½ÚÊý |
| * @return 0±íʾÁ½×Ö·û´®Ç°size³¤¶ÈÍêÈ«Ïàͬ£¬Èç¹ûµÚÒ»¸öÈë²Î´óÓÚµÚ¶þ¸öÈë²Î£¬·µ»ØÕýÖµ£¬·ñÔò·µ»Ø¸ºÖµ£» |
| * @note |
| * @warning |
| */ |
| int at_strncmp(const char *dest, const char *source, int size); |
| |
| /** |
| * @brief ÔÚºöÂÔ´óСдµÄÇé¿öÏ£¬ÔÚsourceÖÐѰÕÒsubstr×Ó´®µÄλÖà |
| * @param dest Ä¿±ê×Ö·û´® |
| * @param source Ô´×Ö·û´® |
| * @return Èç¹ûÕÒµ½£¬Ö±½Ó·µ»ØsubstrÔÚsourceÖеÚÒ»´Î³öÏÖµÄλÖã¬Èç¹ûûÓÐÕÒµ½£¬·µ»ØNULL |
| * @note |
| * @warning |
| */ |
| char * at_strstr(const char * source, const char * substr); |
| |
| |
| //ÓÃÓÚ¼ÆËãÀÛ¼ÓµÄCHECKSUMÖµ |
| unsigned short get_chksum(const unsigned char *ptr, unsigned short len); |
| #endif |
| |
| #endif |
| |