Dummy Lora Packet Sending

Fork of Dealer_18feb17 by kumar singh

Revision:
19:886d50ecc718
Parent:
18:86f069689502
Child:
21:a5fb0ae94dc6
--- a/Lora.h	Sat Feb 18 08:52:04 2017 +0000
+++ b/Lora.h	Tue Feb 21 06:27:13 2017 +0000
@@ -55,38 +55,39 @@
 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 Misc_Packets
+{
+    uint8 Protocol_Version;
+    uint16 OBD_Battery_Voltage;
+    uint16 Car_Battery_Voltage;
+    uint8 OBD_Battery_Temperature;
+    uint8 Car_Ambient_Temperature;
+    uint8 VIN[17];
+    uint8 ODO_METER_READING[3];
+};
+
 struct Heart_Beat_PacketType
 {
     uint8 Header;
-    uint8 Protocol_Version;
+    Misc_Packets Misc_Packet_Data;
     uint8 Packet_Type;
-    uint16 OBD_Battery_Voltage;
-    uint16 Car_Battery_Voltage;
-    uint8 OBD_Battery_Temperature;
-    uint8 Car_Ambient_Temperature;
     Fixed_Beacon Fixed_Beacon_Packet;
     uint8 FCS;
 };
@@ -94,15 +95,9 @@
 struct Vehicle_Status_PacketType
 {
     uint8 Header;
-    uint8 Protocol_Version;
+    Misc_Packets Misc_Packet_Data;
     uint8 Packet_Type;
-    uint8 VIN[17];
-    uint8 ODO_METER_READING[3];
     uint16 Fuel_Level;
-    uint16 OBD_Battery_Voltage;
-    uint16 Car_Battery_Voltage;
-    uint8 OBD_Battery_Temperature;
-    uint8 Car_Ambient_Temperature;
     uint8 BLE_Adv_Beacon_ID[6];
     Fixed_Beacon Fixed_Beacon_Packet;
     Near_Car_Beacon Near_Car_Beacon_Packet;
@@ -112,14 +107,8 @@
 struct CheckIN_PacketType
 {
     uint8 Header;
-    uint8 Protocol_Version;
+    Misc_Packets Misc_Packet_Data;
     uint8 Packet_Type;
-    uint8 VIN[17];
-    uint8 ODO_METER_READING[3];
-    uint16 OBD_Battery_Voltage;
-    uint16 Car_Battery_Voltage;
-    uint8 OBD_Battery_Temperature;
-    uint8 Car_Ambient_Temperature;
     Fixed_Beacon Fixed_Beacon_Packet;
     uint8 FCS;
 };
@@ -127,21 +116,15 @@
 struct CheckOUT_PacketType
 {
     uint8 Header;
-    uint8 Protocol_Version;
+    Misc_Packets Misc_Packet_Data;
     uint8 Packet_Type;
-    uint8 VIN[17];
-    uint8 ODO_METER_READING[3];
-    uint16 OBD_Battery_Voltage;
-    uint16 Car_Battery_Voltage;
-    uint8 OBD_Battery_Temperature;
-    uint8 Car_Ambient_Temperature;
     uint8 FCS;
 };
 
 struct Motion_PacketType
 {
     uint8 Header;
-    uint8 Protocol_Version;
+    Misc_Packets Misc_Packet_Data;
     uint8 Packet_Type;
     Fixed_Beacon Fixed_Beacon_Packet;
     Near_Car_Beacon Near_Car_Beacon_Packet;
@@ -171,7 +154,8 @@
  extern Near_Car_Beacon Near_Car_Packet;
  extern Fixed_Beacon Fixed_Beacon_Packet;
  extern CheckOUT_PacketType CheckOUT_Packet;
-
+ extern Misc_Packets Misc_Packet_Data;
+    
 void Send_Lora_Packet_To_Gateway(uint8* Command_To_Send,uint8 Length);
 extern void Flip_Lora_Packet_Sending(); 
 extern void Lora_Periodic_Packet_Sending_thread(void const *arg);
@@ -182,6 +166,7 @@
 void Get_Acceleration_Type(void);
 void Send_Motion_Packet(void);
 void Send_CheckIN_Packet(void);
+void Send_CheckOUT_Packet(void);
 void Send_HeartBeat_Packet(void);
 void Send_Vehicle_Status_Packet(void);
 extern uint8 Calculate_Lora_Frame_FCS(uint8* Packet_Data,uint8 Packet_Length);