投影片 1

Similar documents
高中英文科教師甄試心得

ebook140-8


Windows XP

Microsoft Word - 11月電子報1130.doc

Microsoft PowerPoint - STU_EC_Ch08.ppt

Untitiled

lan03_yen

參 加 第 二 次 pesta 的 我, 在 是 次 交 流 營 上 除 了, 與 兩 年 沒 有 見 面 的 朋 友 再 次 相 聚, 加 深 友 誼 外, 更 獲 得 與 上 屆 不 同 的 體 驗 和 經 歴 比 較 起 香 港 和 馬 來 西 亞 的 活 動 模 式, 確 是 有 不 同 特

Microsoft Word - template.doc

Microsoft Word doc

國立中山大學學位論文典藏.PDF

國立桃園高中96學年度新生始業輔導新生手冊目錄

[ 13 年 12 月 06 日, 下 午 6 点 24 分 ] Intel Hosts 新 加 入 的 同 学 们, 快 去 听 听 在 线 宣 讲 会 哦, 同 时 完 成 页 面 下 方 有 奖 调 查, 就 有 资 格 参 与 大 奖 抽 取 啦! [ 13 年 12 月 06 日, 下 午

国 培 简 讯 国 培 计 划 (2012) 示 范 性 集 中 培 训 项 目 国 培 计 划 (2012) 中 小 学 教 师 示 范 性 集 中 培 训 暨 中 西 部 农 村 教 师 集 中 培 训 中 小 学 骨 干 教 师 北 京 外 国 语 大 学 英 语 学 科 研 修 项 目 毕

Lorem ipsum dolor sit amet, consectetuer adipiscing elit

89???????q?l?????T??

<4D F736F F D C4EAC0EDB9A4C0E04142BCB6D4C4B6C1C5D0B6CFC0FDCCE2BEABD1A15F325F2E646F63>

Microsoft Word - ChineseSATII .doc

ch_code_infoaccess

Microsoft Word - 第四組心得.doc

IP Access Lists IP Access Lists IP Access Lists

穨control.PDF

1.ai

Bus Hound 5

PowerPoint 簡報

1 SIGMA Lab Sydney IntelliGent MultimediA Laboratory Electrical and Information Engineering department EIE Ph.D. M.Phil. 1.QS (Associate Profess

101 年 全 國 高 職 學 生 實 務 專 題 製 作 競 賽 暨 成 果 展 報 告 書 題 目 :Beat CNN`s Report, 驚 艷 外 國 人 的 嘴 - 皮 蛋 之 大 改 造 指 導 老 師 : 林 佩 怡 參 賽 學 生 : 胡 雅 吟 楊 椀 惇 張 毓 津 許 巧 文

A Community Guide to Environmental Health

封面dd.tif

投影片 1

2015 Chinese FL Written examination

C o n t e n t s Acceptance Allow Love Apologize Archangel Metatron Archangel Michael Ask for

國立中山大學學位論文典藏

BC04 Module_antenna__ doc



TX-NR3030_BAS_Cs_ indd

前 言 一 場 交 換 學 生 的 夢, 夢 想 不 只 是 敢 夢, 而 是 也 要 敢 去 實 踐 為 期 一 年 的 交 換 學 生 生 涯, 說 長 不 長, 說 短 不 短 再 長 的 路, 一 步 步 也 能 走 完 ; 再 短 的 路, 不 踏 出 起 步 就 無 法 到 達 這 次


十二年國民基本教育

Microsoft PowerPoint - Aqua-Sim.pptx

十二年國民基本教育

软件测试(TA07)第一学期考试

十二年國民基本教育

第六章

Microsoft PowerPoint - Performance Analysis of Video Streaming over LTE using.pptx

untitled

<4D F736F F D205F FB942A5CEA668B443C5E9BB73A740B5D8A4E5B8C9A552B1D0A7F75FA6BFB1A4ACFC2E646F63>

PowerPoint Presentation

Edge-Triggered Rising Edge-Triggered ( Falling Edge-Triggered ( Unit 11 Latches and Flip-Flops 3 Timing for D Flip-Flop (Falling-Edge Trigger) Unit 11

錫安教會2015年11月29日分享

T stg -40 to 125 C V cc 3.8V V dc RH 0 to 100 %RH T a -40 to +125 C -0.3 to 3.6V V -0.3 to VDD+0.3 V -10 to +10 ma = 25 = 3V) VDD

可 愛 的 動 物 小 五 雷 雅 理 第 一 次 小 六 甲 黃 駿 朗 今 年 暑 假 發 生 了 一 件 令 人 非 常 難 忘 的 事 情, 我 第 一 次 參 加 宿 營, 離 開 父 母, 自 己 照 顧 自 己, 出 發 前, 我 的 心 情 十 分 緊 張 當 到 達 目 的 地 後

入學考試網上報名指南

唐彪《讀書作文譜》述略

99 學年度班群總介紹 第 370 期 班群總導 陳怡靜 G45 班群總導 陳怡靜(河馬) A 家 惠如 家浩 T 格 宜蓁 小 霖 怡 家 M 璇 均 蓁 雴 家 數學領域 珈玲 國燈 英領域 Kent

问 她! 我 们 把 这 只 手 机 举 起 来 借 着 它 的 光 看 到 了 我 老 婆 正 睁 着 双 眼 你 在 干 什 么 我 问, 我 开 始 想 她 至 少 是 闭 着 眼 睛 在 yun 酿 睡 意 的 我 睡 不 着 她 很 无 辜 地 看 着 我 我 问 她 yun 酿 的 yu

2

区 域 活 动 进 入 中 班 我 们 区 域 的 设 置 和 活 动 材 料 都 有 所 变 化, 同 时 也 吸 引 孩 子 们 积 极 的 参 与 学 习 操 作 区 的 新 材 料 他 们 最 喜 欢, 孩 子 们 用 立 方 块 进 行 推 理 操 作 用 扑 克 牌 进 行 接 龙 游

從詩歌的鑒賞談生命價值的建構

AL-M200 Series

(Microsoft Word - 10\246~\253\327\262\304\244@\264\301\256\325\260T_Version4)

Microsoft Word - 生活禮儀柯友惠981

4. 每 组 学 生 将 写 有 习 语 和 含 义 的 两 组 卡 片 分 别 洗 牌, 将 顺 序 打 乱, 然 后 将 两 组 卡 片 反 面 朝 上 置 于 课 桌 上 5. 学 生 依 次 从 两 组 卡 片 中 各 抽 取 一 张, 展 示 给 小 组 成 员, 并 大 声 朗 读 卡

2-7.FIT)

Important Notice SUNPLUS TECHNOLOGY CO. reserves the right to change this documentation without prior notice. Information provided by SUNPLUS TECHNOLO

States and capital package

Improved Preimage Attacks on AES-like Hash Functions: Applications to Whirlpool and Grøstl

2005 5,,,,,,,,,,,,,,,,, , , 2174, 7014 %, % 4, 1961, ,30, 30,, 4,1976,627,,,,, 3 (1993,12 ),, 2


( 一 ) 實 習 的 時 候 就 和 讀 書 會 的 同 學 一 起 把 陳 嘉 陽 紮 實 地 讀 過 一 遍 了, 也 因 此 在 考 完 教 檢 之 後, 我 們 只 有 把 不 熟 或 是 常 考 的 章 節 再 導 讀 一 次 ( 例 如 : 統 計 行 政 法 規 ), 主 力 則 是

神 学 家 陶 恕 博 士 曾 经 相 当 感 叹 的 说, 数 以 百 万 计 的 我 们 生 活 在 福 音 既 得 之 地, 各 自 都 有 所 属 的 教 会, 也 努 力 去 传 基 督 教 的 信 仰, 但 可 悲 的 是, 或 许 终 其 一 生, 都 未 曾 认 真 思 想 过 神

(2008) 主 张 教 师 在 课 文 教 学 中 应 让 学 生 有 意 识 地 注 意 语 块, 并 指 出 语 块 教 学 对 大 学 生 的 英 语 写 作 能 力 有 着 重 要 的 意 义 于 秀 莲 (2008) 以 大 学 生 为 受 试 对 象, 在 对 不 同 学 生 分 别

目 录 第 一 章 电 力 行 业 内 部 控 制 操 作 指 南 概 述... 1 第 二 章 内 部 控 制 规 范 体 系 建 设 与 运 行 第 三 章 内 部 环 境 建 设 第 一 节 组 织 架 构 第 二 节 发 展 战 略 第 三 节

豐 邑 家 族 季 刊 編 者 的 話 No.07 彼 此 相 愛 總 編 輯 : 邱 崇 喆 主 編 : 戴 秋 柑 編 輯 委 員 : 黃 淑 美 盧 永 吉 王 森 生 趙 家 明 林 孟 姿 曾 淑 慧 執 行 編 輯 : 豐 邑 建 設 企 劃 課 出 版 發 行 :

蔡 氏 族 譜 序 2

国 际 视 野 中 国 立 场 原 创 诉 求 专 业 精 神 读 者 寄 语 Readers of the Message

Lorem ipsum dolor sit amet, consectetuer adipiscing elit


四 本 學 期 程 架 構 : (1) 學 活 流 程 與 策 略 視 聽 故 事 時 事 節 令 生 活 問 題 預 習 單 朗 讀 問 答 討 論 討 論 理 解 欣 賞 想 像 練 習 章 結 構 敘 寫 技 巧 修 辭 要 領 仿 作 造 字 原 理 字 義 釐 清 字 音 字 形 辨 析

中國飲食色彩初探

Microsoft Word - Final Exam Review Packet.docx

<4D F736F F D20A4BAA4E52DA4A4B2A3AEF8B64FAF53BC782E646F63>

Microsoft Word - 論文封面 修.doc

國立中山大學學位論文典藏.PDF

Liao Mei-Yu Professor, Department of Chinese Literature, National Cheng Kung University Abstract Yao Ying was a government official in Taiwan for more

Microsoft PowerPoint - NCBA_Cattlemens_College_Darrh_B

K7VT2_QIG_v3

Microsoft Word 國企國貿.doc

202 The Sending Back of The Japanese People in Taiwan in The Beginning Years After the World War II Abstract Su-ying Ou* In August 1945, Japan lost th

<4D F736F F D203033BDD7A16DA576B04FA145A4ADABD2A5BBACF6A16EADBAB6C0ABD2A4A7B74EB8712E646F63>

Microsoft Word - 口試本封面.doc

編輯要旨 一 教育部為了協助本國失學民眾 新住民及 其他國外朋友 有系統的學習華語文的 聽 說 讀 寫 算等識字能力及跨文化 適應 以培養具有基本公民素養的終身學 習者 特別委託新北市政府教育局新住民 文教輔導科團隊編輯本教材 二 依據上述目的 本教材共有六冊 並分為 六級 分級及單元名稱詳如下表

Microsoft Word - 國小中年級.doc

逢 甲 大 學

第一章 緒論

目 錄 壹 目 的... 1 一 計 畫 背 景... 1 二 計 畫 目 的... 1 三 預 期 效 應... 2 貳 過 程... 3 一 計 畫 期 程... 3 二 學 生 活 動 安 排 時 程... 3 三 活 動 檢 核 表... 4 四 組 織 與 分 工... 5 五 活 動 行

簡報技巧

Logitech Wireless Combo MK45 English

Transcription:

Lab 06 Xbee API Communications 實驗

What is API mode An application programming interface (API) is simply a set of standard interfaces created to allow one software program to interact with another. APIs let one computer application request services from another application in a standard manner. The most important thing to note is that APIs are specifically engineered to enable computers to talk efficiently to other computers. They are not generally designed for direct human interaction. The interactions are made easy for humans, but they are not as robust, explicit, and efficient for computers. Computers prefer to deal with numbers, and do best when the organization of these numbers provides an unambiguous and highly structured method for transfer. 2

XBee API Protocol The goal of API-mode communications is to transmit highly structured data quickly, predictably, and reliably. We will begin by taking a look at the structures shared by all API data frames and work our way into the specifics for each frame type. The tiny microcontroller inside the Series 2 XBee radio doesn t have enough room to hold all the instructions for both AT mode (transparent/command modes) and API mode. Therefore, different firmware must be loaded into the xbee device. 3

API Frame Types Inside the general frame structure there are substructures that cover all the different kinds of data that you might want to send to and receive from your local XBee radio. The frame type byte tells us what type of API frame we are looking at. Knowing the frame type is crucial to knowing what information is coming next. For example, if the frame type is 0x08, that indicates it is an AT command frame. So by reading the first four bytes we will know: Where the frame begins (start byte) How long the frame is going to be (length bytes) What kind of frame we re looking at (frame type) 4

API Frame Types Every frame type is assigned a number, following table lists the basic ones, including all the frame types. 5

AT Commands AT-type commands can be sent via API frames to configure your local radio. They can query the settings on the local radio or set parameters. These are all the same commands you typed in transparent/command mode. AT command frames begin with our old buddy the start byte: 0x7E (see next slide). First two bytes that indicate the frame length. There s also a checksum at the end. The data that makes the AT command frame unique goes in the Frame-specific section, starting right after the length byte. 6

API format for AT commands 7

ZigBee Receive Packet Here s another API frame that gives us far more than we could get from simple trans-parent/command mode interactions. When a transmission is received in transparent mode, it comes with no indication of who the sender was. On a simple pair network that s fine because there s only one possible sender. But on a larger network, it s usually of considerable interest to know not only what was received but where it came from. So in addition to the usual preamble bytes, including the frame type of 0x90 to indicate a ZigBee Receive Packet and a frame ID that was sent by the transmitter, we get to see the 64-bit and 16-bit source addresses along with a receive options indicator, and of course the payload data itself, followed by a checksum. 8

ZigBee Receive Packet 9

ZigBee Receive Packet 10

API Mode Parameter Range, 有 0-2 的數值可以更改,0 = Disabled, 1 = API Enabled, 2 = API w/escaped 發現你的另外一顆 xbee 傳過來的訊息不是正常的字串, 這是因為 XBee 已經進入 API 傳輸模式 11

Hex Mode 看到右邊的奇怪符號, 打開 Show Hex 按鈕顯示 16 進制模式 12

API Type ASCII 碼, 順序是 7E 00 06 81 00 1F 31 00 61 CD 參考 datasheet 的 API 格式說明, 對照我們得到的是封包內容去解讀 13

Packets Format 7E 是開頭, 然後接著的 00 06 代表後面會有 6 個 bytes 的封包內容, 然後 81 是 cmdid, 然後剩下 00 1F 31 00 61 CD 這些我們要先去看 cmdid = 81 的格式是什麼,RX packet 16-bit address (page 54 0x90) 14

checksum 00 1F 就是 source Address, 也就是說傳給我們那一顆 Xbee 的 MY, MSB 是高位元 LSB 是低位元, 然後 31 是 RSSI 是傳輸信號強度,00 是保留用 0 = 沒作用, 1 = 廣播模式, 2 PAN 廣播, 最後的 61 才是我們的字元 a (16bit) 那最後 CD 的意思是什麼呢?? 也就是 Checksum,Checksum 的算法很簡單, 就是扣除開頭的 7E 以及長度還有 checksum 全部加起來的總和取 LSB 的 byte 去減掉 0xFF 看是否是等於 CD, 也就是說 : 7E 00 06 81 00 1F 31 00 61 CD 取 81 00 1F 31 00 61 加起來 0xFF - (81+0+1F+31+0+61) = 0xFF - 0x132 = 0xFF - 0x32 = 0xCD 15

checksum 把所有的 byte 加起來之後不包括 7E 跟長度應該 LSB 等於 0xFF, 也就是說 : 7E 00 06 81 00 1F 31 00 61 CD = 81 + 1F + 31 + 61 + CD = 0x1FF 16