/**
	@brief Register an extended method for a specified application.

	@param appName Name of the application that implements the method.
	@param methodName The fully qualified name of the method.
	@param symbolName The symbol name (function name) that implements the method.
	@param notes Public documentation for this method.
	@param argc How many arguments this method expects.
	@param options Bit switches setting various options.
	@param user_data Opaque pointer to be passed to the dynamically called function.
	@return Zero if successful, or -1 upon error.

	This function is identical to osrfAppRegisterMethod(), except that it also installs
	a method-specific opaque pointer.  When we call the corresponding function at
	run time, this pointer will be available to the function via the method context.
*/
int osrfAppRegisterExtendedMethod( const char* appName, const char* methodName,
	const char* symbolName, const char* notes, int argc, int options, void * user_data ) {

	if( !appName || ! methodName ) return -1;

	osrfApplication* app = _osrfAppFindApplication(appName);
	if(!app) {
		osrfLogWarning( OSRF_LOG_MARK, "Unable to locate application %s", appName );
		return -1;
	}

	osrfLogDebug( OSRF_LOG_MARK, "Registering method %s for app %s", methodName, appName );

	// Extract the only valid option bits, and ignore the rest.
	int opts = options & ( OSRF_METHOD_STREAMING | OSRF_METHOD_CACHABLE );

	// Build and install a non-atomic method.
	register_method(
		app, methodName, symbolName, notes, argc, opts, user_data );

	if( opts & OSRF_METHOD_STREAMING ) {
		// Build and install an atomic version of the same method.
		register_method(
			app, methodName, symbolName, notes, argc, opts | OSRF_METHOD_ATOMIC, user_data );
	}

	return 0;
}
SdpBrowser::SdpBrowser( const BdAddr& from, const BdAddr& to )
:	DBus::LocalInterface(BTOOL_SDPBROWSER_IFACE),
	Sdp::Client(from, to),
	_bus(DBus::Connection::SystemBus()),
	_reply(NULL)
{
	register_method( SdpBrowser, SearchServices );
	register_method( SdpBrowser, SearchAttributes );
	register_method( SdpBrowser, SearchServAttrs );
	register_method( SdpBrowser, SearchAllRecords );
	register_method( SdpBrowser, SearchAllRecordsCached );

	//this->on_response.connect( sigc::mem_fun( this, &SdpBrowser::on_read_response ));
}
Exemple #3
0
	WiMax_adaptor()
	: ::DBus::InterfaceAdaptor("org.freedesktop.NetworkManager.Device.WiMax")
	{
		bind_property(HwAddress, "s", true, false);
		bind_property(CenterFrequency, "u", true, false);
		bind_property(Rssi, "i", true, false);
		bind_property(Cinr, "i", true, false);
		bind_property(TxPower, "i", true, false);
		bind_property(Bsid, "s", true, false);
		bind_property(ActiveNsp, "o", true, false);
		register_method(WiMax_adaptor, GetNspList, _GetNspList_stub);
	}
Exemple #4
0
JNIEXPORT jint JNI_OnLoad(JavaVM* vm, void* reserved)
{
    env = NULL;
    jint result = -1;

    if (vm->GetEnv(  ( void**) &env, JNI_VERSION_1_4) != JNI_OK) {
        return result;
    }

    LOGD("onLoad");
    register_method(env);

    // ·µ»ØjniµÄ°æ±¾
    return JNI_VERSION_1_4;
}
Exemple #5
0
	Device_adaptor()
	: ::DBus::InterfaceAdaptor("org.freedesktop.NetworkManager.Device")
	{
		bind_property(Udi, "s", true, false);
		bind_property(Interface, "s", true, false);
		bind_property(IpInterface, "s", true, false);
		bind_property(Driver, "s", true, false);
		bind_property(Capabilities, "u", true, false);
		bind_property(Ip4Address, "i", true, false);
		bind_property(State, "u", true, false);
		bind_property(StateReason, "(uu)", true, false);
		bind_property(ActiveConnection, "o", true, false);
		bind_property(Ip4Config, "o", true, false);
		bind_property(Dhcp4Config, "o", true, false);
		bind_property(Ip6Config, "o", true, false);
		bind_property(Dhcp6Config, "o", true, false);
		bind_property(Managed, "b", true, false);
		bind_property(FirmwareMissing, "b", true, false);
		bind_property(DeviceType, "u", true, false);
		register_method(Device_adaptor, Disconnect, _Disconnect_stub);
	}
/**
	@brief Register all of the system methods for this application.
	@param app Pointer to the application.

	A client can call these methods the same way it calls application-specific methods,
	but they are implemented by functions here in this module, not by functions in the
	shared object.
*/
static void register_system_methods( osrfApplication* app ) {

	if( !app ) return;

	register_method(
		app, OSRF_SYSMETHOD_INTROSPECT, NULL,
		"Return a list of methods whose names have the same initial "
		"substring as that of the provided method name PARAMS( methodNameSubstring )",
		1, OSRF_METHOD_SYSTEM | OSRF_METHOD_STREAMING,
		NULL );

	register_method(
		app, OSRF_SYSMETHOD_INTROSPECT, NULL,
		"Return a list of methods whose names have the same initial "
		"substring as that of the provided method name PARAMS( methodNameSubstring )",
		1, OSRF_METHOD_SYSTEM | OSRF_METHOD_STREAMING | OSRF_METHOD_ATOMIC,
		NULL );

	register_method(
		app, OSRF_SYSMETHOD_INTROSPECT_ALL, NULL,
		"Returns a complete list of methods. PARAMS()",
		0, OSRF_METHOD_SYSTEM | OSRF_METHOD_STREAMING,
		NULL );

	register_method(
		app, OSRF_SYSMETHOD_INTROSPECT_ALL, NULL,
		"Returns a complete list of methods. PARAMS()",
		0, OSRF_METHOD_SYSTEM | OSRF_METHOD_STREAMING | OSRF_METHOD_ATOMIC,
		NULL );

	register_method(
		app, OSRF_SYSMETHOD_ECHO, NULL,
		"Echos all data sent to the server back to the client. PARAMS([a, b, ...])",
		0, OSRF_METHOD_SYSTEM | OSRF_METHOD_STREAMING,
		NULL );

	register_method(
		app, OSRF_SYSMETHOD_ECHO, NULL,
		"Echos all data sent to the server back to the client. PARAMS([a, b, ...])",
		0, OSRF_METHOD_SYSTEM | OSRF_METHOD_STREAMING | OSRF_METHOD_ATOMIC,
		NULL );
}