iCub-main
diagnosticLowLevelFormatter.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2006-2018 Istituto Italiano di Tecnologia (IIT)
3  * All rights reserved.
4  *
5  * This software may be modified and distributed under the terms of the
6  * BSD-3-Clause license. See the accompanying LICENSE file for details.
7  */
8 
9 
10 #ifndef __diagnosticLowLevelFormatter_h__
11 #define __diagnosticLowLevelFormatter_h__
12 
13 #include <string>
14 
15 
16 #include "EoManagement.h"
17 #include "ethManager.h"
18 #include "diagnosticInfo.h"
19 
20 
21 
22 namespace Diagnostic {
23  namespace LowLevel {
24  class InfoFormatter;
25  }
26 }
27 
28 //The info formatter is used to read the diagnostic embedded info on reception of a nv diagnostic realated.
30 {
31 public:
32  InfoFormatter(eth::TheEthManager* ethManager, eOmn_info_basic_t* infobasic, uint8_t * extra, const EOnv* nv, const eOropdescriptor_t* rd);
33  InfoFormatter() = delete;
37 
38  virtual bool getDiagnosticInfo(Diagnostic::EmbeddedInfo &info);
39 
40 
41 private:
42  eOmn_info_basic_t* m_infobasic;
43  uint8_t * m_extra;
44  const EOnv* m_nv;
45  const eOropdescriptor_t* m_rd;
46  eth::TheEthManager* m_ethManager;
47 
48  void getTimeOfInfo(Diagnostic::TimeOfInfo &timeOfInfo);
49  void getSourceOfMessage(Diagnostic::EmbeddedInfo &info);
50  void ipv4ToString(Diagnostic::EmbeddedInfo &info);
51  void getSeverityOfError(Diagnostic::EmbeddedInfo &info);
52 };
53 
54 #endif //__diagnosticLowLevelFormatter_h__
virtual bool getDiagnosticInfo(Diagnostic::EmbeddedInfo &info)
InfoFormatter(const Diagnostic::LowLevel::InfoFormatter &&InfoFormatter)
InfoFormatter(const Diagnostic::LowLevel::InfoFormatter &InfoFormatter)