Show code
html`
<div class="quick-ref-card" style="background: linear-gradient(135deg, #16A085 0%, #1ABC9C 100%); color: white; padding: 20px; border-radius: 12px; margin: 15px 0;">
<h3 class="depth-l0" style="margin-top: 0; border-bottom: 2px solid rgba(255,255,255,0.3); padding-bottom: 10px;">MQTT Protocol</h3>
<div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px;">
<div>
<h4 class="depth-l0" style="margin: 10px 0 5px 0; color: #F1C40F;">Connection</h4>
<pre style="background: rgba(0,0,0,0.2); padding: 10px; border-radius: 6px; font-size: 12px; margin: 0;">
Port: 1883 (TCP), 8883 (TLS)
WebSocket: 80/443
Keep-Alive: 60s default
Clean Session: true/false</pre>
</div>
<div>
<h4 class="depth-l0" style="margin: 10px 0 5px 0; color: #F1C40F;">QoS Levels</h4>
<pre style="background: rgba(0,0,0,0.2); padding: 10px; border-radius: 6px; font-size: 12px; margin: 0;">
QoS 0: At most once (fire & forget)
QoS 1: At least once (with PUBACK)
QoS 2: Exactly once (4-way handshake)</pre>
</div>
<div>
<h4 class="depth-l0" style="margin: 10px 0 5px 0; color: #F1C40F;">Topic Wildcards</h4>
<pre style="background: rgba(0,0,0,0.2); padding: 10px; border-radius: 6px; font-size: 12px; margin: 0;">
+ = single level: sensors/+/temp
# = multi level: sensors/#
$ = system topics: $SYS/#</pre>
</div>
<div>
<h4 class="depth-l0" style="margin: 10px 0 5px 0; color: #F1C40F;">Packet Types</h4>
<pre style="background: rgba(0,0,0,0.2); padding: 10px; border-radius: 6px; font-size: 12px; margin: 0;">
CONNECT/CONNACK - Establish connection
PUBLISH/PUBACK - Send message
SUBSCRIBE/SUBACK - Subscribe topic
PINGREQ/PINGRESP - Keep alive</pre>
</div>
</div>
<div style="margin-top: 15px; font-size: 12px; opacity: 0.9;">
<strong>Best Practice:</strong> Use QoS 0 for telemetry, QoS 1 for commands, retain for status
</div>
</div>
`