Modeling and Code Generation Framework for IoT