智能码表文件格式2.0
Bike Computer File Format Document 2.0
版本历史
版本 | 时间 | 作者 | 描述 |
---|---|---|---|
1.0.0 | 20231010 | 胡伟 | 初始化文档 |
作者
姓名 | 邮箱 | 公司 |
---|---|---|
胡伟 | wei.hu@bi-ci.com | 上海大不自多信息科技有限公司 |
版权告知
本文档版权属于上海大不自多信息科技有限公司。
通用格式定义
- 通用文件格式头:
Key | type | value | description |
---|---|---|---|
version | string | 2.0.0 | 每个位置一个数字字符 |
device_model | string | Nav | 设备版本<16 字符 |
sn | string | Sn_xoss_909378 | |
updated_at | uint32_t | UTC timestamp当设备时间未知时,等于0 |
Code sample
{
"version": "2.0.0", // String 版本号 递增
"device_model":"NAV", // String 设备版本号
"sn":"xxsd.00383", // String 设备sn号
"updated_at":[UTC timestamp] // 更新时间
}
运动文件列表 Fit File List Format 2.0
workout fit文件列表格式定义
workouts每个数组元素表示一条轨迹数据状态
index | Object | Type | Default value | Comment |
---|---|---|---|---|
0 | name | uint64 | [timestamp]yyyymmddhhmmss | Fit file name |
1 | size | UInt | the size of fit, bytes | 文件大小 |
2 | state | UInt | 0 | 0: Unsynced1: recording 2: Syncing3: Synced |
Code sample
{
"version": "2.0.0",
"device_model": "NAV",
"sn": "xxsd.00383",
"updated_at": 1233676623,
"workouts": [
[
20220103120603, // long name format: [%ld].fit
23442,
0
],
[
20220103120605,
24442,
1
],
[
20220103120608,
23542,
1
]
]
}
通用设置信息
通用配置信息字段定义settings.json
Object | Type | Default Value | Description |
---|---|---|---|
language_i18n | string | en | 参考W3C 标准 https://www.w3.org/International/O-charset-lang.html参考枚举类型 enum languagei18n<8 字符 |
unit | uint | 0 | 单位 0:公制 1:英制 |
temperature_unit | uint | 0 | 温度单位 0 摄氏度 1华氏度 |
time_formatter | uint | 0 | 时间格式0 24小时 1 12小时 |
backlight | uint | 0 | 背光 0 自动 1 常亮 2 关闭 |
logo_light | uint | 0 | 背光 0 自动 1 常亮 2 关闭 |
auto_pause | uint | 0 | 0 自动 1关闭 |
overwrite | uint | 0 | 0 自动复写 1 关闭复写 |
keytone | bool | true | 按键音 true 开启 |
Code sample:
{
"version": "2.0.0",
"device_model": "NAV",
"sn": "xxsd.00383",
"updated_at": 1233676623,
"settings":{
"language_i18n": "en",
"unit": 0,
"temperature_unit": 0,
"time_formatter": 0,
"backlight": 0,
"logo_light":0,
"auto_pause": 0,
"overwrite": 0,
"keytone": 0
}
}
用户设置信息
用户信息字段定义user_profile.json
Object | Type | Default Value | Range | Description |
---|---|---|---|---|
birthday | UINT16:year[0-X]UINT8:month[0-11]UINT8:day[0-30] | 0 | 2022-08-01 07E6 0700 | |
gender | Uint | 0~1 | 性别 0:女 1:男 2:其他 | |
weight | Uint | 0 | 0~500000 | 体重 单位 (g) |
height | Uint | 0 | 0~3000 | 身高 单位( mm) |
ALAHR | Uint | 0 | 0~255 | 报警心率 |
MAXHR | Uint | 200 | 0~255 | 最大心率 |
LTHR | Uint | 160 | 0~255 | 阈值心率 |
FTP | Uint | 200 | 1~1023 | 功能阈值功率 |
ALASPEED | Uint | 0 | 0~20000 | 速度提醒 0.01 m/s |
time_zone | int32 | 0 | -43200~+50400 | 秒 |
Code sample:
{
"version": "2.0.0",
"device_model": "NAV",
"sn": "xxsd.00383",
"updated_at": 1233676623,
"user": {
"uid": 1000,
"user_name": "T Hugo",
"platform": "XOSS"
},
"user_profile": {
"birthday": 10000002343,
"gender": 0,
"weight": 0,
"height": 0,
"ALAHR": 0,
"MAXHR": 0,
"LTHR": 0,
"FTP": 0,
"ALASPEED": 0,
"time_zone": 0
}
}
装备配置定义
gear_profile.json
Object | Type | Default Value | Description | 与硬件同步 | 是否必须 |
---|---|---|---|---|---|
name | string | <32字符 不可为空 | 是 | ||
gid | uint | 唯一id 自增 不可为空 | 是 | ||
weight | uint | 10000 | 单位g | 是 | |
wheel_size | uint | 0 | mm | 是 | |
type | string | bike | bike helmet footwear light 不可为空 | 是 | |
brand | string | “” | <32 字符 可为空 | 否 | |
model | string | “” | <32 字符 可为空 | 否 | |
activated | bool | false | 是 | ||
manufacturer | string | "" | <64字符 可为空 | 否 |
sample:
{
"version": "2.0.0",
"device_model": "NAV",
"sn": "xxsd.00383",
"updated_at": 1233676623,
"gears":[
{
"gid":1,
"name":"BiCi Bike",
"type":"bike",
"activated":false,
"manufacturer":"XOSS",
"model":"G6PRO",
"weight":10000,
"wheel_size":1476
"brand":"BH"
}
]
}
多语言定义
public enum languagei18n:String {
case English = "en" "English"
case Italian = "it" "Italiano"
case Korean = "ko" "한국어"
case Japanese = "ja" "日本語"
case German = "de" "Deutsch"
case Spanish = "es" "Español"
case French = "fr" "Français"
case Chinese = "zh-cn" "简体中文"
case ChineseHK = "zh-hk" "繁體中文(中國香港)"
case ChineseTaiwan = "zh-tw" "繁體中文(中國台灣)"
case Portuguese = "pt-pt" "Português(Portugal)"
case PortugueseBrazil = "pt-br" "Português(Brasil)"
}
枚举类型定义
// 服务器平台
public enum Platform: String {
case Xingzhe = "XingZhe"
case XOSS = "XOSS"
}
// 路书类型
public enum RouteTypeString: String {
case Cycling = "Cycling"
case Walking = "Walking"
case Hiking = "Hiking"
}
// 性别
public enum Gender:Int{
case female = 0
case male = 1
}
// 文件类型后缀
public enum FileType:String {
case Fit = "fit"
case Route = "ro"
case Map = "map"
case JSON = "json"
}
/// XOSS Nav filename define read from Device
let WorkoutListFileName = "workouts.json" 轨迹列表
/// XOSS Nav file read and write file
let UserProfileFileName = "user_profile.json" 用户信息
let SettingFileName = "settings.json" 系统信息