ITS
Manager.cpp
Go to the documentation of this file.
1 #include "Manager.h"
2 
3 Manager::Manager(QMutex* mutex, FakeGPSProvider *pGPS, FakeCANProvider *pCAN, ParameterDENM *pDENM,
5 {
6  m_mutex = mutex;
7  if(m_mutex != 0)
8  m_mutex->lock();
10  m_paramGPS = pGPS;
11  m_paramCAN = pCAN;
12  m_paramDENM = pDENM;
13  m_paramAppli = pAppli;
14  m_paramUpperTester = pUt;
16 
18  {
20  hashMap["Security"] = m_paramSecurity;
21  }
22 
23  hashMap["Configuration"] = m_paramConf;
24  hashMap["GPS"] = m_paramGPS;
25  hashMap["CAN"] = m_paramCAN;
26  hashMap["DENM"] = m_paramDENM;
27  hashMap["Application"] = m_paramAppli;
28  hashMap["UpperTester"] = m_paramUpperTester;
29  hashMap["Network"] = m_paramNetwork;
30 
31  quint8 man = m_paramConf->itsGnLocalAddrConfMethod() == 0? 1 << 15:0 << 15;
33  hashMap["GnAddr"] = m_gnA;
34 
35  if(m_mutex != 0)
36  m_mutex->unlock();
37 
38  QObject::connect(this, SIGNAL(midToChange()), this, SLOT(changeMID()));
39 }
40 
41 void Manager::updateGnAddr(uchar* mid)
42 {
43  m_paramConf->updateMID(mid);
44 
45  quint8 man = m_paramConf->itsGnLocalAddrConfMethod() == 0? 1 << 15:0 << 15;
47 }
48 
50 {
51 }
52 
54 {
55 }
56 
58 {
59  if(m_mutex != 0)
60  m_mutex->lock();
61  //FIXME: Changer m_paramConf->itsGnLocalAddrConfMethod() de bool à int
64  printf("MID en cours de modification\n");
66  {
67  uchar newMid[6];
68  for(int i=0;i<6;i++)
69  newMid[i]= m_paramConf->mid(i);
70  newMid[5] = newMid[5] + 1;
71 
72  updateGnAddr(newMid);
73  }
74  if(m_mutex != 0)
75  m_mutex->unlock();
76 }
void updateGnAddr(uchar *mid)
updateGnAddr Update the GN-ADDR
Definition: Manager.cpp:41
void changeMID()
changeMID Slot used when need to change the MID.
Definition: Manager.cpp:57
Manager class.
ParameterNetwork * m_paramNetwork
Definition: Manager.h:79
QHash< QString, void * > hashMap
Definition: Manager.h:53
uchar * mid()
mid MID getter.
#define itsGnLocalAddrConfMethod_auto
Definition: constantes.h:67
QMutex * m_mutex
Definition: Manager.h:81
ParameterDENM * m_paramDENM
Definition: Manager.h:76
ParameterConfiguration * m_paramConf
Definition: Manager.h:75
GnAddr * m_gnA
Definition: Manager.h:80
Manager(QMutex *mutex=nullptr, FakeGPSProvider *pGPS=nullptr, FakeCANProvider *pCAN=nullptr, ParameterDENM *pDENM=nullptr, FakeApplicationProvider *pAppli=nullptr, ParameterUpperTester *pUt=nullptr)
Manager Manager constructor.
Definition: Manager.cpp:3
void updateMID(uchar *mid)
updateMacAddr Get GnAddr from security layer if itsGnLocalGnAddrConfMethod = 2 or if DAD is invoked ...
FakeCANProvider * m_paramCAN
Definition: Manager.h:73
ulong countryCode() const
countryCode ITS-S country code getter.
StationType_t stationType() const
stationType Station type getter.
void execute()
execute Slot used to be threadable.
Definition: Manager.cpp:53
FakeGPSProvider * m_paramGPS
Definition: Manager.h:72
ParameterSecurity * m_paramSecurity
Definition: Manager.h:78
bool itsGnLocalAddrConfMethod() const
itsGnLocalAddrConfMethod ITS GN-ADDR configuration method getter.
ParameterApplication & data()
data Returns the vehicle status.
void midToChange()
midToChange Signal used when need to change the MID.
~Manager()
Definition: Manager.cpp:49
Definition: GnAddr.h:28
FakeApplicationProvider * m_paramAppli
Definition: Manager.h:74
bool itsGnSecurity() const
itsGnSecurity Is the security layer used?
ParameterUpperTester * m_paramUpperTester
Definition: Manager.h:77
#define itsGnLocalAddrConfMethod_anonymous
Definition: constantes.h:69