e.g. followings are predefined role by default
"role": "MediaPlayer|Radio|Phone|Navigation|HVAC|Settings|Dashboard|POI|Mixer"
+ In order to pass port number and token which are given from
+ AGL application framework binder to XDG application,
+ you can use special string '@port@' and '@token@'.
+
+ For 'params', you can use special string '@port@' and '@token@"
+ to pass them to target XDG application
+ which are from AGL application framework binder.
+
+ e.g. params = [ --port=@port@ --secret=@token@ ]
+
3. Prepare config.xml for widget
<content> should be follow.
auto params = app->get_array_of<std::string>("params");
for (const auto& param : *params)
{
+ // replace special string "@port@" and "@token@"
+ size_t found = param.find("@port@");
+ if (found != std::string::npos) {
+ std::string sub1 = param.substr(0, found);
+ std::string sub2 = param.substr(found + 6, param.size() - found);
+ std::string str = sub1 + std::to_string(m_port) + sub2;
+ pl->m_args_v.push_back(str);
+ AGL_DEBUG("params[%s] (match @port@)", str.c_str());
+ continue;
+ }
+
+ found = param.find("@token@");
+ if (found != std::string::npos) {
+ std::string sub1 = param.substr(0, found);
+ std::string sub2 = param.substr(found + 7, param.size() - found);
+ std::string str = sub1 + m_token + sub2;
+ pl->m_args_v.push_back(str);
+ AGL_DEBUG("params[%s] (match @token@)", str.c_str());
+ continue;
+ }
+
pl->m_args_v.push_back(param);
+
AGL_DEBUG("params[%s]", param.c_str());
}