Commit b4516d47 authored by Reto Da Forno's avatar Reto Da Forno
Browse files

new message types added for data aggregation

parent b4fdb8a2
......@@ -151,6 +151,17 @@ typedef struct {
} dpp_geophone_acq_t;
#define DPP_GEOPHONE_ACQ_MIN_LEN 14 /* bytes*/
typedef struct {
uint16_t node_id; /* ID of the node which created this message */
uint16_t event_id; /* ID of the event / acquisition */
uint32_t start_time; /* Start time in seconds */
uint16_t peak_val; /* Peak value / amplitude (pos. or neg.) */
uint16_t trg_count; /* Count of triggers (pos. + neg.) */
uint16_t duration; /* Event duration in ms */
} dpp_geophone_acq_min_t;
#define DPP_GEOPHONE_ADC_LEN DPP_MSG_PAYLOAD_LEN
#define DPP_GEOPHONE_ADC_HDR_LEN 9
#define DPP_GEOPHONE_ADC_DFMT_BPS_MASK 0x03 /* 2 bits used for # adc bits per sample: 0 (native), 1 (8 bit), 2 (16), 3 (24) */
......@@ -170,6 +181,7 @@ typedef struct {
uint8_t adc_data[DPP_GEOPHONE_ADC_LEN - DPP_GEOPHONE_ADC_HDR_LEN]; /* use the remaining bytes of this packet to store the ADC samples */
} dpp_geophone_adc_t;
#pragma pack()
......
......@@ -101,7 +101,8 @@ typedef enum {
/* event-driven specific message types */
DPP_MSG_TYPE_STAG_WAKEUP = 41, /* Staggered Wakeup message */
DPP_MSG_TYPE_ACK_COMMAND = 42, /* Acknowledgment from the Base Station combined with a command to the sensor nodes */
DPP_MSG_TYPE_HEALTH_AGGR = 43, /* Aggregated health message */
DPP_MSG_TYPE_AE_EVT_AGGR = 44, /* Aggregated acoustic emission event */
/* no types below this */
DPP_MSG_TYPE_LASTID = 127
......@@ -162,6 +163,15 @@ typedef struct {
} dpp_command_t;
/* for general data aggregation (several 'blocks' of the same type of data sequentialized) */
typedef struct {
uint16_t id;
uint8_t block_cnt;
uint8_t block_size;
uint8_t blocks[DPP_MSG_PAYLOAD_LEN - 4];
} dpp_data_aggr_t;
#define DPP_FW_HDR_LEN 4
#define DPP_FW_BLOCK_SIZE 64
typedef struct {
......@@ -241,7 +251,9 @@ typedef struct {
dpp_fw_t firmware;
dpp_lwb_health_t lwb_health;
dpp_geophone_acq_t geo_acq;
dpp_geophone_acq_min_t geo_acq_min;
dpp_geophone_adc_t geo_adc;
dpp_data_aggr_t data_aggr;
uint8_t payload[DPP_MSG_MIN_PAYLOAD_LEN + 2]; /* raw bytes */
uint16_t payload16[DPP_MSG_PAYLOAD_LEN / 2]; /* rounded down! */
};
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment