最近幾年來,無線感測器網路已經變成熱門研究之一。各式各樣的應用也逐漸被開發出來。而為了能夠更有效率的開發各種程式,需要一種適合無線感測器網路的程式模型。在這篇論文裡,我們設計了針對無線感測器網路的一種程式開發環境(SPE- sensor programming environment)。此SPE 裡包含著一個中介軟體,用來管理底層硬體並提供各種應用程式介面;除此之外,還包含者一個我們提出的以角色為主的程式設計模型,以提供高階抽象程式設計概念。使用者可以針對不同的應用,依據我們的程式模型,設計出各種角色圖表。藉由分析此圖表,可以更了解程式的執行流程,因而減少邏輯錯誤的可能性。在這篇論文之後,我們會秀出一個簡單的範例程式,結果可以指出SPE 和角色為主的程式模型的確能更有效率的設計各種無線感應器網路程式。
In recent years, the wireless sensor network has been one of the hottest research topics. Many different applications for different challenges have been developed. In order to reduce the efforts in programming, it is necessary to develop a new programming model suitable for the wireless sensor network. In this paper, we present a sensor programming environment (SPE) for users to write application programs for wireless sensor networks. The SPE includes a middleware, for hiding low-level operations and providing high level APIs for application programs, and a role-based programming library, for abstraction of programming design. A user can build up a role graph for his/her application program based on the role-based programming model. From the role graph of an application program, a user can write codes for each role and analyze the execution flow of the application program. We have shown a design example by using the proposed SPE. The simulation results indicate that the proposed SPE is easy to use and the role-based programming model can reduce the design efforts of a WSN program.