當前位置:首頁 » 安卓系統 » android發送at指令

android發送at指令

發布時間: 2024-10-18 13:14:18

1. AT+CREG和AT+CGREG的區別

AT+CREG用於查詢網路注冊狀態。AT+CGREG用於查詢GPRS網路注冊狀態。


AT 即Attention,AT指令集是從終端設備(Terminal Equipment,TE)或數據終端設備(Data Terminal Equipment,DTE)向終端適配器(Terminal Adapter, TA)或數據電路終端設備(Data Circuit Terminal Equipment,DCE)發送的。通過TA,TE發送AT指令來控制移動台(Mobile Station,MS)的功能,與GSM 網路業務進行交互。


用戶可以通過AT指令進行呼叫、簡訊、電話本、數據業務、傳真等方面的控制。90年代初,AT指令僅被用於Modem操作。沒有控制行動電話文本消息的先例,只開發了一種叫SMS BlockMode的協議,通過終端設備(TE)或電腦來完全控制 SMS。幾年後,主要的行動電話生產廠商諾基亞、愛立信、摩托羅拉和HP共同為GSM 研製了一整套AT指令,其中就包括對SMS的控制。


AT指令在此基礎上演化並被加入GSM 07.05標准以及現在的GSM07.07標准,完全標准化和比較健全的標准。如:對SMS的控制共有3種實現途徑:最初的Block Mode;基於AT指令的Text Mode;基於AT指令的PDU Mode。


到現在PDU Mode已經取代BlockMode,後者逐漸淡出。GSM 模塊與計算機之間的通信協議是一些AT指令集,AT指令是以AT作首,字元結束的字元串,AT指令的響應數據包在 中。每個指令執行成功與否都有相應的返回。其他的一些非預期的信息(如有人撥號進來、線路無信號等),模塊將有對應的一些信息提示,接收端可做相應的處理。

2. Android 發送AT指令

1、hardware\ril\reference-ril\Reference-ril.c 中 onRequest() 處理RIL_REQUEST_DIAL 時會 調用requestDial();
2、requestDial()中轉換RIL_REQUEST_DIAL 請求為AT指令;
3、通過at_send_command()下發;
4、經過at_send_command_full,at_send_command_full_nolock ,writeline()寫到設備中。

3. apktool 回編 報錯: brut.common.BrutException:could not exec (exit code = 1) 請各位大神幫忙 謝謝!

apktool解包後確實存在打包回不去的問題,這種情況下即使解包後什麼都不做直接回編也失敗,問題出在apk包上,可能做了反編譯的處理,使jar包結構發生改變,這種情況下就無法對該apk進行反編譯和回編的處理了。

匯編時出現:

F:apktool>apktool b Hello Hello.apk

Exception in thread "main" brut.androlib.AndrolibException: brut.directory.PathN

otExist: apktool.yml

at brut.androlib.Androlib.readMetaFile(Unknown Source)

at brut.androlib.Androlib.build(Unknown Source)

at brut.androlib.Androlib.build(Unknown Source)

at brut.apktool.Main.cmdBuild(Unknown Source)

at brut.apktool.Main.main(Unknown Source)

Caused by: brut.directory.PathNotExist: apktool.yml

at brut.directory.AbstractDirectory.getFileInput(Unknown Source)

經驗證是,反匯編時沒有生成apktool.yml

進行反匯編時,改用命令apktool d -r xx.apk xx便可以解決(加上了-r選項)。

(3)android發送at指令擴展閱讀:

匯編執行指令經匯編程序翻譯為機器指令,二者之間基本上保持一一對應的關系。匯編偽指令又稱作匯編指示,用於向匯編程序提供用戶自定義的符號、數據的類型、數據空間的長度,以及目標程序的格式、存放位置等提示性信息,其作用是指示匯編程序如何進行匯編。使用匯編語言編寫的源代碼,需要通過使用相應的匯編程序將它們轉換成可執行的機器代碼。這一過程被稱為匯編過程。

許多匯編程序可以識別代表地址和常量的標簽(label)和符號(symbols),這樣就可以用字元來代表操作數而無需採取寫死的方式。普遍地說,特定的匯編語言和特定的機器語言指令集是一一對應的。

許多匯編程序為程序開發、匯編控制、輔助調試提供了額外的支持機制。有的匯編語言編程工具經常會提供宏,它們也被稱為宏匯編器。

4. android 怎麼通過藍牙向一個硬體發送AT指令

將16進制的字元串轉換成bytes,通過hexstring2bytes轉換,從而發送指令。

5. android kernel和標准linux kernel的區別

android kernel和標准linux kernel的區別

android kernel和標准linux kernel的區別
總的區別可以歸納如下:
ARCH -- 這是Android修改了arch/arm下面的一些檔案:
arch/arm:
Chg: arch/arm/kernel/entry-armv.S
Chg: arch/arm/kernel/mole.c
Chg: arch/arm/kernel/process.c
Chg: arch/arm/kernel/ptrace.c
Chg: arch/arm/kernel/setup.c
Chg: arch/arm/kernel/signal.c
Chg: arch/arm/kernel/traps.c
Chg: arch/arm/mm/cache-v6.S
Chg: arch/arm/vfp/entry.S
Chg: arch/arm/vfp/vfp.h
Chg: arch/arm/vfp/vfphw.S
Chg: arch/arm/vfp/vfpmole.c
Goldfish -- 這是Android為了模擬器所開發的一個虛擬硬體平台。Goldfish執行arm926T指令(在2.6.29中,goldfish也支援ATMv7指令),但是在實際的裝置中,該虛擬平台的檔案不會被編譯。
arch/arm/mach-goldfish:
New: arch/arm/mach-goldfish/audio.c
New: arch/arm/mach-goldfish/board-goldfish.c
New: arch/arm/mach-goldfish/pdev_bus.c
New: arch/arm/mach-goldfish/pm.c
New: arch/arm/mach-goldfish/switch.c
New: arch/arm/mach-goldfish/timer.c
YAFFS2 -- 和PC把檔案儲存在硬碟上不一樣, 移動裝置一般把Flash作為儲存裝數模鏈置。尤其是NAND flash應用非常廣泛(絕大多數手機用的都是NAND flash,三星的一些手機使用的是OneNAND)。NAND flash具有低成碼帶本和高密度的優點。
YAFFS2 是「Yet Another Flash File System, 2nd edition" 的簡稱。 它提供在Linux核心和NAND flash裝置 之前高效率的介面。 YAFFS2並沒薯孫有包含在標準的Linux核心中, Google把它新增到了Android的kernel
fs/yaffs2:
New: fs/yaffs2/devextras.h
New: fs/yaffs2/Kconfig
New: fs/yaffs2/Makefile
New: fs/yaffs2/moleconfig.h
New: fs/yaffs2/yaffs_checkptrw.c
New: fs/yaffs2/yaffs_checkptrw.h
New: fs/yaffs2/yaffs_e.c
New: fs/yaffs2/yaffs_e.h
New: fs/yaffs2/yaffs_fs.c
New: fs/yaffs2/yaffs_getblockinfo.h
New: fs/yaffs2/yaffs_guts.c
New: fs/yaffs2/yaffs_guts.h
New: fs/yaffs2/yaffsinterface.h
New: fs/yaffs2/yaffs_mtdif1.c
New: fs/yaffs2/yaffs_mtdif1.h
New: fs/yaffs2/yaffs_mtdif2.c
New: fs/yaffs2/yaffs_mtdif2.h
New: fs/yaffs2/yaffs_mtdif.c
New: fs/yaffs2/yaffs_mtdif.h
New: fs/yaffs2/yaffs_nand.c
New: fs/yaffs2/yaffs_nandemul2k.h
New: fs/yaffs2/yaffs_nand.h
New: fs/yaffs2/yaffs_packedtags1.c
New: fs/yaffs2/yaffs_packedtags1.h
New: fs/yaffs2/yaffs_packedtags2.c
New: fs/yaffs2/yaffs_packedtags2.h
New: fs/yaffs2/yaffs_qsort.c
New: fs/yaffs2/yaffs_qsort.h
New: fs/yaffs2/yaffs_tagspat.c
New: fs/yaffs2/yaffs_tagspat.h
New: fs/yaffs2/yaffs_tagsvalidity.c
New: fs/yaffs2/yaffs_tagsvalidity.h
New: fs/yaffs2/yportenv.h
Bluetooth -- Google為Bluetooth打上了patch,fix了一些Bluetooth的bug
drivers/bluetooth:
Chg: drivers/bluetooth/bfu *** .c
Chg: drivers/bluetooth/bt3c_cs.c
Chg: drivers/bluetooth/btu *** .c
Chg: drivers/bluetooth/hci_h4.c
Chg: drivers/bluetooth/hci_ll.c
Scheler -- 對於Scheler的改變非常小,我對它並沒有去研究。
Chg: kernel/sched.c

New Android Functionality -- 除了fix一些bug以及其他一些小的更改,Android增加了一些新的功能,介紹如下:
IPC Binder -- The IPC Binder is an Inter-Process Communication (IPC) mechani *** . It allows processes to provide services to other processes via a set of higher-level APIs than are available in standard Linux. An Inter search indicated that the Binder concept originated at Be, Inc., and then made its way into Palm's sofare, before Google wrote a new Binder for Android.
New: drivers/staging/android/binder.c
Low Memory Killer -- Android adds a low-memory killer that, each time it's called, scans the list of running Linux processes, and kills one. It was not clear in our cursory examination why Android adds a low-memory killer on of the already existing one in the standard Linux kernel.
New: drivers/staging/android/lowmemorykiller.c
Ashmem -- Ashmem is an Anonymous SHared MEMory system that adds interfaces so processes can share named blocks of memory. As an example, the system could use Ashmem to store icons, which multiple processes could then aess when drawing their UI. The advantage of Ashmem over traditional Linux shared memory is that it provides a means for the kernel to reclaim these shared memory blocks if they are not currently in use. If a process then tries to aess a shared memory block the kernel has freed, it will receive an error, and will then need to reallocate the block and reload the data.
New: mm/ashmem.c
RAM Console and Log Device -- To aid in debugging, Android adds the ability to store kernel log messages to a RAM buffer. Additionally, Android adds a separate logging mole so that user processes can read and write user log messages.
New: drivers/staging/android/ram_console.c
Android Debug Bridge -- Debugging embedded devices can best be described as challenging. To make debugging easier, Google created the Android Debug Bridge (ADB), which is a protocol that runs over a USB link beeen a hardware device running Android and a developer writing applications on a desk PC.
drivers/u *** /gadget:
New: drivers/u *** /gadget/android.c
Chg: drivers/u *** /gadget/posite.c
Chg: drivers/u *** /gadget/f_acm.c
New: drivers/u *** /gadget/f_acm.h
New: drivers/u *** /gadget/f_adb.c
New: drivers/u *** /gadget/f_adb.h
New: drivers/u *** /gadget/f_mass_storage.c
New: drivers/u *** /gadget/f_mass_storage.h
Android also adds a new real-time clock, switch support, and timed GPIO support. We list the impacted files for these new moles at the end of this document.
Power Management -- Power management is one of the most difficult pieces to get right in mobile devices, so we split it out into a group separate from the other pieces. It's interesting to note that Google added a new power management system to Linux, rather than reuse what already existed. We list the impacted files at the end of this document.
kernel/power:
New: kernel/power/consoleearlysuspend.c
New: kernel/power/earlysuspend.c
New: kernel/power/fbearlysuspend.c
Chg: kernel/power/main.c
Chg: kernel/power/power.h
Chg: kernel/power/process.c
New: kernel/power/userwakelock.c
New: kernel/power/wakelock.c
Miscellaneous Changes -- In addition to the above, we found a number of changes that could best be described as, 'Miscellaneous.' Among other things, these changes include additional debugging support, keypad light controls, and management of TCP neorking.
(freedom_asic)

Android kernel是從linux kernel 修改過來的,大部分的核心沒什麼變化。Android廠商會定製原始碼修改驅動 或者增加新的特性等。

6. 如何獲取當前使用的網路運營商

您好,我來為您解答:
發送at指令獲得網路狀態
這條指令用來檢查無線通信模塊是否已經登上網路。如果使用的是中國移動的SIM卡,已登錄網路返回值應該是+COPS: 0,0,「China Mobile」,尚未登陸網路的返回值為+COPS:0。
希望我的回答對你有幫助。

熱點內容
c語言中非 發布:2024-10-18 16:21:20 瀏覽:143
招編程人員 發布:2024-10-18 16:19:37 瀏覽:422
什麼數據類型存儲圖片 發布:2024-10-18 16:19:28 瀏覽:749
電腦維護伺服器 發布:2024-10-18 16:18:51 瀏覽:435
取捨演算法 發布:2024-10-18 16:12:36 瀏覽:249
安卓數據線一般在什麼價位 發布:2024-10-18 16:09:25 瀏覽:732
老式安卓機怎麼插卡 發布:2024-10-18 15:52:35 瀏覽:338
pc搭建nas伺服器 發布:2024-10-18 15:51:59 瀏覽:266
androidimei 發布:2024-10-18 15:51:56 瀏覽:292
c語言零基礎入門 發布:2024-10-18 15:46:42 瀏覽:188