Dummy Lora Packet Sending

Fork of Dealer_18feb17 by kumar singh

Revision:
16:7703b9d92326
Parent:
14:144ed8b74713
Child:
18:86f069689502
--- a/Lora.h	Sun Feb 12 18:38:39 2017 +0000
+++ b/Lora.h	Fri Feb 17 08:30:35 2017 +0000
@@ -52,6 +52,32 @@
  extern uint8 Packet_Type_To_Send;  //By Default Heart Beat PAckets should be sent
 
 
+struct Fixed_Beacon
+{
+    uint8 Parking1_Beacon_ID[6];
+    uint16 Parking1_Beacon_Minor;
+    uint8 Parking1_Beacon_Signal_Strength;
+    uint8 Parking2_Beacon_ID[6];
+    uint16 Parking2_Beacon_Minor;
+    uint8 Parking2_Beacon_Signal_Strength;  
+    uint8 Parking3_Beacon_ID[6];
+    uint16 Parking3_Beacon_Minor;
+    uint8 Parking3_Beacon_Signal_Strength;
+};
+
+struct Near_Car_Beacon
+{
+    uint8 Near_Car1_Beacon_ID[6];
+    uint16 Near_Car1_Beacon_Minor;
+    uint8 Near_Car1_Beacon_Signal_Strength;
+    uint8 Near_Car2_Beacon_ID[6];
+    uint16 Near_Car2_Beacon_Minor;
+    uint8 Near_Car2_Beacon_Signal_Strength;  
+    uint8 Near_Car3_Beacon_ID[6];
+    uint16 Near_Car3_Beacon_Minor;
+    uint8 Near_Car3_Beacon_Signal_Strength;
+};
+
 struct Heart_Beat_PacketType
 {
     uint8 Header;
@@ -61,15 +87,7 @@
     uint16 Car_Battery_Voltage;
     uint8 OBD_Battery_Temperature;
     uint8 Car_Ambient_Temperature;
-    uint8 Parking1_Beacon_ID[6];
-    uint16 Parking1_Beacon_Minor;
-    uint8 Parking1_Beacon_Signal_Strength;
-    uint8 Parking2_Beacon_ID[6];
-    uint16 Parking2_Beacon_Minor;
-    uint8 Parking2_Beacon_Signal_Strength;  
-    uint8 Parking3_Beacon_ID[6];
-    uint16 Parking3_Beacon_Minor;
-    uint8 Parking3_Beacon_Signal_Strength;
+    Fixed_Beacon Fixed_Beacon_Packet;
     uint8 FCS;
 };
 
@@ -86,24 +104,8 @@
     uint8 OBD_Battery_Temperature;
     uint8 Car_Ambient_Temperature;
     uint8 BLE_Adv_Beacon_ID[6];
-    uint8 Parking1_Beacon_ID[6];
-    uint16 Parking1_Beacon_Minor;
-    uint8 Parking1_Beacon_Signal_Strength;
-    uint8 Parking2_Beacon_ID[6];
-    uint16 Parking2_Beacon_Minor;
-    uint8 Parking2_Beacon_Signal_Strength;  
-    uint8 Parking3_Beacon_ID[6];
-    uint16 Parking3_Beacon_Minor;
-    uint8 Parking3_Beacon_Signal_Strength;
-    uint8 Near_Car1_Beacon_ID[6];
-    uint16 Near_Car1_Beacon_Minor;
-    uint8 Near_Car1_Beacon_Signal_Strength;
-    uint8 Near_Car2_Beacon_ID[6];
-    uint16 Near_Car2_Beacon_Minor;
-    uint8 Near_Car2_Beacon_Signal_Strength;  
-    uint8 Near_Car3_Beacon_ID[6];
-    uint16 Near_Car3_Beacon_Minor;
-    uint8 Near_Car3_Beacon_Signal_Strength;
+    Fixed_Beacon Fixed_Beacon_Packet;
+    Near_Car_Beacon Near_Car_Beacon_Packet;
     uint8 FCS;
 };
 
@@ -118,15 +120,7 @@
     uint16 Car_Battery_Voltage;
     uint8 OBD_Battery_Temperature;
     uint8 Car_Ambient_Temperature;
-    uint8 Parking1_Beacon_ID[6];
-    uint16 Parking1_Beacon_Minor;
-    uint8 Parking1_Beacon_Signal_Strength;
-    uint8 Parking2_Beacon_ID[6];
-    uint16 Parking2_Beacon_Minor;
-    uint8 Parking2_Beacon_Signal_Strength;  
-    uint8 Parking3_Beacon_ID[6];
-    uint16 Parking3_Beacon_Minor;
-    uint8 Parking3_Beacon_Signal_Strength;
+    Fixed_Beacon Fixed_Beacon_Packet;
     uint8 FCS;
 };
 
@@ -135,28 +129,13 @@
     uint8 Header;
     uint8 Protocol_Version;
     uint8 Packet_Type;
-    uint8 Parking1_Beacon_ID[6];
-    uint16 Parking1_Beacon_Minor;
-    uint8 Parking1_Beacon_Signal_Strength;
-    uint8 Parking2_Beacon_ID[6];
-    uint16 Parking2_Beacon_Minor;
-    uint8 Parking2_Beacon_Signal_Strength;  
-    uint8 Parking3_Beacon_ID[6];
-    uint16 Parking3_Beacon_Minor;
-    uint8 Parking3_Beacon_Signal_Strength;
-    uint8 Near_Car1_Beacon_ID[6];
-    uint16 Near_Car1_Beacon_Minor;
-    uint8 Near_Car1_Beacon_Signal_Strength;
-    uint8 Near_Car2_Beacon_ID[6];
-    uint16 Near_Car2_Beacon_Minor;
-    uint8 Near_Car2_Beacon_Signal_Strength;  
-    uint8 Near_Car3_Beacon_ID[6];
-    uint16 Near_Car3_Beacon_Minor;
-    uint8 Near_Car3_Beacon_Signal_Strength;
+    Fixed_Beacon Fixed_Beacon_Packet;
+    Near_Car_Beacon Near_Car_Beacon_Packet;
     uint8 Acceleration_Type;
     uint8 FCS;
 };
 
+ 
  extern uint8 Send_Lora_Packet_Flag;
  extern int Lora_RxBuffer_Crnt_Pos,Lora_RxBuffer_End_Pos; // must be volatile or the compiler may over-optimise.
  extern int receivedDataCount;
@@ -175,6 +154,8 @@
  extern CheckIN_PacketType CheckIN_Lora_Packet; //Allocate Memory for CheckIN Lora Packets
  extern Motion_PacketType Motion_Lora_Packet;    //Allocate Memory for Movement Lora Packets
  extern Vehicle_Status_PacketType Vehicle_Status_Lora_Packet;    //Allocate Memory for Movement Lora Packets
+ extern Near_Car_Beacon Near_Car_Packet;
+ extern Fixed_Beacon Fixed_Beacon_Packet;
 
 void Send_Lora_Packet_To_Gateway(uint8* Command_To_Send,uint8 Length);
 extern void Flip_Lora_Packet_Sending();