[ubseds18] telemetry strings

main-solar-only
Richard Meadows 2016-08-16 19:53:17 +01:00
rodzic 54f313ed3e
commit 662ed90324
3 zmienionych plików z 13 dodań i 12 usunięć

Wyświetl plik

@ -22,7 +22,7 @@
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
//#include "hw_config/main-solar-only.h"
#include "hw_config/main-solar-only.h"
//#include "hw_config/ubseds16.h"
#include "hw_config/low-power-solar.h"
//#include "hw_config/low-power-solar.h"
//#include "hw_config/low-power-side.h"

Wyświetl plik

@ -100,12 +100,13 @@ void encode_altitude(char* str, uint32_t altitude_meters) {
void encode_telemetry(char* str, tracker_datapoint* dp)
{
base91_encode(str+0, 2, (dp->battery * 1000)); /* Battery never > 8V */
base91_encode(str+2, 2, (dp->solar * 1000)); /* Solar never > 8V */
base91_encode(str+4, 2, ((dp->thermistor_temperature+273.2)*10)); /* Temp never > 526º! */
base91_encode(str+6, 2, ((dp->radio_die_temperature+273.2)*10)); /* Temp never > 526º! */
//base91_encode(str+6, 2, dp->satillite_count); /* Small! */
base91_encode(str+8, 2, dp->time_to_first_fix +
// base91_encode(str+2, 2, (dp->solar * 1000)); /* Solar never > 8V */
base91_encode(str+2, 2, ((dp->thermistor_temperature+273.2)*10)); /* Temp never > 526º! */
base91_encode(str+4, 2, ((dp->radio_die_temperature+273.2)*10)); /* Temp never > 526º! */
base91_encode(str+6, 2, dp->satillite_count +
((dp->flash_status & 0x7) * 1000)); /* < 8000 */
//base91_encode(str+8, 2, dp->time_to_first_fix +
//((dp->flash_status & 0x7) * 1000)); /* < 8000 */
}
/**

Wyświetl plik

@ -81,18 +81,18 @@ uint16_t format_telemetry_string(char* string, struct tracker_datapoint* dp,
/* sprintf - full string (approx 90 chars) */
len += sprintf(string + len,
// "%s,%02u:%02u:%02u,%02u%02u%02u,%02.4f,%03.4f,%ld,%u,%u,%.2f,%.1f,%.1f",
"%s,%02u:%02u:%02u,%02u%02u%02u,%02.4f,%03.4f,%ld,%u,%u,%.2f,%.2f,%.1f,%.1f,%d",
// "%s,%02u:%02u:%02u,%02u%02u%02u,%02.4f,%03.4f,%ld,%u,%.2f,%.1f,%ld,%d",
// "%s,%02u:%02u:%02u,%02u%02u%02u,%02.4f,%03.4f,%ld,%u,%u,%.2f,%.2f,%.1f,%.1f,%d",
"%s,%02u:%02u:%02u,%02u%02u%02u,%02.4f,%03.4f,%ld,%u,%.2f,%.1f,%.1f,%ld,%d",
CALLSIGN, /* 2+6+2+1=11 */
dp->time.hour, dp->time.minute, dp->time.second, /* 2+1+2+1+2+1=9 */
dp->time.year%100, dp->time.month, dp->time.day, /* 2+2+2+1=7 */
lat_fmt, lon_fmt, altitude, dp->satillite_count, /* 3+1+4+1 + 4+1+4+1 + 5+1 + 2+1 = 28 */
dp->time_to_first_fix, /* 2+1 = 3 */
// dp->time_to_first_fix, /* 2+1 = 3 */
dp->battery, /* 1+1+2+1 = 5 */
dp->solar, /* 1+1+2+1 = 5 */
// dp->solar, /* 1+1+2+1 = 5 */
dp->thermistor_temperature, /* 3+1+1+1 = 6 */
dp->radio_die_temperature, /* 3+1+1+1 = 6 */
// dp->xosc_error,
dp->xosc_error,
dp->flash_status);
/* sum = 80 (must be less than or equal to 114) */