<div dir="ltr"><div>conn = ubus.connect(1000)<br><br></div>gives me following error:<br><br>attempt to index local 'conn' (a nil value)<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Nov 20, 2015 at 6:58 PM, Jo-Philipp Wich <span dir="ltr"><<a href="mailto:jow@openwrt.org" target="_blank">jow@openwrt.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi.<br>
<span class=""><br>
> I am trying to call a function registered on ubus from lua script. I<br>
> know how to call a argument less function but don't know the syntax of a<br>
> function with args (also how to add ubus timeout).<br>
<br>
</span>Simply pass a table with your arguments as 3rd argument:<br>
<br>
conn:call(object, function, { arg_1 = foo, arg_2 = bar })<br>
<br>
You cannot set timeouts per call but you can specify them globally by<br>
passing the amount of milliseconds to the ubus.connect() call.<br>
<br>
E.g. conn = ubus.connect(1000) to have an 1s timeout on all calls.<br>
<br>
~ Jow<br>
_______________________________________________<br>
openwrt-devel mailing list<br>
<a href="mailto:openwrt-devel@lists.openwrt.org">openwrt-devel@lists.openwrt.org</a><br>
<a href="https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel" rel="noreferrer" target="_blank">https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel</a><br>
</blockquote></div><br></div>