跳到主要内容

智能码表文件格式2.0

Bike Computer File Format Document 2.0

版本历史

版本时间作者描述
1.0.020231010胡伟初始化文档

作者

姓名邮箱公司
胡伟wei.hu@bi-ci.com上海大不自多信息科技有限公司

版权告知

本文档版权属于上海大不自多信息科技有限公司。

通用格式定义

  1. 通用文件格式头:
Keytypevaluedescription
versionstring2.0.0每个位置一个数字字符
device_modelstringNav设备版本<16 字符
snstringSn_xoss_909378
updated_atuint32_tUTC 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每个数组元素表示一条轨迹数据状态

indexObjectTypeDefault valueComment
0nameuint64[timestamp]yyyymmddhhmmssFit file name
1sizeUIntthe size of fit, bytes文件大小
2stateUInt00: 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

ObjectTypeDefault ValueDescription
language_i18nstringen参考W3C 标准 https://www.w3.org/International/O-charset-lang.html参考枚举类型 enum languagei18n<8 字符
unituint0单位 0:公制 1:英制
temperature_unituint0温度单位 0 摄氏度 1华氏度
time_formatteruint0时间格式0 24小时 1 12小时
backlightuint0背光 0 自动 1 常亮 2 关闭
logo_lightuint0背光 0 自动 1 常亮 2 关闭
auto_pauseuint00 自动 1关闭
overwriteuint00 自动复写 1 关闭复写
keytonebooltrue按键音 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

ObjectTypeDefault ValueRangeDescription
birthdayUINT16:year[0-X]UINT8:month[0-11]UINT8:day[0-30]02022-08-01 07E6 0700
genderUint0~1性别 0:女 1:男 2:其他
weightUint00~500000体重 单位 (g)
heightUint00~3000身高 单位( mm)
ALAHRUint00~255报警心率
MAXHRUint2000~255最大心率
LTHRUint1600~255阈值心率
FTPUint2001~1023功能阈值功率
ALASPEEDUint00~20000速度提醒 0.01 m/s
time_zoneint320-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

ObjectTypeDefault ValueDescription与硬件同步是否必须
namestring<32字符 不可为空
giduint唯一id 自增 不可为空
weightuint10000单位g
wheel_sizeuint0mm
typestringbikebike helmet footwear light 不可为空
brandstring“”<32 字符 可为空
modelstring“”<32 字符 可为空
activatedboolfalse
manufacturerstring""<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" 系统信息