Upload
dangnhi
View
218
Download
4
Embed Size (px)
Citation preview
BaseStation
BaseStation sensor PC
1. nesCtask TinyOSprovidesatwolevelschedulinghierarchyconsistingoftasksand
hardwareeventhandlers.
Tasksareusedtoperformlongerprocessingoperations,suchasbackgrounddataprocessing,andcanbepreemptedbyhardwareeventhandler.
Ataskisdeclaredinyourimplementationmoduleusingthesyntax: taskvoidtaskname(){...}
Todispatchataskfor(later)execution,usethesyntax: posttaskname();
2. BaseStation
PC UART BaseStation broadcast Radio BaseStation UART
PC
queue UART radio
message_t uartQueueBufs[UART_QUEUE_LEN];
uint8_t uartIn,uartOut;
bool uartBusy,uartFull;
message_t radioQueueBufs[RADIO_QUEUE_LEN];
uint8_t radioIn,radioOut;
bool radioBusy,radioFull;
RadioReceice Radio
UART UARTSendTask URATSend
uartQueueBufs
UARTSendTask
UARTReceice UART
3. sensor sensor BaseStation PC USB
4. sensorBlinkToRadionodeid BaseStation sensor
nodeid makeoctopus ($input
id)
nodeid 1 2(
$input 1 2)\build\octopus
main.out1.ihex main.out2.ihex
sensor
tossetsymbolsobjcopymsp430objcopyobjdumpmsp430objdumptargetihexbuild/octopus/main.ihex
build/octopus/main.out$input.ihexTOS_NODE_ID=$input
5. sensor
cygwin Listen BaseStation UART Sensor1 Sensor2