TAILIEUCHUNG - Factory Automation Part 4

Tham khảo tài liệu 'factory automation part 4', kỹ thuật - công nghệ, cơ khí - chế tạo máy phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | 112 Factory Automation In the next sections we will show how to port this C implementation of the state machine in MANTIS TinyOS and ZigBee respectively. 6. MANTIS MANTIS is a light-weight multi-threaded operating system that is capable of multi-tasking on energy constrained distributed sensor networks. The scheduler of MANTIS supports thread preemption which allows the operating system to switch between active threads without waiting. So the responsiveness of the operating system to critical events can be faster than in TinyOS which is non-preemptive. The scheduler of MANTIS is priority-based with round robin. The kernel ensures that all low priority threads execute after the higher priority threads. When there is no thread scheduled for execution the system moves to sleep mode by executing the idle-thread. Kernel and APIs of MANTIS are written in standard C. void state_machine void If for_the_first_time current_state IN_Init Storing the current state tNextRX getRandNumber Generic function to get random number tNextTX getRandNumber packetCount 0 else switch current_state case IN_Init if incoming_event event_CLK Handling CLK event current_state IN_Sleep break case IN_Sleep if incoming_event event_CLK tNextTX 0 tNextRX 0 tNextTX-- tNextRX-- current_state IN_Sleep else if tNextRX 0 led_toggle 0 temp 0 Generic function to toggle led receivePacket 30 Generic function to receive packets current_state IN_Receive_pkt else if packetCount 5 current_state IN_done led_on 0 led_on 1 led_on 2 else if tNextTX 0 led_toggle 1 current_state IN_Transmit_pkt payload 0 1 sendPacket payload Generic function to send packet break case IN_Receive_pkt if temp 3 tNextRX getRandNumber led_toggle 0 current_state IN_Sleep else if incoming_event event_PKT Handling PKT event getPktData payload Generic function to get packet content process_data Rapid application development for wireless sensor networks 113 if incoming_event event_CLK Handling CLK event temp break case IN_Transmit_pkt tNextTX .

TỪ KHÓA LIÊN QUAN
TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.