Model based real-time networked applications for Wireless Sensor Networks