Radio.create

From Yate Documentation
Revision as of 08:15, 25 May 2018 by Marian (talk | contribs) (Created page with " '''radio.create''' is a message sent to request creation of a radio interface. ===Parameters=== ;radio_driver : Optional radio driver (module) name. If present only modu...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

radio.create is a message sent to request creation of a radio interface.

Parameters

radio_driver
Optional radio driver (module) name. If present only modules matching it will handle the message
radio_params_prefix
Optional prefix for radio init parameters. Defaults to radio.
Message parameters starting with indicated prefix will be used to create the radio interface

Return

Success (message dispatch return true)
A RadioInterface pointer is returned in interface parameter
Failure (message dispatch return false)
code (RadioInterface error code) parameter may be returned along with other parameters describing the failure

Usage example

Message m("radio.create");
// Set some radio related params ...
Engine::dispatch(m);
NamedPointer* np = YOBJECT(NamedPointer,m.getParam(YSTRING("interface")));
RadioInterface* r = np ? YOBJECT(RadioInterface,np) : 0;
if (r) {
    // Remove pointer from 'np': take ownership
    np->takeData();
    // Use the RadioInterface. You are owning the pointer now!
}
else {
    // Failure !
}