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.
67 lines
2.4 KiB
67 lines
2.4 KiB
#ifndef __DFSL_HARDWARE_RESOURCE_HEADER__
|
|
#define __DFSL_HARDWARE_RESOURCE_HEADER__
|
|
|
|
#include "../components/base/basicObject.h"
|
|
#include "../components/base/basicLogCollection.h"
|
|
#include "dataBinder.h"
|
|
|
|
#include <linux/types.h>
|
|
#include <arpa/inet.h>
|
|
|
|
#include <vector>
|
|
|
|
#define DBC_RESOURCE_DESC_SIZE 64
|
|
|
|
typedef struct S_PARSE_RESULT_NET_INTERFACES{
|
|
bool enabled;
|
|
bool if_static;
|
|
bool hot_plug;
|
|
char address[INET6_ADDRSTRLEN];
|
|
char netmask[INET6_ADDRSTRLEN];
|
|
char gateway[INET6_ADDRSTRLEN];
|
|
}PARSE_RESULT_NET_INTERFACES;
|
|
|
|
typedef struct S_PARSE_RESULT_WIFI_SETTINGS{
|
|
char SSID[64];
|
|
char password[64];
|
|
WIFI_ENCRIPTION encryption;
|
|
bool access_point;
|
|
uint8_t channel;
|
|
char country_code[3];
|
|
bool hiden_ssid;
|
|
/* Router Settings */
|
|
bool router_enabled;
|
|
char router_outbond[INET6_ADDRSTRLEN];
|
|
/* DHCP */
|
|
bool dhcp_enabled;
|
|
char range_start[INET6_ADDRSTRLEN];
|
|
char range_stop[INET6_ADDRSTRLEN];
|
|
char netmask[INET6_ADDRSTRLEN];
|
|
char lease_period[INET6_ADDRSTRLEN];
|
|
}PARSE_RESULT_WIFI_SETTINGS;
|
|
|
|
|
|
class hardwareResource: public basicObject{
|
|
protected:
|
|
HARDWARE_PROVIDERS m_eProviderType;
|
|
DBC_RESOURCE_DATA m_sResourceSettings;
|
|
dataBinder * m_pDBC;
|
|
basicLogCollection * m_pLog;
|
|
bool m_bValid;
|
|
public:
|
|
hardwareResource();
|
|
hardwareResource( uint32_t id, HARDWARE_PROVIDERS type = HARDWARE_PROVIDER_UNKNOWN );
|
|
virtual ~hardwareResource();
|
|
virtual bool create( void ){ return false; };
|
|
virtual bool create( uint32_t id, HARDWARE_PROVIDERS type );
|
|
virtual bool validate( void ){ return m_bValid; };
|
|
bool isValid( void ){ return m_bValid; };
|
|
uint32_t getDbId( void ){ return m_sResourceSettings.aux_id; };
|
|
RESOURCE_TYPE getHardwareType( void ){ return (RESOURCE_TYPE) m_sResourceSettings.type; };
|
|
HARDWARE_PROVIDERS getProviderType( void ){ return m_eProviderType; };
|
|
};
|
|
|
|
|
|
typedef std::vector<hardwareResource *> VECTOR_HW_RESOURCES;
|
|
|
|
#endif
|