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 Network Access Stack
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 orer er for AllJoyn lJoyn
A Modbus variant used for communications over TCP/IP networks, connecting over 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: DSB • Connects to the Modbus Gateway Network Stack • Sends Modbus TCP request to the Modbus MyModbusGateway Library Device • Listens and parses Modbus TCP response from the Modbus Device
Instantiates and manages virtual devices on behalf of each device from the non-AllJoyn network DSB Adapter Translates device schemas into internal device objects Network Stack MyModbusGateway Library
Initialize Modbus Gateway • Connect to the Modbus Gateway DSB Adapter Initialize Modbus Sensor Device • Create ModbusSensorDevice class as a child of Network Stack IAdapterDevice MyModbusGateway Library • Define device property and attributes:
GetPropertyValue() • ModbusSensorAttribute::ReadAsync() • Creates a Modbus read request • Sends the Modbus read request to the device DSB Adapter • Listens for the Modbus response from the device • Parses the response and updates Value.Data of the attribute Network Stack MyModbusGateway Library 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
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 o 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 DSB • Adapter Define a Event Handler of the Signal Network Stack MyModbusGateway Library Call the Event Handler in GetPropertyValue()
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 •
allseen-gateway@lists.allseenalliance.org Subscribe
We want to hear from you! Join WinHEC LINE Community @winhec hec Please Complete the Evaluation Form and return it to our reception. Your input is highly important to us! Thank you!!
Recommend
More recommend