Я попытался создать простой проект, используя AllJoyn, чтобы открыть интерфейс для моей Гаражной двери через Raspberry Pi 2 под управлением Windows 10 IoT.Поддерживает ли AllJoyn Studio Extension создание методов с аргументами?
Соответствующий Самоанализ XML-файл выглядит следующим образом:
<node xmlns:xsi="http://www.w3.org/2001/XMLSchemainstance" xsi:noNamespaceSchemaLocation="https://allseenalliance.org/schemas/introspect.xsd">
<interface name="com.hastarin.GarageDoor">
<!--<annotation name="org.alljoyn.Bus.Secure" value="true" />-->
<description language="en">Interface for controlling a garage door.</description>
<property name="IsOpen" type="b" access="read">
<annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="true"/>
<description language="en">Is TRUE if the door is open.</description>
</property>
<property name="IsPartiallyOpen" type="b" access="read">
<annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="true"/>
<description language="en">Is TRUE if the door is only partially open for air flow.</description>
</property>
<method name="Open">
<description language="en">Opens the door if it's closed.</description>
<argument name="partialOpen" type="b" direction="in">
<description language="en">
If TRUE, the door will only be partially opened to allow air flow.
If FALSE, the door will be fully opened.
</description>
</argument>
</method>
<method name="Close">
<description language="en">Close the door if it's open.</description>
</method>
<method name="PushButton">
<description language="en">Will trigger the push button on the garage door.</description>
</method>
</interface>
</node>
К сожалению, генерируемый интерфейс сервиса не включает аргумент для открытого метода.
public interface IGarageDoorService
{
IAsyncOperation<GarageDoorOpenResult> OpenAsync([In] AllJoynMessageInfo info);
IAsyncOperation<GarageDoorCloseResult> CloseAsync([In] AllJoynMessageInfo info);
IAsyncOperation<GarageDoorPushButtonResult> PushButtonAsync([In] AllJoynMessageInfo info);
IAsyncOperation<GarageDoorGetIsOpenResult> GetIsOpenAsync([In] AllJoynMessageInfo info);
IAsyncOperation<GarageDoorGetIsPartiallyOpenResult> GetIsPartiallyOpenAsync([In] AllJoynMessageInfo info);
}
Полный исходный код проекта можно найти на GitHub: https://github.com/hastarin/HastPiControl
Может кто-нибудь сказать мне, если я делаю что-то не так, или, если возможно, это ограничение студии Extension AllJoyn ?
Может ли кто-нибудь предложить обходной путь?
Спасибо, я следовал примерам из [статьи на канале 9] (https://channel9.msdn.com/Blogs/Internet -of-Things-Blog/Create-AllJoyn-Producers-and-Authoring-AllJoyn-Introspection-XML), который показал его как ''. Все остальное показывает это как '' - [События и действия] (https://allseenalliance.org/framework/documentation/develop/api-guide/events-and-actions) | [Спецификация D-Bus] (http://dbus.freedesktop.org/doc/dbus-specification.html#introspection-format) | [Расширенный формат интроспекции] (https://wiki.allseenalliance.org/irb/extended_introspection_xml) –
Hastarin