Create functions for DB manipulation
This commit is contained in:
parent
1d79b8bb9d
commit
21472310d8
|
@ -7,6 +7,7 @@
|
||||||
#include <boost/asio/steady_timer.hpp>
|
#include <boost/asio/steady_timer.hpp>
|
||||||
#include "autoware_auto_perception_msgs/msg/predicted_objects.hpp"
|
#include "autoware_auto_perception_msgs/msg/predicted_objects.hpp"
|
||||||
#include "autoware_v2x/positioning.hpp"
|
#include "autoware_v2x/positioning.hpp"
|
||||||
|
#include <vanetza/asn1/cpm.hpp>
|
||||||
|
|
||||||
namespace v2x
|
namespace v2x
|
||||||
{
|
{
|
||||||
|
@ -28,6 +29,18 @@ namespace v2x
|
||||||
void printObjectsList(int);
|
void printObjectsList(int);
|
||||||
void send();
|
void send();
|
||||||
|
|
||||||
|
/** Creates the database schema.
|
||||||
|
* Creates tables for cpm_sent, cpm_received
|
||||||
|
*/
|
||||||
|
void createTables();
|
||||||
|
|
||||||
|
/** Inserts CPM into the database.
|
||||||
|
* Constructs and executes queries for inserting the specified CPM data.
|
||||||
|
* @param cpm The CPM to be inserted
|
||||||
|
* @param table_name The table to insert the CPM into (cpm_sent or cpm_received)
|
||||||
|
*/
|
||||||
|
void insertCpmToCpmTable(vanetza::asn1::Cpm, char* table_name);
|
||||||
|
|
||||||
struct Object {
|
struct Object {
|
||||||
std::string uuid;
|
std::string uuid;
|
||||||
int objectID; // 0-255 for CPM
|
int objectID; // 0-255 for CPM
|
||||||
|
|
|
@ -561,4 +561,12 @@ namespace v2x {
|
||||||
++cpm_num_;
|
++cpm_num_;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CpmApplication::createTables() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void CpmApplication::insertCpmToCpmTable(vanetza::asn1::Cpm cpm, char* table_name) {
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue