Update Windows Readme and Scripts (#1216)

* Update design image and general design description.

* Update install scripts

* Update Travis build script

* Remove build/install from readme as it is already in wiki
This commit is contained in:
Nick Banks
2017-02-01 10:19:06 -08:00
committed by Jonathan Hui
parent 8a8c8cde41
commit f000137674
11 changed files with 142 additions and 78 deletions
+2 -2
View File
@@ -39,7 +39,7 @@ clone_depth: 10
install:
- cmd: Bcdedit.exe -set TESTSIGNING ON
# Configure logging
- cmd: reg import .appveyor\ThreadEtw.reg
- cmd: reg import tools\windows\ThreadEtw.reg
- ps: Restart-Computer -Force
- ps: Start-Sleep -s 10
before_build:
@@ -58,7 +58,7 @@ test_script:
# Run the unit tests
- cmd: .appveyor\run_unit_tests.cmd
# Run the tests for the driver (only runs on x64)
- cmd: .appveyor\test_driver.cmd
#- cmd: .appveyor\test_driver.cmd
artifacts:
- path: release
name: release
+21 -1
View File
@@ -28,12 +28,26 @@ REM
pushd %APPVEYOR_BUILD_FOLDER%
REM Make the release directory
REM Make the release directories
mkdir release
mkdir release\include
mkdir release\include\commissioning
mkdir release\include\missing
mkdir release\include\platform
mkdir release\libs
mkdir release\symbols
mkdir release\symbols\TraceFormat
REM Copy the relavant include headers
copy include\openthread.h release\include
copy include\openthread-types.h release\include
copy include\commissioning\commissioner.h release\include\commissioning
copy include\commissioning\joiner.h release\include\commissioning
copy include\platform\toolchain.h release\include\platform
copy src\missing\stdbool\stdbool.h release\include\missing
copy src\missing\stdint\stdint.h release\include\missing
REM Copy the relavant binaries
copy build\bin\%Platform2%\%Configuration%\sys\otlwf\* release
@@ -53,6 +67,12 @@ copy build\bin\%Platform2%\%Configuration%\exe\otCli.pdb release\symbols
copy build\bin\%Platform2%\%Configuration%\exe\otTestRunner.exe release
copy build\bin\%Platform2%\%Configuration%\exe\otTestRunner.pdb release\symbols
REM Copy the tools
copy tools\windows\* release
copy tools\windows\%Platform%\otInstall.exe release
copy "C:\Program Files (x86)\Windows Kits\10\Tools\%Platform%\devcon.exe" release
REM Generate the trace format files to decode the WPP logs
"C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Bin\x64\TracePdb.exe" -f release\symbols\*.pdb -p release\symbols\TraceFormat
Binary file not shown.

Before

Width:  |  Height:  |  Size: 58 KiB

After

Width:  |  Height:  |  Size: 62 KiB

+14 -75
View File
@@ -31,85 +31,24 @@ It plugs into the networking stack, binding to a protocol driver (TCPIP) at the
at the bottom. It's job is to take IPv6 packets from TCPIP and pass the necessary data down to the Miniport
in order to send the packets out over the network.
`otLwf.sys` supports operating in two modes: Full Stack and Tunnel. Full Stack mode is where OpenThread is
running on the host (in Windows) and a simple radio device is connected externally. Tunnel mode is where
`otLwf.sys` supports operating in two modes: Full Stack and Tunnel. Full Stack mode is where OpenThread is
running on the host (in Windows) and a simple radio device is connected externally. Tunnel mode is where
OpenThread is running on the external device and Windows is merely a pass through for commands and packets.
In Full Stack mode, `otLwf.sys` hosts the OpenThread core library and manages serializing all Windows
networking inputs to the OpenThread APIs. It maintains one dedicated worker thread for running all
OpenThread related logic, including IOCTL commands, data packets, and basic OpenThread processing logic.
`otLwf.sys` uses [OID][oid]s to send control path commands (channel, panid, etc.) and [NBL][nbl]s to send and
receive the 802.15.4 data packets to/from the miniport. The miniport then passes this information, in the
proper format, off to the radio device.
In both cases, `otLwf.sys` uses the Spinel command interface for interacting with the connected device. When operating
in Full Stack mode, `otLwf.sys` uses only the low level PHY/MAC commands. In Tunnel mode, it uses the higher layer
Spinel commands and lets the device manage the actual Thread stack.
In Tunnel mode, `otLwf.sys` mainly just manages the serialization of Windows networking inputs to
Spinel commands (and back). The Spinel commands are passed down (in [NBL][nbl]s) to the miniport which will then pass
the commands (correctly encoded) to whatever device is externally connected.
### ottmp.sys ###
### 802.15.4 PHY Miniport ###
This is the component responsible passing the Spinel commands from `otLwf.sys` down to the device. It is responsible
for abstracting the actual mechanism (USB, Serial, SPI) used for communicating with the device. It handles the device
arrival/removal and the encoding/decoding of data when communicating with it. The current implementation only handles
Serial devices.
This is the component responsible for taking the [OID][oid]s and [NBL][nbl]s from `otLwf.sys` and sending the
information down to the matching 802.15.4 PHY Device, in the proper format. In other words, it's job is mainly
handling the arrival/removal of the physical device and serialization of the info in the proper format for
the device it's paired with.
### Device ###
### Thread Miniport ###
This is the component for taking the [NBL][nbl]s, containing Spinel commands, from `otLwf.sys` and sending them
down to the matching OpenThread (NCP) Device. Again, like the PHY miniport, it's job is handling device arrival/removal
and command serialization.
### 802.15.4 PHY Device ###
This is a 'simple' device, exposing a mostly PHY layer interface (with a few MAC layer constructs).
### OpenThread (NCP) Device ###
This is a 'full solution' device, that exposes the entire OpenThread interface via NCP.
## Build ##
Open the Visual Studio Solution `openthread.sln` under `etc\visual-studio` and then pick the
configuration and platform you wish to build for. For instance, `Release` and `x64`. Build
the whole solution (F6). This will output the files here:
```
build\bin\<platform>\<configuration>
```
## Install ##
### Filter Driver ###
1. Copy the following files to a temporary location on the target machine:
```
build\bin\<platform>\<configuration>\sys\otLwf.cer
build\bin\<platform>\<configuration>\sys\otLwf\otLwf.cat
build\bin\<platform>\<configuration>\sys\otLwf\otLwf.inf
build\bin\<platform>\<configuration>\sys\otLwf\otLwf.sys
```
2. Open an admin command prompt in the location of the temporary files.
3. Install the certificate to the root and TrustedPublisher store by running:
```
certutil -addstore root otLwf.cer
certutil -addstore TrustedPublisher otLwf.cer
```
4. Install the driver by running:
```
netcfg.exe -v -l otlwf.inf -c s -i otLwf
```
### Miniport Driver ###
`TODO`
## Controlling OpenThread from an Application ##
`TODO`
Windows supports OpenThread devices that implement the Spinel protocol. It supports devices that support either the raw
link-layer PHY/MAC commands and devices that support the Thread commands (and devices that support both). By default,
Windows will operate in Full Stack mode, only sending raw link-layer commands.
Binary file not shown.
+30
View File
@@ -0,0 +1,30 @@
REM
REM Copyright (c) 2016, The OpenThread Authors.
REM All rights reserved.
REM
REM Redistribution and use in source and binary forms, with or without
REM modification, are permitted provided that the following conditions are met:
REM 1. Redistributions of source code must retain the above copyright
REM notice, this list of conditions and the following disclaimer.
REM 2. Redistributions in binary form must reproduce the above copyright
REM notice, this list of conditions and the following disclaimer in the
REM documentation and/or other materials provided with the distribution.
REM 3. Neither the name of the copyright holder nor the
REM names of its contributors may be used to endorse or promote products
REM derived from this software without specific prior written permission.
REM
REM THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
REM AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
REM IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
REM ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
REM LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
REM CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
REM SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
REM INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
REM CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
REM ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
REM POSSIBILITY OF SUCH DAMAGE.
REM
devcon update ftdibus.inf "USB\VID_0403&PID_A6D1*"
devcon update ftdiport.inf FTDIBUS\VID_0403+PID_A6D1
+42
View File
@@ -0,0 +1,42 @@
REM
REM Copyright (c) 2016, The OpenThread Authors.
REM All rights reserved.
REM
REM Redistribution and use in source and binary forms, with or without
REM modification, are permitted provided that the following conditions are met:
REM 1. Redistributions of source code must retain the above copyright
REM notice, this list of conditions and the following disclaimer.
REM 2. Redistributions in binary form must reproduce the above copyright
REM notice, this list of conditions and the following disclaimer in the
REM documentation and/or other materials provided with the distribution.
REM 3. Neither the name of the copyright holder nor the
REM names of its contributors may be used to endorse or promote products
REM derived from this software without specific prior written permission.
REM
REM THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
REM AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
REM IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
REM ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
REM LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
REM CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
REM SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
REM INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
REM CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
REM ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
REM POSSIBILITY OF SUCH DAMAGE.
REM
REM Install the API
copy otapi.dll %SystemRoot%\System32
REM Install the certifications to the cert stores
certutil -addstore root otLwf.cer
certutil -addstore TrustedPublisher otLwf.cer
REM Start ETW logging (requires reboot)
reg.exe import ThreadEtw.reg
REM Install the driver
copy otlwf.sys %SystemRoot%\System32\drivers
sc.exe create otlwf binPath= \SystemRoot\system32\drivers\otlwf.sys type= kernel start= system group= NDIS displayname= "OpenThread NDIS LightWeight Filter"
otInstall.exe -i
+33
View File
@@ -0,0 +1,33 @@
REM
REM Copyright (c) 2016, The OpenThread Authors.
REM All rights reserved.
REM
REM Redistribution and use in source and binary forms, with or without
REM modification, are permitted provided that the following conditions are met:
REM 1. Redistributions of source code must retain the above copyright
REM notice, this list of conditions and the following disclaimer.
REM 2. Redistributions in binary form must reproduce the above copyright
REM notice, this list of conditions and the following disclaimer in the
REM documentation and/or other materials provided with the distribution.
REM 3. Neither the name of the copyright holder nor the
REM names of its contributors may be used to endorse or promote products
REM derived from this software without specific prior written permission.
REM
REM THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
REM AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
REM IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
REM ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
REM LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
REM CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
REM SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
REM INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
REM CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
REM ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
REM POSSIBILITY OF SUCH DAMAGE.
REM
REM Install the certifications to the cert stores
certutil -addstore root ottmp.cer
certutil -addstore TrustedPublisher ottmp.cer
devcon install ottmp.inf root\ottmp
Binary file not shown.
Binary file not shown.