* Created on: Jun 9, 2010
* Author: lamikr
*/
+#include <plp/log.h>
#include "plpbus/BusServer.hh"
#include "plpbus/BusClient.hh"
using namespace std;
using namespace plpbus;
+#define MSG_ID_HELLO 33
+
class ClientListenerImpl : public IClientListener
{
public:
};
int ClientListenerImpl::response_received(const char *msg_rsp_param) {
- cout << "response_received(char *: " << msg_rsp_param << ") " << endl;
+ log_debug("response_received(char *%s)\n", msg_rsp_param);
return 0;
}
int ClientListenerImpl::response_received(const BusMessage *msg_rsp_param) {
- cout << "response_received(BusMessage *) " << endl;
+ long type;
+
+ type = 0;
+ ((BusMessage *)msg_rsp_param)->get_type(&type);
+ log_debug("response_received(), type: %ld\n", type);
+ ((BusMessage *)msg_rsp_param)->printout();
return 0;
}
int err_flg;
char *rsp;
- busmsg = new BusMessage();
+ busmsg = new BusMessage(MSG_ID_HELLO);
busmsg->add_string_parameter("a", "hello");
busmsg->add_string_parameter("b", "world");
client->send_message_and_request_response(busmsg);