Qassay 快速检测阅读器 - 软件开发工具包 (SDK)

文档编号: D006-PIB21001 | 版本: Rev B | 日期: 2025年12月10日
P4Q Electronics - Calle Nuestra Senora de la Guia, N 19, 48810 ALONSOTEGI (BIZKAIA), Spain
电话: +34 94 498 2028

目录 / Table of Contents

  1. BLE 连接 / BLE Connectivity
    1. 服务 / Services
    2. 操作 / Operation
    3. 读取工作流 / Reading Workflow
    4. 设备连接 / Device Connection
    5. 固件无线更新 / FUOTA
    6. 质控流程 / QC Procedure
    7. 硬件错误检测 / HW Error Detection
    8. 用户错误 / User Errors
  2. API 连接 / API Connectivity
    1. 工作流 / Workflow
    2. Qassay 检测项目属性 / Qassay Test Properties
    3. 生产批次属性 / Manufacturing Batch Properties
  3. 文档管理记录 / Document Management Log
1 BLE 连接 / BLE Connectivity
ENThe aim of this report is to describe the software development kit to build an application based on the Bluetooth characteristics of the device and connectivity to the Qassay API.
本文档旨在介绍基于设备蓝牙特性以及 Qassay API 连接的应用程序开发工具包 (SDK)。
1.1 服务 / Services
ENThe device exposes a single service UUID: 01DEA611-EFE9-4A3A-AA30-ED10C3C84F55
设备暴露一个单一的服务 UUID:01DEA611-EFE9-4A3A-AA30-ED10C3C84F55
按钮特征 / Button Characteristic
ENUUID: 01DEA612-EFE9-4A3A-AA30-ED10C3C84F55
UUID: 01DEA612-EFE9-4A3A-AA30-ED10C3C84F55
ENThe button characteristic indicates if the button inside the device is pressed. If this button is pressed it indicates that the cassette is fully inserted.
Read: 1 byte unsigned
Notify: Triggered when the button changes its status
按钮特征用于指示设备内部的按钮是否被按下。按钮按下表示检测卡已完全插入。
读取: 1字节无符号整数
通知: 按钮状态变化时触发
硬件与软件信息 / Hardware & Software Info
ENUUID: 01DEA617-EFE9-4A3A-AA30-ED10C3C84F55
UUID: 01DEA617-EFE9-4A3A-AA30-ED10C3C84F55
ENHardware & software indicates some info about the embedded firmware and the sensors built within the device.
Read: 8 bytes unsigned
Format: AAAA BB CC DD 00 00 00
  AAAA: Hardware ID (0x201 White, 0x202 Dual)
  BB: Client ID (0x01 generic, 0xFF test)
  CC: SW Minor ID
  DD: SW Major ID
硬件与软件特征提供嵌入式固件及设备内置传感器的一些信息。
读取: 8字节无符号整数
格式: AAAA BB CC DD 00 00 00
  AAAA: 硬件ID (0x201 白色版, 0x202 双通道版)
  BB: 客户ID (0x01 通用版, 0xFF 测试版)
  CC: 软件小版本号
  DD: 软件大版本号
电池电压 / Battery Voltage
ENUUID: 01DEA614-EFE9-4A3A-AA30-ED10C3C84F55
UUID: 01DEA614-EFE9-4A3A-AA30-ED10C3C84F55
ENIndicates the battery voltage, can be used in order to determine the battery percentage in order to proceed with a reading. Note that very low levels of charge may lead to malformed readings.
Read: 2 bytes unsigned little endian (HEX)
Formula: SOC (%) = 200 * (batteryVoltage / 1000) - 730
Example: 0x960F -> swap to 0x0F96 -> DEC=3990 -> 200*(3990/1000)-730 = 68%

Thresholds:
• <3650: 0% -> Dead (block readings)
• Low battery 3750: 20% -> Low battery (Red LED)
• >4150: 100% -> Full battery (Green LED)
指示电池电压,可用于确定电池电量百分比以决定是否继续读取。请留意,极低电量可能导致读取结果异常。
读取: 2字节无符号小端序(HEX)
公式: 电量 (%) = 200 * (电池电压 / 1000) - 730
示例: 0x960F -> 交换为 0x0F96 -> 十进制=3990 -> 200*(3990/1000)-730 = 68%

阈值:
• 低于3650: 0% -> 已耗尽 (阻止读取)
• 低电量3750: 20% -> 低电量 (红色LED)
• 高于4150: 100% -> 满电 (绿色LED)
USB 连接 / USB Connected
ENUUID: 01DEA619-EFE9-4A3A-AA30-ED10C3C84F55
For now USB connection is used only for charging, so using charging characteristics is recommended.
Read: 1 byte unsigned
UUID: 01DEA619-EFE9-4A3A-AA30-ED10C3C84F55
目前 USB 连接仅用于充电,建议使用充电特征来判断。
读取: 1字节无符号整数
充电状态 / Charging
ENUUID: 01DEA61A-EFE9-4A3A-AA30-ED10C3C84F55
Indicates if the battery is charging
Read: 1 byte unsigned
UUID: 01DEA61A-EFE9-4A3A-AA30-ED10C3C84F55
指示电池是否正在充电
读取: 1字节无符号整数
低电量通知 / Low Battery Notification
ENUUID: 01DEA61E-EFE9-4A3A-AA30-ED10C3C84F55
There is a characteristic that notifies whether the device is in low battery status
Read: 1 byte unsigned
UUID: 01DEA61E-EFE9-4A3A-AA30-ED10C3C84F55
该特征用于通知设备是否处于低电量状态
读取: 1字节无符号整数
MAC 地址 / Mac Address
ENUUID: 01DEA618-EFE9-4A3A-AA30-ED10C3C84F55
Indicates the MAC address
Read: 6 bytes unsigned
UUID: 01DEA618-EFE9-4A3A-AA30-ED10C3C84F55
指示设备的 MAC 地址
读取: 6字节无符号整数
IMPORTANT: This characteristic is especially relevant for iPhone devices, as the MAC is not exposed by the phone.
重要: 此特征对于 iPhone 设备尤其重要,因为苹果手机不会主动暴露连接的蓝牙设备 MAC 地址。
获取上次读取的传感器配置 / Get Sensor Configuration from Previous Reading
ENUUID: 01DEA615-EFE9-4A3A-AA30-ED10C3C84F55
Indicates the configuration of the sensor in the previous reading
Read: 6 bytes unsigned
Byte 0 & 1: ASTEP
Byte 2: ATIME
Byte 3: AGAIN
Byte 4: LED_DRIVE
Byte 5: 0 (raw) / 1 (normalized)
UUID: 01DEA615-EFE9-4A3A-AA30-ED10C3C84F55
指示上次读取中传感器的配置参数
读取: 6字节无符号整数
字节 0 & 1: ASTEP (步进时间)
字节 2: ATIME (积分时间)
字节 3: AGAIN (模拟增益)
字节 4: LED_DRIVE (LED驱动电流)
字节 5: 0 (原始数据) / 1 (归一化数据)
1.2 操作 / Operation
执行读取操作 / Operation to Perform Reading
ENUUID: 01DEA613-EFE9-4A3A-AA30-ED10C3C84F55
Write 0x04: Enables reading, next button press/release will proceed with reading
Write 0x07: Enables White LED (when using a DUAL reader and trying to read a visible test)
UUID: 01DEA613-EFE9-4A3A-AA30-ED10C3C84F55
写入 0x04: 启用读取模式,下一次按下/释放按钮将执行读取
写入 0x07: 开启白色LED (当使用双通道(Dual)设备读取可见光检测卡时)
光谱数据特征 / Spectrals Characteristics
ENThe spectrals characteristics allow retrieval of the readings from the sensors. Key concepts:
• Once the device is turned on, when the button is released the device will execute a reading.
• The reading process takes about 1 second, and takes 250 sensor reads, after this the characteristics will be available.
• Once the reading is finished the device will notify the F1 characteristic.
• The read operations over any of the following characteristics will return the last reading.
• There is memory limit on how many characteristics can be read at the same time (3), but it is recommended to read them one by one.
• Each characteristic represents light for a certain wavelength with an array of 250 x 16 byte unsigned integers.
光谱特征用于获取传感器的读数。关键概念:
• 设备开机后,释放按钮时设备将执行一次读取。
• 读取过程约需 1 秒,采集 250 次传感器读数,之后特征数据可用。
• 读取完成后设备将通过 F1 特征发出通知。
• 对以下任一特征的读取操作将返回最后一次读取结果。
• 同时读取特征数量存在内存限制(最多3个),但建议逐个读取。
• 每个特征代表特定波长的光信号,包含一个由 250 个 16 字节无符号整数组成的数组。
EN F1: 01DEA621-EFE9-4A3A-AA30-ED10C3C84F55
F2: 01DEA622-EFE9-4A3A-AA30-ED10C3C84F55
F3: 01DEA623-EFE9-4A3A-AA30-ED10C3C84F55
F4: 01DEA624-EFE9-4A3A-AA30-ED10C3C84F55
F5: 01DEA625-EFE9-4A3A-AA30-ED10C3C84F55
F6: 01DEA626-EFE9-4A3A-AA30-ED10C3C84F55
F7: 01DEA627-EFE9-4A3A-AA30-ED10C3C84F55
F8: 01DEA628-EFE9-4A3A-AA30-ED10C3C84F55
F1: 01DEA621-EFE9-4A3A-AA30-ED10C3C84F55
F2: 01DEA622-EFE9-4A3A-AA30-ED10C3C84F55
F3: 01DEA623-EFE9-4A3A-AA30-ED10C3C84F55
F4: 01DEA624-EFE9-4A3A-AA30-ED10C3C84F55
F5: 01DEA625-EFE9-4A3A-AA30-ED10C3C84F55
F6: 01DEA626-EFE9-4A3A-AA30-ED10C3C84F55
F7: 01DEA627-EFE9-4A3A-AA30-ED10C3C84F55
F8: 01DEA628-EFE9-4A3A-AA30-ED10C3C84F55
ENRead: 500 bytes unsigned, each 2 bytes represent a point, pairwise u8 as little endian
u8 => 2^8 = 16*16 = 256
Example: "eb", "6" -> eb + 6 -> 256*6 + 235 = 1771
Notify: Only F1 sends a notification, this notification indicates that the read operations can be executed.
读取: 500字节无符号整数,每2字节代表一个数据点,以小端序成对u8编码
u8 => 2^8 = 256
示例: "eb", "6" -> eb + 6 -> 256*6 + 235 = 1771
通知: 仅 F1 会发送通知,该通知表示读取操作可以执行。
1.3 读取工作流 / Reading Workflow
ENAs a summary on how to operate with the device:
• Check if the battery is not very low, otherwise stop the execution
• If DUAL device is attempting to read a visible test -> Write operation with 0x07
• Write operation with 0x04
• Wait for button notification to be triggered with false (button released)
• Wait for F1 notification to be triggered (reading completed)
• Iterate over the frequencies reading them one by one.
设备操作流程总结:
• 检查电池电量是否过低,若过低则停止执行
• 如果是双通道设备读取可见光检测卡 -> 写入 0x07
• 写入 0x04 (启用读取模式)
• 等待按钮通知触发 false (按钮已释放)
• 等待 F1 通知触发 (读取完成)
• 逐个遍历 F1-F8 频率通道逐一读取数据。
数据采集实例 / Practical Example of Data Acquisition
const mac: string = '<DEVICE_MAC>';
const service: string = '01DEA611-EFE9-4A3A-AA30-ED10C3C84F55';

read = async (frequency: string): Promise<Uint16Array> => {
  const data: DataView = await BleClient.read(mac, service, frequency);
  return new Uint16Array(data.buffer);
}

const f1: string = '01DEA621-EFE9-4A3A-AA30-ED10C3C84F55';

// Operation - 操作控制
const BLE_OP_CONTROL = '01DEA613-EFE9-4A3A-AA30-ED10C3C84F55';
const BLE_OP_CONTROL_VALUE = 0x04;
const op: Uint8Array = new Uint8Array([BLE_OP_CONTROL_VALUE]);
await BleClient.write(mac, BLE_LFT_POC, BLE_OP_CONTROL, new DataView(op.buffer));

// Reading - 读取数据
await BleClient.startNotifications(mac, service, f1, async () => {
  // Notification received, reading values are ready
  // 收到通知,读取值已就绪
  const reading: Record<string, number[]> = {};
  // Array of characteristics, from F1 to F8
  // 光谱特征数组,从 F1 到 F8
  for (let frequency of frequencies) {
    const values: Uint16Array = read(frequency)
    // Values is an array of 250 unsigned integers of this certain frequency
    // values 是该频率对应的 250 个无符号整数数组
    reading[frequency] = values;
  }
  console.log(reading);
});
1.4 设备连接 / Device Connection
ENThis section provides a brief explanation of the connection flow for the Qassay device.
本章节简要说明 Qassay 设备的连接流程。
ENThe device connection screen can be accessed from the "How to" screen. At this point, the connect device screen or step will load. For the Qassay to be selected for connection, we must first turn on the device. When it flashes, we select it for connection.
设备连接界面可从"使用指南"界面进入。此时将加载连接设备界面或步骤。要选择 Qassay 设备进行连接,首先需要打开设备电源。当设备 LED 闪烁时,即可选择该设备进行连接。
ENWhen the device to be connected has been selected, the battery information and the connected message will be displayed, and this function will then manage the connection.
选定要连接的设备后,将显示电池信息和已连接消息,随后由该功能管理连接过程。
ENThe following handler from the function is used to manage the PIN. If the device is already paired, it will not prompt for the PIN; however, it will if it has never been paired before.
以下处理函数用于管理 PIN 码。如果设备已经配对过,则不会提示输入 PIN 码;但如果从未配对,则会弹出 PIN 码输入提示。
ENThe method for verifying the validity of the pairing and PIN varies depending on whether it is iOS or Android, notifying the user at all times of the status of their actions with visual alerts or toasts.
验证配对和 PIN 码有效性的方法因 iOS 或 Android 平台而异,全程通过视觉提示或 Toast 消息向用户反馈操作状态。
1.5 固件无线更新 / FUOTA (Firmware Update Over The Air)
ENThe FUOTA functionality is implemented so that the firmware of the device can be updated via Bluetooth using the smartphone app.
FUOTA (固件无线更新) 功能已实现,可通过智能手机 App 经由蓝牙对设备固件进行更新。
更新流程 / Update Procedure
EN Step 1: Connect the device
Step 2: Retrieve HW ID and SW ID from characteristic 01DEA617-EFE9-4A3A-AA30-ED10C3C84F55
  - Bytes 1 and 2 -> HW ID
  - Bytes 4 (SW minor) and 5 (SW major)
Step 3: Convert values from HEX to DEC
Step 4: Get from public bucket firmware, filter by HW ID, get the latest UUID:
https://s3.eu-west-3.amazonaws.com/qassay.pre.public/firmwares/index.json
  - Filter the FirmwareIndex by hardwareCode (HW ID in DEC)
步骤 1: 连接设备
步骤 2: 从特征 01DEA617-EFE9-4A3A-AA30-ED10C3C84F55 获取硬件 ID 和软件 ID
  - 字节 1 和 2 -> 硬件 ID
  - 字节 4 (软件小版本) 和 5 (软件大版本)
步骤 3: 将值从 HEX 转换为 DEC
步骤 4: 从公共存储桶获取固件索引,按硬件 ID 过滤,获取最新 UUID:
https://s3.eu-west-3.amazonaws.com/qassay.pre.public/firmwares/index.json
  - 按 hardwareCode (十进制硬件ID) 过滤 FirmwareIndex
EN FirmwareIndex Interface:
interface FirmwareIndex {
    entries: FirmwareIndexEntry[];
}
interface FirmwareIndexEntry {
    id: number;
    code: number;
    name: string;
    uuid: string;
    hardwareCodes: number[];
    createdAt: Date;
}
FirmwareIndex 接口定义:
interface FirmwareIndex {
    entries: FirmwareIndexEntry[];
}
interface FirmwareIndexEntry {
    id: number;
    code: number;
    name: string;
    uuid: string;
    hardwareCodes: number[];
    createdAt: Date;
}
EN Step 5: Check if the SW ID is the latest. If so, no need to update.
Step 6: Download the firmware using the UUID from previous step:
https://s3.eu-west-3.amazonaws.com/qassay.pre.public/firmwares/${firmware.uuid}/data.bin
Step 7: Add a right pad of zeros to the binary so that the file matches a multiple of 16 bytes.
Step 8: Divide the binary in chunks of 240 bytes so the data is uploaded sliced.
Step 9: Calculate number of blocks of 8 (so the progress can be tracked)
步骤 5: 检查软件 ID 是否为最新版本。若是,则无需更新。
步骤 6: 使用上一步获取的 UUID 下载固件:
https://s3.eu-west-3.amazonaws.com/qassay.pre.public/firmwares/${firmware.uuid}/data.bin
步骤 7: 在二进制数据右侧填充零,使文件大小为 16 字节的整数倍。
步骤 8: 将二进制数据按 240 字节为单位进行分块,以便分片上传。
步骤 9: 计算以 8 块为一组的数量 (便于进度追踪)
EN Step 10: Write (without response) to Base Address 2046a492-6798-422d-8dc6-0cf7d7729940
  Data: [0x02, 0x04, 0x80, 0x00, {number of blocks in hex}]
Step 11: Wait (Indicate) for Confirmation Address 2046a492-6798-422d-8dc6-0cf7d7729940
Step 12: Write (without response) binary in chunks of 240 bytes
Step 13: Wait until all the chunks have been uploaded and the progress has finished
Step 14: Read Address 2046a495-6798-422d-8dc6-0cf7d7729940 to check it matches the size of the original binary (optional, recommended especially for iOS)
Step 15: Reboot after a couple of seconds to complete update
Step 16: Connect the device again
Step 17: POST /readers/{readerId}/firmware-update-history
  Body: { "hardwareVersion": 513, "softwareVersion": 1282 }
步骤 10: 向基地址 2046a492-6798-422d-8dc6-0cf7d7729940 无响应写入
  数据: [0x02, 0x04, 0x80, 0x00, {块数量(十六进制)}]
步骤 11: 等待确认地址 2046a492-6798-422d-8dc6-0cf7d7729940 的 Indicate 通知
步骤 12: 按 240 字节分块无响应写入固件数据
步骤 13: 等待所有分块上传完毕且进度完成
步骤 14: 读取地址 2046a495-6798-422d-8dc6-0cf7d7729940 检查是否与原始固件大小一致 (可选,iOS 平台强烈建议)
步骤 15: 几秒后设备自动重启完成更新
步骤 16: 重新连接设备
步骤 17: POST /readers/{readerId}/firmware-update-history
  请求体: { "hardwareVersion": 513, "softwareVersion": 1282 }
FUOTA 代码参考 / FUOTA Code Reference
const BLE_INSTALL_FIRMWARE_CHUNK_SIZE: number = 240;
const BLE_INSTALL_FIRMWARE_BLOCK_SIZE: number = 16;

enum BleFirmwareUpdateBaseAddressActionEnum {
    StopAllUpload = 0x00,
    StartUserDataUpload = 0x01,
    StartApplicationFileUpload = 0x02,
    EndOfFileTransfer = 0x06,
    FileUploadFinish = 0x07,
    CancelUpload = 0x08
}

export interface InstallFirmwareProgressInterface {
    step: InstallFirmwareStepEnum;
    total: number;
    uploaded: number;
}

export enum InstallFirmwareStepEnum {
    'START',                 // 开始
    'WRITE_START_FILE_UPLOAD', // 写入启动文件上传
    'WAITING_FOR_CONFIRMATION', // 等待确认
    'UPLOAD_FIRMWARE',       // 上传固件
    'WRITE_END_OF_FILE_TRANSFER', // 写入结束文件传输
    'WAITING_FOR_REBOOT',    // 等待重启
    'FINISHED',              // 完成
    'FAILED'                 // 失败
}
1.6 质控流程 / QC Procedure
ENThe QC Check is a functionality that verifies if the device is working correctly after several uses. The concept of QC check stands for verification of the performance of the device, not recalibration.
质控检查 (QC Check) 是用于在经过多次使用后验证设备是否正常工作的功能。QC 检查的概念是验证设备性能,而非重新校准。
In the future this procedure will be replaced by the QC fluorescence card, implementation is not recommended for the moment.
未来此流程将被 QC 荧光卡取代,目前不建议实现此功能。
QC 流程步骤 / QC Procedure Steps
EN • Scan QR code on calibration stick
• Check QR code corresponds to a calibration stick
• GET calibration stick ID from endpoint, where code is QR code: GET /calibration-stick/by-code/:code
• On-screen instructions on how to insert the QC kit (recommended)
• When the QC kit is inserted, execute the test with a button in the app
• Write byte 0x07 and then byte 0x03 to characteristic 01DEA613-EFE9-4A3A-AA30-ED10C3C84F5
• Store spectral data from F1 to F8
• 扫描校准棒上的 QR 码
• 验证 QR 码对应的是校准棒
• 通过端点获取校准棒 ID: GET /calibration-stick/by-code/:code
• 屏幕上显示 QC 质控卡插入操作指引 (建议)
• QC 质控卡插入后,通过 App 中的按钮执行检测
• 向特征 01DEA613-EFE9-4A3A-AA30-ED10C3C84F5 依次写入 0x07 和 0x03
• 存储 F1 至 F8 的光谱数据
EN Get normalization data from Black and White:
[BLACK] Write bytes 0x05 and 0x00 to characteristic 01DEA616-EFE9-4A3A-AA30-ED10C3C84F55
Expected response: 0B XX AAAA BBBB CCCC DDDD EEEE FFFF GGGG HHHH
(F1=AAAA, F2=BBBB, etc.; each Fx is 2 bytes of normalization data for each spectral)

[WHITE] Write bytes 0x05 and 0x01 to characteristic 01DEA616-EFE9-4A3A-AA30-ED10C3C84F55
Expected response: 0B XX AAAA BBBB CCCC DDDD EEEE FFFF GGGG HHHH
(F1=AAAA, F2=BBBB, etc.; each Fx is 2 bytes of normalization data for each spectral)
获取黑白归一化数据:
[黑色校准] 向特征 01DEA616-EFE9-4A3A-AA30-ED10C3C84F55 写入字节 0x05 和 0x00
预期响应: 0B XX AAAA BBBB CCCC DDDD EEEE FFFF GGGG HHHH
(F1=AAAA, F2=BBBB, 以此类推; 每个 Fx 为对应光谱通道的 2 字节归一化数据)

[白色校准] 向特征 01DEA616-EFE9-4A3A-AA30-ED10C3C84F55 写入字节 0x05 和 0x01
预期响应: 0B XX AAAA BBBB CCCC DDDD EEEE FFFF GGGG HHHH
(F1=AAAA, F2=BBBB, 以此类推; 每个 Fx 为对应光谱通道的 2 字节归一化数据)
请求数据格式 / Request JSON Format
{
  "data": {
    "F1": { ... },
    "F2": { ... },
    "F3": { ... },
    "F4": { ... },
    "F5": { ... },
    "F6": { ... },
    "F7": { ... },
    "F8": { ... }
  },
  "normalizationData": {
    "white": { "F1": xx, "F2": xx, "F3": xx, "F4": xx, "F5": xx, "F6": xx, "F7": xx, "F8": xx },
    "black": { "F1": xx, "F2": xx, "F3": xx, "F4": xx, "F5": xx, "F6": xx, "F7": xx, "F8": xx }
  },
  "calibrationStick": { "id": 0 },
  "reader": { "id": 0 }
}
EN • Send composed JSON to endpoints:
  POST /readers/:id/quality-checks
  POST /readers/:id/check-calibration
• Expected response with status: "Error" or "Ok"
OK -> Success, you can keep using the device
Error -> Failed, please check your distributor and no longer use the device
• 将构造的 JSON 发送至以下端点:
  POST /readers/:id/quality-checks
  POST /readers/:id/check-calibration
• 预期响应包含状态: "Error" 或 "Ok"
OK -> 成功,可继续使用设备
Error -> 失败,请联系经销商,不要再使用此设备
1.7 硬件错误检测 / HW Error Detection
ENEvery time a device is connected, the following checks are required. These are considered functionality errors, which may get the device inoperable. It is recommended to replace the reader in these cases.
每次设备连接时,需要进行以下检查。这些属于功能性错误,可能导致设备无法正常工作。建议在这些情况下更换设备。
EN - Description中文 - 描述EN - Feedback中文 - 反馈
USB/Charging Check:
• If USB characteristic is enabled, device is charging
• If USB characteristic is disabled, device is not charging
USB/充电检查:
• 若 USB 特征已启用,表示设备正在充电
• 若 USB 特征已禁用,表示设备未在充电
Error - Please contact your distributor 错误 - 请联系您的经销商
Low Battery Check:
• Check device is not in low battery
低电量检查:
• 检查设备不处于低电量状态
Low battery - Please charge the device 低电量 - 请给设备充电
Normalization Data Check:
• Check values are different to 0 and 32767
归一化数据检查:
• 检查值不等于 0 和 32767
Error - Please contact your distributor 错误 - 请联系您的经销商
1.8V Check:
• Check voltage is okay
1.8V 电压检查:
• 检查电压是否正常
Error - Please contact your distributor 错误 - 请联系您的经销商
Product ID Check:
• Hardware ID, SW ID and HW ID is not 0x00
产品 ID 检查:
• 硬件 ID、软件 ID 及硬件 ID 不为 0x00
Error - Please contact your distributor 错误 - 请联系您的经销商
OTP Memory Free Space Check OTP 内存可用空间检查 Error - Please contact your distributor 错误 - 请联系您的经销商
1.8 用户错误 / User Errors
ENDuring the use of the device, the following errors from the user may arise. This is a non-exhaustive list that aims to describe the most common ones, and the advised feedback and action from the user.
在使用设备过程中,可能会出现以下用户操作引起的错误。此非详尽列表,旨在描述最常见的错误情况及建议的用户反馈和操作。
EN - Description中文 - 描述EN - Feedback中文 - 反馈
Device won't turn on 设备无法开机 Low battery - Please charge the device. If the LED does not switch on after the USB-C cable is connected, please contact your distributor. 低电量 - 请给设备充电。若连接 USB-C 线缆后 LED 仍未亮起,请联系经销商。
QR read is not available in the platform 平台中无法读取该 QR 码 Test not available - Please check the correct QR code is being read 检测不可用 - 请确认正在读取的是正确的 QR 码
Read UV QR with a White device 用白色版设备读取紫外线检测卡 QR 码 Test not available - Please check the correct QR code is being read 检测不可用 - 请确认正在读取的是正确的 QR 码
Bluetooth permission not granted 未授予蓝牙权限 Bluetooth permission required - Please grant permission to use the Bluetooth 需要蓝牙权限 - 请授予使用蓝牙的权限
Bluetooth is turned off 蓝牙已关闭 Bluetooth disabled - Please turn on the Bluetooth on your phone 蓝牙已禁用 - 请在手机上开启蓝牙
Camera permission not granted 未授予相机权限 Camera permission required - Please grant permission to use the camera 需要相机权限 - 请授予使用相机的权限
Device connection failed (wrong PIN) 设备连接失败 (PIN 码错误) Connection failed - Connection failed, make sure you introduced the correct PIN 连接失败 - 请确认输入了正确的 PIN 码
Device connection failed (device is off) 设备连接失败 (设备已关机) Connection failed - Make sure your device is on 连接失败 - 请确认设备已开机
Test removed too fast 检测卡拔出过快 Repeat reading - Please remove the test slower at a steady speed 重新读取 - 请以稳定速度较慢地拔出检测卡
Test removed too slow 检测卡拔出过慢 Repeat reading - Please remove the test faster at a steady speed 重新读取 - 请以稳定速度较快地拔出检测卡
Reading error (other) 读取错误 (其他) Repeat reading - Please remove the test at a steady speed 重新读取 - 请以稳定速度拔出检测卡
Read expired batch QR code 读取了已过期的批次 QR 码 Batch expired - Batch expired, please use a valid batch 批次已过期 - 请使用有效批次的检测卡
Test deemed invalid due to:
(1) Long time after reaction time
(2) Missing control line
(3) Unexpected signal
检测判定无效,原因:
(1) 超出反应时间
(2) 缺少质控线
(3) 非预期信号
Invalid test - (1) The reaction time was exceeded, please repeat the process with a new test. (2) (3) Repeat procedure with a new test. 无效检测 - (1) 反应时间已超过,请使用新的检测卡重新检测。(2)(3) 请使用新的检测卡重新检测。
QC fails 质控检查失败 QC failed - Please contact your distributor 质控失败 - 请联系您的经销商
MAC does not exist in the database MAC 地址不在数据库中 Device not found - Please contact your distributor 未找到设备 - 请联系您的经销商
Failed update 更新失败 Update failed - Update failed, please retry the process 更新失败 - 请重试更新流程
The user gets out of the reading process mid process 用户在读取过程中退出 You are about to leave - You will receive a notification when the test is ready. Reading is discarded. 您即将离开 - 检测就绪时将收到通知。当前读数将被丢弃。
Resume test 恢复检测 You have a pending test, do you want to resume? If discarded, it won't appear on dashboard nor app if no readings exist. 您有一个待处理的检测,是否恢复?若丢弃且无读数记录,则不会显示在仪表盘和 App 中。
Internet connection lost 网络连接丢失 Please make sure you are connected to the internet to use the device 请确保已连接互联网以使用设备
2 API 连接 / API Connectivity
2.1 工作流 / Workflow
Note: The endpoints may change, but the goal is to keep the operation the same.
注意: API 端点可能会有变化,但旨在保持操作方式不变。
EN Step 1: Retrieve the strip ID from its code (the QR code)
GET https://api.qassay.com/documentation#/Strips/StripController_getByCode
Make sure to retrieve sampleTypes from the test you read, as it will be required on next step.
You can also retrieve the "maxReactionTime", the extra time after the test reaction time has been exceeded (to be checked after reaction time has expired).
- Check Expiration date -> If expired, notify user the test is expired, and to use another test.
步骤 1: 通过 QR 码获取检测卡 ID
GET https://api.qassay.com/documentation#/Strips/StripController_getByCode
请务必从读取的检测结果中获取 sampleTypes (样本类型),下一步将需要用到。
同时也可获取 "maxReactionTime"(最大反应时间),即检测反应时间到期后的额外允许时间 (需在反应时间到期后进行检查)。
- 检查有效期 -> 若已过期,通知用户检测卡已过期,需使用另一张检测卡。
EN Step 2: Create the sample
POST https://api.qassay.com/documentation#/Samples/SampleController_create
Make sure to choose a sampleType from the previous step, and set it up; this sample type will then apply a corrective factor. If sample type is blood, you can predefine it. In this case, select "blood" as sampleType.
步骤 2: 创建样本
POST https://api.qassay.com/documentation#/Samples/SampleController_create
请从上一步中选取一个 sampleType 并设置; 该样本类型将应用相应的校正因子。若样本类型为血液,可预定义为 "blood"。
EN Step 3: Retrieve the timer for the sample you just created
GET https://api.qassay.com/documentation#/Samples/SampleController_getTimer
Once the timer ends, the maxReactionTime needs to be tracked. If it also ends, the reading needs to be disabled and the user should be asked to repeat the reading with another test.
步骤 3: 获取刚刚创建的样本计时器
GET https://api.qassay.com/documentation#/Samples/SampleController_getTimer
计时器结束后,需要追踪 maxReactionTime。如果 maxReactionTime 也结束,需禁用读取并提示用户使用另一张检测卡重新检测。
EN Step 4: Retrieve the reader ID from its MAC address
GET https://api.qassay.com/documentation#/Readers/ReaderController_getByMac
- Check the reader exists.
步骤 4: 通过 MAC 地址获取设备 ID
GET https://api.qassay.com/documentation#/Readers/ReaderController_getByMac
- 检查设备是否存在。
EN Step 5: Once the reading is finished, ask the server to validate the reading data
POST /samples/{id}/validate
{
  "id": 0,
  "attemptNumber": 0,
  "key": "string",
  "result": {
    "id": 0,
    "status": "Error",  // Error or OK
    "error": "ExtractionTooFast"  // Error codes
  },
  "createdAt": "2025-06-16T09:57:23.766Z",
  "updatedAt": "2025-06-16T09:57:23.766Z"
}
步骤 5: 读取完成后,请服务器验证读取数据
POST /samples/{id}/validate
{
  "id": 0,
  "attemptNumber": 0,
  "key": "string",
  "result": {
    "id": 0,
    "status": "Error",  // Error 或 OK
    "error": "ExtractionTooFast"  // 错误码
  },
  "createdAt": "2025-06-16T09:57:23.766Z",
  "updatedAt": "2025-06-16T09:57:23.766Z"
}
预期错误码 / Expected Errors
EN - Error中文 - 错误EN - Description / Action中文 - 描述 / 操作
ExtractionTooFast 拔出过快 Extraction was done too fast. Action: Repeat reading slower, as shown in the video. If encountered TooFast/TooSlow 10 times in a row, ask the user to use another test. 拔出速度过快。操作: 如视频所示以较慢速度重新读取。若连续 10 次出现过快/过慢,提示用户更换检测卡。
ExtractionTooSlow 拔出过慢 Extraction was done too slow. Action: Repeat reading faster, as shown in the video. If encountered TooFast/TooSlow 10 times in a row, ask the user to use another test. 拔出速度过慢。操作: 如视频所示以较快速度重新读取。若连续 10 次出现过快/过慢,提示用户更换检测卡。
MissingControlLine 缺少质控线 The control line on the test was not found. Action: Invalid test, ask the user to repeat the test. If encountered 3 times in a row, ask the user to use another test. 未检测到质控线。操作: 无效检测,提示用户重新检测。若连续 3 次出现,提示用户更换检测卡。
Other 其他错误 Used when non-parsed errors are detected. Action: Repeat reading. If encountered 3 times in a row, ask the user to use another test. 用于未解析的错误。操作: 重新读取。若连续 3 次出现,提示用户更换检测卡。
EN Step 6: Upload the data to the server
POST https://api.qassay.com/documentation#/Samples/SampleController_upload
Once this is done, the server will start processing the sample. It takes a couple of seconds until the reading is available and processed.
步骤 6: 上传数据到服务器
POST https://api.qassay.com/documentation#/Samples/SampleController_upload
完成后服务器将开始处理样本。读数需要几秒钟时间才能处理完毕并可用。
2.2 Qassay 检测项目属性 / Qassay Test Properties
ENFollowing properties are expected for tests (strip-type). These are examples for some markers already on the Qassay platform. A similar configuration may be set up for the custom platform.
以下为检测项目 (strip-type) 的预期属性。这些是 Qassay 平台已上线的部分标志物示例。定制平台可参照此配置进行类似设置。
Property / 属性 FSHLHProgesterone / 孕酮 AMHβ-HCGVitamin D / 维生素D TSHEstradiol / 雌二醇(E2)
strip-type-id / 检测卡类型ID 502430368369485494457494
Light / 光源类型 Ultra-violet / 紫外线
sampleTypes / 样本类型
(校正因子)
Serum/血清: 1
Plasma/血浆: 1
Blood/全血: 1.5
Serum: 1
Plasma: 1
Blood: 2
Serum: 1
Plasma: 1
Blood: 1.5 / 1.3
Serum: 1
Plasma: 1
Blood: 1.5
Sampling / 反应时间 (秒) 900
maxReactionTime / 最大允许读数时间 (秒) 180
sampleWellOrientation / 样本孔方向 analytes-control / 分析物-质控
分析物详细属性 / Analyte Properties
Property / 属性FSHLHProgesteroneAMHβ-HCGVitamin DTSHE2
Analyte ID31267824222823
Analyte Name / 分析物名称FSHLHProgesterone / 孕酮AMHβ-HCGVitamin D / 维生素DTSHE2 / 雌二醇
rangeMin / 最小范围0.20000000
rangeMax / 最大范围1501006016200001001003000
cutOff / 截断值0.250.50.1550.15
Unit / 单位mIU/mLmIU/Lng/mLng/mLmIU/mLng/mLuIU/mLpg/mL
assayMethod / 检测方法Sandwich / 夹心法
ENAvailable result units: %, mg/L, ug/mL, ng/mL, TCID50/mL, uUi/mL, g/dL, pg/mL, UI/L, mUI/L, ug/dL, ug/g, U/mL, mg/dL, BAU/mL, mUI/mL, pmol/mL, ng/L, g/L, mmol/L, RBC/uL, WBC/uL, nmol/L
可用的结果单位: %、mg/L、ug/mL、ng/mL、TCID50/mL、uUi/mL、g/dL、pg/mL、UI/L、mUI/L、ug/dL、ug/g、U/mL、mg/dL、BAU/mL、mUI/mL、pmol/mL、ng/L、g/L、mmol/L、RBC/uL、WBC/uL、nmol/L
2.3 生产批次属性 / Manufacturing Batch Properties
ENTests are manufactured in manufacturing batches, and identified via QR printed on the cassette.
检测卡按生产批次制造,通过印在检测卡盒上的 QR 码进行识别。
EN - Property中文 - 属性EN - Description中文 - 描述
strip-type-id 检测卡类型 ID strip-type-id information is gathered 收集检测卡类型 ID 信息
manufacturingDate (timestamp) 生产日期 (时间戳) Timestamp of manufacturing date 生产日期时间戳
expiryDate (timestamp) 有效期 (时间戳) Timestamp of expiration date 有效期时间戳
Traceability / 可追溯性 可追溯性 - Individual traceability: Serial number applied to the manufacturing batch (e.g., VD 28374648 0000). These codes can only be read once.
- Lot traceability: Lot number can be read indefinitely.
- 个体追溯: 应用于生产批次的序列号 (例如: VD 28374648 0000)。这些编码仅可读取一次。
- 批次追溯: 批号可无限次读取。
文档修订历史 / Revision History
Rev 版本Date 日期Author 作者EN - Description中文 - 描述
A2025-12-09I. AurrekoetxeaNew document新建文档
B2025-12-10I. AurrekoetxeaAdded QC and FUOTA新增 QC 质控流程和 FUOTA 固件更新章节
B-CN-MGMT-0012026-06-22Claude / 项目协作Added local document management log and recovery reference for later command-integration requirement analysis. The source technical content remains unchanged.新增本地文档管理记录与恢复参考,供后续指令对接需求分析使用。原始技术内容未变更。
B-CN-COMMENT-0012026-06-22Claude / 项目协作Added self-contained local Word-like comment and reply feature.新增本地自包含批注与回复功能。
B-CN-COMMENT-0022026-06-22Claude / 项目协作Upgraded comment persistence from browser-local localStorage to embedded HTML comment data for repository-shareable multi-person review. Added explicit updated-HTML export/save workflow and legacy localStorage migration.将批注持久化方式由浏览器本地 localStorage 升级为 HTML 内嵌批注数据,支持随文件进入仓库进行多人共享;新增导出/保存更新后 HTML 的显式流程,并支持旧版本地批注迁移。
B-CN-COMMENT-0032026-06-23Claude / 项目协作Changed the comment system to Cloudflare Pages Functions with KV persistence and shared password validation for adding comments and replies.将批注系统调整为 Cloudflare Pages Functions + KV 持久化,并新增添加批注/回复时的共享密码校验。
文档管理记录 / Document Management Log
日期记录类型文件/位置说明恢复方式
2026-06-22 基线备份 文档备份/CN_D006-PIB21001_revB_Qassay SDK_baseline_20260622.html 在新增管理记录前保存当前 HTML 文档基线,便于后续需求分析、指令对接和差异比对。 如需恢复,可用该备份文件覆盖当前 HTML 文档;覆盖前建议先另存当前版本。
2026-06-22 管理机制建立 本文档底部:文档修订历史、文档管理记录 明确后续所有基于本文档的需求分析、指令对接说明、翻译校正、接口含义补充,都需要在“文档修订历史”中新增记录;涉及文件级变更或备份/恢复动作时,同时维护“文档管理记录”。 查看本表定位可恢复文件;若需精确恢复某次变更,请优先使用最近一次备份,再结合修订历史确认差异。
2026-06-22 批注功能实施前备份 文档备份/CN_D006-PIB21001_revB_Qassay SDK_before_comments_20260622.html 在新增 Word 式批注与回复功能前保存当前 HTML,便于回退到无批注功能版本。 恢复前先备份当前文件,再用该备份覆盖当前 HTML。
2026-06-22 批注功能实现 本文档:批注 CSS、批注面板、运行时脚本;legacy localStorage key: qassay-sdk-comments:CN_D006-PIB21001_revB 新增本地自包含批注功能,支持选择正文添加批注、回复、解决/重新打开、删除、JSON 导出/导入。该版本最初使用浏览器 localStorage;后续已升级为 HTML 内嵌批注数据。 HTML 功能可通过实施前备份恢复;旧 localStorage 批注可由升级后的页面检测并迁移到 HTML 内嵌数据。
2026-06-22 内嵌批注升级前备份 文档备份/CN_D006-PIB21001_revB_Qassay SDK_before_embedded_comments_20260622.html 在将批注持久化从浏览器 localStorage 升级为 HTML 内嵌数据前保存当前版本,便于回退到本地批注版本。 恢复前先备份当前文件,再用该备份覆盖当前 HTML。
2026-06-22 批注持久化升级 本文档:HTML 内嵌批注数据块、批注面板、运行时脚本、导出更新后的 HTML 批注以 HTML 内嵌 JSON 为主数据源,支持随文件进入外部仓库多人共享。新增/修改批注后需点击“导出更新后的 HTML”或“保存 HTML 文件”,再替换原文件并提交仓库。 HTML 可通过升级前备份恢复;批注可从 HTML 内嵌 JSON 或“备份 JSON”恢复。
2026-06-23 Cloudflare KV 密码批注升级前备份 文档备份/CN_D006-PIB21001_revB_Qassay SDK_before_cloudflare_kv_password_comments_20260623.html 在将批注系统调整为 Cloudflare Pages Functions + KV + 共享密码前保存当前 HTML 版本。 恢复前先备份当前文件,再用该备份覆盖当前 HTML。
2026-06-23 Cloudflare KV 批注功能实现 本文档、comment-system.js、functions/api/comments/*、comments.schema.json、comments.seed.json 批注数据改由 Cloudflare KV 持久保存;新增/回复批注需输入共享密码,默认 SZY123;KV binding 名称为 COMMENTS_KV;comments.json 可通过 /api/comments/export 导出。 HTML 可通过升级前备份恢复;批注数据以 Cloudflare KV 为准,可通过导出 comments.json 备份。
ENManagement rule: Future requirement-analysis notes, command-integration decisions, translation fixes, and interface clarifications derived from this document should append a row to Revision History. File backup, restore, or migration actions should also append a row to this Document Management Log.
管理规则: 后续基于本文档形成的需求分析、指令对接决策、翻译校正、接口含义补充,都应追加到“文档修订历史”。涉及文件备份、恢复、迁移等动作时,还应同步追加到“文档管理记录”。