Design and Analysis of Routing and Scheduling Algorithms for Industrial Wireless Sensor Networks