1 /* 2 * Copyright 2022 Meta 3 * 4 * SPDX-License-Identifier: Apache-2.0 5 */ 6 7 #pragma once 8 9 #ifdef __ZEPHYR__ 10 #include <zephyr/kernel.h> 11 #else 12 #define printk printf 13 #endif 14 15 #include <iostream> 16 17 #include "Hello.h" 18 19 class HelloHandler : virtual public HelloIf 20 { 21 public: HelloHandler()22 HelloHandler() : count(0) 23 { 24 } 25 ping()26 void ping() 27 { 28 printk("%s\n", __func__); 29 } 30 echo(std::string & _return,const std::string & msg)31 void echo(std::string &_return, const std::string &msg) 32 { 33 printk("%s: %s\n", __func__, msg.c_str()); 34 _return = msg; 35 } 36 counter()37 int32_t counter() 38 { 39 ++count; 40 printk("%s: %d\n", __func__, count); 41 return count; 42 } 43 44 protected: 45 int count; 46 }; 47