Bug in Lua code generator for XML implementations of the S_InputSelection1.xml

I’m in the process of writing a Vera/Lua/RS232C driver for my TV. In doing this, I began implementing the packages UPnP service file:

[tt] S_InputSelection1.xml[/tt]

In this file, there’s a Service action:

<action> <name>DiscreteinputTV/VCR</name> </action>

and when you’re implementing the Service, you put a line like the following into your I_xxx.xml file:

<action> <serviceId>urn:micasaverde-com:serviceId:InputSelection1</serviceId> <name>DiscreteinputTV/VCR</name> <run> -- Not implemented </run> </action>

This generates a Lua code-block like:

[code]function DiscreteinputTV/VCR_run(lul_device,lul_settings)

            -- Not implemented

end
[/code]

This function/method name isn’t valid, as it has a “/” in the function name. The XML->Lua generator block needs to “escape” certain characters in ACTION names.

On the plus side, my TV doesn’t have this method, so I can remove the stub service/action, but it will break for those that need to implement it.

Where are you getting this ‘code generator’ screen?

Thanks,
Brian

After you’ve written a [tt]I_Xxxxxxx.xml[/tt] file, uploaded it, and then created a Device using it, Vera will attempt to load and/or derive a Lua “version” of it.

This is something that Vera must generate somewhere along the way, using the information provided in the .xml.

In this case, this internal process is generating a method name for the [tt][/tt] child Element of each [tt][/tt] Element defined in the Implementation file and, because there’s a syntax error (due to the slash “/”), Vera emits the full [generated/derived] source into the [tt]LuaUPnP.log[/tt] file, along with the line number where it found the problem :wink: