溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點(diǎn)擊 登錄注冊 即表示同意《億速云用戶服務(wù)條款》

高通平臺AT命令擴(kuò)展

發(fā)布時間:2020-07-09 22:44:11 來源:網(wǎng)絡(luò) 閱讀:3587 作者:polee 欄目:開發(fā)技術(shù)
 

          七月份剛畢業(yè),進(jìn)入一家高通通訊公司。本人對通信方面沒什么了解,更是在進(jìn)公司之前沒聽說過高通平臺。進(jìn)公司到現(xiàn)在也已經(jīng)一個多月了,對于這方面的知識還大多一知半解,還好老大給力,為了讓我更快了解高通平臺,給了我很多幫助?,F(xiàn)在寫這篇博文來記錄自己的學(xué)習(xí)歷程。

            我是先從EFS出發(fā)的,當(dāng)然都是從最簡單的開始。學(xué)習(xí)使用高通工具QPST和QXDM是必修課,當(dāng)然還有超級終端的AT命令了,一般公司都是自己擴(kuò)展的自己的AT命令,當(dāng)時還只會記住這些命令的作用,兩天前老大給了我?guī)灼臋n和告訴我有關(guān)AT命令擴(kuò)展的相關(guān)MODEM源碼在什么地方,讓我熟悉下怎么擴(kuò)展,我自己研究了2天,感覺有點(diǎn)吃力,下面把我掌握的有限知識和大家分享下,希望有和我一樣的小白能探討下,更希望有大神能指點(diǎn)一二,感激不盡。

            添加一個新的AT命令的入口結(jié)構(gòu)體函數(shù)如下:

typedef struct dsati_cmd_struct 
{ 
    byte name[20]; 
    uint32 attrib; 
    byte special; 
    byte compound; 
    uint32 cmd_id; 
    const void *val_ptr; 
    const void *val_ptr2; 
    const void *def_lim_ptr; 
    dsat_result_enum_type (*proc_func)( dsat_mode_enum_type, 
    const struct dsati_cmd_struct*, 
    const tokens_struct_type*, 
    dsm_item_type* ); 
    boolean (*abort_func)( const struct dsati_cmd_struct* ); 
} dsati_cmd_type;

 文檔上面寫的10部建立一個新的AT命令,因?yàn)楸救擞⒄Z水平有限,就不把文檔翻譯了,主要怕誤導(dǎo)大家,如果哪位大神幫忙翻譯一下,感激不盡。

1.Select a unique name for the command. The command name can be up to 10 characters in  length, including the leading +, $, ^, or &.
2. Determine the command attributes. The various commands attributes and their meanings are  listed in Table 3-3.
3. Create a unique command identity (cmd_id) for the command and add this command ID into the corresponding command index table.
4. Create a variable to store the argument value(s). If the command has one or more arguments, declare a variable of the appropriate type in dsatctab.c or dsatetsictab.c to store the argument  values. The variable should be doubled for dual stack operations. The command variable  should not export via extern, command variables must be accessed by get and set utilities  defined in dsatutil.c. If the argument values are referenced by modules external to ATCoP,  declare get and set utilities in dsat_v.h and protect it by critical section.

5. Define the default value and the allowed range for the command arguments. For commands  with simple numeric arguments, use the dflm_type. Initialize the default value and the lower  and upper bounds. For commands of type LIST, use the def_list_type. Create the list_v and  list_t data structures, and initialize the default value. For commands of type mixed parameter,  create and initialize the appropriate dflm_type and def_list_type for each parameter of this  type. For string arguments, this is not applicable. All of these variables should be declared in  dsatctab.c or dsatetsictab.c. For AT commands whose defaults and/or limits need to be  initialized at runtime, this initialization may be performed in the function, dsatctab_data_init.
6. Make sure val_ptr2 is not set to NULL, if DUAL_STACK attribute is defined in the table  entry. Usually, val_ptr2 would contain the address of the expanded variable.
7. Add the command execution function, if any. If the command requires special processing  code outside the generic parameter processing functions defined in dsatparm.c, add a new  command execution function to the appropriate command processing file (dsatparm.c,  dsatact.c, dsatvend.c, dsatetsicall.c, dsatetsipkt.c, dsatetsime.c, dsatetsismsc.c, dsatgsmfax.c).  Take advantage of any AT command processing utilities exported by dsati.h or parameter  processing exported by dsatparm.h.
8. Add the abort command function, if any. If the command is abortable, an abort command function must be defined in the appropriate command processing file. The command processing files are the same as those identified in step 7.
9. Add the command to the appropriate command table. First, determine which command table  the AT command belongs to, based on the command syntax and command type. Then, add  the dsati_cmd_type entry to the selected command table. Initialize the dsati_cmd_type  command table entry. Initialize the dsati_cmd_type command table entry to point to this new  command execution function. If no new special processing code is required, initialize the command table entry to point to the appropriate parameter processing function or NULL, depending on the command response desired. Initialize the abort command function pointer  to NULL if the command is not abortable; otherwise, initialize it to point to the abort command function.
10. Compile and test. The AT command is now ready to use.

根據(jù)上面的文檔我試著自己添加了一個AT命令,當(dāng)然我只是照著葫蘆畫瓢,用一個已知的AT命令改個名字,功能不變。編譯出來和原來已知命令重疊了,就是改變一個的值,另一個也跟著改變。對于添加一個異步命令還有些力不從心。

            上面就是我最近兩天的學(xué)習(xí)成果,希望有志同道合的兄弟能和我一起探討下,更希望大神能指點(diǎn)下,這是第一次發(fā)博客,主要是記錄自己的工作學(xué)習(xí)經(jīng)歷。

            希望有英語大牛能幫我把上面的英語翻譯一下,感激不盡,因?yàn)槲抑荒苓B猜戴蒙的看,也不知道對不對。

向AI問一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI