AllJoyn Node AllJoyn Thin Client Other Proximal or Cloud Devices - - PowerPoint PPT Presentation
AllJoyn Node AllJoyn Thin Client Other Proximal or Cloud Devices - - PowerPoint PPT Presentation
Any questions please contact winhectpe@microsoft.com AllJoyn Node AllJoyn Thin Client Other Proximal or Cloud Devices 72 Device System Bridge AllJoyn Common Interface Others OSS Z-Wave example Bridge Adapter
AllJoyn Node Other Proximal or Cloud Devices AllJoyn Thin Client Device System Bridge
Others
72°
AllJoyn Common Interface
OSS Z-Wave example
Network Access Stack Bridge
- Adapter
Go to Visu sual al Studi dio Galler ery and search for “DSB” or Download here
An Visual Studio extension developed by Microsoft
IoT T Explor
- rer
er for AllJoyn lJoyn
A Modbus variant used for communications over TCP/IP networks, connecting
- ver port 502.
Client/Server Model
Transaction ID Protocol ID Frame Field Unit ID Function Code Target Address Data bytes 2 Bytes 2 Bytes 2 Bytes 1 Byte 1 Byte 2 Bytes N bytes
- 1. Install the AllJoyn Device
System Bridge T emplate
- 2. Launch Visu
sual al Studio dio 2015, click Fi File > New > Proje ject ct.
- 3. In the New Project dialog
box, click Inst stalled lled > T emp mplates es > Visu sual al C# > Windo dows ws > AllJo Joyn yn Devic ice e Syst stem em Bridg dge to create a new AllJoyn Device System Bridge App project
Access to non-AllJoyn Network specific In case of Modbus TCP , the network stack does the following:
- Connects to the Modbus Gateway
- Sends Modbus TCP request to the Modbus
Device
- Listens and parses Modbus TCP response from
the Modbus Device
Network Stack
MyModbusGateway Library
DSB
Instantiates and manages virtual devices on behalf of each device from the non-AllJoyn network Translates device schemas into internal device objects
Adapter Network Stack
MyModbusGateway Library
DSB
Initialize Modbus Gateway
- Connect to the Modbus Gateway
Initialize Modbus Sensor Device
- Create ModbusSensorDevice class as a child of
IAdapterDevice
- Define device property and attributes:
Adapter Network Stack
MyModbusGateway Library
DSB
GetPropertyValue()
- ModbusSensorAttribute::ReadAsync()
- Creates a Modbus read request
- Sends the Modbus read request to the device
- Listens for the Modbus response from the device
- Parses the response and updates Value.Data of the attribute
SetPropetyValue()
- ModbusSensorAttribute::WriteAsync()
- Check input values
- Creates a Modbus write request
- Sends the Modbus write request to the device
- Listens for the Modbus response from the device
Adapter Network Stack
MyModbusGateway Library
DSB
- 1. Install the AllJoyn Studio
- 2. Launch Visu
sual al Studi dio 2015, click Fi File > Ne New > Projec ject.
- 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
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 erfac aces es... ... to launch the Inter erface face manager ger
Add a “Using” clause to access the WinRT components
Using Windows.Devices.AllJoyn; Using com.microsoft.ModbusAdapter.MyModbusSensor.interface_1;
Implement the Watcher
Create a new AllJoynBusAttachment Initialize the watcher with the AllJoynBusAttachment Register the watcher Added event Start the watcher Register a consumer NOTE: One consumer for one producer.
Get Attribute Value
Interface_1GetAttributeResult myResult = await myConusmer.GetAttributeAsync(); if(myResult.Status != AllJoynStatus.Ok) return; double myValue = myResult.AttributeValue;
Set Attribute Value
await myConusmer.SetAttributeAsync();
Use the predefined function calls om Interface_1Consumer.
ModbusSensorDevice::Initialize()
- Define Signals
- Implicit Signal
- Explicit Signal
Define a Event Handler of the Signal Call the Event Handler in GetPropertyValue()
Adapter Network Stack
MyModbusGateway Library
DSB
In Watcher_Added event
Register events for the various Signals that the producer will emit.
- Property changed signals are direct members of the consumer class.
- Other signals are members of the Signals class under the Main Interface.
Define an Event Handler for the Signal
Send toast notification when received the temperature changed event.
http://ms-iot.github.io/content/en-US/win10/AllJoyn.htm git.allseenalliance.org/cgit/dsb.git
- Mock DSB Tutorial and Sample
- Z-Wave DSB Tutorial and Sample
- ZigBee DSB Tutorial and Sample
- REST API DSB Tutorial and Sample (soon, keep checking)
- GPIO DSB Tutorial
- BACnet DSB Sample