viewof selectedService = Inputs.select(
["Heart Rate (0x180D)", "Battery (0x180F)", "Environmental Sensing (0x181A)", "Cycling Speed (0x1816)", "Device Information (0x180A)", "Blood Pressure (0x1810)", "Generic Access (0x1800)", "Health Thermometer (0x1809)"],
{value: "Heart Rate (0x180D)", label: "GATT Service"}
)
viewof showProperties = Inputs.checkbox(["Show characteristic properties", "Show data format"], {value: ["Show characteristic properties"]})GATT Service UUID Lookup
GATT Service UUID Lookup
animation
bluetooth
ble
Try Leave GATT Service on Heart Rate (0x180D) and enable Show data format. Compare the format lines with the visible characteristic properties.
Observe The default Heart Rate (0x180D) entry lists 3 characteristics with NOTIFY, READ and WRITE properties. Format lines stay hidden until Show data format is selected.
Explain GATT Service chooses a stored service record containing its UUID and characteristics. Show characteristic properties and Show data format control which extra details appear.
Technical boundaries. The lookup assumes the fixed records supplied for its 8 selectable services. It displays stored UUIDs, properties and format descriptions without discovering a connected device or checking its actual services.
NoteTry It: GATT Service UUID Lookup
Select a standard BLE GATT service to see its UUID, characteristics, and typical use case. This demonstrates the service discovery process that the GATT Explorer performs.
gattLookupResult = {
const services = {
"Heart Rate (0x180D)": {
uuid: "0000180d-0000-1000-8000-00805f9b34fb",
shortUuid: "0x180D",
description: "Exposes heart rate and energy expenditure data from a heart rate sensor.",
characteristics: [
{name: "Heart Rate Measurement", uuid: "0x2A37", props: ["NOTIFY"], format: "uint8 (flags) + uint8/uint16 (bpm)"},
{name: "Body Sensor Location", uuid: "0x2A38", props: ["READ"], format: "uint8 enum (chest=1, wrist=2, finger=3)"},
{name: "Heart Rate Control Point", uuid: "0x2A39", props: ["WRITE"], format: "uint8 (1=reset energy expended)"}
],
color: "#E74C3C"
},
"Battery (0x180F)": {
uuid: "0000180f-0000-1000-8000-00805f9b34fb",
shortUuid: "0x180F",
description: "Reports battery level as a percentage (0-100%).",
characteristics: [
{name: "Battery Level", uuid: "0x2A19", props: ["READ", "NOTIFY"], format: "uint8 (0-100 percent)"}
],
color: "#E67E22"
},
"Environmental Sensing (0x181A)": {
uuid: "0000181a-0000-1000-8000-00805f9b34fb",
shortUuid: "0x181A",
description: "Exposes temperature, humidity, pressure, and other environmental measurements.",
characteristics: [
{name: "Temperature", uuid: "0x2A6E", props: ["READ", "NOTIFY"], format: "int16 (0.01 degree Celsius)"},
{name: "Humidity", uuid: "0x2A6F", props: ["READ", "NOTIFY"], format: "uint16 (0.01 percent)"},
{name: "Pressure", uuid: "0x2A6D", props: ["READ", "NOTIFY"], format: "uint32 (0.1 Pascal)"}
],
color: "#16A085"
},
"Cycling Speed (0x1816)": {
uuid: "00001816-0000-1000-8000-00805f9b34fb",
shortUuid: "0x1816",
description: "Exposes speed and cadence data from a cycling sensor.",
characteristics: [
{name: "CSC Measurement", uuid: "0x2A5B", props: ["NOTIFY"], format: "uint8 (flags) + uint32 (wheel revs) + uint16 (crank revs)"},
{name: "CSC Feature", uuid: "0x2A5C", props: ["READ"], format: "uint16 bitfield"},
{name: "Sensor Location", uuid: "0x2A5D", props: ["READ"], format: "uint8 enum"}
],
color: "#3498DB"
},
"Device Information (0x180A)": {
uuid: "0000180a-0000-1000-8000-00805f9b34fb",
shortUuid: "0x180A",
description: "Provides manufacturer, model, firmware, and hardware information about the device.",
characteristics: [
{name: "Manufacturer Name", uuid: "0x2A29", props: ["READ"], format: "UTF-8 string"},
{name: "Model Number", uuid: "0x2A24", props: ["READ"], format: "UTF-8 string"},
{name: "Firmware Revision", uuid: "0x2A26", props: ["READ"], format: "UTF-8 string"},
{name: "Hardware Revision", uuid: "0x2A27", props: ["READ"], format: "UTF-8 string"}
],
color: "#9B59B6"
},
"Blood Pressure (0x1810)": {
uuid: "00001810-0000-1000-8000-00805f9b34fb",
shortUuid: "0x1810",
description: "Exposes blood pressure measurement data from a cuff-based sensor.",
characteristics: [
{name: "Blood Pressure Measurement", uuid: "0x2A35", props: ["INDICATE"], format: "uint8 (flags) + SFLOAT (systolic/diastolic/MAP)"},
{name: "Blood Pressure Feature", uuid: "0x2A49", props: ["READ"], format: "uint16 bitfield"}
],
color: "#E74C3C"
},
"Generic Access (0x1800)": {
uuid: "00001800-0000-1000-8000-00805f9b34fb",
shortUuid: "0x1800",
description: "Mandatory service on every BLE device. Contains device name and appearance.",
characteristics: [
{name: "Device Name", uuid: "0x2A00", props: ["READ"], format: "UTF-8 string (max 248 bytes)"},
{name: "Appearance", uuid: "0x2A01", props: ["READ"], format: "uint16 enum (phone=64, watch=192, sensor=1344)"}
],
color: "#2C3E50"
},
"Health Thermometer (0x1809)": {
uuid: "00001809-0000-1000-8000-00805f9b34fb",
shortUuid: "0x1809",
description: "Exposes temperature measurement data for health/medical applications.",
characteristics: [
{name: "Temperature Measurement", uuid: "0x2A1C", props: ["INDICATE"], format: "uint8 (flags) + IEEE-11073 FLOAT (Celsius)"},
{name: "Temperature Type", uuid: "0x2A1D", props: ["READ"], format: "uint8 enum (armpit=1, body=2, ear=3, mouth=5)"}
],
color: "#E67E22"
}
};
const svc = services[selectedService];
const showProps = showProperties.includes("Show characteristic properties");
const showFormat = showProperties.includes("Show data format");
return html`<div style="font-family: Arial, sans-serif; background: #f8f9fa; border-radius: 8px; padding: 16px;">
<div style="display: flex; align-items: center; gap: 12px; margin-bottom: 12px;">
<div style="width: 12px; height: 12px; border-radius: 50%; background: ${svc.color};"></div>
<span style="font-size: 16px; font-weight: bold; color: #2C3E50;">${selectedService}</span>
</div>
<div style="background: white; border-radius: 6px; padding: 12px; margin-bottom: 12px; border: 1px solid #e0e0e0;">
<div style="font-size: 12px; color: #7F8C8D; margin-bottom: 4px;">Full UUID</div>
<code style="font-size: 13px; color: #2C3E50; background: #eaf2f8; padding: 4px 8px; border-radius: 4px;">${svc.uuid}</code>
<div style="font-size: 13px; color: #2C3E50; margin-top: 8px;">${svc.description}</div>
</div>
<div style="font-size: 14px; font-weight: bold; color: #2C3E50; margin-bottom: 8px;">Characteristics (${svc.characteristics.length})</div>
${svc.characteristics.map((ch, idx) => html`<div style="background: white; border-radius: 6px; padding: 10px; margin-bottom: 6px; border-left: 3px solid ${svc.color};">
<div style="display: flex; justify-content: space-between; align-items: center;">
<span style="font-size: 13px; font-weight: bold; color: #2C3E50;">${ch.name}</span>
<code style="font-size: 11px; color: #7F8C8D; background: #f0f0f0; padding: 2px 6px; border-radius: 3px;">${ch.uuid}</code>
</div>
${showProps ? html`<div style="margin-top: 6px; display: flex; gap: 6px;">
${ch.props.map(p => {
const pColor = p === "READ" ? "#16A085" : p === "WRITE" ? "#E67E22" : p === "NOTIFY" ? "#3498DB" : "#9B59B6";
return html`<span style="font-size: 11px; color: white; background: ${pColor}; padding: 2px 8px; border-radius: 10px;">${p}</span>`;
})}
</div>` : ""}
${showFormat ? html`<div style="margin-top: 6px; font-size: 12px; color: #7F8C8D;">Format: ${ch.format}</div>` : ""}
</div>`)}
</div>`;
}