On Mon Jun 23, 2014 at 12:49:34 +0200, Martin Schröder wrote:
Am 22.06.2014 23:25, schrieb Adam Lackorzynski:
- How can I use the device in the example if the hid is not unique? I even
tried wrap(hw:device(NIC0)) but this does not work eiher.
wrap(hw.NIC0) should do it.
this fails here:
io | rom/foo.io: error executing lua config: Wrong arguments for overloaded function 'Vi_dev_factory_create' io | Possible C/C++ prototypes are: io | Vi::Dev_factory::create(std::string const &) io | Vi::Dev_factory::create(Hw::Device *,bool) io | Vi::Dev_factory::create(Hw::Device *)
by using wrap(hw.NIC0()) instead, io does not complain any longer.
- How can I set the device name for client0/client1 into "foo.dev0" for
dev0 as in the (old) example above? dev0.set_name("foo.dev0"); seems not to be the right one.
I don't think this is easily possible with the new syntax. Do you need that type of name?
With that change, l4linux does no longer utilize the provided callbacks [mach_setup.c: void register_platform_callbacks(void) -> l4x_register_platform_device_callback("foodevice", my_device_cb)]. So none of the Hw Devices is probed/found.
So setting the name is possible. It should work like this: client0 = Io.Vi.System_bus(function () _self["x.y"] = wrap(...); end),
with table style it looks a bit cleaner: client0 = Io.Vi.System_bus{ ["x.y"] = wrap(...), };
(I'm not sure it works with the _self syntax for you).
Adam