hanback electronics co., ltd. tinyos 구조와 스케줄러의 이해 ㈜한백전자 이철희

47
HANBACK ELECTRONICS CO., LTD. TinyOS 구구구 구구구구구 구구 구구구구구 구구구

Upload: aubrey-lindsey

Post on 18-Jan-2016

243 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: HANBACK ELECTRONICS CO., LTD. TinyOS 구조와 스케줄러의 이해 ㈜한백전자 이철희

HANBACKELECTRONICS CO., LTD.

TinyOS 구조와 스케줄러의 이해

㈜한백전자이철희

Page 2: HANBACK ELECTRONICS CO., LTD. TinyOS 구조와 스케줄러의 이해 ㈜한백전자 이철희

HANBACKELECTRONICS CO., LTD.

NesC Programming Language

application:configuration

comp1:module

comp3

comp4comp2:configuration

• Components:– 구성

- module: C 로 구현- configuration:

select and wire– interfaces

- provides interface- uses interface

2무단 복사 및 전재 금지

Page 3: HANBACK ELECTRONICS CO., LTD. TinyOS 구조와 스케줄러의 이해 ㈜한백전자 이철희

HANBACKELECTRONICS CO., LTD.

Component

3무단 복사 및 전재 금지

Page 4: HANBACK ELECTRONICS CO., LTD. TinyOS 구조와 스케줄러의 이해 ㈜한백전자 이철희

HANBACKELECTRONICS CO., LTD.

NesC Programming Language

• Component 의 종류 :– configuration: 컴포넌트의 연결을 나타냄– module: 인터페이스의 동작을 기술 , 이벤트 핸들러 작성

4무단 복사 및 전재 금지

Page 5: HANBACK ELECTRONICS CO., LTD. TinyOS 구조와 스케줄러의 이해 ㈜한백전자 이철희

HANBACKELECTRONICS CO., LTD.

NesC Programming Language

• Configurations 의 연결 :configuration app { }implementation { components c1, c2, c3;

c1 -> c2; // implicit interface sel.c2.out -> c3.triangle;c3 <- c2.side;

}

• Configuration 의 부분 기술 :Component c2c3 { provides interface triangle t1;}implementation { components c2, c3;

t1 -> c2.in;c2.out -> c3.triangle;c3 <- c2.side;

}

C1

C2

C3

C2

C3

5무단 복사 및 전재 금지

Page 6: HANBACK ELECTRONICS CO., LTD. TinyOS 구조와 스케줄러의 이해 ㈜한백전자 이철희

HANBACKELECTRONICS CO., LTD.

NesC Programming Language

•modules:module C1 { uses interface triangle;} implementation { ... }module C2 { provides interface triangle in; uses { interface triangle out; interface rectangle side; }} implementation { ... }module C3 { provides interface triangle; provides interface rectangle;} implementation { ... }

C1

C2

C3

6무단 복사 및 전재 금지

Page 7: HANBACK ELECTRONICS CO., LTD. TinyOS 구조와 스케줄러의 이해 ㈜한백전자 이철희

HANBACKELECTRONICS CO., LTD.

NesC Blink exampleblink.nc (configuration)

configuration Blink {}implementation { components Main, BlinkM, TimerC, LedsC; Main.StdControl -> TimerC.StdControl; Main.StdControl -> BlinkM.StdControl; BlinkM.Timer -> TimerC.Timer[unique("Timer")]; BlinkM.Leds -> LedsC;}

7무단 복사 및 전재 금지

Page 8: HANBACK ELECTRONICS CO., LTD. TinyOS 구조와 스케줄러의 이해 ㈜한백전자 이철희

HANBACKELECTRONICS CO., LTD.

NesC Blink exampleblinkM.nc (module)module BlinkM { provides { interface StdControl; } uses { interface Timer as Timer; interface Leds; }}implementation { command result_t StdControl.init() { call Leds.init();

return SUCCESS;} command result_t StdControl.start() { call Timer.start(TIMER_REPEAT, 1000); return

SUCCESS; } command result_t StdControl.stop() { call Timer.stop();return SUCCESS; } event result_t Timer.fired() { call Leds.redToggle(); return SUCCESS; }}

8무단 복사 및 전재 금지

Page 9: HANBACK ELECTRONICS CO., LTD. TinyOS 구조와 스케줄러의 이해 ㈜한백전자 이철희

HANBACKELECTRONICS CO., LTD.

Blink 의 구조• 컴포넌트 : Main, TimerC, LedsC, BlinkM

– /opt/tinyos-1.x/tos/system/Main.nc

configuration Main { uses interface StdControl;}implementation{ components RealMain, PotC, HPLInit;

StdControl = RealMain.StdControl; RealMain.hardwareInit -> HPLInit; RealMain.Pot -> PotC;}

9무단 복사 및 전재 금지

Page 10: HANBACK ELECTRONICS CO., LTD. TinyOS 구조와 스케줄러의 이해 ㈜한백전자 이철희

HANBACKELECTRONICS CO., LTD.

Main.nc

• Component : RealMain, PotC, HPLInit

MainStdControl

RealMain

PotC HPLInit

Pot Hardwareinit

같은 interface 이므로 = 로 연결

Provide 와 use interface이므로 -> 로 연결

10무단 복사 및 전재 금지

Page 11: HANBACK ELECTRONICS CO., LTD. TinyOS 구조와 스케줄러의 이해 ㈜한백전자 이철희

HANBACKELECTRONICS CO., LTD.

RealMain <-> HPLInitmodule RealMain { uses { command result_t hardwareInit(); interface StdControl; interface Pot; }}implementation{ int main() __attribute__ ((C, spontaneous)) { call hardwareInit(); call Pot.init(10); TOSH_sched_init(); call StdControl.init(); call StdControl.start(); __nesc_enable_interrupt(); while(1) { TOSH_run_task(); } }}

/opt/tinyos-1.x/platform/avrmote/HPLInit.nc

module HPLInit { provides command result_t init();}Implementation{ // Basic hardware init. command result_t init() { TOSH_SET_PIN_DIRECTIONS(); return SUCCESS; }}

Simple FIFO 스케줄러

11무단 복사 및 전재 금지

Page 12: HANBACK ELECTRONICS CO., LTD. TinyOS 구조와 스케줄러의 이해 ㈜한백전자 이철희

HANBACKELECTRONICS CO., LTD.

RealMain<->PotCmodule RealMain { uses { command result_t hardwareInit(); interface StdControl; interface Pot; }}implementation{ int main() __attribute__ ((C, spontaneous)) { call hardwareInit(); call Pot.init(10); TOSH_sched_init(); call StdControl.init(); call StdControl.start(); __nesc_enable_interrupt(); while(1) { TOSH_run_task(); } }}

/opt/tinyos-1.x/system/PotC.ncconfiguration PotC{ provides interface Pot;}implementation { components PotM, HPLPotC; Pot = PotM; PotM.HPLPot -> HPLPotC;}

module PotM{ provides interface Pot; uses interface HPLPot;}implementation { …. command result_t Pot.init(uint8_t initialSetting) { setPot(initialSetting); return SUCCESS; } …..

12무단 복사 및 전재 금지

Page 13: HANBACK ELECTRONICS CO., LTD. TinyOS 구조와 스케줄러의 이해 ㈜한백전자 이철희

HANBACKELECTRONICS CO., LTD.

RealMain<->BlinkMmodule RealMain { uses { command result_t hardwareInit(); interface StdControl; interface Pot; }}implementation{ int main() __attribute__ ((C, spontaneous)) { call hardwareInit(); call Pot.init(10); TOSH_sched_init(); call StdControl.init(); call StdControl.start(); __nesc_enable_interrupt(); while(1) { TOSH_run_task(); } }}

module BlinkM{ provides { interface StdControl; } uses { interface Timer as Timer; interface Leds; }}implementation { command result_t StdControl.init() { call Leds.init(); return SUCCESS; } command result_t StdControl.start() { call Timer.start(TIMER_REPEAT, 1000); return SUCCESS; } StdControl.stop() { call Timer.stop(); return SUCCESS; } event result_t Timer.fired() { call Leds.redToggle(); return SUCCESS; }}

13무단 복사 및 전재 금지

Page 14: HANBACK ELECTRONICS CO., LTD. TinyOS 구조와 스케줄러의 이해 ㈜한백전자 이철희

HANBACKELECTRONICS CO., LTD.

사용된 Interface

• StdControl, Pot, hardwareInit(); interface StdControl{ command result_t init(); command result_t start(); command result_t stop();}

interface Pot { command result_t init(uint8_t initialSetting); command result_t set(uint8_t setting); command result_t increase(); command result_t decrease(); command uint8_t get();}

command result_t hardwareInit();

14무단 복사 및 전재 금지

Page 15: HANBACK ELECTRONICS CO., LTD. TinyOS 구조와 스케줄러의 이해 ㈜한백전자 이철희

HANBACKELECTRONICS CO., LTD.

Blink 의 구조• 컴포넌트 : Main, TimerC, LedsC, BlinkM

configuration TimerC { provides interface Timer[uint8_t id]; provides interface StdControl;}implementation{ components TimerM, ClockC, NoLeds, HPLPowerManagementM; TimerM.Leds -> NoLeds; TimerM.Clock -> ClockC; TimerM.PowerManagement -> HPLPowerManagementM; StdControl = TimerM; Timer = TimerM;}

15무단 복사 및 전재 금지

Page 16: HANBACK ELECTRONICS CO., LTD. TinyOS 구조와 스케줄러의 이해 ㈜한백전자 이철희

HANBACKELECTRONICS CO., LTD.

TimerC

• TimerC 의 구조

TimerCTimer StdControl

TimerM

NoLeds ClockC HPLPowerManagementM

Leds Clock PowerManagement

16무단 복사 및 전재 금지

Page 17: HANBACK ELECTRONICS CO., LTD. TinyOS 구조와 스케줄러의 이해 ㈜한백전자 이철희

HANBACKELECTRONICS CO., LTD.

Blink 의 구조• 컴포넌트 : Main, TimerC, LedsC, BlinkM

module LedsC { provides interface Leds;}implementation{ uint8_t ledsOn; enum { RED_BIT = 1, GREEN_BIT = 2, YELLOW_BIT = 4 }; async command result_t Leds.init() { … return SUCCESS; } async command result_t Leds.redOn() {…} async command result_t Leds.redOff() {…} async command result_t Leds.redToggle() {…} …. async command uint8_t Leds.get() {…} async command result_t Leds.set(uint8_t ledsNum) {…}}

17무단 복사 및 전재 금지

Page 18: HANBACK ELECTRONICS CO., LTD. TinyOS 구조와 스케줄러의 이해 ㈜한백전자 이철희

HANBACKELECTRONICS CO., LTD.

Blink 의 구조• 컴포넌트 : Main, TimerC, LedsC, BlinkM

module BlinkM{ provides { interface StdControl; } uses { interface Timer as Timer; interface Leds; }}implementation { command result_t StdControl.init() {call Leds.init(); return SUCCESS; } command result_t StdControl.start() {call Timer.start(TIMER_REPEAT, 1000); return SUCCESS; } StdControl.stop() { call Timer.stop(); return SUCCESS; } event result_t Timer.fired() { call Leds.redToggle(); return SUCCESS; }}}

18무단 복사 및 전재 금지

Page 19: HANBACK ELECTRONICS CO., LTD. TinyOS 구조와 스케줄러의 이해 ㈜한백전자 이철희

HANBACKELECTRONICS CO., LTD.

BlinkM <->LedsCmodule BlinkM{ provides { interface StdControl; } uses { interface Timer as Timer; interface Leds; }}implementation { command result_t StdControl.init() { call Leds.init(); return SUCCESS; } command result_t StdControl.start() { call Timer.start(TIMER_REPEAT, 1000); return SUCCESS; } StdControl.stop() { call Timer.stop(); return SUCCESS; } event result_t Timer.fired() { call Leds.redToggle(); return SUCCESS; }}

module LedsC { provides interface Leds;}implementation{ uint8_t ledsOn; enum { RED_BIT = 1, GREEN_BIT = 2, YELLOW_BIT = 4 }; async command result_t Leds.init() { … return SUCCESS; } async command result_t Leds.redOn() {…} async command result_t Leds.redOff() {…} async command result_t Leds.redToggle() {…} …. async command uint8_t Leds.get() {…} async command result_t Leds.set(uint8_t ledsNum) {…}}

19무단 복사 및 전재 금지

Page 20: HANBACK ELECTRONICS CO., LTD. TinyOS 구조와 스케줄러의 이해 ㈜한백전자 이철희

HANBACKELECTRONICS CO., LTD.

TinyOS 프로그래밍

20무단 복사 및 전재 금지

Page 21: HANBACK ELECTRONICS CO., LTD. TinyOS 구조와 스케줄러의 이해 ㈜한백전자 이철희

HANBACKELECTRONICS CO., LTD.

TinyOS

• 이미 구현된 다양한 컴포넌트를 적절하게 구성• Main 컴포넌트는 반드시 포함되어야 함

– C 에서 main() 을 포함하고 있음

21무단 복사 및 전재 금지

Page 22: HANBACK ELECTRONICS CO., LTD. TinyOS 구조와 스케줄러의 이해 ㈜한백전자 이철희

HANBACKELECTRONICS CO., LTD.

개발환경과 도구• 제공된 CD 를 이용하여 환경구성• ncc: NesC 컴파일러• avr-gcc: ncc 컴파일 결과 파일 app.c 를

컴파일• Main.hex 생성• BlinkM 의 컴파일

– Cygwin 의 시작– cd /opt/tinyos-1.x/apps/Blink< 엔터 >– Make clean;make zigbex < 엔터 >– ls build/zigbex/

22무단 복사 및 전재 금지

Page 23: HANBACK ELECTRONICS CO., LTD. TinyOS 구조와 스케줄러의 이해 ㈜한백전자 이철희

HANBACKELECTRONICS CO., LTD.

LED 의 제어• /opt/tinyos-1.x/apps/Blink 를 변경하여

원하는 LED 를 제어한다 .

23무단 복사 및 전재 금지

Page 24: HANBACK ELECTRONICS CO., LTD. TinyOS 구조와 스케줄러의 이해 ㈜한백전자 이철희

HANBACKELECTRONICS CO., LTD.

Timer 의 제어• /opt/tinyos-1.x/apps/Blink 를 타이머 3 개를

사용하도록 수정• 타이머 3 개를 이용하여 세개의 LED 를 제어

24무단 복사 및 전재 금지

Page 25: HANBACK ELECTRONICS CO., LTD. TinyOS 구조와 스케줄러의 이해 ㈜한백전자 이철희

HANBACKELECTRONICS CO., LTD.

Timer 의 설정• 타이머의 개수 설정• /opt/tinyos-1.x/tos/interfaces/timer.h

• Timer 를 12 개 사용하는 경우

#ifndef NTIMERS#if NESC >= 110#define NTIMERS uniqueCount("Timer")#else#define NTIMERS 12#endif#endifenum { TIMER_REPEAT = 0, TIMER_ONE_SHOT = 1, NUM_TIMERS = NTIMERS};

Makefile 에서 PFLAGS += -DNTIMERS=1225무단 복사 및 전재 금지

Page 26: HANBACK ELECTRONICS CO., LTD. TinyOS 구조와 스케줄러의 이해 ㈜한백전자 이철희

HANBACKELECTRONICS CO., LTD.

TINYOS• TinyOS (TOS) = atmega128 에서 수행 가능한

이미지• event-driven 구조• 단일 스택• 커널 없음 , 프로세스관리 없음 , 메모리관리 없음 ,

가상메모리 사용안함• Main 함수에서 구동되는 Simple FIFO 스케줄러

26무단 복사 및 전재 금지

Page 27: HANBACK ELECTRONICS CO., LTD. TinyOS 구조와 스케줄러의 이해 ㈜한백전자 이철희

HANBACKELECTRONICS CO., LTD.

TINYOS 응용• TOS application = graph of components +

scheduler

CommunicationActuating Sensing Communication

Application (User Components)

Main (includes Scheduler)

Hardware Abstractions

• main {

// component initialization while(1) {

while(more_tasks) schedule_task;

sleep; } // while} // main

27무단 복사 및 전재 금지

Page 28: HANBACK ELECTRONICS CO., LTD. TinyOS 구조와 스케줄러의 이해 ㈜한백전자 이철희

HANBACKELECTRONICS CO., LTD.

스케줄러• 스케줄링 :

– 2-level scheduling (events and tasks)– single shared stack, used by events and

function calls

28무단 복사 및 전재 금지

Page 29: HANBACK ELECTRONICS CO., LTD. TinyOS 구조와 스케줄러의 이해 ㈜한백전자 이철희

HANBACKELECTRONICS CO., LTD.

Event 와 task 의 관계

Hardware

Interrupts

Events

Commands

Tasks

Relation between Tasks and Events

29

Page 30: HANBACK ELECTRONICS CO., LTD. TinyOS 구조와 스케줄러의 이해 ㈜한백전자 이철희

HANBACKELECTRONICS CO., LTD.

Task

• 타스크 :– 이벤트에 선점 가능– 함수의 호출– Signal 을 발생– 타스크에 의해 선점되지 않음 (simple FIFO)

30무단 복사 및 전재 금지

Page 31: HANBACK ELECTRONICS CO., LTD. TinyOS 구조와 스케줄러의 이해 ㈜한백전자 이철희

HANBACKELECTRONICS CO., LTD.

event

• 이벤트 – 인터럽트에 의해 발생되는 요청• INTERRUPT(_output_compare2_)() { //

Hardware Timer Event Handler…

TOS_SIGNAL_EVENT(CLOCK_FIRE_EVENT)(); // Software event

…}

31무단 복사 및 전재 금지

Page 32: HANBACK ELECTRONICS CO., LTD. TinyOS 구조와 스케줄러의 이해 ㈜한백전자 이철희

HANBACKELECTRONICS CO., LTD.

TinyOS 의 scheduling

Task QueueEmpty?

EventHandler

Sleep Run Task

timer

ADC

RF

UART

y

task1

task2

task3

task4

task5

task6

task7

Task exist

Interruptoccurs

Interrupt Vectors

Task Queue

32무단 복사 및 전재 금지

Page 33: HANBACK ELECTRONICS CO., LTD. TinyOS 구조와 스케줄러의 이해 ㈜한백전자 이철희

HANBACKELECTRONICS CO., LTD.

TinyOS scheduler

Task queue

Task #1Task #2Task #...

Task #n-1Task #n

Interruptvectors

ADCtimer1UART0

SPIcompare

IfTask queueEmptyThensleep

scheduler

Task(i)

Command(i)sleep

Eventhandler

Command(j)

call

callreturn

return

No task

Task return

If queue != emptyThen execute TASK

Timer0 time out !!

interrupt

interrupt

33무단 복사 및 전재 금지

Page 34: HANBACK ELECTRONICS CO., LTD. TinyOS 구조와 스케줄러의 이해 ㈜한백전자 이철희

HANBACKELECTRONICS CO., LTD.

하드웨어 구성• 하드웨어의 개념 :

– LED (pin numbering/HW wiring)– CLOCK (counter interrupt)– UART (baud rate control,

transfer)– ADC (ADC interrupt handling)– RFM (abstracts bit level timing,

RFM specific control logic)– 센서

CommunicationActuating Sensing Communication

Application (User Components)

Main (includes Scheduler)

Hardware Abstractions

34무단 복사 및 전재 금지

Page 35: HANBACK ELECTRONICS CO., LTD. TinyOS 구조와 스케줄러의 이해 ㈜한백전자 이철희

HANBACKELECTRONICS CO., LTD.

ADC• the Sensor stack:

– 각종 센서를 센싱– ADC component– 데이터 요청 , 센싱이 끝날 때까지 대기

CommunicationActuating Sensing Communication

Application (User Components)

Main (includes Scheduler)

Hardware Abstractions

35무단 복사 및 전재 금지

Page 36: HANBACK ELECTRONICS CO., LTD. TinyOS 구조와 스케줄러의 이해 ㈜한백전자 이철희

HANBACKELECTRONICS CO., LTD.

통신• 통신 스택 :

– RFM(bit level) 부터 시작– bit level abstracts away radio

specifics– byte level radio component

collects individual bits into bytes

– packet level constructs packets from bytes

– messaging layer interprets packets as messages

CommunicationActuating Sensing Communication

Application (User Components)

Main (includes Scheduler)

Hardware Abstractions

36무단 복사 및 전재 금지

Page 37: HANBACK ELECTRONICS CO., LTD. TinyOS 구조와 스케줄러의 이해 ㈜한백전자 이철희

HANBACKELECTRONICS CO., LTD.

TINYOS 의 구성• /opt/tinyos-1.x

TinyOS 의 폴더

37무단 복사 및 전재 금지

Page 38: HANBACK ELECTRONICS CO., LTD. TinyOS 구조와 스케줄러의 이해 ㈜한백전자 이철희

HANBACKELECTRONICS CO., LTD.

tos 의 구성

• interfaces: 구현된 interface 를 모아놓은 곳• system : CPU 중심적 컴포넌트와 스케줄러• Platform : TinyOS 를 사용하는 플랫폼을 정의• Types : TinyOS 메시지 해더를 정의

38무단 복사 및 전재 금지

Page 39: HANBACK ELECTRONICS CO., LTD. TinyOS 구조와 스케줄러의 이해 ㈜한백전자 이철희

HANBACKELECTRONICS CO., LTD.

Group ID, address

• Group ID– Makefile 에 다음과 같이 정의하여 사용한다 .

(default 0x7D)– DEFAULT_LOCAL GROUP = 0xgid

(gid = 0~ff)

• Address– 0x007E UART 를 의미– 0xFFFF broadcast 를 의미– TOS_LOCAL_ADDRESS

• make ZigbeX reinstall.#• # 이 TOS_LOCAL_ADDRESS 즉 mote ID 이다 .

39무단 복사 및 전재 금지

Page 40: HANBACK ELECTRONICS CO., LTD. TinyOS 구조와 스케줄러의 이해 ㈜한백전자 이철희

HANBACKELECTRONICS CO., LTD.

TOS Message 의 구성• Sync byte

– TOS Message 의 시작과 끝을 알림– 0x7E– 예

– 0: 항상 0x7E– 1:packet type

• 0x42 : ack 가 필요 없는 사용자 패킷• 0x41 : ack 가 필요한 사용자 패킷• 0x40 : 0x41 에 대한 응답 패킷• 0xFF : 형식이 없는 패킷

– 2…n-1 : payload data– N: 항상 0x7E

40무단 복사 및 전재 금지

Page 41: HANBACK ELECTRONICS CO., LTD. TinyOS 구조와 스케줄러의 이해 ㈜한백전자 이철희

HANBACKELECTRONICS CO., LTD.

Sync byte 의 문제

• Payload data 에 sync byte 가 포함된 경우– 탈출 문자를 지정하여 sync byte 가 아님을 표시– 예 0x7D 0x7E (0x7D 가 탈출문자 )

• 탈출문자가 payload data 에 포함된 경우– 0x7D 다음데이터를 0x20 과 exclusive or 해서

표시– 예

• 0x7E -> 0x7D 0x5E• 0x7D -> 0x7D 0x5D

– RFC1662 참조

41무단 복사 및 전재 금지

Page 42: HANBACK ELECTRONICS CO., LTD. TinyOS 구조와 스케줄러의 이해 ㈜한백전자 이철희

HANBACKELECTRONICS CO., LTD.

RAW Data Packet 1

• cygwin 에서 확인– 먼저 모트 두 개를 준비한다 .– 1 번 모트에 TOSBase 를 컴파일한 후 프로그램 한다 .– 2 번 모트에 OscilloscopeRF 를 컴파일한 후

프로그램 한다 .– 1 번 모트에 시리얼 젠더와 케이블을 연결한다 .– cygwin 을 시작해서 다음과 같이 입력하여 확인한다 .

• cd /opt/tinyos-1.x/tools/java• java net.tonyos.tools.ListenRaw COM1

42무단 복사 및 전재 금지

Page 43: HANBACK ELECTRONICS CO., LTD. TinyOS 구조와 스케줄러의 이해 ㈜한백전자 이철희

HANBACKELECTRONICS CO., LTD.

RAW Data Packet 2

• 실행결과

– 7E 42 FF………48 7E43무단 복사 및 전재 금지

Page 44: HANBACK ELECTRONICS CO., LTD. TinyOS 구조와 스케줄러의 이해 ㈜한백전자 이철희

HANBACKELECTRONICS CO., LTD.

TOS Message 의 구조

• TOS Message

– RAW 패킷의 payload 데이터– 0,1 : address – 2 : type-----– 3 : group ID– 4 : length– 5~n-2 : payload data– n-1~n : CRC16

• 각 type 에 대한 응용 프로그램확인

44무단 복사 및 전재 금지

Page 45: HANBACK ELECTRONICS CO., LTD. TinyOS 구조와 스케줄러의 이해 ㈜한백전자 이철희

HANBACKELECTRONICS CO., LTD.

Type 과 응용 프로그램

• TOS 메시지를 확인 프로그램– java net.tinyos.tools.Listen– java net.tinyos.tools.ListenRaw

• 0x0A –Oscope Message - Oscilloscope– java net.tinyos.oscope.oscilloscope

• 0x11 – surge message – surge– java net.tinyos.surge.MainClass 125(group)

• 0x03 – mhop Message – surge• 다른 형식의 메시지도 사용자가 정의하여

사용가능

45무단 복사 및 전재 금지

Page 46: HANBACK ELECTRONICS CO., LTD. TinyOS 구조와 스케줄러의 이해 ㈜한백전자 이철희

HANBACKELECTRONICS CO., LTD.

TOS Message 확인

• cygwin 에서 다음명령으로 확인• java net.tinyos.tools.Listen

– FFFF : address 0A:Oscope Message– 7D : group ID 1A: Length

46무단 복사 및 전재 금지

Page 47: HANBACK ELECTRONICS CO., LTD. TinyOS 구조와 스케줄러의 이해 ㈜한백전자 이철희

HANBACKELECTRONICS CO., LTD.

TOS Message 의 응용프로그램

• Oscope 메시지를 받아서 표시– java net.tinyos.oscope.oscilloscope– 파형이 안보이면

scrolling 클릭

47무단 복사 및 전재 금지