Open Bip901 opened 8 months ago
you can generate the xml from whatever bluez service you want from linux.
For example:
busctl list
busctl tree org.bluez
busctl introspect org.bluez /org/bluez/hci0 --xml-interface
Then put that xml file into some folder of your project (dbus/org.bluez.xml
in the below example), then modify your csproj:
<ItemGroup>
<PackageReference Include="Tmds.DBus.Protocol" Version="0.16.0" />
<PackageReference Include="Tmds.DBus.SourceGenerator" Version="0.0.15" PrivateAssets="All">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
<ItemGroup>
<AdditionalFiles Include="dbus/org.bluez.xml" DBusGeneratorMode="Proxy" />
</ItemGroup>
Result:
DBusGeneratorMode
affects the generated classes:
Proxy
: generated classes are publicHandler
: generated classes are internal abstract Cool! Consider including this generation command in the README.
Hi! I'm new to this repo.
I've managed to find this example by searching through old issues, but some official examples of how the XML should look like would be highly appreciated!