From c036b044c005d80e55cd37be719f5584df022dad Mon Sep 17 00:00:00 2001 From: Florian Ludwig Date: Sat, 9 Jun 2018 22:28:20 +0200 Subject: [PATCH] move header into seperate files and have include guards --- src/configmanager.h | 8 ++++++++ src/lorawan.h | 10 ++++++++++ src/macsniff.h | 5 +++++ src/main.h | 20 ++++---------------- 4 files changed, 27 insertions(+), 16 deletions(-) create mode 100644 src/configmanager.h create mode 100644 src/lorawan.h diff --git a/src/configmanager.h b/src/configmanager.h new file mode 100644 index 00000000..f9c5d3fa --- /dev/null +++ b/src/configmanager.h @@ -0,0 +1,8 @@ +#ifndef CONFIGMANAGER_H +#define CONFIGMANAGER_H + +void eraseConfig(void); +void saveConfig(void); +void loadConfig(void); + +#endif \ No newline at end of file diff --git a/src/lorawan.h b/src/lorawan.h new file mode 100644 index 00000000..de54b6e8 --- /dev/null +++ b/src/lorawan.h @@ -0,0 +1,10 @@ +#ifndef LORAWAN_H +#define LORAWAN_H + +void onEvent(ev_t ev); +void do_send(osjob_t* j); +void gen_lora_deveui(uint8_t * pdeveui); +void RevBytes(unsigned char* b, size_t c); +void get_hard_deveui(uint8_t *pdeveui); + +#endif \ No newline at end of file diff --git a/src/macsniff.h b/src/macsniff.h index a92046df..5eb07f30 100644 --- a/src/macsniff.h +++ b/src/macsniff.h @@ -1,3 +1,6 @@ +#ifndef MACSNIFF_H +#define MACSNIFF_H + // ESP32 Functions #include @@ -26,3 +29,5 @@ void wifi_sniffer_packet_handler(void *buff, wifi_promiscuous_pkt_type_t type); // function defined in rokkithash.cpp uint32_t rokkit(const char * , int ); + +#endif \ No newline at end of file diff --git a/src/main.h b/src/main.h index 18b9bfb8..a2e0eeb0 100644 --- a/src/main.h +++ b/src/main.h @@ -1,4 +1,8 @@ +#include "configmanager.h" +#include "lorawan.h" +#include "macsniff.h" + // program version - note: increment version after modifications to configData_t struct!! #define PROGVERSION "1.3.8" // use max 10 chars here! #define PROGNAME "PAXCNT" @@ -23,22 +27,6 @@ void reset_counters(void); void blink_LED(uint16_t set_color, uint16_t set_blinkduration); void led_loop(void); -// defined in configmanager.cpp -void eraseConfig(void); -void saveConfig(void); -void loadConfig(void); - -// defined in lorawan.cpp -void onEvent(ev_t ev); -void do_send(osjob_t* j); -void gen_lora_deveui(uint8_t * pdeveui); -void RevBytes(unsigned char* b, size_t c); -void get_hard_deveui(uint8_t *pdeveui); - -// defined in wifisniffer.cpp -void wifi_sniffer_init(void); -void wifi_sniffer_set_channel(uint8_t channel); -void wifi_sniffer_packet_handler(void *buff, wifi_promiscuous_pkt_type_t type); // defined in blescan.cpp #ifdef BLECOUNTER