<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8">
<meta name="generator" content="pdf2htmlEX">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<link rel="stylesheet" href="https://static.pudn.com/base/css/base.min.css">
<link rel="stylesheet" href="https://static.pudn.com/base/css/fancy.min.css">
<link rel="stylesheet" href="https://static.pudn.com/prod/directory_preview_static/62511d2774bc5c0105944cb7/raw.css">
<script src="https://static.pudn.com/base/js/compatibility.min.js"></script>
<script src="https://static.pudn.com/base/js/pdf2htmlEX.min.js"></script>
<script>
try{
pdf2htmlEX.defaultViewer = new pdf2htmlEX.Viewer({});
}catch(e){}
</script>
<title></title>
</head>
<body>
<div id="sidebar" style="display: none">
<div id="outline">
</div>
</div>
<div id="pf1" class="pf w0 h0" data-page-no="1"><div class="pc pc1 w0 h0"><img class="bi x0 y0 w1 h1" alt="" src="https://static.pudn.com/prod/directory_preview_static/62511d2774bc5c0105944cb7/bg1.jpg"><div class="c x0 y1 w2 h0"><div class="t m0 x1 h2 y2 ff1 fs0 fc0 sc0 ls0 ws0">Copyright 2019, Nordic Semiconductor ASA </div><div class="t m0 x2 h3 y3 ff2 fs1 fc1 sc0 ls0 ws0">Nordic Semicond<span class="_ _0"></span>uctor Sniffer A<span class="_ _0"></span>PI Guide </div><div class="t m0 x3 h4 y4 ff3 fs0 fc0 sc0 ls0 ws0">Version 0.4 </div><div class="t m0 x4 h4 y5 ff3 fs0 fc0 sc0 ls0 ws0"> </div><div class="t m0 x4 h4 y6 ff3 fs0 fc0 sc0 ls0 ws0"> </div><div class="t m0 x1 h2 y7 ff1 fs0 fc0 sc0 ls0 ws0">The Sniffer API guide provides the documentation of the Python API used to interface </div><div class="t m0 x1 h2 y8 ff1 fs0 fc0 sc0 ls0 ws0">with the nRF Sniffer for Bluetooth low energy. The nRF Sniffer is available for </div><div class="t m0 x1 h2 y9 ff1 fs0 fc0 sc0 ls0 ws0">download at nordicsemi.com. </div><div class="t m0 x1 h2 ya ff1 fs0 fc0 sc0 ls0 ws0"> </div><div class="t m0 x1 h2 yb ff1 fs0 fc0 sc0 ls0 ws0">Revision History </div></div><div class="c x5 yc w3 h5"><div class="t m0 x6 h6 yd ff4 fs0 fc0 sc0 ls0 ws0">Revision </div></div><div class="c x4 yc w4 h5"><div class="t m0 x6 h6 yd ff4 fs0 fc0 sc0 ls0 ws0">Changes </div></div><div class="c x5 ye w3 h7"><div class="t m0 x6 h2 yf ff1 fs0 fc0 sc0 ls0 ws0">0.1 </div></div><div class="c x4 ye w4 h7"><div class="t m0 x6 h2 yf ff1 fs0 fc0 sc0 ls0 ws0">Initial version </div></div><div class="c x5 y10 w3 h5"><div class="t m0 x6 h2 yd ff1 fs0 fc0 sc0 ls0 ws0">0.2 </div></div><div class="c x4 y10 w4 h5"><div class="t m0 x6 h2 yd ff1 fs0 fc0 sc0 ls0 ws0">Added description of LED and GPIO. </div></div><div class="c x5 y11 w3 h8"><div class="t m0 x6 h2 y12 ff1 fs0 fc0 sc0 ls0 ws0">0.3 </div></div><div class="c x4 y11 w4 h8"><div class="t m0 x6 h2 y12 ff1 fs0 fc0 sc0 ls0 ws0">Updated documentation to reflect API </div><div class="t m0 x6 h2 yd ff1 fs0 fc0 sc0 ls0 ws0">changes after 0.9.7 </div></div><div class="c x5 y13 w3 h5"><div class="t m0 x6 h2 yd ff1 fs0 fc0 sc0 ls0 ws0">0.4 </div></div><div class="c x4 y13 w4 h5"><div class="t m0 x6 h2 yd ff1 fs0 fc0 sc0 ls0 ws0">Updated documentation for version 2.0.0 </div></div><div class="c x0 y1 w2 h0"><div class="t m0 x1 h2 y14 ff1 fs0 fc0 sc0 ls0 ws0"> </div><div class="t m0 x1 h2 y15 ff1 fs0 fc0 sc0 ls0 ws0"> <span class="_ _1"> </span> </div></div></div><div class="pi" data-data='{"ctm":[1.568627,0.000000,0.000000,1.568627,0.000000,0.000000]}'></div></div>
</body>
</html>
<div id="pf2" class="pf w0 h0" data-page-no="2"><div class="pc pc2 w0 h0"><img class="bi x0 y0 w1 h1" alt="" src="https://static.pudn.com/prod/directory_preview_static/62511d2774bc5c0105944cb7/bg2.jpg"><div class="c x0 y1 w2 h0"><div class="t m0 x1 h2 y2 ff1 fs0 fc0 sc0 ls0 ws0">Copyright 2019, Nordic Semiconductor ASA </div><div class="t m0 x1 h3 y16 ff2 fs1 fc1 sc0 ls0 ws0">Introduction<span class="_ _0"></span> </div><div class="t m0 x1 h2 y17 ff1 fs0 fc0 sc0 ls0 ws0"> </div><div class="t m0 x1 h2 y18 ff1 fs0 fc0 sc0 ls0 ws0">The Sniffer API is a Python API that allows scripted use of the Nordic Semiconductor </div><div class="t m0 x1 h2 y19 ff1 fs0 fc0 sc0 ls0 ws0">BLE Sniffer. It allows discovery of devices and sniffing of a single device. <span class="_ _2"></span>It provides </div><div class="t m0 x1 h2 y1a ff1 fs0 fc0 sc0 ls0 ws0">access to all the BLE packets received by the sniffer a<span class="_ _0"></span>nd the devices discovered. </div><div class="t m0 x1 h2 y1b ff1 fs0 fc0 sc0 ls0 ws0"> </div><div class="t m0 x1 h2 y1c ff1 fs0 fc0 sc0 ls0 ws0">The sniffer consists of four parts as seen in Figure 1. Code that uses the Sniffer API </div><div class="t m0 x1 h2 y1d ff5 fs0 fc0 sc0 ls0 ws0">directly will effectively replace<span class="_ _0"></span> the “Sniffer extcap” and “Wireshark” components.<span class="_ _2"></span><span class="ff1"> </span></div><div class="t m0 x1 h2 y1e ff1 fs0 fc0 sc0 ls0 ws0"> </div><div class="t m0 x1 h2 y1f ff1 fs0 fc0 sc0 ls0 ws0"> </div><div class="t m0 x7 h2 y20 ff1 fs0 fc0 sc0 ls0 ws0"> </div><div class="t m0 x1 h9 y21 ff4 fs2 fc0 sc0 ls0 ws0">Figure 1 - The parts of the sniffer. </div><div class="t m0 x1 h2 y22 ff1 fs0 fc0 sc0 ls0 ws0">The <span class="ff5">“Sniffer extcap” </span>is included under extcap/nrf_sniffer.py (and the helper script </div><div class="t m0 x1 h2 y23 ff1 fs0 fc0 sc0 ls0 ws0">extcap/nrf_sniffer.bat for Windows). See </div><div class="t m0 x1 h2 y24 ff1 fs0 fc2 sc0 ls0 ws0">https://www.wireshark.org/docs/wsdg_html_chunked/ChCaptureExtcap.html<span class="fc0"> for more </span></div><div class="t m0 x1 h6 y25 ff1 fs0 fc0 sc0 ls0 ws0">information on how the extcap system works. Note: you do <span class="ff4">not</span> need to use the extcap if </div><div class="t m0 x1 h2 y26 ff1 fs0 fc0 sc0 ls0 ws0">you are using the Sniffer API directly. </div><div class="t m0 x1 h3 y27 ff2 fs1 fc1 sc0 ls0 ws0">Dependencies<span class="_ _0"></span> </div><div class="t m0 x1 h2 y28 ff1 fs0 fc0 sc0 ls0 ws0"> </div><div class="t m0 x1 h2 y29 ff1 fs0 fc0 sc0 ls0 ws0">The API has been developed using Python 2.7.15 32 bit. 64-bit is not well tested but </div><div class="t m0 x1 h2 y2a ff1 fs0 fc0 sc0 ls0 ws0">should work. The API also requires one third party Python library: </div><div class="t m0 x8 h2 y2b ff1 fs0 fc2 sc0 ls0 ws0">1.<span class="ff6"> <span class="_ _3"> </span></span><span class="fc0">Pyserial (cross platform) version 3.4. <span class="ff5">Download using pip: “pip install </span></span></div><div class="t m0 x9 h2 y2c ff5 fs0 fc0 sc0 ls0 ws0">‘<span class="ff1">pyserial>=3.4</span>’”<span class="ff1 fc2"> </span></div><div class="t m0 x1 h2 y2d ff1 fs0 fc0 sc0 ls0 ws0"> </div><div class="t m0 x1 h2 y2e ff1 fs0 fc0 sc0 ls0 ws0">See the Sniffer User Guide v2 for more information. </div><div class="t m0 x1 h3 y2f ff2 fs1 fc1 sc0 ls0 ws0">Using the Sniffer<span class="_ _0"></span> API </div><div class="t m0 x1 h2 y30 ff1 fs0 fc0 sc0 ls0 ws0"> </div><div class="t m0 x1 h6 y31 ff4 fs0 fc0 sc0 ls0 ws0">Getting Started </div><div class="t m0 x8 h2 y32 ff1 fs0 fc0 sc0 ls0 ws0">1.<span class="ff6"> <span class="_ _3"> </span></span>Install dependencies. </div><div class="t m0 x8 h2 y33 ff1 fs0 fc0 sc0 ls0 ws0">2.<span class="ff6"> <span class="_ _3"> </span></span>Include the SnifferAPI folder in y<span class="_ _0"></span>our Python project. </div><div class="t m0 x8 h2 y34 ff1 fs0 fc0 sc0 ls0 ws0">3.<span class="ff6"> <span class="_ _3"> </span></span>Import the API with </div><div class="t m0 xa ha y35 ff7 fs3 fc0 sc0 ls1 ws0">from SnifferAPI import Sniffer<span class="ls0"> </span></div><div class="t m0 x8 h2 y36 ff1 fs0 fc0 sc0 ls0 ws0">4.<span class="ff6"> <span class="_ _3"> </span></span>Optional: discover a list of the connected sniffers using: </div><div class="t m0 x9 h2 y37 ff1 fs0 fc0 sc0 ls0 ws0"> <span class="ff7 fs3 ls1">from SnifferAPI import UART<span class="ls0"> </span></span></div><div class="t m0 x9 h2 y38 ff1 fs0 fc0 sc0 ls0 ws0"> <span class="ff7 fs3 ls1">ports = UART.find_sniffer()</span> </div></div><a class="l" rel='nofollow' onclick='return false;'><div class="d m1"></div></a><a class="l" rel='nofollow' onclick='return false;'><div class="d m1"></div></a></div><div class="pi" data-data='{"ctm":[1.568627,0.000000,0.000000,1.568627,0.000000,0.000000]}'></div></div>