# 架构

Source: [https://docs.qualcomm.com/doc/80-70014-7Y/topic/architecture.html](https://docs.qualcomm.com/doc/80-70014-7Y/topic/architecture.html)

Note: 低功耗处理器 (aDSP) 的源代码（包括 QSH 框架）仅供授权用户使用。要升级您的访问权限，可访问：[www.qualcomm.com/support/working-with-qualcomm](https://www.qualcomm.com/support/working-with-qualcomm).

Note: 要继续阅读有关 API 和/或部署传感器的信息，直接跳至[接口](https://docs.qualcomm.com/bundle/publicresource/topics/80-70014-7/qsh_api_reference.html)。

QSH 是 Qualcomm® Snapdragon™ 传感器内核 (SSC) 的代名词，它为驱动程序和算法提供了一个统一的事件驱动框架。QSH 支持基于硬件和基于软件的传感器的同一组 API。此外，QSH 支持异步总线传输，并且可轻松扩展新的或自定义驱动程序功能。QSH 由各种组件组成，包括 QSH 客户端 API、传感器 API、核心框架、预实现的平台传感器、供应商实现的传感器和测试模块。它为外部客户端提供服务，并提供一个简单的界面来访问传感器数据。

Figure : QSH 架构
                <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- 由 Microsoft Visio, SVG Export 生成 qsh-architecture.svg Page-1 -->
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:v="http://schemas.microsoft.com/visio/2003/SVGExtensions/" width="10.215in" height="7.44601in" viewbox="0 0 735.48 536.113" xml:space="preserve" color-interpolation-filters="sRGB" class="st38"><v:documentproperties v:langid="2052">	<v:userdefs>		<v:ud v:nameu="msvSubprocessMaster" v:prompt="" v:val="VT4(Rectangle)"></v:ud>		<v:ud v:nameu="msvNoAutoConnect" v:val="VT0(1):26"></v:ud>	</v:userdefs></v:documentproperties>
<style>.svg-1 .st1 { fill: #f7f8fa; stroke: none; stroke-width: 0.25 }
.svg-1 .st2 { fill: #ffffff; stroke: none; stroke-linecap: round; stroke-linejoin: round; stroke-width: 0.75 }
.svg-1 .st3 { fill: #ffffff; stroke: #13161e; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2 }
.svg-1 .st4 { fill: none; stroke: none; stroke-linecap: round; stroke-linejoin: round; stroke-width: 0.75 }
.svg-1 .st5 { fill: #13161e; font-family: Arial; font-size: 1.07398em; font-weight: bold }
.svg-1 .st6 { font-family: 黑体; font-size: 1em }
.svg-1 .st7 { fill: #3253dc; stroke: #13161e; stroke-linecap: round; stroke-linejoin: round; stroke-width: 0.916033 }
.svg-1 .st8 { fill: #f7f8fa; font-family: 黑体; font-size: 0.966591em }
.svg-1 .st9 { fill: #4a5a75; stroke: #13161e; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2 }
.svg-1 .st10 { fill: #f7f8fa; font-family: 黑体; font-size: 1.23507em }
.svg-1 .st11 { fill: #39a3b5; stroke: #13161e; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2 }
.svg-1 .st12 { fill: #f7f8fa; font-family: Arial; font-size: 1.23507em }
.svg-1 .st13 { fill: #0b2742; font-family: 黑体; font-size: 1.23507em; font-weight: bold }
.svg-1 .st14 { fill: #13161e; stroke: #13161e; stroke-linecap: round; stroke-linejoin: round; stroke-width: 0.0398275 }
.svg-1 .st15 { fill: none; stroke: #13161e; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2 }
.svg-1 .st16 { fill: #4a5a75; stroke: #13161e; stroke-linecap: round; stroke-linejoin: round; stroke-width: 0.916033 }
.svg-1 .st17 { fill: #f7f8fa; font-family: 黑体; font-size: 0.96666em }
.svg-1 .st18 { fill: #13161e; font-family: 黑体; font-size: 1.07398em; font-weight: bold }
.svg-1 .st19 { fill: #0b2742; font-family: Arial; font-size: 1.23507em; font-weight: bold }
.svg-1 .st20 { fill: #000000; font-family: Arial; font-size: 1.20767em }
.svg-1 .st21 { fill: #f7f8fa; stroke: #000000; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2 }
.svg-1 .st22 { fill: #f7f8fa; stroke: #13161e; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2 }
.svg-1 .st23 { fill: none; stroke: #13161e; stroke-linecap: round; stroke-linejoin: round; stroke-width: 0.79655 }
.svg-1 .st24 { fill: #dee3ec; stroke: none; stroke-linecap: round; stroke-linejoin: round; stroke-width: 0.75 }
.svg-1 .st25 { fill: #13161e; font-family: 黑体; font-size: 1.00001em }
.svg-1 .st26 { fill: #000000; font-family: 黑体; font-size: 1.00001em }
.svg-1 .st27 { fill: #f7f8fa; font-family: Arial; font-size: 0.966591em }
.svg-1 .st28 { fill: #dee3ec; stroke: #000000; stroke-width: 2 }
.svg-1 .st29 { fill: #000000; font-family: 黑体; font-size: 0.75em }
.svg-1 .st30 { font-family: Arial; font-size: 1em }
.svg-1 .st31 { font-size: 1em }
.svg-1 .st32 { fill: #4a5a75; stroke: #c7c8c8; stroke-width: 0.25 }
.svg-1 .st33 { fill: #feffff; font-family: 黑体; font-size: 1.00001em }
.svg-1 .st34 { fill: #39a3b5; stroke: #c7c8c8; stroke-width: 0.25 }
.svg-1 .st35 { fill: #3253dc; stroke: #c7c8c8; stroke-width: 0.25 }
.svg-1 .st36 { fill: #feffff; font-family: Arial; font-size: 1.00001em }
.svg-1 .st37 { fill: #dee3ec; stroke: #c7c8c8; stroke-width: 0.25 }
.svg-1 .st38 { fill: none; fill-rule: evenodd; font-size: 12px; overflow: visible; stroke-linecap: square; stroke-miterlimit: 3 }</style>
<g v:mid="0" v:index="1" v:groupcontext="foregroundPage">	<v:userdefs>		<v:ud v:nameu="msvThemeOrder" v:val="VT0(0):26"></v:ud>	</v:userdefs>	<title>Page-1</title>	<v:pageproperties v:drawingscale="1" v:pagescale="1" v:drawingunits="0" v:shadowoffsetx="9" v:shadowoffsety="-9"></v:pageproperties>	<g id="shape1-1" v:mid="1" v:groupcontext="shape" transform="translate(50.4,-0.00047)">		<title>shape120-1</title>		<rect x="0" y="-3.887" width="678.601" height="540" class="st1"></rect>	</g>	<g id="shape2-3" v:mid="2" v:groupcontext="shape" transform="translate(194.763,-182.924)">		<title>shape5-3</title>		<path d="M0 389.51 C0 373.32 12.84 360.19 28.67 360.19 L485.49 360.19 C501.36 360.19 514.15 373.32 514.15 389.51 L514.15					 506.79 C514.15 523.02 501.36 536.11 485.49 536.11 L28.67 536.11 C12.84 536.11 0 523.02 0 506.79 L0 389.51					 Z" class="st2"></path>	</g>	<g id="shape3-5" v:mid="3" v:groupcontext="shape" transform="translate(194.763,-182.924)">		<title>shape6-5</title>		<path d="M0 389.51 C0 373.32 12.84 360.19 28.67 360.19 L485.49 360.19 C501.36 360.19 514.15 373.32 514.15 389.51 L514.15					 506.79 C514.15 523.02 501.36 536.11 485.49 536.11 L28.67 536.11 C12.84 536.11 0 523.02 0 506.79 L0 389.51					 Z" class="st3"></path>	</g>	<g id="shape4-7" v:mid="4" v:groupcontext="shape" transform="translate(210.588,-333.373)">		<title>shape7-7</title>		<desc>Qualcomm Sensing Hub</desc>		<v:userdefs></v:userdefs>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="82.2678" cy="528.381" width="164.54" height="15.4689"></v:textrect>		<rect x="0" y="520.643" width="164.54" height="15.47" class="st4"></rect>		<text x="14.83" y="532.57" class="st5" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>Qualcomm <tspan class="st6">传感器中枢</tspan></text>		</g>	<g id="shape5-11" v:mid="5" v:groupcontext="shape" transform="translate(507.917,-296.336)">		<title>shape8-11</title>		<path d="M0 513.04 C0 510.5 2.05 508.4 4.53 508.4 L158.7 508.4 C161.19 508.4 163.19 510.5 163.19 513.04 L163.19 531.52					 C163.19 534.06 161.19 536.11 158.7 536.11 L4.53 536.11 C2.05 536.11 0 534.06 0 531.52 L0 513.04 Z" class="st2"></path>	</g>	<g id="shape6-13" v:mid="6" v:groupcontext="shape" transform="translate(507.917,-296.336)">		<title>shape9-13</title>		<path d="M0 513.04 C0 510.5 2.05 508.4 4.53 508.4 L158.7 508.4 C161.19 508.4 163.19 510.5 163.19 513.04 L163.19 531.52					 C163.19 534.06 161.19 536.11 158.7 536.11 L4.53 536.11 C2.05 536.11 0 534.06 0 531.52 L0 513.04 Z" class="st7"></path>	</g>	<g id="shape7-15" v:mid="7" v:groupcontext="shape" transform="translate(532.8,-301.886)">		<title>shape10-15</title>		<desc>Client Manager</desc>		<v:userdefs></v:userdefs>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="56.1274" cy="529.154" width="112.27" height="13.9225"></v:textrect>		<rect x="0" y="522.193" width="112.263" height="13.92" class="st4"></rect>		<text x="21.33" y="532.92" class="st8" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>客户端管理器</text>		</g>	<g id="shape8-18" v:mid="8" v:groupcontext="shape" transform="translate(194.763,-473.717)">		<title>shape12-19</title>		<path d="M0 510.9 C0 508.12 2.24 505.83 4.96 505.83 L509.23 505.83 C511.95 505.83 514.15 508.12 514.15 510.9 L514.15					 531.08 C514.15 533.86 511.95 536.11 509.23 536.11 L4.96 536.11 C2.24 536.11 0 533.86 0 531.08 L0 510.9 Z" class="st9"></path>	</g>	<g id="shape9-20" v:mid="9" v:groupcontext="shape" transform="translate(392.545,-477.492)">		<title>shape13-21</title>		<desc>Client Application</desc>		<v:userdefs></v:userdefs>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="68.2561" cy="527.221" width="136.52" height="17.7886"></v:textrect>		<rect x="0" y="518.323" width="136.52" height="17.79" class="st4"></rect>		<text x="16.38" y="532.04" class="st10" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>客户端应用程序</text>		</g>	<g id="shape10-23" v:mid="10" v:groupcontext="shape" transform="translate(194.763,-419.866)">		<title>shape15-25</title>		<path d="M0 510.9 C0 508.12 2.24 505.83 4.96 505.83 L509.23 505.83 C511.95 505.83 514.15 508.12 514.15 510.9 L514.15					 531.08 C514.15 533.86 511.95 536.11 509.23 536.11 L4.96 536.11 C2.24 536.11 0 533.86 0 531.08 L0 510.9 Z" class="st11"></path>	</g>	<g id="shape11-25" v:mid="11" v:groupcontext="shape" transform="translate(400.286,-425.497)">		<title>shape16-27</title>		<desc>QSH Client API</desc>		<v:userdefs></v:userdefs>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="60.9442" cy="527.221" width="121.9" height="17.7886"></v:textrect>		<rect x="0" y="518.323" width="121.89" height="17.79" class="st4"></rect>		<text x="6.59" y="532.04" class="st12" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>QSH <tspan class="st6">客户端</tspan> API</text>		</g>	<g id="shape12-29" v:mid="12" v:groupcontext="shape" transform="translate(79.2,-505.729)">		<title>shape17-31</title>		<desc>Application processor</desc>		<v:userdefs></v:userdefs>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="53.4736" cy="527.221" width="106.96" height="17.7886"></v:textrect>		<rect x="0" y="518.323" width="106.952" height="17.79" class="st4"></rect>		<text x="16.28" y="532.04" class="st13" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>应用处理器</text>		</g>	<g id="shape13-32" v:mid="13" v:groupcontext="shape" transform="translate(64.8,-364.101)">		<title>shape18-35</title>		<desc>Low power processor</desc>		<v:userdefs></v:userdefs>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="61.7421" cy="527.221" width="123.5" height="17.7886"></v:textrect>		<rect x="0" y="518.323" width="123.49" height="17.79" class="st4"></rect>		<text x="17.11" y="532.04" class="st13" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>低功耗处理器</text>		</g>	<g id="shape14-35" v:mid="14" v:groupcontext="shape" transform="translate(64.8,-394.674)">		<title>shape19-39</title>		<path d="M0 534.78 L9.81 534.78 L9.81 536.11 L0 536.11 L0 534.78 ZM13.48 534.78 L23.3 534.78 L23.3 536.11 L13.48 536.11					 L13.48 534.78 ZM26.97 534.78 L36.74 534.78 L36.74 536.11 L26.97 536.11 L26.97 534.78 ZM40.42 534.78 L50.23					 534.78 L50.23 536.11 L40.42 536.11 L40.42 534.78 ZM53.9 534.78 L63.72 534.78 L63.72 536.11 L53.9 536.11					 L53.9 534.78 ZM67.38 534.78 L77.16 534.78 L77.16 536.11 L67.38 536.11 L67.38 534.78 ZM80.84 534.78 L90.64					 534.78 L90.64 536.11 L80.84 536.11 L80.84 534.78 ZM94.32 534.78 L104.14 534.78 L104.14 536.11 L94.32 536.11					 L94.32 534.78 ZM107.8 534.78 L117.58 534.78 L117.58 536.11 L107.8 536.11 L107.8 534.78 ZM121.26 534.78 L131.06					 534.78 L131.06 536.11 L121.26 536.11 L121.26 534.78 ZM134.74 534.78 L144.55 534.78 L144.55 536.11 L134.74					 536.11 L134.74 534.78 ZM148.22 534.78 L158 534.78 L158 536.11 L148.22 536.11 L148.22 534.78 ZM161.68 534.78					 L171.48 534.78 L171.48 536.11 L161.68 536.11 L161.68 534.78 ZM175.16 534.78 L184.97 534.78 L184.97 536.11					 L175.16 536.11 L175.16 534.78 ZM188.64 534.78 L198.42 534.78 L198.42 536.11 L188.64 536.11 L188.64 534.78					 ZM202.09 534.78 L211.9 534.78 L211.9 536.11 L202.09 536.11 L202.09 534.78 ZM215.58 534.78 L225.38 534.78					 L225.38 536.11 L215.58 536.11 L215.58 534.78 ZM229.06 534.78 L238.83 534.78 L238.83 536.11 L229.06 536.11					 L229.06 534.78 ZM242.51 534.78 L252.32 534.78 L252.32 536.11 L242.51 536.11 L242.51 534.78 ZM256 534.78					 L265.8 534.78 L265.8 536.11 L256 536.11 L256 534.78 ZM269.48 534.78 L279.25 534.78 L279.25 536.11 L269.48					 536.11 L269.48 534.78 ZM282.92 534.78 L292.74 534.78 L292.74 536.11 L282.92 536.11 L282.92 534.78 ZM296.41					 534.78 L306.22 534.78 L306.22 536.11 L296.41 536.11 L296.41 534.78 ZM309.9 534.78 L319.67 534.78 L319.67					 536.11 L309.9 536.11 L309.9 534.78 ZM323.34 534.78 L333.16 534.78 L333.16 536.11 L323.34 536.11 L323.34					 534.78 ZM336.83 534.78 L346.64 534.78 L346.64 536.11 L336.83 536.11 L336.83 534.78 ZM350.32 534.78 L360.09					 534.78 L360.09 536.11 L350.32 536.11 L350.32 534.78 ZM363.76 534.78 L373.57 534.78 L373.57 536.11 L363.76					 536.11 L363.76 534.78 ZM377.25 534.78 L387.06 534.78 L387.06 536.11 L377.25 536.11 L377.25 534.78 ZM390.73					 534.78 L400.51 534.78 L400.51 536.11 L390.73 536.11 L390.73 534.78 ZM404.18 534.78 L413.99 534.78 L413.99					 536.11 L404.18 536.11 L404.18 534.78 ZM417.66 534.78 L427.48 534.78 L427.48 536.11 L417.66 536.11 L417.66					 534.78 ZM431.15 534.78 L440.92 534.78 L440.92 536.11 L431.15 536.11 L431.15 534.78 ZM444.6 534.78 L454.41					 534.78 L454.41 536.11 L444.6 536.11 L444.6 534.78 ZM458.08 534.78 L467.89 534.78 L467.89 536.11 L458.08					 536.11 L458.08 534.78 ZM471.57 534.78 L481.34 534.78 L481.34 536.11 L471.57 536.11 L471.57 534.78 ZM485.02					 534.78 L494.83 534.78 L494.83 536.11 L485.02 536.11 L485.02 534.78 ZM498.5 534.78 L508.31 534.78 L508.31					 536.11 L498.5 536.11 L498.5 534.78 ZM511.99 534.78 L521.76 534.78 L521.76 536.11 L511.99 536.11 L511.99					 534.78 ZM525.43 534.78 L535.25 534.78 L535.25 536.11 L525.43 536.11 L525.43 534.78 ZM538.92 534.78 L548.73					 534.78 L548.73 536.11 L538.92 536.11 L538.92 534.78 ZM552.4 534.78 L562.18 534.78 L562.18 536.11 L552.4					 536.11 L552.4 534.78 ZM565.85 534.78 L575.66 534.78 L575.66 536.11 L565.85 536.11 L565.85 534.78 ZM579.34					 534.78 L589.15 534.78 L589.15 536.11 L579.34 536.11 L579.34 534.78 ZM592.82 534.78 L602.59 534.78 L602.59					 536.11 L592.82 536.11 L592.82 534.78 ZM606.27 534.78 L616.08 534.78 L616.08 536.11 L606.27 536.11 L606.27					 534.78 ZM619.75 534.78 L629.57 534.78 L629.57 536.11 L619.75 536.11 L619.75 534.78 ZM633.24 534.78 L643.01					 534.78 L643.01 536.11 L633.24 536.11 L633.24 534.78 ZM646.69 534.78 L651.79 534.78 L651.79 536.11 L646.69					 536.11 L646.69 534.78 Z" class="st14"></path>	</g>	<g id="shape15-37" v:mid="15" v:groupcontext="shape" transform="translate(581.008,-447.297)">		<title>shape21-41</title>		<path d="M0 519.04 L8.51 510.34 L17.01 519.04 L12.76 519.04 L12.76 527.41 L17.01 527.41 L8.51 536.11 L0 527.41 L4.25					 527.41 L4.25 519.04 L0 519.04 Z" class="st15"></path>	</g>	<g id="shape16-39" v:mid="16" v:groupcontext="shape" transform="translate(236.979,-213.854)">		<title>shape22-44</title>		<path d="M0 502.28 C0 498.58 2.99 495.52 6.62 495.52 L86.64 495.52 C90.3 495.52 93.25 498.58 93.25 502.28 L93.25 529.35					 C93.25 533.09 90.3 536.11 86.64 536.11 L6.62 536.11 C2.99 536.11 0 533.09 0 529.35 L0 502.28 Z" class="st2"></path>	</g>	<g id="shape17-41" v:mid="17" v:groupcontext="shape" transform="translate(225.874,-213.854)">		<title>shape23-46</title>		<path d="M0 502.28 C0 498.58 3.35 495.52 7.4 495.52 L96.95 495.52 C101.05 495.52 104.36 498.58 104.36 502.28 L104.36					 529.35 C104.36 533.09 101.05 536.11 96.95 536.11 L7.4 536.11 C3.35 536.11 0 533.09 0 529.35 L0 502.28 Z" class="st16"></path>	</g>	<g id="shape18-43" v:mid="18" v:groupcontext="shape" transform="translate(232.568,-208.055)">		<title>shape24-48</title>		<path d="M0 502.28 C0 498.58 2.99 495.52 6.62 495.52 L86.01 495.52 C89.67 495.52 92.62 498.58 92.62 502.28 L92.62 529.35					 C92.62 533.09 89.67 536.11 86.01 536.11 L6.62 536.11 C2.99 536.11 0 533.09 0 529.35 L0 502.28 Z" class="st2"></path>	</g>	<g id="shape19-45" v:mid="19" v:groupcontext="shape" transform="translate(220.938,-208.055)">		<title>shape25-50</title>		<path d="M0 502.28 C0 498.58 3.35 495.52 7.4 495.52 L96.25 495.52 C100.35 495.52 103.65 498.58 103.65 502.28 L103.65					 529.35 C103.65 533.09 100.35 536.11 96.25 536.11 L7.4 536.11 C3.35 536.11 0 533.09 0 529.35 L0 502.28 Z" class="st16"></path>	</g>	<g id="shape20-47" v:mid="20" v:groupcontext="shape" transform="translate(228.158,-200.967)">		<title>shape26-52</title>		<path d="M0 502.28 C0 498.58 2.99 495.52 6.62 495.52 L86.64 495.52 C90.3 495.52 93.25 498.58 93.25 502.28 L93.25 529.35					 C93.25 533.09 90.3 536.11 86.64 536.11 L6.62 536.11 C2.99 536.11 0 533.09 0 529.35 L0 502.28 Z" class="st2"></path>	</g>	<g id="shape21-49" v:mid="21" v:groupcontext="shape" transform="translate(216.002,-200.967)">		<title>shape27-54</title>		<path d="M0 502.28 C0 498.58 3.35 495.52 7.4 495.52 L96.95 495.52 C101.05 495.52 104.36 498.58 104.36 502.28 L104.36					 529.35 C104.36 533.09 101.05 536.11 96.95 536.11 L7.4 536.11 C3.35 536.11 0 533.09 0 529.35 L0 502.28 Z" class="st16"></path>	</g>	<g id="shape22-51" v:mid="22" v:groupcontext="shape" transform="translate(225.002,-223.056)">		<title>shape28-56</title>		<desc>Hardware Based</desc>		<v:userdefs></v:userdefs>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="44.2811" cy="530.314" width="88.57" height="11.6025"></v:textrect>		<rect x="0" y="524.513" width="88.57" height="11.6" class="st4"></rect>		<text x="15.28" y="534.08" class="st17" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>基于硬件的  </text>		</g>	<g id="shape23-54" v:mid="23" v:groupcontext="shape" transform="translate(228.277,-208.255)">		<title>shape29-60</title>		<desc>Sensor Drivers</desc>		<v:userdefs></v:userdefs>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="41.0066" cy="530.314" width="82.02" height="11.6025"></v:textrect>		<rect x="0" y="524.513" width="82.02" height="11.6" class="st4"></rect>		<text x="0.41" y="534.08" class="st17" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>传感器驱动程序</text>		</g>	<g id="shape24-57" v:mid="24" v:groupcontext="shape" transform="translate(236.979,-284.737)">		<title>shape30-64</title>		<path d="M0 502.28 C0 498.58 2.99 495.52 6.62 495.52 L86.64 495.52 C90.3 495.52 93.25 498.58 93.25 502.28 L93.25 529.35					 C93.25 533.09 90.3 536.11 86.64 536.11 L6.62 536.11 C2.99 536.11 0 533.09 0 529.35 L0 502.28 Z" class="st2"></path>	</g>	<g id="shape25-59" v:mid="25" v:groupcontext="shape" transform="translate(225.874,-284.737)">		<title>shape31-66</title>		<path d="M0 502.28 C0 498.58 3.35 495.52 7.4 495.52 L96.95 495.52 C101.05 495.52 104.36 498.58 104.36 502.28 L104.36					 529.35 C104.36 533.09 101.05 536.11 96.95 536.11 L7.4 536.11 C3.35 536.11 0 533.09 0 529.35 L0 502.28 Z" class="st7"></path>	</g>	<g id="shape26-61" v:mid="26" v:groupcontext="shape" transform="translate(232.568,-278.938)">		<title>shape32-68</title>		<path d="M0 502.28 C0 498.58 2.99 495.52 6.62 495.52 L86.01 495.52 C89.67 495.52 92.62 498.58 92.62 502.28 L92.62 529.35					 C92.62 533.09 89.67 536.11 86.01 536.11 L6.62 536.11 C2.99 536.11 0 533.09 0 529.35 L0 502.28 Z" class="st2"></path>	</g>	<g id="shape27-63" v:mid="27" v:groupcontext="shape" transform="translate(220.938,-278.938)">		<title>shape33-70</title>		<path d="M0 502.28 C0 498.58 3.35 495.52 7.4 495.52 L96.25 495.52 C100.35 495.52 103.65 498.58 103.65 502.28 L103.65					 529.35 C103.65 533.09 100.35 536.11 96.25 536.11 L7.4 536.11 C3.35 536.11 0 533.09 0 529.35 L0 502.28 Z" class="st7"></path>	</g>	<g id="shape28-65" v:mid="28" v:groupcontext="shape" transform="translate(228.158,-272.494)">		<title>shape34-72</title>		<path d="M0 502.28 C0 498.58 2.99 495.52 6.62 495.52 L86.64 495.52 C90.3 495.52 93.25 498.58 93.25 502.28 L93.25 529.35					 C93.25 533.09 90.3 536.11 86.64 536.11 L6.62 536.11 C2.99 536.11 0 533.09 0 529.35 L0 502.28 Z" class="st2"></path>	</g>	<g id="shape29-67" v:mid="29" v:groupcontext="shape" transform="translate(216.002,-272.494)">		<title>shape35-74</title>		<path d="M0 502.28 C0 498.58 3.35 495.52 7.4 495.52 L96.95 495.52 C101.05 495.52 104.36 498.58 104.36 502.28 L104.36					 529.35 C104.36 533.09 101.05 536.11 96.95 536.11 L7.4 536.11 C3.35 536.11 0 533.09 0 529.35 L0 502.28 Z" class="st7"></path>	</g>	<g id="shape30-69" v:mid="30" v:groupcontext="shape" transform="translate(226.252,-292.454)">		<title>shape36-76</title>		<desc>Software Based</desc>		<v:userdefs></v:userdefs>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="42.1208" cy="530.314" width="84.25" height="11.6025"></v:textrect>		<rect x="0" y="524.513" width="84.25" height="11.6" class="st4"></rect>		<text x="13.12" y="534.08" class="st17" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>基于软件的  </text>		</g>	<g id="shape31-72" v:mid="31" v:groupcontext="shape" transform="translate(246.512,-278.775)">		<title>shape37-80</title>		<desc>Sensors</desc>		<v:userdefs></v:userdefs>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="21.8653" cy="530.314" width="43.74" height="11.6025"></v:textrect>		<rect x="0" y="524.513" width="43.73" height="11.6" class="st4"></rect>		<text x="4.47" y="534.08" class="st17" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>传感器</text>		</g>	<g id="shape32-75" v:mid="32" v:groupcontext="shape" transform="translate(194.763,-111.396)">		<title>shape38-84</title>		<path d="M0 487.26 C0 481.86 4.29 477.47 9.57 477.47 L504.62 477.47 C509.9 477.47 514.15 481.86 514.15 487.26 L514.15					 526.37 C514.15 531.76 509.9 536.11 504.62 536.11 L9.57 536.11 C4.29 536.11 0 531.76 0 526.37 L0 487.26 Z" class="st2"></path>	</g>	<g id="shape33-77" v:mid="33" v:groupcontext="shape" transform="translate(194.763,-111.396)">		<title>shape39-86</title>		<path d="M0 487.26 C0 481.86 4.29 477.47 9.57 477.47 L504.62 477.47 C509.9 477.47 514.15 481.86 514.15 487.26 L514.15					 526.37 C514.15 531.76 509.9 536.11 504.62 536.11 L9.57 536.11 C4.29 536.11 0 531.76 0 526.37 L0 487.26 Z" class="st3"></path>	</g>	<g id="shape34-79" v:mid="34" v:groupcontext="shape" transform="translate(204.992,-150.512)">		<title>shape40-88</title>		<desc>Serial Buses</desc>		<v:userdefs></v:userdefs>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="43.6128" cy="528.381" width="87.23" height="15.4689"></v:textrect>		<rect x="0" y="520.643" width="87.23" height="15.47" class="st4"></rect>		<text x="17.74" y="532.57" class="st18" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>串行总线</text>		</g>	<g id="shape35-82" v:mid="35" v:groupcontext="shape" transform="translate(507.917,-249.94)">		<title>shape41-92</title>		<path d="M0 510.9 C0 508.12 2.24 505.83 4.96 505.83 L67.54 505.83 C70.26 505.83 72.46 508.12 72.46 510.9 L72.46 531.08					 C72.46 533.86 70.26 536.11 67.54 536.11 L4.96 536.11 C2.24 536.11 0 533.86 0 531.08 L0 510.9 Z" class="st2"></path>	</g>	<g id="shape36-84" v:mid="36" v:groupcontext="shape" transform="translate(507.917,-249.94)">		<title>shape42-94</title>		<path d="M0 510.9 C0 508.12 2.24 505.83 4.96 505.83 L67.54 505.83 C70.26 505.83 72.46 508.12 72.46 510.9 L72.46 531.08					 C72.46 533.86 70.26 536.11 67.54 536.11 L4.96 536.11 C2.24 536.11 0 533.86 0 531.08 L0 510.9 Z" class="st7"></path>	</g>	<g id="shape38-86" v:mid="38" v:groupcontext="shape" transform="translate(508.32,-251.947)">		<title>shape44-100</title>		<desc>Sensors</desc>		<v:userdefs></v:userdefs>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="35.9672" cy="524.568" width="71.96" height="23.0973"></v:textrect>		<rect x="0" y="513.02" width="71.9374" height="23.0931" class="st4"></rect>		<text x="6.97" y="528.34" class="st8" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>平台传感器</text>		</g>	<g id="shape39-89" v:mid="39" v:groupcontext="shape" transform="translate(553.284,-202.9)">		<title>shape45-104</title>		<path d="M0 510.9 C0 508.12 2.24 505.83 4.96 505.83 L67.54 505.83 C70.26 505.83 72.46 508.12 72.46 510.9 L72.46 531.08					 C72.46 533.86 70.26 536.11 67.54 536.11 L4.96 536.11 C2.24 536.11 0 533.86 0 531.08 L0 510.9 Z" class="st2"></path>	</g>	<g id="shape40-91" v:mid="40" v:groupcontext="shape" transform="translate(553.284,-202.9)">		<title>shape46-106</title>		<path d="M0 510.9 C0 508.12 2.24 505.83 4.96 505.83 L67.54 505.83 C70.26 505.83 72.46 508.12 72.46 510.9 L72.46 531.08					 C72.46 533.86 70.26 536.11 67.54 536.11 L4.96 536.11 C2.24 536.11 0 533.86 0 531.08 L0 510.9 Z" class="st7"></path>	</g>	<g id="shape41-93" v:mid="41" v:groupcontext="shape" transform="translate(566.5,-216.469)">		<title>shape47-108</title>		<desc>Service</desc>		<v:userdefs></v:userdefs>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<rect x="0" y="522.193" width="51.65" height="13.92" class="st4"></rect>	</g>	<g id="shape42-95" v:mid="42" v:groupcontext="shape" transform="translate(553.68,-210)">		<title>shape48-112</title>		<desc>Manager</desc>		<v:userdefs></v:userdefs>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="36.0001" cy="529.154" width="72.02" height="13.9225"></v:textrect>		<rect x="0" y="522.193" width="72" height="13.92" class="st4"></rect>		<text x="7" y="532.92" class="st8" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>服务管理器</text>		</g>	<g id="shape43-98" v:mid="43" v:groupcontext="shape" transform="translate(204.825,-505.729)">		<title>shape49-116</title>		<desc>Linux OS</desc>		<v:userdefs></v:userdefs>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="37.3009" cy="527.221" width="74.61" height="17.7886"></v:textrect>		<rect x="0" y="518.323" width="74.61" height="17.79" class="st4"></rect>		<text x="4.77" y="531.67" class="st19" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>Linux OS</text>		</g>	<g id="shape44-101" v:mid="44" v:groupcontext="shape" transform="translate(204.825,-364.101)">		<title>shape50-120</title>		<desc>QuRT</desc>		<v:userdefs></v:userdefs>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="25.0129" cy="527.221" width="50.03" height="17.7886"></v:textrect>		<rect x="0" y="518.323" width="50.03" height="17.79" class="st4"></rect>		<text x="4.84" y="531.67" class="st19" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>QuRT</text>		</g>	<g id="shape45-104" v:mid="45" v:groupcontext="shape" transform="translate(248.302,-364.101)">		<title>shape51-124</title>		<desc>OS</desc>		<v:userdefs></v:userdefs>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="37.8474" cy="527.221" width="75.73" height="17.7886"></v:textrect>		<rect x="0" y="518.323" width="75.6984" height="17.79" class="st4"></rect>		<text x="8.09" y="532.04" class="st13" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>操作系统</text>		</g>	<g id="shape46-107" v:mid="46" v:groupcontext="shape" transform="translate(187.832,-401.426)">		<title>shape52-128</title>		<rect x="0" y="406.923" width="528.65" height="129.19" class="st15"></rect>	</g>	<g id="shape47-109" v:mid="47" v:groupcontext="shape" transform="translate(598.651,-249.94)">		<title>shape53-131</title>		<path d="M0 510.9 C0 508.12 2.24 505.83 4.96 505.83 L67.54 505.83 C70.26 505.83 72.46 508.12 72.46 510.9 L72.46 531.08					 C72.46 533.86 70.26 536.11 67.54 536.11 L4.96 536.11 C2.24 536.11 0 533.86 0 531.08 L0 510.9 Z" class="st2"></path>	</g>	<g id="shape48-111" v:mid="48" v:groupcontext="shape" transform="translate(598.651,-249.94)">		<title>shape54-133</title>		<path d="M0 510.9 C0 508.12 2.24 505.83 4.96 505.83 L67.54 505.83 C70.26 505.83 72.46 508.12 72.46 510.9 L72.46 531.08					 C72.46 533.86 70.26 536.11 67.54 536.11 L4.96 536.11 C2.24 536.11 0 533.86 0 531.08 L0 510.9 Z" class="st7"></path>	</g>	<g id="shape49-113" v:mid="49" v:groupcontext="shape" transform="translate(599.04,-256.948)">		<title>shape55-135</title>		<desc>Utilities</desc>		<v:userdefs></v:userdefs>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="35.9954" cy="529.154" width="72" height="13.9225"></v:textrect>		<rect x="0" y="522.193" width="72" height="13.92" class="st4"></rect>		<text x="12.8" y="532.92" class="st8" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>实用工具</text>		</g>	<g id="shape50-116" v:mid="50" v:groupcontext="shape" transform="translate(403.952,-193.234)">		<title>shape56-139</title>		<path d="M3.78 536.11 C1.69 536.11 0 534.38 0 532.25 L0 399.5 C0 397.37 1.69 395.64 3.78 395.64 L18.9 395.64 C20.99 395.64					 22.68 397.37 22.68 399.5 L22.68 532.25 C22.68 534.38 20.99 536.11 18.9 536.11 L3.78 536.11 Z" class="st7"></path>	</g>	<g id="shape51-118" v:mid="51" v:groupcontext="shape" transform="translate(-111.708,337.849) rotate(-90)">		<title>shape57-141</title>		<desc>QSH Sensor API</desc>		<v:userdefs></v:userdefs>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="64.593" cy="527.418" width="129.19" height="17.3941"></v:textrect>		<rect x="0" y="518.723" width="129.19" height="17.39" class="st4"></rect>		<text x="11.45" y="532.13" class="st20" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>QSH <tspan class="st6">传感器</tspan> API</text>		</g>	<g id="shape52-122" v:mid="52" v:groupcontext="shape" transform="translate(499.726,-193.234)">		<title>shape58-145</title>		<rect x="0" y="395.643" width="179.58" height="140.47" class="st15"></rect>	</g>	<g id="shape53-124" v:mid="53" v:groupcontext="shape" transform="translate(581.008,-322.756)">		<title>shape59-148</title>		<path d="M0 446.28 L8.51 435.87 L17.01 446.28 L12.76 446.28 L12.76 525.7 L17.01 525.7 L8.51 536.11 L0 525.7 L4.25 525.7					 L4.25 446.28 L0 446.28 Z" class="st21"></path>	</g>	<g id="shape54-126" v:mid="54" v:groupcontext="shape" transform="translate(330.863,-289.892)">		<title>shape61-150</title>		<path d="M63.64 518.07 L72.46 527.09 L63.64 536.11 L63.64 531.6 L8.82 531.6 L8.82 536.11 L0 527.09 L8.82 518.07 L8.82					 522.58 L63.64 522.58 L63.64 518.07 Z" class="st2"></path>	</g>	<g id="shape55-128" v:mid="55" v:groupcontext="shape" transform="translate(330.863,-289.892)">		<title>shape62-152</title>		<path d="M63.64 518.07 L72.46 527.09 L63.64 536.11 L63.64 531.6 L8.82 531.6 L8.82 536.11 L0 527.09 L8.82 518.07 L8.82					 522.58 L63.64 522.58 L63.64 518.07 Z" class="st15"></path>	</g>	<g id="shape56-130" v:mid="56" v:groupcontext="shape" transform="translate(427.266,-254.451)">		<title>shape63-155</title>		<path d="M63.64 518.07 L72.46 527.09 L63.64 536.11 L63.64 531.6 L8.82 531.6 L8.82 536.11 L0 527.09 L8.82 518.07 L8.82					 522.58 L63.64 522.58 L63.64 518.07 Z" class="st2"></path>	</g>	<g id="shape57-132" v:mid="57" v:groupcontext="shape" transform="translate(427.266,-254.451)">		<title>shape64-157</title>		<path d="M63.64 518.07 L72.46 527.09 L63.64 536.11 L63.64 531.6 L8.82 531.6 L8.82 536.11 L0 527.09 L8.82 518.07 L8.82					 522.58 L63.64 522.58 L63.64 518.07 Z" class="st15"></path>	</g>	<g id="shape58-134" v:mid="58" v:groupcontext="shape" transform="translate(270.374,-170.68)">		<title>shape65-160</title>		<path d="M0 514.2 L8.82 505.18 L17.64 514.2 L13.23 514.2 L13.23 527.09 L17.64 527.09 L8.82 536.11 L0 527.09 L4.41 527.09					 L4.41 514.2 L0 514.2 Z" class="st22"></path>	</g>	<g id="shape59-136" v:mid="59" v:groupcontext="shape" transform="translate(270.374,-170.68)">		<title>shape66-162</title>		<path d="M0 514.2 L8.82 505.18 L17.64 514.2 L13.23 514.2 L13.23 527.09 L17.64 527.09 L8.82 536.11 L0 527.09 L4.41 527.09					 L4.41 514.2 L0 514.2 Z" class="st23"></path>	</g>	<g id="shape60-138" v:mid="60" v:groupcontext="shape" transform="translate(330.863,-219.009)">		<title>shape67-165</title>		<path d="M63.95 518.71 L72.46 527.41 L63.95 536.11 L63.95 531.76 L8.51 531.76 L8.51 536.11 L0 527.41 L8.51 518.71 L8.51					 523.06 L63.95 523.06 L63.95 518.71 Z" class="st2"></path>	</g>	<g id="shape61-140" v:mid="61" v:groupcontext="shape" transform="translate(330.863,-219.009)">		<title>shape68-167</title>		<path d="M63.95 518.71 L72.46 527.41 L63.95 536.11 L63.95 531.76 L8.51 531.76 L8.51 536.11 L0 527.41 L8.51 518.71 L8.51					 523.06 L63.95 523.06 L63.95 518.71 Z" class="st15"></path>	</g>	<g id="shape62-142" v:mid="62" v:groupcontext="shape" transform="translate(187.832,-36.003)">		<title>shape69-170</title>		<rect x="0" y="472.963" width="528.65" height="63.15" class="st15"></rect>	</g>	<g id="shape63-144" v:mid="63" v:groupcontext="shape" transform="translate(402.085,-37.2568)">		<title>shape70-173</title>		<desc>Sensor Hardware</desc>		<v:userdefs></v:userdefs>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="59.5988" cy="524.517" width="119.21" height="23.198"></v:textrect>		<rect x="0" y="512.913" width="119.2" height="23.2" class="st4"></rect>		<text x="27.25" y="528.71" class="st18" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>传感器硬件</text>		</g>	<g id="shape64-147" v:mid="64" v:groupcontext="shape" transform="translate(200.434,-63.7117)">		<title>shape71-177</title>		<path d="M0 512.91 L0 536.11 L90.73 536.11 L90.73 512.91 L0 512.91 Z" class="st24"></path>	</g>	<g id="shape65-149" v:mid="65" v:groupcontext="shape" transform="translate(200.434,-61.2)">		<title>shape72-179</title>		<rect x="0" y="510.401" width="90.73" height="25.7117" class="st15"></rect>	</g>	<g id="shape66-151" v:mid="66" v:groupcontext="shape" transform="translate(200.532,-66.5756)">		<title>shape73-182</title>		<desc>Accelerometer</desc>		<v:userdefs></v:userdefs>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="44.808" cy="529.154" width="89.62" height="13.9225"></v:textrect>		<rect x="0" y="522.193" width="89.62" height="13.92" class="st4"></rect>		<text x="20.81" y="533.05" class="st25" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>加速度计</text>		</g>	<g id="shape67-154" v:mid="67" v:groupcontext="shape" transform="translate(303.769,-61.1342)">		<title>shape74-186</title>		<path d="M0 510.34 L0 536.11 L90.73 536.11 L90.73 510.34 L0 510.34 Z" class="st24"></path>	</g>	<g id="shape68-156" v:mid="68" v:groupcontext="shape" transform="translate(303.769,-61.2)">		<title>shape75-188</title>		<rect x="0" y="510.405" width="90.73" height="25.7073" class="st15"></rect>	</g>	<g id="shape69-158" v:mid="69" v:groupcontext="shape" transform="translate(314.454,-66.0356)">		<title>shape76-191</title>		<desc>Gyroscope</desc>		<v:userdefs></v:userdefs>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="34.0223" cy="529.154" width="68.05" height="13.9225"></v:textrect>		<rect x="0" y="522.193" width="68.05" height="13.92" class="st4"></rect>		<text x="16.02" y="533.05" class="st25" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>陀螺仪</text>		</g>	<g id="shape70-161" v:mid="70" v:groupcontext="shape" transform="translate(406.473,-60.9206)">		<title>shape77-195</title>		<desc>Magnetometer</desc>		<v:userdefs></v:userdefs>		<v:textblock v:margins="rect(4,4,4,4)"></v:textblock>		<v:textrect cx="45.3649" cy="523.59" width="90.74" height="25.0506"></v:textrect>		<path d="M0 511.06 L0 536.11 L90.73 536.11 L90.73 511.06 L0 511.06 Z" class="st24"></path>		<text x="15.36" y="527.49" class="st26" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>地磁传感器</text>		</g>	<g id="shape71-164" v:mid="71" v:groupcontext="shape" transform="translate(406.473,-61.2)">		<title>shape78-198</title>		<rect x="0" y="510.401" width="90.73" height="25.7117" class="st15"></rect>	</g>	<g id="shape72-166" v:mid="72" v:groupcontext="shape" transform="translate(612.513,-63.7117)">		<title>shape85-201</title>		<path d="M0 512.91 L0 536.11 L90.73 536.11 L90.73 512.91 L0 512.91 Z" class="st2"></path>	</g>	<g id="shape73-168" v:mid="73" v:groupcontext="shape" transform="translate(242.335,-86.6681)">		<title>shape88-203</title>		<path d="M3.82 511.06 L3.82 530.76 L2.52 530.76 L2.52 511.06 L3.82 511.06 ZM6.3 529.67 L3.15 536.11 L0 529.67 L6.3 529.67					 Z" class="st14"></path>	</g>	<g id="shape74-170" v:mid="74" v:groupcontext="shape" transform="translate(345.67,-86.6681)">		<title>shape89-205</title>		<path d="M3.82 511.06 L3.82 530.76 L2.52 530.76 L2.52 511.06 L3.82 511.06 ZM6.3 529.67 L3.15 536.11 L0 529.67 L6.3 529.67					 Z" class="st14"></path>	</g>	<g id="shape75-172" v:mid="75" v:groupcontext="shape" transform="translate(448.374,-86.6681)">		<title>shape90-207</title>		<path d="M3.82 511.06 L3.82 530.76 L2.52 530.76 L2.52 511.06 L3.82 511.06 ZM6.3 529.67 L3.15 536.11 L0 529.67 L6.3 529.67					 Z" class="st14"></path>	</g>	<g id="shape76-174" v:mid="76" v:groupcontext="shape" transform="translate(551.709,-86.6681)">		<title>shape91-209</title>		<path d="M3.82 511.06 L3.82 530.76 L2.52 530.76 L2.52 511.06 L3.82 511.06 ZM6.3 529.67 L3.15 536.11 L0 529.67 L6.3 529.67					 Z" class="st14"></path>	</g>	<g id="shape77-176" v:mid="77" v:groupcontext="shape" transform="translate(654.414,-86.6681)">		<title>shape92-211</title>		<path d="M3.82 511.06 L3.82 530.76 L2.52 530.76 L2.52 511.06 L3.82 511.06 ZM6.3 529.67 L3.15 536.11 L0 529.67 L6.3 529.67					 Z" class="st14"></path>	</g>	<g id="shape78-178" v:mid="78" v:groupcontext="shape" transform="translate(187.832,-105.597)">		<title>shape93-213</title>		<rect x="0" y="253.233" width="528.65" height="282.88" class="st15"></rect>	</g>	<g id="shape79-180" v:mid="79" v:groupcontext="shape" transform="translate(327.712,-129.439)">		<title>shape94-216</title>		<path d="M0 516.78 C0 514.65 1.69 512.91 3.78 512.91 L47.26 512.91 C49.34 512.91 51.04 514.65 51.04 516.78 L51.04 532.25					 C51.04 534.38 49.34 536.11 47.26 536.11 L3.78 536.11 C1.69 536.11 0 534.38 0 532.25 L0 516.78 Z" class="st2"></path>	</g>	<g id="shape80-182" v:mid="80" v:groupcontext="shape" transform="translate(327.712,-129.439)">		<title>shape95-218</title>		<path d="M0 516.78 C0 514.65 1.69 512.91 3.78 512.91 L47.26 512.91 C49.34 512.91 51.04 514.65 51.04 516.78 L51.04 532.25					 C51.04 534.38 49.34 536.11 47.26 536.11 L3.78 536.11 C1.69 536.11 0 534.38 0 532.25 L0 516.78 Z" class="st7"></path>	</g>	<g id="shape81-184" v:mid="81" v:groupcontext="shape" transform="translate(344.474,-132.628)">		<title>shape96-220</title>		<desc>I3C</desc>		<v:userdefs></v:userdefs>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="12.1508" cy="529.154" width="24.31" height="13.9225"></v:textrect>		<rect x="0" y="522.193" width="24.3" height="13.92" class="st4"></rect>		<text x="3.13" y="532.63" class="st27" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>I3C</text>		</g>	<g id="shape82-187" v:mid="82" v:groupcontext="shape" transform="translate(393.241,-129.439)">		<title>shape97-224</title>		<path d="M0 516.78 C0 514.65 1.69 512.91 3.78 512.91 L47.89 512.91 C49.97 512.91 51.67 514.65 51.67 516.78 L51.67 532.25					 C51.67 534.38 49.97 536.11 47.89 536.11 L3.78 536.11 C1.69 536.11 0 534.38 0 532.25 L0 516.78 Z" class="st2"></path>	</g>	<g id="shape83-189" v:mid="83" v:groupcontext="shape" transform="translate(393.241,-129.439)">		<title>shape98-226</title>		<path d="M0 516.78 C0 514.65 1.69 512.91 3.78 512.91 L47.89 512.91 C49.97 512.91 51.67 514.65 51.67 516.78 L51.67 532.25					 C51.67 534.38 49.97 536.11 47.89 536.11 L3.78 536.11 C1.69 536.11 0 534.38 0 532.25 L0 516.78 Z" class="st7"></path>	</g>	<g id="shape84-191" v:mid="84" v:groupcontext="shape" transform="translate(410.355,-132.628)">		<title>shape99-228</title>		<desc>SPI</desc>		<v:userdefs></v:userdefs>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="12.522" cy="529.154" width="25.05" height="13.9225"></v:textrect>		<rect x="0" y="522.193" width="25.05" height="13.92" class="st4"></rect>		<text x="3.17" y="532.63" class="st27" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>SPI</text>		</g>	<g id="shape85-194" v:mid="85" v:groupcontext="shape" transform="translate(459.4,-129.439)">		<title>shape100-232</title>		<path d="M0 516.78 C0 514.65 1.69 512.91 3.78 512.91 L47.26 512.91 C49.34 512.91 51.04 514.65 51.04 516.78 L51.04 532.25					 C51.04 534.38 49.34 536.11 47.26 536.11 L3.78 536.11 C1.69 536.11 0 534.38 0 532.25 L0 516.78 Z" class="st2"></path>	</g>	<g id="shape86-196" v:mid="86" v:groupcontext="shape" transform="translate(459.4,-129.439)">		<title>shape101-234</title>		<path d="M0 516.78 C0 514.65 1.69 512.91 3.78 512.91 L47.26 512.91 C49.34 512.91 51.04 514.65 51.04 516.78 L51.04 532.25					 C51.04 534.38 49.34 536.11 47.26 536.11 L3.78 536.11 C1.69 536.11 0 534.38 0 532.25 L0 516.78 Z" class="st7"></path>	</g>	<g id="shape87-198" v:mid="87" v:groupcontext="shape" transform="translate(476.232,-132.628)">		<title>shape102-236</title>		<desc>I2C</desc>		<v:userdefs></v:userdefs>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="12.1508" cy="529.154" width="24.31" height="13.9225"></v:textrect>		<rect x="0" y="522.193" width="24.3" height="13.92" class="st4"></rect>		<text x="3.13" y="532.63" class="st27" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>I2C</text>		</g>	<g id="shape88-201" v:mid="88" v:groupcontext="shape" transform="translate(524.93,-129.439)">		<title>shape103-240</title>		<path d="M0 516.78 C0 514.65 1.69 512.91 3.78 512.91 L47.26 512.91 C49.34 512.91 51.04 514.65 51.04 516.78 L51.04 532.25					 C51.04 534.38 49.34 536.11 47.26 536.11 L3.78 536.11 C1.69 536.11 0 534.38 0 532.25 L0 516.78 Z" class="st2"></path>	</g>	<g id="shape89-203" v:mid="89" v:groupcontext="shape" transform="translate(524.93,-129.439)">		<title>shape104-242</title>		<path d="M0 516.78 C0 514.65 1.69 512.91 3.78 512.91 L47.26 512.91 C49.34 512.91 51.04 514.65 51.04 516.78 L51.04 532.25					 C51.04 534.38 49.34 536.11 47.26 536.11 L3.78 536.11 C1.69 536.11 0 534.38 0 532.25 L0 516.78 Z" class="st7"></path>	</g>	<g id="shape90-205" v:mid="90" v:groupcontext="shape" transform="translate(535.138,-132.628)">		<title>shape105-244</title>		<desc>UART</desc>		<v:userdefs></v:userdefs>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="19.9275" cy="529.154" width="39.86" height="13.9225"></v:textrect>		<rect x="0" y="522.193" width="39.86" height="13.92" class="st4"></rect>		<text x="4.14" y="532.63" class="st27" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>UART</text>		</g>	<g id="shape91-208" v:mid="91" v:groupcontext="shape" transform="translate(507.6,-62.0488)">		<title>shape110-248</title>		<desc>ALS/Prox</desc>		<v:userdefs></v:userdefs>		<v:textblock v:margins="rect(4,4,4,4)"></v:textblock>		<v:textrect cx="46.7983" cy="523.587" width="93.61" height="25.0506"></v:textrect>		<rect x="0" y="511.062" width="93.6" height="25.0506" class="st28"></rect>		<text x="11.55" y="520.66" class="st29" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>光敏传感器<tspan class="st30"> </tspan><tspan class="st30">(</tspan><tspan class="st30">ALS</tspan><tspan class="st30">)</tspan><tspan class="st30" v:langid="2052"> </tspan><tspan x="10.8" dy="1.3em" class="st31">接近传感器</tspan><tspan class="st30"> </tspan><tspan class="st30">(</tspan><tspan class="st30">Prox</tspan><tspan class="st30">)</tspan></text>		</g>	<g id="shape92-221" v:mid="92" v:groupcontext="shape" transform="translate(612.513,-61.65)">		<title>shape111-251</title>		<desc>Other sensors</desc>		<v:userdefs></v:userdefs>		<v:textblock v:margins="rect(4,4,4,4)"></v:textblock>		<v:textrect cx="45.3649" cy="523.515" width="90.74" height="25.1946"></v:textrect>		<rect x="0" y="510.918" width="90.7332" height="25.1946" class="st28"></rect>		<text x="15.36" y="527.42" class="st26" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>其他传感器</text>		</g>	<g id="shape93-224" v:mid="93" v:groupcontext="shape" transform="translate(237.377,-6.404)">		<title>shape112-254</title>		<desc>Third-party</desc>		<v:userdefs>			<v:ud v:nameu="CTypeTopLeftSnip" v:prompt="" v:val="VT0(0):5"></v:ud>			<v:ud v:nameu="CTypeTopRightSnip" v:prompt="" v:val="VT0(0):5"></v:ud>			<v:ud v:nameu="CTypeBotLeftSnip" v:prompt="" v:val="VT0(0):5"></v:ud>			<v:ud v:nameu="CTypeBotRightSnip" v:prompt="" v:val="VT0(0):5"></v:ud>			<v:ud v:nameu="CornerLockHoriz" v:prompt="" v:val="VT0(0):5"></v:ud>			<v:ud v:nameu="CornerLockVert" v:prompt="" v:val="VT0(0):5"></v:ud>			<v:ud v:nameu="CornerLockDiag" v:prompt="" v:val="VT0(0):5"></v:ud>			<v:ud v:nameu="TopLeftOffset" v:prompt="" v:val="VT0(0):26"></v:ud>			<v:ud v:nameu="TopRightOffset" v:prompt="" v:val="VT0(0):26"></v:ud>			<v:ud v:nameu="BotLeftOffset" v:prompt="" v:val="VT0(0):26"></v:ud>			<v:ud v:nameu="BotRightOffset" v:prompt="" v:val="VT0(0):26"></v:ud>			<v:ud v:nameu="visVersion" v:prompt="" v:val="VT0(15):26"></v:ud>		</v:userdefs>		<v:textblock v:margins="rect(4,4,4,4)"></v:textblock>		<v:textrect cx="48.3733" cy="524.517" width="96.76" height="23.198"></v:textrect>		<path d="M9.68 536.11 L87.08 536.11 A9.67483 9.67483 -180 0 0 96.75 526.44 L96.75 522.59 A9.67483 9.67483 -180 0 0 87.08					 512.91 L9.68 512.91 A9.67483 9.67483 -180 0 0 -0 522.59 L0 526.44 A9.67483 9.67483 -180 0 0 9.68 536.11					 Z" class="st32"></path>		<text x="30.37" y="528.42" class="st33" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>第三方</text>		</g>	<g id="shape94-227" v:mid="94" v:groupcontext="shape" transform="translate(361.127,-6.404)">		<title>shape114-257</title>		<desc>Upstream</desc>		<v:userdefs>			<v:ud v:nameu="CTypeTopLeftSnip" v:prompt="" v:val="VT0(0):5"></v:ud>			<v:ud v:nameu="CTypeTopRightSnip" v:prompt="" v:val="VT0(0):5"></v:ud>			<v:ud v:nameu="CTypeBotLeftSnip" v:prompt="" v:val="VT0(0):5"></v:ud>			<v:ud v:nameu="CTypeBotRightSnip" v:prompt="" v:val="VT0(0):5"></v:ud>			<v:ud v:nameu="CornerLockHoriz" v:prompt="" v:val="VT0(0):5"></v:ud>			<v:ud v:nameu="CornerLockVert" v:prompt="" v:val="VT0(0):5"></v:ud>			<v:ud v:nameu="CornerLockDiag" v:prompt="" v:val="VT0(0):5"></v:ud>			<v:ud v:nameu="TopLeftOffset" v:prompt="" v:val="VT0(0):26"></v:ud>			<v:ud v:nameu="TopRightOffset" v:prompt="" v:val="VT0(0):26"></v:ud>			<v:ud v:nameu="BotLeftOffset" v:prompt="" v:val="VT0(0):26"></v:ud>			<v:ud v:nameu="BotRightOffset" v:prompt="" v:val="VT0(0):26"></v:ud>			<v:ud v:nameu="visVersion" v:prompt="" v:val="VT0(15):26"></v:ud>		</v:userdefs>		<v:textblock v:margins="rect(4,4,4,4)"></v:textblock>		<v:textrect cx="48.3733" cy="524.517" width="96.76" height="23.198"></v:textrect>		<path d="M9.68 536.11 L87.08 536.11 A9.67483 9.67483 -180 0 0 96.75 526.44 L96.75 522.59 A9.67483 9.67483 -180 0 0 87.08					 512.91 L9.68 512.91 A9.67483 9.67483 -180 0 0 -0 522.59 L0 526.44 A9.67483 9.67483 -180 0 0 9.68 536.11					 Z" class="st34"></path>		<text x="36.37" y="528.42" class="st33" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>上游</text>		</g>	<g id="shape95-230" v:mid="95" v:groupcontext="shape" transform="translate(484.876,-6.404)">		<title>shape116-260</title>		<desc>Qualcomm</desc>		<v:userdefs>			<v:ud v:nameu="CTypeTopLeftSnip" v:prompt="" v:val="VT0(0):5"></v:ud>			<v:ud v:nameu="CTypeTopRightSnip" v:prompt="" v:val="VT0(0):5"></v:ud>			<v:ud v:nameu="CTypeBotLeftSnip" v:prompt="" v:val="VT0(0):5"></v:ud>			<v:ud v:nameu="CTypeBotRightSnip" v:prompt="" v:val="VT0(0):5"></v:ud>			<v:ud v:nameu="CornerLockHoriz" v:prompt="" v:val="VT0(0):5"></v:ud>			<v:ud v:nameu="CornerLockVert" v:prompt="" v:val="VT0(0):5"></v:ud>			<v:ud v:nameu="CornerLockDiag" v:prompt="" v:val="VT0(0):5"></v:ud>			<v:ud v:nameu="TopLeftOffset" v:prompt="" v:val="VT0(0):26"></v:ud>			<v:ud v:nameu="TopRightOffset" v:prompt="" v:val="VT0(0):26"></v:ud>			<v:ud v:nameu="BotLeftOffset" v:prompt="" v:val="VT0(0):26"></v:ud>			<v:ud v:nameu="BotRightOffset" v:prompt="" v:val="VT0(0):26"></v:ud>			<v:ud v:nameu="visVersion" v:prompt="" v:val="VT0(15):26"></v:ud>		</v:userdefs>		<v:textblock v:margins="rect(4,4,4,4)"></v:textblock>		<v:textrect cx="48.3733" cy="524.517" width="96.76" height="23.198"></v:textrect>		<path d="M9.68 536.11 L87.08 536.11 A9.67483 9.67483 -180 0 0 96.75 526.44 L96.75 522.59 A9.67483 9.67483 -180 0 0 87.08					 512.91 L9.68 512.91 A9.67483 9.67483 -180 0 0 -0 522.59 L0 526.44 A9.67483 9.67483 -180 0 0 9.68 536.11					 Z" class="st35"></path>		<text x="19.37" y="528.12" class="st36" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>Qualcomm</text>		</g>	<g id="shape96-233" v:mid="96" v:groupcontext="shape" transform="translate(608.626,-6.404)">		<title>shape118-263</title>		<desc>Hardware</desc>		<v:userdefs>			<v:ud v:nameu="CTypeTopLeftSnip" v:prompt="" v:val="VT0(0):5"></v:ud>			<v:ud v:nameu="CTypeTopRightSnip" v:prompt="" v:val="VT0(0):5"></v:ud>			<v:ud v:nameu="CTypeBotLeftSnip" v:prompt="" v:val="VT0(0):5"></v:ud>			<v:ud v:nameu="CTypeBotRightSnip" v:prompt="" v:val="VT0(0):5"></v:ud>			<v:ud v:nameu="CornerLockHoriz" v:prompt="" v:val="VT0(0):5"></v:ud>			<v:ud v:nameu="CornerLockVert" v:prompt="" v:val="VT0(0):5"></v:ud>			<v:ud v:nameu="CornerLockDiag" v:prompt="" v:val="VT0(0):5"></v:ud>			<v:ud v:nameu="TopLeftOffset" v:prompt="" v:val="VT0(0):26"></v:ud>			<v:ud v:nameu="TopRightOffset" v:prompt="" v:val="VT0(0):26"></v:ud>			<v:ud v:nameu="BotLeftOffset" v:prompt="" v:val="VT0(0):26"></v:ud>			<v:ud v:nameu="BotRightOffset" v:prompt="" v:val="VT0(0):26"></v:ud>			<v:ud v:nameu="visVersion" v:prompt="" v:val="VT0(15):26"></v:ud>		</v:userdefs>		<v:textblock v:margins="rect(4,4,4,4)"></v:textblock>		<v:textrect cx="48.3733" cy="524.517" width="96.76" height="23.198"></v:textrect>		<path d="M9.68 536.11 L87.08 536.11 A9.67483 9.67483 -180 0 0 96.75 526.44 L96.75 522.59 A9.67483 9.67483 -180 0 0 87.08					 512.91 L9.68 512.91 A9.67483 9.67483 -180 0 0 -0 522.59 L0 526.44 A9.67483 9.67483 -180 0 0 9.68 536.11					 Z" class="st37"></path>		<text x="36.37" y="528.42" class="st26" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>硬件</text>		</g></g>
</svg>

下表列出了用于了解 QSH 框架及其用法的 QSH 术语。

Table : QSH 术语

| **项目** | **说明** |
| --- | --- |
| 传感器 | <ul class="ul" id="architecture__ul_iy1_bt4_p1c_monicapa_03-02-24-1018-25-808"><br>                                    <li class="li">生成单一类型数据，例如，加速度计、陀螺仪、定时器、中断、旋转矢量等</li><br><br>                                    <li class="li">处理异步数据</li><br><br>                                    <li class="li">发布必需属性和自定义属性，并管理其实例</li><br><br>                                </ul> |
| 传感器实例 | <ul class="ul" id="architecture__ul_msk_ft4_p1c_monicapa_03-02-24-1019-42-720"><br>                                    <li class="li">在特定配置下运行，发布输出数据事件，并且可以按客户端请求创建或在多个请求之间共享</li><br><br>                                    <li class="li">物理传感器通常共享单一实例</li><br><br>                                </ul> |
| 传感器唯一标识符 (SUID) | 每个传感器唯一的 128 位 ID |
| 服务 | 为通用实用工具提供同步接口的模块 |
| 数据流 | 客户端与数据源间的唯一连接 |
| 请求 | 由客户端发送至传感器的配置消息（参见 `sns_request.h` 文件） |
| 事件 | 传感器实例生成的异步输出数据消息（参见 `sns_sensor_event.h` 文件） |
| Nanopb | Nanopb 是一个用 ANSI C 实现的小代码量协议缓冲区 |

以下资源提供了有关 QSH 架构的深入信息：

- **应用处理器软件模块**
    - **应用处理器**：该模块包含与应用处理器端的 QSH 客户端 API 交互的*应用程序 main() 或入口函数*。
    - **QSH 客户端 API**：该区块提供 high-level API 来访问 QSH 提供的服务。它通过抽象系统复杂性来简化应用程序开发，并使其能够专注于应用程序逻辑。更多信息，参见[接口](https://docs.qualcomm.com/bundle/publicresource/topics/80-70014-7/qsh_api_reference.html)。
- **低功耗处理器软件模块**
    - **客户端管理器**：该模块负责低功耗处理器与应用处理器的所有通信。客户端管理器负责以下功能：
        - 转换传入请求：客户端管理器接受传入的请求，并将其转换为 QSH 可以理解的格式。
        - 转换传出指示：当客户端管理器从 QSH 接收事件消息时，客户端管理器会将这些事件消息转换为可在 QSH 外部理解的格式的传出指示。
        - 保证批处理选项：如果客户端指定了某些批处理（本地存储/累积）选项，则客户端管理器将确保满足批处理选项。这意味着它会检查数据是否以客户端指定的方式进行分组和发送。
    - **服务管理器**：QSH 通过其服务管理器提供同步服务。传感器和传感器实例 API 使用回调连接到此服务管理器。
        QSH 中可用的服务（也称为 QSH 服务）列在 `adsp_proc/qsh_platform/inc/sns_service.h` 文件中。下表介绍了对设备驱动程序至关重要的关键 QSH 服务。

Table : QSH 服务

        | QSH 服务 | 说明 |
        | --- | --- |
        | 流服务 | <ul class="ul"><br>                                                <li class="li">流服务支持创建和删除传感器数据流。</li><br><br>                                                <li class="li">有关通过数据流发送请求和接收事件的流 API，参见 <code class="ph codeph">adsp_proc/qsh_platform/inc/sns_data_stream.h</code> 文件。</li><br><br>                                            </ul> |
        | 属性服务 | <ul class="ul"><br>                                                <li class="li">属性服务允许传感器发布其属性或功能。</li><br><br>                                                <li class="li">所有标准属性 ID 和预期值类型均在 <code class="ph codeph">sns_std_sensor.proto</code> 文件中定义。</li><br><br>                                                <li class="li">所有属性值必须采用 nanopb 编码格式。</li><br><br>                                                <li class="li">有关 API 的详细信息，参见 <code class="ph codeph">adsp_proc/qsh_platform/inc/services/sns_attribute_service.h</code> 文件。</li><br><br>                                            </ul> |
        | 诊断服务 | <ul class="ul"><br>                                                <li class="li">诊断服务提供调试消息和数据日志数据包服务，并定义标准日志数据包 ID。</li><br><br>                                                <li class="li">有关 API 的详细信息，参见 <code class="ph codeph">adsp_proc/qsh_platform/inc/services/sns_diag_service.h</code> 文件。</li><br><br>                                            </ul> |
        | 事件服务 | <ul class="ul"><br>                                                <li class="li">凭借事件服务可发布来自源传感器实例的输出事件。</li><br><br>                                                <li class="li">有关 API 的详细信息，参见 <code class="ph codeph">adsp_proc/qsh_platform/inc/services/sns_event_service.h</code> 文件。</li><br><br>                                            </ul> |
        | 电源服务 | <ul class="ul"><br>                                                <li class="li">电源服务可供物理传感器注册和投票（开/关）。</li><br><br>                                                <li class="li">有关 API 的详细信息，参见 <code class="ph codeph">adsp_proc/qsh_platform/inc/services/sns_pwr_rail_service.h</code> 文件。</li><br><br>                                            </ul> |
        | 同步 COM 端口 (SCP) 服务 | <ul class="ul"><br>                                                <li class="li">SCP 服务可用于物理传感器注册/注销 COM 端口以及通过 COM 端口执行同步传输。</li><br><br>                                                <li class="li">有关 API 的详细信息，参见 <code class="ph codeph">adsp_proc/qsh_platform/inc/services/sns_sync_com_port_service.h</code> 文件。</li><br><br>                                            </ul> |
        | GPIO 服务 | <ul class="ul"><br>                                                <li class="li">GPIO 服务可供物理传感器读取/写入 GPIO 值。</li><br><br>                                                <li class="li">该服务有效地抽象了一个 low-level CoreBSP 层来控制 GPIO。</li><br><br>                                                <li class="li">有关 API 的详细信息，参见 <code class="ph codeph">adsp_proc/qsh_platform/inc/services/sns_gpio_service.h</code> 文件。</li><br><br>                                            </ul> |
        | Island 服务 | <ul class="ul"><br>                                                <li class="li">物理传感器可以使用 Island 服务来请求 Island 出口。</li><br><br>                                                <li class="li">当应用程序必须访问 DDR 或非 Island 资源时，应用程序代码可以使用 Island 服务。</li><br><br>                                                <li class="li">有关 API 的详细信息，参见 <code class="ph codeph">adsp_proc/qsh_platform/inc/services/sns_island_service.h</code> 文件。</li><br><br>                                            </ul> |
        | 文件系统服务 | <ul class="ul"><br>                                                <li class="li">文件系统服务可供物理传感器使用，用于文件服务管理。</li><br><br>                                                <li class="li">抽象文件系统是应用处理器堆栈的一部分，可用于从低功耗处理器进行本地访问。</li><br><br>                                                <li class="li">有关 API 的详细信息，参见 <code class="ph codeph">adsp_proc/qsh_platform/inc/services/sns_file_service.h</code> 文件。</li><br><br>                                            </ul> |
    - **平台传感器**：QSH 提供一些内置传感器，用于平台或硬件特定的抽象，这些抽象可以被其他传感器和传感器实例使用。下表介绍了平台传感器。

Table : 平台传感器

        | 平台传感器 | 说明 |
        | --- | --- |
        | 注册表传感器 | <ul class="ul" id="architecture__ul_alm_4gl_sbc_rajearor_06-13-24-1518-34-750"><br>                                                <li class="li">QSH 中的注册表传感器为传感器提供了一个接口，用于从持久内存访问注册表数据。它允许传感器创建数据流、发送请求、接收数据事件、订阅更新以及删除不必要的流。</li><br><br>                                                <li class="li">有关注册表传感器的详细信息，参见 <a href="https://docs.qualcomm.com/bundle/resource/topics/80-70014-7A/overview.html" target="_blank" class="xref cursorpointer" onclick="Window.BookmapComponent.navigateExternalFile('https://docs.qualcomm.com/bundle/resource/topics/80-70014-7A/overview.html')">Qualcomm Linux Sensors Guide - Addendum</a> 中的<em class="ph i">配置</em>。<div class="note note" id="architecture__note_cfv_gn4_vbc_rajearor_06-24-24-1929-30-361"><span class="notetitle">Note:</span> <a href="https://docs.qualcomm.com/bundle/resource/topics/80-70014-7A/overview.html" target="_blank" class="xref cursorpointer" onclick="Window.BookmapComponent.navigateExternalFile('https://docs.qualcomm.com/bundle/resource/topics/80-70014-7A/overview.html')">Qualcomm Linux Sensors Guide - Addendum</a> 仅供授权用户访问。</div><br></li><br><br>                                                <li class="li">注册表传感器 API 记录在 <code class="ph codeph">adsp_proc/qsh_api/pb/sns_registry.proto</code> 文件中。</li><br><br>                                            </ul> |
        | 定时器传感器 | <ul class="ul" id="architecture__ul_t2g_qgl_sbc_rajearor_06-13-24-1519-5-683"><br>                                                <li class="li">QSH 中的定时器传感器提供了一个接口用于启动周期性或一次性定时器。需要计时器的传感器必须创建数据流、发送请求并读取传递的数据事件。</li><br><br>                                                <li class="li">计时器传感器 API 记录在 <code class="ph codeph">adsp_proc/qsh_platform/api/public_sns/sns_timer.proto</code> 文件中。</li><br><br>                                            </ul> |
        | 中断传感器 | <ul class="ul" id="architecture__ul_tts_rgl_sbc_rajearor_06-13-24-1519-31-762"><br>                                                <li class="li">QSH 中的中断传感器提供用于记录中断的接口。需要中断的传感器必须创建一个数据流、发送请求并读取传递的数据事件。</li><br><br>                                                <li class="li">中断传感器 API 记录在 <code class="ph codeph">adsp_proc/qsh_platform/api/public_sns/sns_interrupt.proto</code> 文件中。</li><br><br>                                            </ul> |
        | 异步 COM 端口 (ASCP) 传感器 | <ul class="ul" id="architecture__ul_lxc_tgl_sbc_rajearor_06-13-24-1519-56-193"><br>                                                <li class="li">QSH 中的 ASCP 传感器为通过通信端口进行异步读/写操作提供了一个接口。</li><br><br>                                                <li class="li">需要此功能的传感器必须创建数据流、发送请求并读取传递的数据事件。</li><br><br>                                                <li class="li">ASCP 传感器 API 记录在 <code class="ph codeph">adsp_proc/qsh_platform/api/public_sns/sns_async_com_port.proto</code> 文件中。</li><br><br>                                            </ul><br><br>                                            <br>Note: 物理传感器驱动程序通常使用 ASCP 传感器读取大块 FIFO。 |
        | SUID 查询传感器 | <ul class="ul" id="architecture__ul_rrs_wgl_sbc_rajearor_06-13-24-1520-59-587"><br>                                                <li class="li">QSH 中的 SUID 查找传感器提供了一个 API，用于获取相关传感器的 SUID。它自己的 SUID 可通过 <code class="ph codeph">sns_sensor_util.h</code> 文件中的 <code class="ph codeph">sns_get_suid_lookup()</code> 函数使用。</li><br><br>                                                <li class="li">SUID 查找传感器 API 记录在 <code class="ph codeph">adsp_proc/qsh_api/pb/sns_suid.proto</code> 文件中。</li><br><br>                                            </ul> |
        | 测试传感器 | 在 `adsp_proc/qsh_platform/sensors/test` 目录下有一个测试传感器，可用于定制和运行特定传感器的用例。 |
    - **QSH 实用工具**：QSH 为传感器和传感器实例提供了多个帮助程序实用工具。有关所有可用的实用工具，参见 `adsp_proc/qsh_platform/inc/utils` 目录。下表介绍了核心实用工具。

Table : QSH 实用工具

        | QSH 实用工具 | 说明 |
        | --- | --- |
        | Nanopb 编码/解码 | <ul class="ul" id="architecture__ul_nkh_lhl_n1c_monicapa_02-23-24-1918-46-547"><br>                                            <li class="li">为所有传感器提供通用的编码/解码辅助函数。例如，对 <code class="ph codeph">sns_request</code> 消息进行编码/解码，对数据事件进行编码和发布/解码。</li><br><br>                                            <li class="li">异步 COM 端口 nanopb 实用工具可用于物理传感器驱动程序。</li><br><br>                                        </ul> |
        | 传感器实用工具 | <ul class="ul" id="architecture__ul_okh_lhl_n1c_monicapa_02-23-24-1918-46-547"><br>                                            <li class="li">提供常见功能，例如查找传感器实例和获取 SUID 查找传感器的 SUID。</li><br><br>                                        </ul> |
        | 属性实用工具 | <ul class="ul" id="architecture__ul_pkh_lhl_n1c_monicapa_02-23-24-1918-46-547"><br>                                            <li class="li">提供可编码并发布传感器属性的辅助函数。</li><br><br>                                        </ul> |
        | 内存、数学运算、printf 实用工具。 |  |

## 传感器间的通信

Source: [https://docs.qualcomm.com/doc/80-70014-7Y/topic/architecture.html](https://docs.qualcomm.com/doc/80-70014-7Y/topic/architecture.html)

QSH 框架中的每个算法和传感器驱动程序都称为具有标准 QSH API 的传感器。在任何实际用例中，这些传感器之间的信息交换都是必要的。以下资源介绍了这些传感器之间的通信。

所有传感器之间的通信，包括发送和接收，都是通过数据流上的请求和事件消息进行的。消息净荷使用 nanopb 生成器、编码器和解码器以协议缓冲区格式定义。消息净荷长度、消息 ID 和时间戳（位于事件中）在由 QSH 框架管理的元数据内进行通信。

Figure : 传感器通信
                <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- 由 Microsoft Visio, SVG Export 生成 sensors_Comunication.svg Page-1 -->
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:v="http://schemas.microsoft.com/visio/2003/SVGExtensions/" width="7.75694in" height="2.81944in" viewbox="0 0 558.5 203" xml:space="preserve" color-interpolation-filters="sRGB" class="st13"><v:documentproperties v:langid="2052">	<v:userdefs>		<v:ud v:nameu="msvNoAutoConnect" v:val="VT0(1):26"></v:ud>		<v:ud v:nameu="msvWarnOnPersonalInfo" v:val="VT0(0):5"></v:ud>	</v:userdefs></v:documentproperties>
<style>.svg-2 .st1 { fill: #ffffff; stroke: none; stroke-width: 0.25 }
.svg-2 .st2 { fill: #ffffff; stroke: #000000; stroke-width: 2 }
.svg-2 .st3 { fill: #ffffff; stroke: #000000; stroke-width: 0.999998 }
.svg-2 .st4 { fill: #4a5a75; stroke: #000000; stroke-width: 2 }
.svg-2 .st5 { fill: #f7f8fa; font-family: Arial; font-size: 1.00001em }
.svg-2 .st6 { font-family: 黑体; font-size: 1em }
.svg-2 .st7 { fill: #000000; font-family: 黑体; font-size: 1.00001em }
.svg-2 .st8 { font-size: 1em }
.svg-2 .st9 { marker-end: url("#mrkr5-42"); marker-start: url("#mrkr5-40"); stroke: #000000; stroke-linecap: round; stroke-linejoin: round; stroke-width: 0.999998 }
.svg-2 .st10 { fill: #000000; fill-opacity: 1; stroke: #000000; stroke-opacity: 1; stroke-width: 0.2840905884866 }
.svg-2 .st11 { fill: #4a5a75; stroke: #c7c8c8; stroke-width: 0.25 }
.svg-2 .st12 { fill: #feffff; font-family: 黑体; font-size: 1.00001em }
.svg-2 .st13 { fill: none; fill-rule: evenodd; font-size: 12px; overflow: visible; stroke-linecap: square; stroke-miterlimit: 3 }</style>
<defs id="Markers">	<g id="lend5">		<path d="M 2 1 L 0 0 L 1.98117 -0.993387 C 1.67173 -0.364515 1.67301 0.372641 1.98465 1.00043 " style="stroke:none"></path>	</g>	<marker id="mrkr5-40" class="st10" v:arrowtype="5" v:arrowsize="2" v:setback="0" refx="0" orient="auto" markerunits="strokeWidth" overflow="visible">		<use xlink:href="#lend5" transform="scale(3.5200039724201) "></use>	</marker>	<marker id="mrkr5-42" class="st10" v:arrowtype="5" v:arrowsize="2" v:setback="0" refx="-0" orient="auto" markerunits="strokeWidth" overflow="visible">		<use xlink:href="#lend5" transform="scale(-3.5200039724201,-3.5200039724201) "></use>	</marker></defs><g v:mid="0" v:index="1" v:groupcontext="foregroundPage">	<v:userdefs>		<v:ud v:nameu="msvThemeOrder" v:val="VT0(0):26"></v:ud>	</v:userdefs>	<title>Page-1</title>	<v:pageproperties v:drawingscale="1" v:pagescale="1" v:drawingunits="19" v:shadowoffsetx="8.99999" v:shadowoffsety="-8.99999"></v:pageproperties>	<v:layer v:name="Connector" v:index="0"></v:layer>	<g id="shape1-1" v:mid="1" v:groupcontext="shape" transform="translate(18.2503,-18.25)">		<title>shape33-1</title>		<rect x="0" y="36.4999" width="532.999" height="166.5" class="st1"></rect>	</g>	<g id="shape2-3" v:mid="2" v:groupcontext="shape" transform="translate(31.8438,-44.3715)">		<title>shape2-3</title>		<v:userdefs>			<v:ud v:nameu="CTypeTopLeftSnip" v:prompt="" v:val="VT0(0):5"></v:ud>			<v:ud v:nameu="CTypeTopRightSnip" v:prompt="" v:val="VT0(0):5"></v:ud>			<v:ud v:nameu="CTypeBotLeftSnip" v:prompt="" v:val="VT0(0):5"></v:ud>			<v:ud v:nameu="CTypeBotRightSnip" v:prompt="" v:val="VT0(0):5"></v:ud>			<v:ud v:nameu="CornerLockHoriz" v:prompt="" v:val="VT0(1):5"></v:ud>			<v:ud v:nameu="CornerLockVert" v:prompt="" v:val="VT0(1):5"></v:ud>			<v:ud v:nameu="CornerLockDiag" v:prompt="" v:val="VT0(0):5"></v:ud>			<v:ud v:nameu="TopLeftOffset" v:prompt="" v:val="VT0(0):26"></v:ud>			<v:ud v:nameu="TopRightOffset" v:prompt="" v:val="VT0(0):26"></v:ud>			<v:ud v:nameu="BotLeftOffset" v:prompt="" v:val="VT0(0):26"></v:ud>			<v:ud v:nameu="BotRightOffset" v:prompt="" v:val="VT0(0):26"></v:ud>			<v:ud v:nameu="visVersion" v:prompt="" v:val="VT0(15):26"></v:ud>		</v:userdefs>		<path d="M19.78 203 L107.16 203 A19.7817 19.7817 -180 0 0 126.94 183.22 L126.94 140.52 A19.7817 19.7817 -180 0 0 107.16					 120.74 L19.78 120.74 A19.7817 19.7817 -180 0 0 0 140.52 L0 183.22 A19.7817 19.7817 -180 0 0 19.78 203 Z" class="st2"></path>	</g>	<g id="shape3-5" v:mid="3" v:groupcontext="shape" transform="translate(397.532,-44.3751)">		<title>shape3-5</title>		<v:userdefs>			<v:ud v:nameu="CTypeTopLeftSnip" v:prompt="" v:val="VT0(0):5"></v:ud>			<v:ud v:nameu="CTypeTopRightSnip" v:prompt="" v:val="VT0(0):5"></v:ud>			<v:ud v:nameu="CTypeBotLeftSnip" v:prompt="" v:val="VT0(0):5"></v:ud>			<v:ud v:nameu="CTypeBotRightSnip" v:prompt="" v:val="VT0(0):5"></v:ud>			<v:ud v:nameu="CornerLockHoriz" v:prompt="" v:val="VT0(1):5"></v:ud>			<v:ud v:nameu="CornerLockVert" v:prompt="" v:val="VT0(1):5"></v:ud>			<v:ud v:nameu="CornerLockDiag" v:prompt="" v:val="VT0(0):5"></v:ud>			<v:ud v:nameu="TopLeftOffset" v:prompt="" v:val="VT0(0):26"></v:ud>			<v:ud v:nameu="TopRightOffset" v:prompt="" v:val="VT0(0):26"></v:ud>			<v:ud v:nameu="BotLeftOffset" v:prompt="" v:val="VT0(0):26"></v:ud>			<v:ud v:nameu="BotRightOffset" v:prompt="" v:val="VT0(0):26"></v:ud>			<v:ud v:nameu="visVersion" v:prompt="" v:val="VT0(15):26"></v:ud>		</v:userdefs>		<path d="M22.24 203 L120.48 203 A22.2399 22.2399 -180 0 0 142.72 180.76 L142.72 142.98 A22.2399 22.2399 -180 0 0 120.48					 120.74 L22.24 120.74 A22.2399 22.2399 -180 0 0 -0 142.98 L0 180.76 A22.2399 22.2399 -180 0 0 22.24 203 Z" class="st2"></path>	</g>	<g id="shape4-7" v:mid="4" v:groupcontext="shape" transform="translate(158.787,-47.3503)">		<title>shape30-7</title>		<v:userdefs>			<v:ud v:nameu="visVersion" v:val="VT0(15):26"></v:ud>			<v:ud v:nameu="ArrowType" v:prompt="" v:val="VT0(2):26"></v:ud>		</v:userdefs>		<path d="M0 183.4 L13.97 163.8 L13.97 173.6 L238.08 173.6 L238.08 183.4 L238.08 193.2 L13.97 193.2 L13.97 203 L0 183.4					 Z" class="st3"></path>	</g>	<g id="shape5-9" v:mid="5" v:groupcontext="shape" transform="translate(396.079,284.22) rotate(180)">		<title>shape29-9</title>		<v:userdefs>			<v:ud v:nameu="visVersion" v:val="VT0(15):26"></v:ud>			<v:ud v:nameu="ArrowType" v:prompt="" v:val="VT0(2):26"></v:ud>		</v:userdefs>		<path d="M0 184.48 L12 165.96 L12 175.22 L236.82 175.22 L236.82 184.48 L236.82 193.74 L12 193.74 L12 203 L0 184.48 Z" class="st3"></path>	</g>	<g id="shape6-11" v:mid="6" v:groupcontext="shape" transform="translate(96.3773,-55.8231)">		<title>shape22-11</title>		<desc>PB Encode/Decode</desc>		<v:userdefs>			<v:ud v:nameu="CTypeTopLeftSnip" v:prompt="" v:val="VT0(0):5"></v:ud>			<v:ud v:nameu="CTypeTopRightSnip" v:prompt="" v:val="VT0(0):5"></v:ud>			<v:ud v:nameu="CTypeBotLeftSnip" v:prompt="" v:val="VT0(0):5"></v:ud>			<v:ud v:nameu="CTypeBotRightSnip" v:prompt="" v:val="VT0(0):5"></v:ud>			<v:ud v:nameu="CornerLockHoriz" v:prompt="" v:val="VT0(1):5"></v:ud>			<v:ud v:nameu="CornerLockVert" v:prompt="" v:val="VT0(1):5"></v:ud>			<v:ud v:nameu="CornerLockDiag" v:prompt="" v:val="VT0(0):5"></v:ud>			<v:ud v:nameu="TopLeftOffset" v:prompt="" v:val="VT0(0):26"></v:ud>			<v:ud v:nameu="TopRightOffset" v:prompt="" v:val="VT0(0):26"></v:ud>			<v:ud v:nameu="BotLeftOffset" v:prompt="" v:val="VT0(0):26"></v:ud>			<v:ud v:nameu="BotRightOffset" v:prompt="" v:val="VT0(0):26"></v:ud>			<v:ud v:nameu="visVersion" v:prompt="" v:val="VT0(15):26"></v:ud>		</v:userdefs>		<v:textblock v:margins="rect(3.99999,3.99999,3.99999,3.99999)"></v:textblock>		<v:textrect cx="28.4397" cy="173.318" width="56.89" height="59.3639"></v:textrect>		<path d="M11.43 203 L45.45 203 A11.428 11.428 -180 0 0 56.88 191.57 L56.88 155.06 A11.428 11.428 -180 0 0 45.45 143.64					 L11.43 143.64 A11.428 11.428 -180 0 0 -0 155.06 L0 191.57 A11.428 11.428 -180 0 0 11.43 203 Z" class="st4"></path>		<text x="5.1" y="169.42" class="st5" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>PB <tspan class="st6">编码</tspan>/<tspan x="16.44" dy="1.3em" class="st6">解码</tspan></text>		</g>	<g id="shape7-16" v:mid="7" v:groupcontext="shape" transform="translate(403.054,-55.8231)">		<title>shape21-16</title>		<desc>PB Encode/Decode</desc>		<v:userdefs>			<v:ud v:nameu="CTypeTopLeftSnip" v:prompt="" v:val="VT0(0):5"></v:ud>			<v:ud v:nameu="CTypeTopRightSnip" v:prompt="" v:val="VT0(0):5"></v:ud>			<v:ud v:nameu="CTypeBotLeftSnip" v:prompt="" v:val="VT0(0):5"></v:ud>			<v:ud v:nameu="CTypeBotRightSnip" v:prompt="" v:val="VT0(0):5"></v:ud>			<v:ud v:nameu="CornerLockHoriz" v:prompt="" v:val="VT0(1):5"></v:ud>			<v:ud v:nameu="CornerLockVert" v:prompt="" v:val="VT0(1):5"></v:ud>			<v:ud v:nameu="CornerLockDiag" v:prompt="" v:val="VT0(0):5"></v:ud>			<v:ud v:nameu="TopLeftOffset" v:prompt="" v:val="VT0(0):26"></v:ud>			<v:ud v:nameu="TopRightOffset" v:prompt="" v:val="VT0(0):26"></v:ud>			<v:ud v:nameu="BotLeftOffset" v:prompt="" v:val="VT0(0):26"></v:ud>			<v:ud v:nameu="BotRightOffset" v:prompt="" v:val="VT0(0):26"></v:ud>			<v:ud v:nameu="visVersion" v:prompt="" v:val="VT0(15):26"></v:ud>		</v:userdefs>		<v:textblock v:margins="rect(3.99999,3.99999,3.99999,3.99999)"></v:textblock>		<v:textrect cx="32.3853" cy="173.318" width="64.78" height="59.3639"></v:textrect>		<path d="M15.27 203 L49.5 203 A15.2663 15.2663 -180 0 0 64.77 187.73 L64.77 158.9 A15.2663 15.2663 -180 0 0 49.5 143.64					 L15.27 143.64 A15.2663 15.2663 -180 0 0 0 158.9 L0 187.73 A15.2663 15.2663 -180 0 0 15.27 203 Z" class="st4"></path>		<text x="9.05" y="169.42" class="st5" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>PB <tspan class="st6">编码</tspan>/<tspan x="20.39" dy="1.3em" class="st6">解码</tspan></text>		</g>	<g id="shape8-21" v:mid="8" v:groupcontext="shape" transform="translate(243.25,-100.15)">		<title>shape23-21</title>		<desc>Request</desc>		<v:userdefs></v:userdefs>		<v:textblock v:margins="rect(3.99999,3.99999,3.99999,3.99999)"></v:textblock>		<v:textrect cx="28.4397" cy="199.04" width="56.88" height="7.91999"></v:textrect>		<rect x="0" y="195.08" width="56.8799" height="7.91999" class="st1"></rect>		<text x="16.44" y="202.94" class="st7" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>请求</text>		</g>	<g id="shape9-24" v:mid="9" v:groupcontext="shape" transform="translate(243.25,-62.8959)">		<title>shape24-24</title>		<desc>Event</desc>		<v:userdefs></v:userdefs>		<v:textblock v:margins="rect(3.99999,3.99999,3.99999,3.99999)"></v:textblock>		<v:textrect cx="28.4397" cy="197.75" width="56.88" height="10.5"></v:textrect>		<rect x="0" y="192.5" width="56.8799" height="10.5" class="st1"></rect>		<text x="16.44" y="201.65" class="st7" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>事件</text>		</g>	<g id="shape10-27" v:mid="10" v:groupcontext="shape" transform="translate(36.0002,-70.6299)">		<title>shape25-27</title>		<desc>Data Client</desc>		<v:userdefs></v:userdefs>		<v:textblock v:margins="rect(3.99999,3.99999,3.99999,3.99999)"></v:textblock>		<v:textrect cx="28.4397" cy="186.8" width="56.89" height="32.3999"></v:textrect>		<rect x="0" y="170.6" width="56.8799" height="32.3999" class="st1"></rect>		<text x="16.44" y="182.9" class="st7" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>数据<v:lf></v:lf><tspan x="10.44" dy="1.3em" class="st8">客户端</tspan></text>		</g>	<g id="shape11-31" v:mid="11" v:groupcontext="shape" transform="translate(477,-69.3051)">		<title>shape26-31</title>		<desc>Data Source</desc>		<v:userdefs></v:userdefs>		<v:textblock v:margins="rect(3.99999,3.99999,3.99999,3.99999)"></v:textblock>		<v:textrect cx="28.4397" cy="186.8" width="56.89" height="32.3999"></v:textrect>		<rect x="0" y="170.6" width="56.8799" height="32.3999" class="st1"></rect>		<text x="10.44" y="190.7" class="st7" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>数据源</text>		</g>	<g id="shape12-34" v:mid="12" v:groupcontext="shape" v:layermember="0" transform="translate(95.3153,-126.633)">		<title>shape27-35</title>		<path d="M0 203 L0 197.2 L0 196.84 L0 189.5 L373.58 189.5 L373.58 196.84 L373.58 203" class="st9"></path>	</g>	<g id="shape13-43" v:mid="13" v:groupcontext="shape" transform="translate(231.683,-152.105)">		<title>shape31-44</title>		<desc>Data Stream</desc>		<v:userdefs></v:userdefs>		<v:textblock v:margins="rect(3.99999,3.99999,3.99999,3.99999)"></v:textblock>		<v:textrect cx="40.0065" cy="194.144" width="80.02" height="17.712"></v:textrect>		<rect x="0" y="185.288" width="80.0135" height="17.712" class="st1"></rect>		<text x="22.01" y="198.05" class="st7" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>数据流</text>		</g>	<g id="shape14-46" v:mid="14" v:groupcontext="shape" transform="translate(383.486,-21.1304)">		<title>shape35-47</title>		<desc>Third-party</desc>		<v:userdefs>			<v:ud v:nameu="CTypeTopLeftSnip" v:prompt="" v:val="VT0(0):5"></v:ud>			<v:ud v:nameu="CTypeTopRightSnip" v:prompt="" v:val="VT0(0):5"></v:ud>			<v:ud v:nameu="CTypeBotLeftSnip" v:prompt="" v:val="VT0(0):5"></v:ud>			<v:ud v:nameu="CTypeBotRightSnip" v:prompt="" v:val="VT0(0):5"></v:ud>			<v:ud v:nameu="CornerLockHoriz" v:prompt="" v:val="VT0(0):5"></v:ud>			<v:ud v:nameu="CornerLockVert" v:prompt="" v:val="VT0(0):5"></v:ud>			<v:ud v:nameu="CornerLockDiag" v:prompt="" v:val="VT0(0):5"></v:ud>			<v:ud v:nameu="TopLeftOffset" v:prompt="" v:val="VT0(0):26"></v:ud>			<v:ud v:nameu="TopRightOffset" v:prompt="" v:val="VT0(0):26"></v:ud>			<v:ud v:nameu="BotLeftOffset" v:prompt="" v:val="VT0(0):26"></v:ud>			<v:ud v:nameu="BotRightOffset" v:prompt="" v:val="VT0(0):26"></v:ud>			<v:ud v:nameu="visVersion" v:prompt="" v:val="VT0(15):26"></v:ud>		</v:userdefs>		<v:textblock v:margins="rect(3.99999,3.99999,3.99999,3.99999)"></v:textblock>		<v:textrect cx="40.0065" cy="194.144" width="80.02" height="17.712"></v:textrect>		<path d="M8 203 L72.01 203 A8.00122 8.00122 -180 0 0 80.01 195 L80.01 193.29 A8.00122 8.00122 -180 0 0 72.01 185.29 L8					 185.29 A8.00122 8.00122 -180 0 0 0 193.29 L0 195 A8.00122 8.00122 -180 0 0 8 203 Z" class="st11"></path>		<text x="22.01" y="198.14" class="st12" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>第三方</text>		</g></g>
</svg>

发送的请求消息用于启用、禁用和/或重新配置传感器。请求消息始终可寻址到特定的 SUID。当目标传感器接收到请求消息后，就会将其发送至传感器实例进行适当处理。传感器实例将事件消息异步发送到其注册的客户端，这些客户端可能是其他传感器或传感器实例。

### 传感器和传感器实例

- 传感器是异步数据的生产者和/或消费者
- 每个传感器可具有一个或多个传感器实例。
    - 每个实例运行于特定的配置环境
    - 对传感器数据的任何请求，都将创建一个传感器实例或共享一个现有实例
- 传感器实例根据传感器确定的结果按需创建
    - 传感器完全管理其相应实例的生命周期和配置，并负责向其客户端发送配置更新和初始状态事件
    - 供应商应使用尽可能少的传感器实例为所有客户端请求提供服务
    - 由传感器实例生成的数据流会发送至所有活动客户端
- 多个传感器可以共享和配置单个传感器实例，此操作模式通常适用于硬件传感器的组合驱动程序。在这里，传感器表示支持的数据类型，传感器实例是通信和配置硬件的唯一模块。

## QSH 中的 Nanopb 协议缓冲区

Source: [https://docs.qualcomm.com/doc/80-70014-7Y/topic/architecture.html](https://docs.qualcomm.com/doc/80-70014-7Y/topic/architecture.html)

QSH 将 nanopb 协议缓冲区应用于：

- 传感器之间交换的所有请求和事件消息
    - 传感器/传感器实例必须针对其发送至从属传感器/实例的所有请求的净荷（如果存在）进行编码。
    - 传感器/传感器实例必须针对其接收的所有请求的净荷（如果存在）进行解码。
    - 传感器/传感器实例必须针对其发布的所有事件的净荷（如果存在）进行编码。
    - 传感器/传感器实例必须针对其从属传感器/实例发送的所有事件的净荷（如果存在）进行解码。
    - 部分请求/事件不含消息主体。在这种情况下，预期不针对净荷进行解码/编码。此类消息通过其消息 ID 进行处理。
- 表示属性数据
    - 所有属性值均采用 nanopb 编码格式
- 日志数据包净荷
    - 日志数据包中的所有净荷均采用 nanopb 编码格式

有关 Google 协议缓冲区和 nanopb 的更多信息，参见[协议缓冲区](https://developers.google.com/protocol-buffers/)和 [nanopb](https://jpa.kapsi.fi/nanopb/)。

## 传感器 API 消息

Source: [https://docs.qualcomm.com/doc/80-70014-7Y/topic/architecture.html](https://docs.qualcomm.com/doc/80-70014-7Y/topic/architecture.html)

以下 API 消息用于传感器之间的通信：

- `.proto`文件包含以下用于传感器之间通信的元素：
    - 协议缓冲区消息定义
    - 文档
- 下表列出了 `<workspace>/build-qcom-wayland/workspace/sources/sensinghub/sensing-hub/apis/proto/sns_std_*.proto` 文件中的标准消息定义：

Table : 标准 proto 文件

    | 文件 | 说明 |
    | --- | --- |
    | `sns_std.proto` | 此文件包括标准定义，例如消息 ID、请求消息、批处理规范、属性请求和事件以及错误事件。 |
    | `sns_std_sensor.proto` | 此文件包含多项定义，例如标准传感器的请求和事件 API 的消息 ID、数据流和事件消息、传感器示例状态类型、标准属性 ID、常用属性类型以及物理传感器配置事件消息。 |
    | `sns_std_type.proto` | 此文件包含通用 API 类型定义，如 SUID 消息、属性事件和值消息以及通用错误类型。 |
    | `sns_std_event_gated_sensor.proto` | 此文件包括事件门控传感器的 API，包括配置消息 ID 和 API 文档。 |

- 特定于物理传感器的 API 定义和文档位于特定于传感器的 `.proto` 文件中。例如，`sns_accel.proto`、`sns_proximity.proto` 和 `sns_motion_detect.proto`。
- 平台传感器 API 定义和文档位于 `adsp_proc/qsh_platform/api/` 目录中。例如，`sns_timer.proto`、`sns_interrupt.proto` 和 `sns_async_com_port.proto`。
- SUID、注册表和诊断的框架相关 API 在以下 proto 文件中定义：
    - `sns_suid.proto`
    - `sns_registry.proto`
    - `sns_diag.proto`

Last Published: Aug 20, 2024

[Previous Topic
功能](https://docs.qualcomm.com/bundle/publicresource/80-70014-7Y/topics/supported_features.md) [Next Topic
接口](https://docs.qualcomm.com/bundle/publicresource/80-70014-7Y/topics/qsh_api_reference.md)