// Copyright (C) 2021 Eric Martin
// 
// This file is part of wec-pcap-utils.
// 
// wec-pcap-utils is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// 
// wec-pcap-utils is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
// 
// You should have received a copy of the GNU General Public License
// along with wec-pcap-utils.  If not, see <http://www.gnu.org/licenses/>.

#ifndef _LCM_AHRS_PCAP_H
#define _LCM_AHRS_PCAP_H

#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <pcap.h>
#include <lcm/lcm.h>
#include "lcmtypes_wec_ahrs_data_l.h"

// Defines
#define LCM_CHANNEL_PKT_OFFSET 50
#define LCM_AHRS_DATA_PKT_OFFSET 55

void print_ahrs_data_csv(lcmtypes_wec_ahrs_data_l * message, const struct pcap_pkthdr * packet_header);
void ahrs_packet_handler(const struct pcap_pkthdr * header, const u_char *packet);
void print_ahrs_data_csv_header();
int is_ahrs_packet(const u_char * packet);

#endif