The medium to enable AllJoyn applications to communicate via - - PowerPoint PPT Presentation

the medium to enable alljoyn applications to communicate
SMART_READER_LITE
LIVE PREVIEW

The medium to enable AllJoyn applications to communicate via - - PowerPoint PPT Presentation

Any questions please contact winhectpe@microsoft.com The medium to enable AllJoyn applications to communicate via published APIs Communication is via messages that map directly to APIs in high-level programming languages Based on


slide-1
SLIDE 1

Any questions please contact winhectpe@microsoft.com

slide-2
SLIDE 2
slide-3
SLIDE 3
slide-4
SLIDE 4
slide-5
SLIDE 5
  • The “medium” to enable AllJoyn applications to communicate via published APIs
  • Communication is via messages that map directly to APIs in high-level programming

languages

  • Based on discovery of applications/services

Can run over Wi-Fi, Wi-Fi Direct, Ethernet, PLC and Bluetooth

slide-6
SLIDE 6

Co Consu sumer mer (cl client) ient) Pr Produc

  • ducer

er (se server) er)

slide-7
SLIDE 7

If required, authentication occurs on demand between the two apps when a method is invoked or to receive a signal. PIN code, PSK, or ECDSA (Elliptical Curve Digital Signature Algorithm). Once authenticated, all messages between these two devices are encrypted using AES-128 CMM.

slide-8
SLIDE 8

Servicing, reduced code size Optimized performance, full integration Reduced code size, integrated with Windows SDK AllJoyn Studio accelerates development for Windows UWP Samples

slide-9
SLIDE 9

AllJoyn Standard Client API (C) MSAJAPI.dll

slide-10
SLIDE 10
slide-11
SLIDE 11
slide-12
SLIDE 12

An Visual Studio extension developed by Microsoft

slide-13
SLIDE 13

Windows Runtime Class Description <Foo>Watcher Searches for producers that advertise the target service <Foo>JoinSessionResult Reports the success or failure of joining a session, and exposes a <Foo>Consumer instance for the session if the join was successful. <Foo>Producer Advertises a service and exposes handlers for AllJoyn events. <Foo>Signals Exposes methods and handlers to send and receive signals. Used by both producers and consumers. <Foo>Consumer Interacts with a service after it has been discovered. <Foo><Method>CalledEventArgs Arguments passed to methods in EventAdapters.<Foo>ServiceEventAdapter. <Foo><Method>Result Used by method implementations in IService to report the success

  • r failure of the call, as well as any return values.

<Foo><Signal>ReceivedEventArgs Arguments passed to a signal in Signals.

slide-14
SLIDE 14
slide-15
SLIDE 15

Interfaces as described via signals, properties and methods.

<node> <interface name="com.example.Door"> <annotation name="org.alljoyn.Bus.Secure" value="true" /> <annotation name="org.alljoyn.Bus.DocString.En" value="Example interface for a doorway" /> <property name="Locked" type="b" access="read"> <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="true" /> </property> <method name="SetLockState"> <arg name="lockDoor" type="b" direction="in" /> <annotation name="org.freedesktop.DBus.Method.NoReply" value="true" /> </method> <signal name="ThresholdCrossed" /> </interface> </node>

slide-16
SLIDE 16

low-overhead, inter-process communication with a type format for data representation. Extends D-Bus Specification XML with XML tags for holding textual descriptions while also applying AllJoyn principles to the specification.

slide-17
SLIDE 17

"com.contoso.Sensor” vs “com.contoso.Sensor.Humidity” The "Foo" interface created by Contoso Ltd., which owns the contoso.com domain <interface name="com.contoso.Foo">

slide-18
SLIDE 18

Properties Signals Methods Describe additional functionality

  • r constraints

Producer  Consumer (direction="out") Consumer  Producer (direction="in")

<node> <interface name="com.example.Door"> <annotation name="org.alljoyn.Bus.Secure" value="true" /> <annotation name="org.alljoyn.Bus.DocString.En" value="Example interface for a doorway" /> <property name="Locked" type="b" access="read"> <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="true" /> </property> <method name="SetLockState"> <arg name="lockDoor" type="b" direction="in" /> <annotation name="org.freedesktop.DBus.Method.NoReply" value="true" /> </method> <signal name="ThresholdCrossed" /> </interface> </node>

slide-19
SLIDE 19

Default: "null" authentication Strong authentication: pre-shared key (PSK) / certificate key exchange (ECDSA).

<node> <interface name="com.example.Door"> <annotation name="org.alljoyn.Bus.Secure" value="true" /> <annotation name="org.alljoyn.Bus.DocString.En" value="Example interface for a doorway"/> ... </interface> </node>

slide-20
SLIDE 20
  • Allow access to a producer's state
  • Access values: “read” and “readwrite”
  • Annotation - “org.freedesktop.DBus.Property.EmitsChangedSignal”

Value Action when property change occurs

true Emit a signal denoting the changed property and the new value Invalidates Emit a signal denoting the changed property but NOT the new value false Emit no signal const The property will never change value and never emit a changed signal. This will be introduced in the AllJoyn 16.04 release; until then, use "true".

slide-21
SLIDE 21
  • Modify the state of a producer
  • May have input and output arguments
  • No return message: "org.freedesktop.DBus.Method.NoReply".
  • Inform consumers of an event that they could not determine by querying

the producer

  • “out” arguments only.
  • Should never be state-based.
slide-22
SLIDE 22

Provide feedback as error, warning, and informational messages ajxmlcop.exe doorExample.xml

GitHub

slide-23
SLIDE 23
slide-24
SLIDE 24
  • 1. Install the AllJoyn Studio
  • 2. Launch Visu

sual al Studi dio 2015, click Fi File > New > Proje ject ct.

  • 3. In the New Project dialog

box, click Inst stalle lled > T emp mplates es > Visu sual al C# > Windo dows ws > Unive versal sal to create a new AllJ lJoyn yn App pp project

slide-25
SLIDE 25

Add and Remove Interfaces Automatically add the generated files as a WinRT Component T

  • modify the interfaces after the solution is created…

Go to AllJoyn lJoyn > Add/Re Remo move ve Inter terfac aces es... ... to launch the Inter terface face ma manager ger

slide-26
SLIDE 26

Add a “Using” clause to access the WinRT components

Using Windows.Devices.AllJoyn; Using com.example.Door;

Implement the Producer

1.

Create a class for the producer’s service. Use Quick Action to fill in the necessary components.

2.

Create a new AllJoynBusAttachment

3.

(Optional) Populate the About data for the producer through AllJoynBusAttachment.AboutData

4.

Initialize the producer with the AllJoynBusAttachment

5.

Instantiate the newly created Service for the producer

6.

Start the producer

slide-27
SLIDE 27

allseen-gateway@lists.allseenalliance.org Subscribe

slide-28
SLIDE 28

https://channel9.msdn.com/Blogs/Internet-of-Things-Blog/Creating-AllJoyn-Producers-and-Authoring- AllJoyn-Introspection-XML?ocid=EntriesInArea https://channel9.msdn.com/Blogs/Internet-of-Things-Blog/Using-the-AllJoyn--Studio-Extension https://wiki.allseenalliance.org/irb/interface_design_guidelines_1.1

slide-29
SLIDE 29

Join WinHEC LINE Community @winhec hec

We want to hear from you! Please Complete the Evaluation Form and return it to our reception. Your input is highly important to us! Thank you!! 

slide-30
SLIDE 30