Language: English
On this page本页目录

WIRELESS FUEL LEVEL SENSOR无线燃油液位传感器

AG-BFLS

Bluetooth communication protocol蓝牙通信协议

Advertising, connected data and calibration. The reference for your Android, iOS or gateway integration.广播数据、连接通信与校准,供 Android、iOS 及网关开发接入。

Quick start快速接入

Read fuel data without a connection through advertising, or connect to configure and calibrate a sensor. Identify the device by manufacturer data and its sensor ID; the Bluetooth name may be absent.通过广播可免连接读取液位数据;连接后可配置和校准。使用厂商数据与传感器 ID 识别设备,蓝牙名称可能不存在。

  1. 1Scan manufacturer data扫描厂商数据
  2. 2Identify sensor ID识别传感器 ID
  3. 3Connect & discover service连接并发现服务
  4. 4Enable FFF2 notifications启用 FFF2 通知
  5. 5Verify for protected commands受保护操作先验证
  6. 6Write FFF1 → validate FFF2 reply写入 FFF1 → 校验 FFF2 响应

Enable notifications before sending a command. Send one request at a time. The examples below use sensor ID 999999 (0F 42 3F); replace it with the actual advertised ID and recalculate CRC.先启用通知再发送命令,同一时间只保留一个未完成请求。以下示例使用传感器 ID 999999(0F 42 3F);实际使用时替换为广播中的 ID,并重新计算 CRC。

First read · firmware version首次读取 · 固件版本
0C 05 0F 42 3F 26 FD

Expected example reply: 0C 07 0F 42 3F 26 08 1B A1 → version 8.27. Example values are synthetic, not a recording from a connected sensor.示例响应:0C 07 0F 42 3F 26 08 1B A1 → 版本 8.27。示例数值为构造数据,不是连接实机的采集记录。

BLE advertisingBLE 广播

Offsets below start at the manufacturer payload after the two company bytes. First parse AD structures as Length | Type | Value. Find AD type FF; do not assume the name, flags or field order are fixed. Company bytes are little-endian.下表偏移从厂商数据的两个 Company 字节之后开始。先按 Length | Type | Value 解析 AD 结构,查找类型 FF;不要假设名称、Flags 或字段顺序固定。Company 字节为小端。

Format格式CompanyPayload bytes载荷字节数Identification识别
Universal / DominatorFFFF243F 36 B4; current Type = 5B当前 Type = 5B
AOOOGFF4315Validate length and sensor ID校验长度与传感器 ID

Universal / Dominator · current format通用 / Dominator · 当前格式

Offset偏移Bytes字节数Field字段Encoding / meaning编码 / 含义
03Signature3F 36 B4
31Firmware major固件主版本uint8; decimal, e.g. 08 → 8uint8,十进制,例如 08 → 8
41Firmware minor固件次版本uint8; decimal, e.g. 1B → 27uint8,十进制,例如 1B → 27
51Type5B in the current firmware当前固件为 5B
63Sensor ID / SN传感器 ID / SNuint24 BE: (b6 × 65536) + (b7 × 256) + b8
94Message counter消息计数uint32 BE
131StatusCurrent value 01; no public bit flags defined当前值 01,未定义公开位标志
142Frequency频率uint16 BE, Hz; fractional part omitteduint16 BE,Hz,不含小数部分
162Reserved保留Skip; no public interpretation跳过,不作公开解析
182Empty frequency空频率uint16 BE, Hzuint16 BE,Hz
202Fuel output液位输出uint16 BE; mode 0: value / 100 = %. Modes 1/2: integer mm/L. Read output mode via GATT.uint16 BE;模式 0:值 / 100 = 百分比。模式 1/2:整数 mm/L。输出类型需通过 GATT 读取。
221Temperature温度uint8 − 40 = °C; integer resolutionuint8 − 40 = °C,整数分辨率
231Battery电量uint8, 0–100%

A complete current advertisement is 31 bytes: 02 01 06 (Flags), then 1B FF FF FF and the 24-byte payload. There is no local name in this format. The four-byte counter is independent of the version and can restart; do not use it as a permanent device identity.当前完整广播为 31 字节:02 01 06(Flags),随后是 1B FF FF FF 与 24 字节载荷。该格式不携带本地名称。四字节计数与版本独立,可能重新开始,不能用作永久设备身份。

Complete AD example · 31 bytes完整 AD 示例 · 31 字节
02 01 06 1B FF FF FF 3F 36 B4 08 1B 5B 0F 42 3F 00 00 01 26 01 35 C2 34 BC 34 80 13 88 43 64

Decoded: ID 999999; version 8.27; counter 294; frequency 13762 Hz; empty frequency 13440 Hz; output 5000 = 50.00% only in mode 0; temperature 27°C; battery 100%. Reserved bytes are ignored.解析:ID 999999;版本 8.27;计数 294;频率 13762 Hz;空频率 13440 Hz;输出 5000,仅在模式 0 下表示 50.00%;温度 27°C;电量 100%。保留字节忽略。

Modes 1/2 do not put their unit in this payload. Store/read the configured output mode. This advertisement only carries the low 16 bits of integer output; use GATT for fractional values or values above 65535.模式 1/2 不在此载荷中携带单位,需保存或读取配置的输出类型。该广播只携带整数输出的低 16 位;小数或超过 65535 的值请通过 GATT 读取。

AOOOG · manufacturer payloadAOOOG · 厂商数据载荷

Offset偏移Bytes字节数Field字段Encoding / meaning编码 / 含义
03Sensor ID / SN传感器 ID / SNuint24 BE
31Output mode + battery high输出类型 + 电量码高位mode = b3 >> 4; battery high = b3 & 0F模式 = b3 >> 4;电量码高位 = b3 & 0F
41Battery low电量码低位code = ((b3 & 0x0F) << 8) | b4
52Temperature温度int16 BE / 8 = °C
74Frequency频率IEEE 754 float32 LE, Hz
114Fuel output液位输出IEEE 754 float32 LE; mode 0: 0–10000; mode 1: mm; mode 2: LIEEE 754 float32 LE;模式 0:0–10000;模式 1:mm;模式 2:L
Payload example · 15 bytes载荷示例 · 15 字节
0F 42 3F 02 BC 00 D8 00 08 4F 46 00 40 9C 45

Decoded: ID 999999; mode 0; battery code 700; temperature 27°C; frequency 13250 Hz; output 5000 = 50.00%. The FF AD structure begins 12 FF 43 FF followed by this payload.解析:ID 999999;模式 0;电量码 700;温度 27°C;频率 13250 Hz;输出 5000 = 50.00%。对应 FF AD 结构以 12 FF 43 FF 开头,后接上述载荷。

Android manufacturer-data APIs commonly supply the company identifier separately; iOS manufacturer data includes those two bytes. Normalize the input to the payload boundary before applying these offsets.Android 厂商数据接口通常将 Company 标识单独提供;iOS 厂商数据包含这两个字节。先统一到上述载荷起点再按偏移解析。

GATT connectionGATT 连接

Role用途UUIDProperties属性
Service0000FFF0-1212-EFDE-1523-785FEABCD123Primary
Command0000FFF1-1212-EFDE-1523-785FEABCD123Read / Write / Write Without Response
Response0000FFF2-1212-EFDE-1523-785FEABCD123Notify

Use the full 128-bit UUIDs. Subscribe to FFF2 notifications (CCCD value 01 00), then write complete frames to FFF1. Reading FFF1 is not the command-response path. A successful BLE write acknowledges transport, not execution; wait for the FFF2 response.使用完整的 128 位 UUID。订阅 FFF2 通知(CCCD 值 01 00),然后向 FFF1 写入完整帧。直接读取 FFF1 不能代替命令响应。蓝牙写入成功只代表传输确认,执行结果应等待 FFF2。

Operation操作Largest frame最大帧Required ATT MTU所需 ATT MTU
Read current data (14)读取当前数据(14)29 bytes≥ 32
Read calibration block (15)读取校准块(15)87 bytes≥ 90
Write calibration block (16)写入校准块(16)88 bytes≥ 91

Prefer Write With Response. For Android, request MTU 247 and check the negotiated result. On iOS, check the available write length rather than assuming it. The characteristic limit is 128 bytes. This protocol does not reassemble application frames split across separate writes; keep each request in one supported write.优先使用带响应写入。Android 可请求 MTU 247,并检查实际协商结果;iOS 检查可用写入长度,不作固定假设。特征值上限 128 字节。协议不会拼接多次独立写入中的应用帧,每个请求应通过一次受支持的写入完成。

On reconnect, rediscover as needed, enable notifications and verify access again. Use sensor ID for business identity; an iOS peripheral identifier is not a MAC address.重连后按需重新发现服务、启用通知并再次验证访问。业务身份使用传感器 ID;iOS 外设标识符不是 MAC 地址。

Frames & CRC数据帧与 CRC

Request / data response请求 / 数据响应
0C LL ID2 ID1 ID0 CMD [DATA …] CRC8
Offset偏移Bytes字节数Field字段Encoding / meaning编码 / 含义
01SOF0C
11LL5 + payload byte count; total frame size = LL + 25 + 载荷字节数;完整帧长 = LL + 2
23ID2 ID1 ID0uint24 BE
51CMDPublic command code公开命令码
6NDATACommand-specific payload; may be empty命令对应载荷,可为空
6 + N1CRC8Covers LL through the final payload byte; excludes SOF and CRC从 LL 到最后一个载荷字节,不含 SOF 与 CRC 本身

A status response uses LL = 06 and one payload byte: 00 = success; 01 = failure. A data response uses the same command code and its documented payload length. For a one-byte read, interpret the byte as data, not a success flag. Validate total size, sensor ID, command and CRC before parsing.状态响应 LL = 06,载荷一字节:00 成功,01 失败。数据响应使用同一命令码与规定载荷长度。对于单字节读取,字节代表数据,不是成功标志。解析前先校验总长度、传感器 ID、命令码和 CRC。

CRC-8/MAXIM-DOWCRC-8/MAXIM-DOW

Polynomial 0x31 (reflected implementation 0x8C); initial value 0x00; reflected input/output; XOR-out 0x00. The result is one byte. This CRC applies to GATT application frames, not the manufacturer advertising payload.多项式 0x31(反射实现 0x8C);初始值 0x00;输入/输出反射;最终异或 0x00;结果一字节。此 CRC 用于 GATT 应用帧,不用于厂商广播载荷。

JavaScript
function crc8(bytes) {
  let crc = 0;
  for (const byte of bytes) {
    crc ^= byte;
    for (let bit = 0; bit < 8; bit++) {
      crc = (crc & 1) ? (crc >>> 1) ^ 0x8C : crc >>> 1;
    }
  }
  return crc;
}
Kotlin
fun crc8(bytes: ByteArray): Int {
    var crc = 0
    for (byte in bytes) {
        crc = crc xor (byte.toInt() and 0xFF)
        repeat(8) {
            crc = if ((crc and 1) != 0) (crc ushr 1) xor 0x8C else crc ushr 1
        }
    }
    return crc
}
Swift
func crc8(_ bytes: [UInt8]) -> UInt8 {
    var crc: UInt8 = 0
    for byte in bytes {
        crc ^= byte
        for _ in 0..<8 {
            crc = (crc & 1) != 0 ? (crc >> 1) ^ 0x8C : crc >> 1
        }
    }
    return crc
}
CRC inputCRC 输入Result结果
05 0F 42 3F 14FF
06 0F 42 3F 04 147C
31 32 33 34 35 36 37 38 39A1
CRC8 = FF

Public command reference公开命令参考

All command codes and frame examples are hexadecimal. “Verify first” means command 12 must have succeeded on the same connection. Examples show one possible response, not fixed measurement values. Use the real sensor ID in every request.所有命令码与帧示例均为十六进制。“需先验证”表示本次连接中命令 12 必须先成功。响应示例为一组可能的值,不是固定测量结果。请求必须使用实际传感器 ID。

21 / 21
01Restart sensor重启传感器Verify first需先验证

Request payload请求载荷

No payload.无载荷。

Response payload响应载荷

Status, then reset.状态响应,随后复位。

Reconnect, enable notifications and authenticate again.重连后重新启用通知并验证密码。

Request example请求示例
0C 05 0F 42 3F 01 5D
Response example响应示例
0C 06 0F 42 3F 01 00 7F
Compact Hex连续 Hex
Request
0C050F423F015D
Response
0C060F423F01007F
02Close sensor关闭传感器Verify first需先验证

Request payload请求载荷

No payload.无载荷。

Response payload响应载荷

Status, then shutdown of measurement/advertising and BLE disconnect.状态响应,随后停止采集和广播并断开蓝牙。

The sensor attempts to send status before closing. A disconnect alone does not prove success. Magnet activation is needed to start a closed sensor again.传感器在关闭前尝试发送状态。仅断开连接不能证明成功。关闭后需通过磁铁重新启动。

Request example请求示例
0C 05 0F 42 3F 02 BF
Response example响应示例
0C 06 0F 42 3F 02 00 2A
Compact Hex连续 Hex
Request
0C050F423F02BF
Response
0C060F423F02002A
04Set broadcast interval设置广播间隔Verify first需先验证

Request payload请求载荷

1 byte: seconds, 1–255. Example: 20 s = 14.1 字节:秒,1–255。示例 20 秒 = 14。

Response payload响应载荷

Status. Read back with 05.状态;使用 05 读回。

This is the period between advertising windows, not the BLE event spacing inside a window. Temporary fast discovery can use a different period.这是广播窗口之间的周期,不是窗口内 BLE 事件间隔。临时快速连接模式可使用不同周期。

Request example请求示例
0C 06 0F 42 3F 04 14 7C
Response example响应示例
0C 06 0F 42 3F 04 00 80
Compact Hex连续 Hex
Request
0C060F423F04147C
Response
0C060F423F040080
05Read broadcast interval读取广播间隔Open无需验证

Request payload请求载荷

No payload.无载荷。

Response payload响应载荷

1 byte: configured interval in seconds.1 字节:配置的广播间隔,单位秒。

Request example请求示例
0C 05 0F 42 3F 05 3C
Response example响应示例
0C 06 0F 42 3F 05 14 B8
Compact Hex连续 Hex
Request
0C050F423F053C
Response
0C060F423F0514B8
0ASet transmit power设置发射功率Verify first需先验证

Request payload请求载荷

1 signed byte (int8): −40, −20, −16, −12, −8, −4, 0, +3 or +4 dBm. Example: 0 dBm = 00.1 个有符号字节(int8):−40、−20、−16、−12、−8、−4、0、+3 或 +4 dBm。示例 0 dBm = 00。

Response payload响应载荷

Status. Read back with 0B.状态;使用 0B 读回。

Negative numbers use two’s complement, e.g. −4 = FC. This command saves the setting; readback confirms the stored value, not an RF measurement or immediate application to an active connection.负数采用补码,例如 −4 = FC。命令保存配置;读回只确认配置值,不代表射频实测或当前连接立即应用。

Request example请求示例
0C 06 0F 42 3F 0A 00 5C
Response example响应示例
0C 06 0F 42 3F 0A 00 5C
Compact Hex连续 Hex
Request
0C060F423F0A005C
Response
0C060F423F0A005C
0BRead transmit power读取发射功率Open无需验证

Request payload请求载荷

No payload.无载荷。

Response payload响应载荷

1 signed byte: configured dBm.1 个有符号字节:配置的 dBm。

Request example请求示例
0C 05 0F 42 3F 0B 23
Response example响应示例
0C 06 0F 42 3F 0B 00 98
Compact Hex连续 Hex
Request
0C050F423F0B23
Response
0C060F423F0B0098
0CContinue after restart重启后继续工作Verify first需先验证

Request payload请求载荷

1 byte: 00 = disabled; 01 = enabled.1 字节:00 = 禁用;01 = 启用。

Response payload响应载荷

Status. Read back byte 2 of 0D.状态;读回 0D 的载荷字节 2。

Disabling also records the closed flag; this is not a substitute for command 02 to close immediately. Enabling alone does not clear an already saved closed flag.禁用时也会记录关闭标志;不能代替 02 立即关闭。仅启用此项不会清除已有的关闭标志。

Request example请求示例
0C 06 0F 42 3F 0C 01 A8
Response example响应示例
0C 06 0F 42 3F 0C 00 F6
Compact Hex连续 Hex
Request
0C060F423F0C01A8
Response
0C060F423F0C00F6
0DRead parameters读取参数Open无需验证

Request payload请求载荷

No payload.无载荷。

Response payload响应载荷

13 bytes; see parameter layout below.13 字节,详见下方参数结构。

Request example请求示例
0C 05 0F 42 3F 0D FE
Response example响应示例
0C 12 0F 42 3F 0D 05 00 01 00 00 60 6A 46 00 40 1C 46 00 2D
Compact Hex连续 Hex
Request
0C050F423F0DFE
Response
0C120F423F0D0500010000606A4600401C46002D
10Set empty设置空点Verify first需先验证

Request payload请求载荷

No payload. Captures the current frequency and temperature.无载荷。记录当前频率与温度。

Response payload响应载荷

Status. Read empty frequency with 0D or 14.状态;通过 0D 或 14 读回空频率。

Wait for stable readings in the actual empty condition before sending. The request carries no frequency value.先在实际空状态等待读数稳定。请求中不携带频率数值。

Request example请求示例
0C 05 0F 42 3F 10 9E
Response example响应示例
0C 06 0F 42 3F 10 00 57
Compact Hex连续 Hex
Request
0C050F423F109E
Response
0C060F423F100057
11Set full设置满点Verify first需先验证

Request payload请求载荷

No payload. Captures the current frequency and temperature.无载荷。记录当前频率与温度。

Response payload响应载荷

Status. Read full frequency with 0D or 14.状态;通过 0D 或 14 读回满频率。

Wait for stable readings in the specified full condition before sending.在规定的满状态等待读数稳定后发送。

Request example请求示例
0C 05 0F 42 3F 11 C0
Response example响应示例
0C 06 0F 42 3F 11 00 93
Compact Hex连续 Hex
Request
0C050F423F11C0
Response
0C060F423F110093
12Verify access password验证访问密码Open无需验证

Request payload请求载荷

Exactly 8 credential bytes supplied separately by AoooG. Do not assume ASCII or a default value.由 AoooG 单独提供的 8 个凭据字节。不要假设为 ASCII 或某个默认值。

Response payload响应载荷

Status: 00 = accepted; 01 = rejected.状态:00 = 通过;01 = 拒绝。

Required before protected commands on each connection. Disconnection clears authorization. Credentials must not be embedded in a public webpage.每次连接后,先验证再发送受保护命令。断开连接会清除授权。不要在公开网页嵌入凭据。

Template · placeholders, not sendable请求模板 · 占位符,不可直接发送
0C 0D 0F 42 3F 12 P0 P1 P2 P3 P4 P5 P6 P7 CRC
Response example响应示例
0C 06 0F 42 3F 12 00 C6
14Read current data读取当前数据Open无需验证

Request payload请求载荷

No payload.无载荷。

Response payload响应载荷

22 bytes; frequency, temperature, battery and output are cached measurements. See layout below.22 字节;频率、温度、电量与输出为缓存测量值。详见下方结构。

This command does not trigger a new temperature or battery measurement. No separate battery/temperature read is required.此命令不触发新一轮温度或电量采集,无需分别发送电量或温度读取命令。

Request example请求示例
0C 05 0F 42 3F 14 FF
Response example响应示例
0C 1B 0F 42 3F 14 02 BC 00 D8 52 00 00 40 1C 46 00 60 6A 46 00 08 4F 46 00 40 9C 45 36
Compact Hex连续 Hex
Request
0C050F423F14FF
Response
0C1B0F423F1402BC00D8520000401C4600606A4600084F4600409C4536
15Read calibration block读取校准表块Open无需验证

Request payload请求载荷

1 byte: start index. Use 0, 10, 20, …, 90. Example: first block = 00.1 字节:起始索引。使用 0、10、20、…、90。示例首块 = 00。

Response payload响应载荷

80 bytes: exactly 10 entries × 8 bytes. No index is echoed in the response payload.80 字节:固定 10 条 × 8 字节。响应载荷不返回索引。

Never request a start index above 90. The app must retain the pending index and use an ATT MTU of at least 90 for this response.不得使用大于 90 的起始索引。APP 必须保存本次请求索引;响应需要至少 90 的 ATT MTU。

Request example请求示例
0C 06 0F 42 3F 15 00 A8
Response example响应示例
0C 55 0F 42 3F 15 00 00 00 00 00 00 00 00 00 00 48 42 2C 01 C4 09 00 00 C8 42 58 02 88 13 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 2D
Compact Hex连续 Hex
Request
0C060F423F1500A8
Response
0C550F423F150000000000000000000048422C01C4090000C8425802881300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002D
16Write calibration block写入校准表块Verify first需先验证

Request payload请求载荷

81 bytes: start index + exactly 10 complete entries. Use block starts 0, 10, …, 90.81 字节:起始索引 + 固定 10 条完整数据。块起点使用 0、10、…、90。

Response payload响应载荷

Status. Read the same block back with 15.状态;使用 15 读回同一块。

Writing start index 0 clears the entire previous table before writing this block. Complete and verify all blocks before selecting a table-based output. Frame size is 88 bytes; use ATT MTU ≥ 91.写入索引 0 会先清空整张旧表再写本块。完成并验证所有块后,再选择校准表输出模式。完整帧 88 字节,需要 ATT MTU ≥ 91。

Request example请求示例
0C 56 0F 42 3F 16 00 00 00 00 00 00 00 00 00 00 00 48 42 2C 01 C4 09 00 00 C8 42 58 02 88 13 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 56
Response example响应示例
0C 06 0F 42 3F 16 00 FD
Compact Hex连续 Hex
Request
0C560F423F16000000000000000000000048422C01C4090000C84258028813000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000056
Response
0C060F423F1600FD
19Set output mode设置输出类型Open无需验证

Request payload请求载荷

1 byte: 00 = normalized; 01 = millimetres; 02 = litres.1 字节:00 = 标准化输出;01 = 毫米;02 = 升。

Response payload响应载荷

Status. Read back with 1A.状态;使用 1A 读回。

Modes 1 and 2 require a valid customer calibration table. This command is not password-gated in the current firmware.模式 1、2 需要有效客户校准表。当前固件此命令不受密码验证限制。

Request example请求示例
0C 06 0F 42 3F 19 00 E5
Response example响应示例
0C 06 0F 42 3F 19 00 E5
Compact Hex连续 Hex
Request
0C060F423F1900E5
Response
0C060F423F1900E5
1ARead output mode读取输出类型Open无需验证

Request payload请求载荷

No payload.无载荷。

Response payload响应载荷

1 byte: 00 / 01 / 02.1 字节:00 / 01 / 02。

Request example请求示例
0C 05 0F 42 3F 1A E0
Response example响应示例
0C 06 0F 42 3F 1A 00 B0
Compact Hex连续 Hex
Request
0C050F423F1AE0
Response
0C060F423F1A00B0
1BRead calibration coordinate读取校准坐标Open无需验证

Request payload请求载荷

No payload.无载荷。

Response payload响应载荷

4 bytes: float32 LE, coordinate 0–5000.4 字节:float32 LE,坐标范围 0–5000。

Use this value for the calibration table’s fix_value field after deliberate integer rounding. It is not the 0–10000 output field.合理取整后用于校准表的 fix_value 字段。不要与 0–10000 输出字段混用。

Request example请求示例
0C 05 0F 42 3F 1B BE
Response example响应示例
0C 09 0F 42 3F 1B 00 40 1C 45 92
Compact Hex连续 Hex
Request
0C050F423F1BBE
Response
0C090F423F1B00401C4592
20Read BLE address读取蓝牙地址Open无需验证

Request payload请求载荷

No payload.无载荷。

Response payload响应载荷

6 address bytes in stack order. Example payload 66 55 44 33 22 11 displays as 11:22:33:44:55:66.6 字节,协议栈原始顺序。示例 66 55 44 33 22 11 显示为 11:22:33:44:55:66。

Use the three-byte sensor ID as the application identity; this value is not an iOS peripheral identifier.业务身份使用三字节传感器 ID;此值不是 iOS 的外设标识符。

Request example请求示例
0C 05 0F 42 3F 20 20
Response example响应示例
0C 0B 0F 42 3F 20 66 55 44 33 22 11 F5
Compact Hex连续 Hex
Request
0C050F423F2020
Response
0C0B0F423F20665544332211F5
21Read advertising protocol读取广播协议Open无需验证

Request payload请求载荷

No payload.无载荷。

Response payload响应载荷

1 byte: 00 = AOOOG; 01 = Universal/Dominator.1 字节:00 = AOOOG;01 = 通用 / Dominator。

Request example请求示例
0C 05 0F 42 3F 21 7E
Response example响应示例
0C 06 0F 42 3F 21 01 E0
Compact Hex连续 Hex
Request
0C050F423F217E
Response
0C060F423F2101E0
22Set advertising protocol设置广播协议Open无需验证

Request payload请求载荷

1 byte: 00 = AOOOG; 01 = Universal/Dominator.1 字节:00 = AOOOG;01 = 通用 / Dominator。

Response payload响应载荷

Status. Read back with 21.状态;使用 21 读回。

Update your scanner parser for the selected format. This command is not password-gated in the current firmware.更新扫描解析器以适配所选格式。当前固件此命令不受密码验证限制。

Request example请求示例
0C 06 0F 42 3F 22 01 B5
Response example响应示例
0C 06 0F 42 3F 22 00 EB
Compact Hex连续 Hex
Request
0C060F423F2201B5
Response
0C060F423F2200EB
26Read firmware version读取固件版本Open无需验证

Request payload请求载荷

No payload.无载荷。

Response payload响应载荷

2 bytes: major, minor. Example 08 1B = 8.27.2 字节:主版本、次版本。示例 08 1B = 8.27。

Format as decimal major + "." + decimal minor. Do not combine into uint16 or interpret as BCD. Older firmware may not respond.按十进制主版本 + 小数点 + 十进制次版本显示,不合并成 uint16,也不按 BCD 解析。旧固件可能不响应。

Request example请求示例
0C 05 0F 42 3F 26 FD
Response example响应示例
0C 07 0F 42 3F 26 08 1B A1
Compact Hex连续 Hex
Request
0C050F423F26FD
Response
0C070F423F26081BA1

Response layouts响应数据结构

All offsets in this section start at the first response payload byte (frame byte 6). Floats are four-byte IEEE 754 little-endian values, not integer bit patterns or text.本节偏移从响应载荷首字节开始(完整帧字节 6)。浮点数均为四字节 IEEE 754 小端格式,不应按整数或文本解释。

0D · Parameters, 13 bytes0D · 参数,13 字节

Offset偏移Bytes字节数Field字段Encoding / meaning编码 / 含义
01Broadcast interval广播间隔uint8, s
11Reserved保留Ignore for public integration客户接入忽略
21Continue after restart重启后继续工作00 / 01
31Transmit power发射功率int8, dBm
44Empty frequency空频率float32 LE, Hz
84Full frequency满频率float32 LE, Hz
121Output mode输出类型00 / 01 / 02

14 · Current data, 22 bytes14 · 当前数据,22 字节

Offset偏移Bytes字节数Field字段Encoding / meaning编码 / 含义
02Battery code电量码uint16 BE; see conversion见转换公式
22Temperature温度int16 BE / 8 = °C
41Legacy version code旧版版本码Compatibility byte; use 26 for the full version兼容字节;完整版本请读取 26
51Reserved保留00
64Full frequency满频率float32 LE, Hz
104Empty frequency空频率float32 LE, Hz
144Current frequency当前频率float32 LE, Hz
184Fuel output液位输出float32 LE; units depend on output modefloat32 LE;单位由输出类型决定

The sample response under command 14 decodes to battery code 700, 27°C, legacy version byte 82, full 10000 Hz, empty 15000 Hz, current 13250 Hz and output 5000. In mode 0 this output is 50.00%.命令 14 示例响应解析为:电量码 700、27°C、旧版本字节 82、满频率 10000 Hz、空频率 15000 Hz、当前频率 13250 Hz、输出 5000。模式 0 下输出对应 50.00%。

Data conversion数据转换

Field字段Formula / rule公式 / 规则
Sensor ID传感器 ID(ID2 × 65536) + (ID1 × 256) + ID0
Mode 0 output模式 0 输出percent = output / 100; 0 → 0%, 10000 → 100%百分比 = 输出 / 100;0 → 0%,10000 → 100%
Mode 1 / mode 2模式 1 / 模式 2Use output directly as mm / L, from the customer calibration table输出直接表示客户校准表转换后的 mm / L
Calibration coordinate (1B)校准坐标(1B)float32 LE, 0–5000; not a 0–4095 or 0–10000 fieldfloat32 LE,0–5000;不是 0–4095 或 0–10000 字段
AOOOG / GATT temperatureAOOOG / GATT 温度signed int16 BE / 8
Universal temperature通用协议温度uint8 − 40
AOOOG / GATT battery %AOOOG / GATT 电量百分比floor(clamp((code − 500) × 100 / 220, 0, 100))
Universal battery %通用协议电量百分比Use the byte directly; already scaled to 0–100直接使用字节,已转换为 0–100
Full firmware version完整固件版本decimal(major) + "." + decimal(minor)

Battery code 700 gives 90%, not 700% or 100%. It is a battery code, not a millivolt field. The public profile does not specify a separate calibrated voltage measurement. Reject non-finite floats. Frequency is not linearly proportional to the final output: use the sensor’s output instead of applying a second frequency-to-level conversion.电量码 700 对应 90%,不是 700% 或 100%。这是电量码,不是毫伏字段;此公开协议不规定独立的校准电压测量。应拒绝非有限浮点数。频率与最终输出并非简单线性关系,应使用传感器输出,不再重复进行频率到液位转换。

Empty/full calibration is required for meaningful level output. An output of zero by itself cannot distinguish an uncalibrated sensor from a genuinely empty tank. Read the empty/full frequencies to inspect calibration.有效液位输出依赖空满校准。仅凭输出 0 无法区分未校准与真正空箱;可读取空满频率检查校准状态。

Calibration workflows校准流程

Empty & full空点与满点

  1. Connect, enable notifications, verify access and read current data.连接、启用通知、验证访问,并读取当前数据。
  2. Place the sensor in the specified empty condition. Wait for frequency and temperature to stabilize. Send 10 and validate the reply. Read 0D to confirm the recorded empty frequency.将传感器置于规定空状态,等待频率与温度稳定。发送 10 并校验响应;读取 0D 确认记录的空频率。
  3. Repeat in the specified full condition with 11, then read back the full frequency.在规定满状态重复上述过程,使用 11,随后读回满频率。
  4. Read 14 at intermediate levels to confirm output. Writes are saved asynchronously; a success response is not a flash-commit notification. Do not remove power immediately.在中间液位读取 14 验证输出。参数异步保存;成功响应不是 Flash 落盘通知。不要立即断电。

Customer calibration table客户校准表

The table has 100 slots. Each entry is 8 bytes, with no padding. Commands 15/16 transfer exactly 10 entries per block. The response to 15 contains entries only; retain the requested index in the app.校准表包含 100 个槽位,每条 8 字节,无填充。命令 15/16 每块固定传输 10 条。15 的响应只含条目,APP 需保存请求索引。

Offset偏移Bytes字节数Field字段Encoding / meaning编码 / 含义
04volume_lfloat32 LE, L
42level_mmuint16 LE, mm
62fix_valueuint16 LE, 0–5000; captured from 1Buint16 LE,0–5000;从 1B 获取

For an entry with 50 L, 300 mm and coordinate 2500, the bytes are:一条 50 L、300 mm、坐标 2500 的数据编码为:

Single entry · 8 bytes单条数据 · 8 字节
00 00 48 42 2C 01 C4 09
  1. Back up the existing table with 15. Collect stable coordinates with 1B at measured levels/volumes. Round to uint16 deliberately and sort by strictly increasing coordinate; do not allow duplicate coordinates.先用 15 备份旧表。在实测高度/容积下用 1B 获取稳定坐标,明确取整为 uint16,按坐标严格递增排列,不允许重复坐标。
  2. Build the full replacement in the app. The example uses three entries: (0 L, 0 mm, 0), (50 L, 300 mm, 2500), (100 L, 600 mm, 5000). Remaining entries in the block are zero.在 APP 中准备整张新表。示例为三条:(0 L、0 mm、0)、(50 L、300 mm、2500)、(100 L、600 mm、5000)。块内剩余条目补零。
  3. Verify access. Write index 0 first; it clears the entire old table. Send later blocks in order. Each payload must include all 80 entry bytes even for a partially filled block. An all-zero entry after the first is a terminator; no gaps are allowed.验证访问后,先写索引 0,它会清空整张旧表。依次发送后续块;即使最后一块未填满也要携带完整 80 字节条目。首条之后的全零条目表示结束,中间不允许空洞。
  4. Read back each written block with 15 and compare all bytes. After the full table is verified, select mode 1 or 2 with 19. Keep the backup until readings are validated.每块写完后使用 15 读回并逐字节比较。整表验证后使用 19 选择模式 1 或 2。在读数验证完成前保留备份。

Transfer is not an atomic whole-table transaction. An interrupted upload can leave a partial table; reconnect, read back and recover the complete table. Never blindly restart an upload from index 0. Test the minimum and maximum calibrated levels before commissioning.传输不是整表原子事务。上传中断可能留下部分表格;应重连、读回并恢复完整表。不要盲目从索引 0 重传。交付使用前应测试最低和最高校准液位。

Connection & error handling连接与错误处理

Observation现象App actionAPP 处理
No device name没有设备名Identify the manufacturer payload; current Universal advertising intentionally has no name.通过厂商载荷识别;当前通用广播不携带名称。
Scan does not see every window无法收到每个广播窗口Scan across several configured broadcast periods. A missed packet is not a disconnect. Use magnet-triggered fast discovery when connecting.扫描覆盖多个配置广播周期。漏包不等于断开;连接时可通过磁铁触发快速发现。
No command response命令无响应Check notification subscription, correct ID, frame length, CRC, command support and authentication. Use an app-side timeout; the firmware specifies no response deadline.检查通知订阅、ID、帧长、CRC、命令支持与验证状态。APP 自行设置超时,固件没有规定响应时限。
Status 01状态 01Operation rejected. Do not treat it as data for a multi-byte read. Check payload and allowed range.操作被拒绝。多字节读取收到此状态时不能当作数据;检查载荷与允许范围。
Write success / notification missing写入成功但无通知Transport acknowledgement is not a command result. Wait for the matching FFF2 frame.传输确认不是命令执行结果,等待匹配的 FFF2 帧。
Timeout after calibration or setting校准或设置后超时Read state back before retrying; the write may already have executed.重试前先读回状态,写入可能已经执行。
Reconnect重新连接Restore notifications and authenticate again before protected operations.恢复通知,并在受保护操作前重新验证。

An incorrect sensor ID or CRC, an unsupported command, or a protected command sent before verification can be silently ignored. There is no automatic error notification for these cases.传感器 ID 或 CRC 错误、不支持的命令,以及验证前发送的受保护命令,都可能被直接忽略,不会自动返回错误通知。

A closed sensor requires magnet activation. Hold the magnet near the sensing area for about 3 seconds, then remove it before another activation. Fast discovery is temporary. Temperature and battery are cached and may update less frequently than frequency; this is expected for a battery-powered sensor.关闭的传感器需要磁铁激活。将磁铁靠近感应区约 3 秒,下次触发前先移开。快速发现是临时状态。温度和电量使用缓存,更新频率可能低于频率数据,这是电池设备的正常行为。

For firmware upgrade integration, request the separate approved upgrade guide and firmware package from AoooG. Upgrade transfer is outside this application communication profile.需要集成固件升级时,请向 AoooG 获取单独的升级指南和授权固件包。升级传输不属于本应用通信协议。

Version compatibility版本兼容

This page describes the current AG-BFLS application format verified against firmware 8.27 on 19 September 2026. A firmware version is not a Bluetooth specification version.本页描述 2026 年 9 月 19 日对照固件 8.27 核实的当前 AG-BFLS 应用格式。固件版本不等于蓝牙规范版本。

Current field当前字段Current meaning当前含义Compatibility rule兼容规则
Universal payload [3:5]Two bytes: major, minor两个字节:主、次版本Earlier formats used other meanings, including version code and interval. Do not reinterpret an old packet using the current layout without confirming its firmware.早期格式曾用于版本码和广播间隔等含义。未确认固件前,不要用当前含义解析旧包。
Universal Type5BEarlier samples used 5A. Type alone is not a complete firmware-version detector; obtain the matching specification for older devices.早期样本使用 5A。仅凭 Type 不能完整识别固件版本,旧设备需匹配对应规格。
GATT 14, byte 4One-byte legacy version code单字节兼容版本码Not sufficient for the full minor version; use 26.不足以表示完整次版本;使用 26。
GATT 26major / minorOlder firmware may have no response. Show “version unavailable” rather than inventing a version.旧固件可能不响应,应显示“版本不可用”,不要推算版本。

Only the commands documented here are part of this public profile. Public integration does not require internal sensor algorithms or production programming instructions.只有本文档列出的命令属于此公开接口。客户接入不需要内部传感算法或生产编程指令。