Programming wireless sensor networks: Fundamental concepts and state of the art