aboutsummaryrefslogtreecommitdiff
path: root/GEOLOC/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'GEOLOC/main.c')
-rw-r--r--GEOLOC/main.c51
1 files changed, 51 insertions, 0 deletions
diff --git a/GEOLOC/main.c b/GEOLOC/main.c
new file mode 100644
index 0000000..07ef640
--- /dev/null
+++ b/GEOLOC/main.c
@@ -0,0 +1,51 @@
+#include "lib/dragino.h"
+#include "lib/config.h"
+#include "app/frame.h"
+#if TARGET == ANCHOR
+ #include "app/anchor/app.h"
+#else
+ #include "app/mobile/app.h"
+#endif
+#include <stdio.h>
+#include "lib/gps.h"
+
+
+// NMEA_GGA Frame
+struct NMEA_GGA NmeaGgaFrame;
+
+int main(){
+
+ // Init dragino pins
+ initPins();
+
+ // Init sx1276
+ reset();
+
+ // Init configuration
+ Config config;
+ config.mod=MOD_FSK; // Choose modulation
+ config.mode=MODE_SLEEP; // Standby mode at startup
+ config.cFreq=868100000; // Choose carrier frequency
+ config.fsk.preambleSize=1; // Choose preamble size
+ config.fsk.crcOn=CRC_OFF; // ON/OFF CRC check
+ config.fsk.freqDev=5002; // Choose frequency deviation
+ config.fsk.preambleDetection=PREAMBLE_DETECTION_ON; // ON/OFF preamble detection
+ config.lnaGain=LNA_GAIN_G1; // Choose LNA GAIN
+ config.fsk.crcAutoClearOff=CRC_AUTOCLEAR_OFF_OFF; // ON/OFF CRC autoclean
+ config.fsk.bitrate=4800; // Choose bitrate
+ config.fsk.fixedPayloadLength=FIXED_PAYLOAD_LENGTH_OFF; // ON/OFF Fixed payload length
+ config.fsk.payloadLength=FRAME_SIZE; // Choose payload length
+ config.fsk.fifoThreshold=FRAME_SIZE-1; // Choose fifo threshold
+ config.paSelect=PA_SELECT_ON; // Toggle PA BOOST
+ config.maxPower=15; // Define max power
+ config.outputPower=17; // Set the output power
+ config.fsk.rssiSmoothing=RSSI_SAMPLE_256; // Set rssi sample
+
+ // Fetch GPS position
+ NmeaGgaFrame=getNMEA_GGAFrame();
+
+ // Run ANCHOR or MOBILE application according to Makefile TARGET definition
+ runApp(config);
+
+ return(0);
+}