ABSTRACT
Given the success of IoT platforms, more developers and companies want to include the technology in their portfolio. Code generators for API clients can enhance productivity, but they tend to generate universal purpose code, and on the other hand the networking primitives of IoT devices are platform specific, especially when security mechanisms such as Transport Layer Security are part of the picture. This paper presents cpp-tiny-client, an API client generator developed as a plugin for the OpenAPI Generator project, which can tailor the generated code based on the IoT platform specified by the user. Our work allows to generate correct code for API clients for IoT devices, and thus can empower a developer with more productivity and a faster time-to-market for its own applications. By combining together mainstream technologies only, cpp-tiny-client offers a gentle learning curve. Moreover, experiments show that the generated code has a reasonable footprint, at least with respect to the IoT devices that were used in the validation of the work. The code related to this work is available through the OpenAPI Generator project [31]. The information in this paper is extended in [27].
- Michele Albano, Erkki Jantunen, Gregor Papa, and Urko Zurutuza. The MANTIS book: cyber physical system based proactive collaborative maintenance. River Publishers, 2019.Google ScholarCross Ref
- Arduino. Information about the arduino-mega-2560-rev3 microcontroller. https://store.arduino.cc/arduino-mega-2560-rev3, 2021.Google Scholar
- Arduino. Information about the arduino-uno-wifi-rev2 microcontroller. https://store.arduino.cc/arduino-uno-wifi-rev2, 2021.Google Scholar
- ARM. Mbed os|mbed. https://os.mbed.com/mbed-os/, 2021 Last visited January 5, 2022.Google Scholar
- ARM. Mbed os|mbed. https://os.mbed.com/teams/sandbox/code/mbed-http/, 2021 Last visited January 5, 2022.Google Scholar
- Dan-Radu Berte. Defining the iot. In Proceedings of the International Conference on Business Excellence, volume 12, pages 118--128, 2018.Google ScholarCross Ref
- Silvia Bonfanti, Marco Carissoni, Angelo Gargantini, and Atif Mashkoor. Asm2c++: a tool for code generation from abstract state machines to arduino. In NASA Formal Methods Symposium, pages 295--301, Moffett Field, CA, 2017. Springer.Google ScholarCross Ref
- Louis Columbus. 2017 roundup of internet of things forecasts. Forbes, December 2017.Google Scholar
- Louis Columbus. 2018 roundup of internet of things forecasts and market estimates. Forbes, December 2018.Google Scholar
- Bruno Costa, Paulo F Pires, Flávia C Delicato, and Paulo Merson. Evaluating a representational state transfer (rest) architecture: What is the impact of rest in my architecture? In 2014 IEEE/IFIP Conference on Software Architecture, pages 105--114. IEEE, 2014.Google ScholarDigital Library
- CURL. command line tool for transferring data with urls. https://curl.se/, 2021.Google Scholar
- Manik Lal Das and Navkar Samdaria. On the security of ssl/tls-enabled applications. Applied Computing and informatics, 10(1--2):68--81, 2014.Google Scholar
- Espressif. A world-leading aiot platform. https://www.espressif.com/en/company/about-espressif, 2021 Last visited January 5, 2022.Google Scholar
- Nicolas Harrand, Franck Fleurey, Brice Morin, and Knut Eilif Husa. Thingml: a language and code generation framework for heterogeneous targets. In Proceedings of the ACM/IEEE 19th Int. Conf. on Model Driven Engineering Languages and Systems, pages 125--135, Saint-malo, France, 2016. ACM/IEEE.Google ScholarDigital Library
- OpenAPI Initiative. Openapi specification description. https://github.com/OAI/OpenAPI-Specification, 2021.Google Scholar
- Tellu IoT. The thingml modelling language. https://github.com/TelluIoT/ThingML, 2021 Last visited January 5, 2022.Google Scholar
- Adeel Javed. Building arduino projects for the internet of things. Experiments with Real-World Applications. United States of America: Apress Media, LLC, pages 15--34, 2016.Google Scholar
- PlatformIO Labs. What is platformio? https://docs.platformio.org/en/latest/what-is-platformio.html#technologies, 2021.Google Scholar
- Sergio Laso, Marino Linaje, Jose Garcia-Alonso, Juan M Murillo, and Javier Berrocal. Deployment of apis on android mobile devices and microcontrollers. In 2020 IEEE International Conference on Pervasive Computing and Communications Workshops (PerCom Workshops), pages 1--3. IEEE, 2020.Google ScholarCross Ref
- Michael W. Lucas. TLS Mastery. Tilted Windmill Press, April 2021.Google Scholar
- Henry Muccini and Mohammad Sharaf. Caps: a tool for architecting situational-aware cyber-physical systems. In 2017 IEEE Int. Conf. on Software Architecture Workshops (ICSAW), pages 286--289, Gothenburg, Sweden, 2017. IEEE.Google ScholarCross Ref
- Thiago Nepomuceno, Tiago Carneiro, Paulo Henrique Maia, Muhammad Adnan, Thalyson Nepomuceno, and Alexander Martin. Autoiot: a framework based on user-driven mde for generating iot applications. In Proceedings of the 35th Annual ACM Symposium on Applied Computing, pages 719--728, 2020.Google ScholarDigital Library
- OpenApi. What is openapi. https://swagger.io/docs/specification/about/, 2021.Google Scholar
- PlatformIO Labs OÜ. A professional collaborative platform for embedded development · platformio. https://platformio.org/, 2021 Last visited January 5, 2022.Google Scholar
- Mohammad Sharaf, Mai Abusair, Rami Eleiwi, Yara Shana'a, Ithar Saleh, and Henry Muccini. Modeling and code generation framework for iot. In Int. Conf. on System Analysis and Modeling, pages 99--115, Munich, Germany, 2019. Springer.Google ScholarDigital Library
- Mohammad Sharaf, Henry Muccini, and Moamin Abughazala. ArIA: arduino code generation based on the caps. In Proceedings of the 12th European Conference on Software Architecture, pages 1--4, Madrid, Spain, 2018. ACM.Google Scholar
- Anders Aaen Springborg, Martin Kaldahl Andersen, Kaare Holland Hattel, and Michele Albano. Towards a secure api client generator for iot devices. Technical Report arXiv:2201.00270, ArXiV, January 2022.Google Scholar
- Steinwurf. Json bourne library. https://github.com/steinwurf/bourne, 2021.Google Scholar
- Espressif Systems. Esp8266httpclient. https://github.com/esp8266/Arduino/tree/master/libraries/ESP8266HTTPClient, 2021.Google Scholar
- Espressif Systems. Httpclient for esp32. https://github.com/espressif/arduino-esp32/tree/master/libraries/HTTPClient, 2021.Google Scholar
- OpenApi Tools. Openapi generator. https://openapi-generator.tech/, 2021.Google Scholar
- OpenApi Tools. Who is using this? https://openapi-generator.tech/users, 2021.Google Scholar
- Chris Wanstrath. Mustache manual. https://mustache.github.io/mustache.5.html.Google Scholar
- John Yannakopoulos. Hypertext transfer protocol: A short course. University of Crete. August, 2003.Google Scholar
Index Terms
- cpp-tiny-client: a secure API client generator for IoT devices
Comments