如上述 JSON 中,若 lac 在物模型的定义是数值类型,但对应的 Value 为字符串类型9;str_model 的物模型的定义为字符串型,但是对应的 Value 为数值型133,当这样的格式上报后,系统会分别提示如下错误:
{"method":"report_reply","clientToken":"IUZ9DQISGJ-10","code":406,"status":"check report data err: readNumberAsString: invalid number, error found in #0 byte of ...|\"str\"|..., bigger context ...|\"str\"|..."}
{"method":"report_reply","clientToken":"IUZ9DQISGJ-10","code":406,"status":"check report data err: ReadString: expects \" or n, but found 1, error found in #1 byte of ...|133|..., bigger context ...|133|..."}
数值范围越界错误
布尔型的值超出0或1范围,数值型上报的数值超过物模型所定义的数据范围,则会出现越界错误。
{
"method":"report",
"clientToken":"IUZ9DQISGJ-10",
"params":{
"win_switch":3,
"altitude":9999999
}
}
如上述 JSON 中,若 win_switch 在物模型的定义是布尔型,但对应的 Value 为3;altitude 的物模型的定义为数值型,但是对应的数值范围为:-1000至20000,当上述格式上报后,系统会分别提示如下错误:
{"method":"report_reply","clientToken":"IUZ9DQISGJ-10","code":406,"status":"check report data err: win_switch value 3 out of range:[0,1]"}
{"method":"report_reply","clientToken":"IUZ9DQISGJ-10","code":406,"status":"check report data err: altitude value 9999999 out of range:[-1000,20000]"}