-
Notifications
You must be signed in to change notification settings - Fork 1
/
Telem.h
52 lines (43 loc) · 1.31 KB
/
Telem.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#ifndef Telem_h
#define Telem_h
#include "Config.h"
typedef struct
{
uint32_t custom_mode;
uint8_t base_mode;
boolean armed;
uint16_t distance_sensor;
uint8_t landed_state;
} APdata_t;
class Telem
{
public:
Telem(HardwareSerial &hs);
void begin();
void run(void (*msgRecivedCallback)(mavlink_message_t msg));
void armDisarm();
void heartbeat();
void status_text(char * text);
void param_value(mavlink_param_value_t param_value);
void request_data_streams(uint8_t req_stream_id, uint16_t req_message_rate, uint8_t start_stop);
void request_distance_sensor();
// Parámetros iniciales
mavlink_param_value_t cond_dis_sen = { COND_ALTITUDE, 3, 0, "COND_DIST_SEN", MAV_PARAM_TYPE_REAL32};
mavlink_param_value_t dis_sen_cont = { DISTANCE_SENSOR_FILTER_COUNT, 3, 1, "DIST_SENS_CONT", MAV_PARAM_TYPE_REAL32};
mavlink_param_value_t landing_alt = { LANDING_ALTITUDE, 3, 2, "LANDING_ALT", MAV_PARAM_TYPE_REAL32};
// Lista de parámetros en memoria
mavlink_param_value_t paramsList[3];
APdata_t APdata;
boolean link;
boolean led_status;
private:
HardwareSerial *_MAVSerial;
void check_link();
uint8_t system_id;
uint8_t component_id;
uint8_t target_sysid; // Target sysid
uint8_t target_compid; // Target compid
unsigned long time_heartbeat;
unsigned long last_heatbeat;
};
#endif