-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
update FlexApiProtocolDecoder #4829
base: master
Are you sure you want to change the base?
Conversation
fix: 4g network rsrp has higher priority than rssi.
fix: 4g network rsrp has higher priority than rssi.
Optional.ofNullable(payload.getJsonNumber("gnss.altitude")) | ||
.map(JsonNumber::doubleValue).ifPresent(position::setAltitude); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Personally I think this format is hard to read. If you want to do the check, I would recommend doing it explicitly.
Are you sure all the parameters you check for null are optional?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll go confirm with firmware developer again.
@@ -33,12 +33,10 @@ public void testDecode() throws Exception { | |||
|
|||
verifyAttributes(decoder, text( | |||
"${\"topic\":\"v1/VF3102021111601/sysinfo/info\",\"payload\":{\"sysinfo.ts\":1637224740,\"sysinfo.model_name\":\"310\",\"sysinfo.oem_name\":\"inhand\",\"sysinfo.serial_number\":\"VF3102021111601\",\"sysinfo.firmware_version\":\"VT3_V1.1.32\",\"sysinfo.product_number\":\"FQ58\",\"sysinfo.description\":\"www.inhand.com.cn\"}}xx")); | |||
|
|||
verifyAttributes(decoder, text( | |||
"${\"topic\":\"v1/VF3102021111601/io/info\",\"payload\":{\"io.ts\":1637227722,\"io.AI1\":0,\"io.DI1\":1,\"io.DI2\":0,\"io.DI3\":0,\"io.DI4\":0,\"io.DI1_pullup\":0,\"io.DI2_pullup\":0,\"io.DI3_pullup\":0,\"io.DI4_pullup\":0,\"io.DO1\":0,\"io.DO2\":0,\"io.DO3\":0,\"io.IGT\":1}}xx")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are you removing a test?
some info is not required, and 4g network "rsrp" has higher priority than "rssi".