Fixed the floating point precision problem with Lorawan stack
Fixed the floating point precision problem with Lorawan stack.pull/73/head
rodzic
0e0717c51a
commit
aebd5852ed
|
@ -488,7 +488,9 @@ int buildPacket(uint32_t tmst, uint8_t *buff_up, struct LoraUp LoraUp, bool inte
|
|||
}
|
||||
#endif
|
||||
buff_index += j;
|
||||
ftoa((double)freq/1000000,cfreq,6); // XXX This can be done better
|
||||
double iifreq;
|
||||
iifreq = freq/1000000;
|
||||
ftoa(iifreq,cfreq,6); // Fixed the floating point precision problem with Lorawan stack
|
||||
j = snprintf((char *)(buff_up + buff_index), TX_BUFF_SIZE-buff_index, ",\"chan\":%1u,\"rfch\":%1u,\"freq\":%s", 0, 0, cfreq);
|
||||
buff_index += j;
|
||||
memcpy((void *)(buff_up + buff_index), (void *)",\"stat\":1", 9);
|
||||
|
|
Ładowanie…
Reference in New Issue