获取硬件列表
获取当前已连接到电脑的 USB 控制硬件列表。
接口说明
接口类型
getChipboards参数
无需参数。
返回值
返回硬件序列号数组:
javascript
[
"序列号",
"序列号",
"序列号"
]基本使用
javascript
// 获取已连接的硬件列表
const chipboards = await apiInvoke('getChipboards');
console.log(`已连接 ${chipboards.length} 个硬件:`);
chipboards.forEach((serialId, index) => {
console.log(`${index + 1}. ${serialId}`);
});