a001da6d
杨鑫
APP 预览打印
|
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
*/
export function normalizeBleUuid (uuid: string): string {
return String(uuid || '').replace(/-/g, '').toLowerCase()
}
/** serviceUuid + characteristicUuid(无横线小写) */
const FORCE_WRITE_NO_RESPONSE: Array<{ service: string; characteristic: string }> = [
/** 佳博 GP-D320FX 等常见 Nordic UART 风格串口(与你机子日志一致) */
{
service: '49535343fe7d4ae58fa99fafd205e455',
characteristic: '49535343884143f4a8d4ecbe34729bb3',
},
]
export function blePairRequiresWriteNoResponse (
serviceId: string,
characteristicId: string
): boolean {
const s = normalizeBleUuid(serviceId)
const c = normalizeBleUuid(characteristicId)
return FORCE_WRITE_NO_RESPONSE.some((p) => p.service === s && p.characteristic === c)
}
|