void Broker::receiveCall(CallMessage msg){ callInRoute.setCallName(msg.getCallName()); callInRoute.setParamOne(msg.getParamOne()); callInRoute.setParamTwo(msg.getParamTwo()); callInRoute.setResult(msg.getResult()); callInRoute.setClientAddr(msg.getClientAddr()); callToString(msg); }
bool ObjectProxy::_invoke_method_noreply(CallMessage &call) { if (call.path() == NULL) call.path(path().c_str()); if (call.destination() == NULL) call.destination(service().c_str()); return conn().send(call); }
Message ObjectProxy::_invoke_method(CallMessage &call) { if (call.path() == NULL) call.path(path().c_str()); if (call.destination() == NULL) call.destination(service().c_str()); return conn().send_blocking(call, get_timeout()); }
std::string Broker::callToString(CallMessage msg){ str = ""; str.append(msg.getCallName()); str.append("###ENDATTR1###"); str.append(msg.getParamOne()); str.append("###ENDATTR2###"); str.append(msg.getParamTwo()); str.append("###ENDATTR3###"); str.append(msg.getResult()); str.append("###ENDATTR4###"); str.append(msg.getClientAddr()); return str; }
Message PropertiesAdaptor::Get(const CallMessage &call) { MessageIter ri = call.reader(); std::string iface_name; std::string property_name; ri >> iface_name >> property_name; debug_log("requesting property %s on interface %s", property_name.c_str(), iface_name.c_str()); InterfaceAdaptor *interface = (InterfaceAdaptor *) find_interface(iface_name); if (!interface) throw ErrorFailed("requested interface not found"); Variant *value = interface->get_property(property_name); if (!value) throw ErrorFailed("requested property not found"); on_get_property(*interface, property_name, *value); ReturnMessage reply(call); MessageIter wi = reply.writer(); wi << *value; return reply; }
bool InterfaceProxy::invoke_method_noreply(const CallMessage &call) { CallMessage &call2 = const_cast<CallMessage &>(call); if (call.interface() == NULL) call2.interface(name().c_str()); return _invoke_method_noreply(call2); }
Message InterfaceAdaptor::dispatch_method( const CallMessage& msg ) { const char* name = msg.member(); MethodTable::iterator mi = _methods.find(name); if( mi != _methods.end() ) { return mi->second.call( msg ); } else { return ErrorMessage(msg, DBUS_ERROR_UNKNOWN_METHOD, name); } }
Message PropertiesAdaptor::Set(const CallMessage &call) { MessageIter ri = call.reader(); std::string iface_name; std::string property_name; Variant value; ri >> iface_name >> property_name >> value; InterfaceAdaptor *interface = (InterfaceAdaptor *) find_interface(iface_name); if (!interface) throw ErrorFailed("requested interface not found"); on_set_property(*interface, property_name, value); interface->set_property(property_name, value); ReturnMessage reply(call); return reply; }
bool CallMessage::operator == (const CallMessage &m) const { return dbus_message_is_method_call(_pvt->msg, m.interface(), m.member()); }