1 / 12

撰寫 Tiny OS – nes C

HSCC- 高速通訊與計算實驗室. 撰寫 Tiny OS – nes C. Present: Li-der Wang. 2012/3. NTHU- 高速通訊與計算實驗室. What is NesC ?. nesC :專為 TinyOS 設計的程式語言 nesC is C-like programming language Component-based 程式是由一個個 Component 所組成 Event-driven 程式運作時是主要是用 event 來 進行 process. NTHU- 高速通訊與計算實驗室.

oded
Download Presentation

撰寫 Tiny OS – nes C

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. HSCC-高速通訊與計算實驗室 撰寫Tiny OS – nesC Present:Li-der Wang 2012/3

  2. NTHU-高速通訊與計算實驗室 What is NesC ? • nesC:專為TinyOS設計的程式語言 • nesC is C-like programming language • Component-based • 程式是由一個個Component所組成 • Event-driven • 程式運作時是主要是用event來進行process

  3. NTHU-高速通訊與計算實驗室 Pragram Architecture • TinyOS把所有功能都包成一個個的component。 • 使用Interface作為呼叫底層Component 的方式 • Component包含程式實作程式碼 • Interface只有method讓使用者呼叫

  4. Pragram Architecture • 自訂的Component為主要控制程式(Main),控制其餘TinyOS本身底層的Component • Component之間連結需要透過interface,所以要經過wired 主程式Component 中間經過Wired 所使用到的 Component NTHU-高速通訊與計算實驗室

  5. Pragram Architecture • Component 有兩種

  6. Example 1 : Blink • C:\cygwin\opt\tinyos-2.x\apps\Blink • BlinkApp.nc • 為configuration檔 ,負責component之間的溝通 • Blink.nc • 實作的介面 for BlinkApp的定義 • 先進行 make octopus 編譯 • 完成後打入 make octopus docs 產生說明文件檔  C:\cygwin\opt\tinyos-2.x\doc\nesdoc\octopus\index.html 可以看到程式接線的實際情形

  7. Example 1 : Blink

  8. Homework • 修改BlinkC.nc檔案,使其根據秒數來閃爍不同色的Led 燈, 4種燈 共16種變化

  9. reference • http://www.tinyos.net/tinyos-2.x/doc/nesdoc/telosb/

More Related