You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

92 lines
2.0 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
5 months ago
​
​
​
​
5 months ago
​
​
5 months ago
​
​
5 months ago
​
​
5 months ago
​
​
5 months ago
​
5 months ago
​
​
​
​
​
​
  1. #ifndef __DFSL_HARDWARE_RESOURCE_HEADER__
  2. #define __DFSL_HARDWARE_RESOURCE_HEADER__
  3. #include "../components/base/basicLogCollection.h"
  4. #include "../components/base/basicObject.h"
  5. #include "dataBinder.h"
  6. #include <arpa/inet.h>
  7. #include <linux/types.h>
  8. #include <vector>
  9. #define DBC_RESOURCE_DESC_SIZE 64
  10. typedef struct S_PARSE_RESULT_NET_INTERFACES
  11. {
  12. bool enabled;
  13. bool if_static;
  14. bool hot_plug;
  15. char address[INET6_ADDRSTRLEN];
  16. char netmask[INET6_ADDRSTRLEN];
  17. char gateway[INET6_ADDRSTRLEN];
  18. } PARSE_RESULT_NET_INTERFACES;
  19. typedef struct S_PARSE_RESULT_WIFI_SETTINGS
  20. {
  21. char SSID[64];
  22. char password[64];
  23. WIFI_ENCRIPTION encryption;
  24. bool access_point;
  25. uint8_t channel;
  26. char country_code[3];
  27. bool hiden_ssid;
  28. /* Router Settings */
  29. bool router_enabled;
  30. char router_outbond[INET6_ADDRSTRLEN];
  31. /* DHCP */
  32. bool dhcp_enabled;
  33. char range_start[INET6_ADDRSTRLEN];
  34. char range_stop[INET6_ADDRSTRLEN];
  35. char netmask[INET6_ADDRSTRLEN];
  36. char lease_period[INET6_ADDRSTRLEN];
  37. } PARSE_RESULT_WIFI_SETTINGS;
  38. class hardwareResource : public basicObject
  39. {
  40. protected:
  41. HARDWARE_PROVIDERS m_eProviderType;
  42. DBC_RESOURCE_DATA m_sResourceSettings;
  43. dataBinder * m_pDBC;
  44. basicLogCollection * m_pLog;
  45. bool m_bValid;
  46. public:
  47. hardwareResource();
  48. hardwareResource(uint32_t id, HARDWARE_PROVIDERS type = HARDWARE_PROVIDER_UNKNOWN);
  49. virtual ~hardwareResource();
  50. virtual bool create(void){
  51. return false;
  52. }
  53. virtual bool create(uint32_t id, HARDWARE_PROVIDERS type);
  54. virtual bool validate(void){
  55. return m_bValid;
  56. }
  57. bool isValid(void){
  58. return m_bValid;
  59. }
  60. uint32_t getDbId(void){
  61. return m_sResourceSettings.aux_id;
  62. }
  63. RESOURCE_TYPE getHardwareType(void){
  64. return (RESOURCE_TYPE) m_sResourceSettings.type;
  65. }
  66. HARDWARE_PROVIDERS getProviderType(void){
  67. return m_eProviderType;
  68. }
  69. virtual bool activate( void ){
  70. return false;
  71. }
  72. };
  73. typedef std::vector<hardwareResource *> VECTOR_HW_RESOURCES;
  74. #endif