RDK Documentation (Open Sourced RDK Components)
Service_Storage_PhyMedium.h
Go to the documentation of this file.
1 /*
2  * If not stated otherwise in this file or this component's Licenses.txt file the
3  * following copyright and licenses apply:
4  *
5  * Copyright 2016 RDK Management
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18 */
19 
20 /**
21  * @file Service_Storage_PhyMedium.h
22  * @brief The header file provides storage service physical medium information APIs.
23  */
24 
25 /**
26  * @defgroup TR69_HOSTIF_STORAGE_PHYSICALMEDIUM TR-069 Object (Device.StorageService.PhysicalMedium.Interface)
27  * This object provides information about each physical medium connected to this device.
28  * At most one entry in this table can exist with a given value for Name, or with all the
29  * same values for Vendor, Model and SerialNumber, or with a given value for Alias.
30  *
31  * @note Alias
32  * is a non-volatile handle used to reference this instance. Alias provides a mechanism for an ACS to
33  * label this instance for future reference.
34  *
35  * If the CPE supports the Alias-based Addressing feature the following mandatory constraints MUST be enforced:
36  * - Its value MUST NOT be empty.
37  * - Its value MUST start with a letter.
38  * If its value is not assigned by the ACS, it MUST start with a 'cpe-' prefix.
39  * The CPE MUST NOT change the parameter value.
40  * @ingroup TR69_HOSTIF_STORAGE
41  *
42  * @defgroup TR69_HOSTIF_STORAGE_PHYSICALMEDIUM_API TR-069 Object (Device.StorageService.PhysicalMedium.Interface.{i}) Public APIs
43  * Describe the details about RDK TR069 storage service physical medium APIs specifications.
44  * @ingroup TR69_HOSTIF_STORAGE_PHYSICALMEDIUM
45  *
46  * @defgroup TR69_HOSTIF_STORAGE_PHYSICALMEDIUM_CLASSES TR-069 Object (Device.StorageService.PhysicalMedium.Interface.{i}) Public Classes
47  * Describe the details about classes used in TR-069 storage service physical medium.
48  * @ingroup TR69_HOSTIF_STORAGE_PHYSICALMEDIUM
49  */
50 #ifndef _SERVICE_STORAGE_PHYMED_H_
51 #define _SERVICE_STORAGE_PHYMED_H_
52 #include "hostIf_main.h"
53 #include "hostIf_tr69ReqHandler.h"
54 #include "hostIf_utils.h"
55 #include "hostIf_updateHandler.h"
56 #define MAX_PHY_MED_ALIAS_LEN 64
57 #define MAX_PHY_MED_NAME_LEN 64
58 #define MAX_PHY_MED_VENDOR_LEN 64
59 #define MAX_PHY_MED_MODEL_LEN 128
60 #define MAX_PHY_MED_SERIAL_NUM_LEN 64
61 #define MAX_PHY_MED_FIRMWARE_VER_LEN 64
62 #define MAX_PHY_MED_CONNECTION_TYPE_LEN 64
63 #define MAX_PHY_MED_STATUS_LEN 64
64 #define MAX_PHY_MED_HEALTH_LEN 64
65 
66 /**
67  * @struct physicalMediumMembers
68  * @brief It contains the members variables of the physicalMediumMembers structure.
69  */
70 typedef struct physicalMediumMembers
71 {
72  char alias[MAX_PHY_MED_ALIAS_LEN];
73  char name[MAX_PHY_MED_NAME_LEN];
74  char vendor[MAX_PHY_MED_VENDOR_LEN];
75  char model[MAX_PHY_MED_MODEL_LEN];
76  char serialNumber[MAX_PHY_MED_SERIAL_NUM_LEN];
77  char firmwareVersion[MAX_PHY_MED_FIRMWARE_VER_LEN];
78  char connectionType[MAX_PHY_MED_CONNECTION_TYPE_LEN];
79  bool removable;
80  unsigned int capacity;
81  char status[MAX_PHY_MED_STATUS_LEN];
82  unsigned int uptime;
83  bool smartCapable;
84  char health[MAX_PHY_MED_HEALTH_LEN];
85  bool hotSwappable;
87 
88 /**
89  * @enum ePhysicalMediumMembers_t
90  * @brief It contains the members variables of the ePhysicalMediumMembers_t enum.
91  */
92 typedef enum
93 {
94  eAlias,
95  eName,
96  eVendor,
97  eModel,
98  eSerialNumber,
99  eFirmwareVersion,
100  eConnectionType,
101  eRemovable,
102  eCapacity,
103  eStatus,
104  eUptime,
105  eSmartCapable,
106  eHealth,
107  eHotSwappable
109 
110 /**
111  * @brief This class provides the TR-069 host interface physical medium information.
112  * @ingroup TR69_HOSTIF_STORAGE_PHYSICALMEDIUM_CLASSES
113  */
115 {
116 
117  static GHashTable *phyMedHash;
118 
119  static GMutex *m_mutex;
120 
121  int dev_id;
122 
124 
125  int get_StorageService_PhyMed_Fields(ePhysicalMediumMembers_t phyMedMember);
126 
127  hostIf_PhysicalMedium(int StorageServiceInstanceNumber, int dev_id);
128 
129  int getMediumName(char* mediumName);
130 
131  bool isSmartCapable();
132 
133  int isMediumHealthOK();
134 
135  static int rebuildHash();
136 
137  static int getPhysicalMediumNumberOfEntries(int storageServiceInstanceNumber);
138 
139  int storageServiceInstanceNumber;
140 
141  public:
142 
143  static hostIf_PhysicalMedium* getInstance(int storageService, int dev_id);
144 
145  static void closeInstance(hostIf_PhysicalMedium*);
146 
147  static GList* getAllInstances();
148 
149  static void closeAllInstances();
150 
151  static int get_Device_Service_StorageMedium_ClientNumberOfEntries(HOSTIF_MsgData_t *stMsgData, int dev_id);
152 
153  static int updateCallbackFunction(updateCallback cb);
154 
156 
158 
160 
162 
164 
166 
168 
170 
172 
174 
176 
178 
180 
181  void getLock();
182 
183  void releaseLock();
184 };
185 #endif
hostIf_PhysicalMedium::get_Device_Service_StorageMedium_Status
int get_Device_Service_StorageMedium_Status(HOSTIF_MsgData_t *stMsgData)
This function get the status of the storage service medium. Currently not implemented.
Definition: Service_Storage_PhyMedium.cpp:474
hostIf_PhysicalMedium::get_Device_Service_StorageMedium_Health
int get_Device_Service_StorageMedium_Health(HOSTIF_MsgData_t *stMsgData)
This function get the health of the storage service medium.
Definition: Service_Storage_PhyMedium.cpp:300
hostIf_PhysicalMedium::get_Device_Service_StorageMedium_Alias
int get_Device_Service_StorageMedium_Alias(HOSTIF_MsgData_t *stMsgData)
This function get the alias of storage service medium. Currently not implemented.
Definition: Service_Storage_PhyMedium.cpp:348
hostIf_PhysicalMedium::get_Device_Service_StorageMedium_SerialNumber
int get_Device_Service_StorageMedium_SerialNumber(HOSTIF_MsgData_t *stMsgData)
This function get the serial number of the storage service medium. Currently not implemented.
Definition: Service_Storage_PhyMedium.cpp:402
_HostIf_MsgData_t
Definition: hostIf_tr69ReqHandler.h:170
hostIf_PhysicalMedium::get_Device_Service_StorageMedium_HotSwappable
int get_Device_Service_StorageMedium_HotSwappable(HOSTIF_MsgData_t *stMsgData)
This function get the storage service medium hot swappable. Currently not implemented.
Definition: Service_Storage_PhyMedium.cpp:510
hostIf_PhysicalMedium::get_Device_Service_StorageMedium_FirmwareVersion
int get_Device_Service_StorageMedium_FirmwareVersion(HOSTIF_MsgData_t *stMsgData)
This function get the firmware version of the storage service medium. Currently not implemented.
Definition: Service_Storage_PhyMedium.cpp:420
ePhysicalMediumMembers_t
ePhysicalMediumMembers_t
It contains the members variables of the ePhysicalMediumMembers_t enum.
Definition: Service_Storage_PhyMedium.h:92
hostIf_PhysicalMedium::get_Device_Service_StorageMedium_Removable
int get_Device_Service_StorageMedium_Removable(HOSTIF_MsgData_t *stMsgData)
This function get the storage service medium removable. Currently not implemented.
Definition: Service_Storage_PhyMedium.cpp:456
hostIf_PhysicalMedium::hostIf_PhysicalMedium
hostIf_PhysicalMedium(int StorageServiceInstanceNumber, int dev_id)
Class Constructor of the class hostIf_PhysicalMedium.
Definition: Service_Storage_PhyMedium.cpp:88
hostIf_main.h
hostIf_main API.
hostIf_PhysicalMedium::get_Device_Service_StorageMedium_Vendor
int get_Device_Service_StorageMedium_Vendor(HOSTIF_MsgData_t *stMsgData)
This function get the vendor of the storage service medium. Currently not implemented.
Definition: Service_Storage_PhyMedium.cpp:366
hostIf_PhysicalMedium::getLock
void getLock()
This function get the lock before setting or getting the attributes of the host interface physical me...
Definition: Service_Storage_PhyMedium.cpp:98
hostIf_PhysicalMedium
This class provides the TR-069 host interface physical medium information.
Definition: Service_Storage_PhyMedium.h:114
hostIf_PhysicalMedium::get_Device_Service_StorageMedium_SMARTCapable
int get_Device_Service_StorageMedium_SMARTCapable(HOSTIF_MsgData_t *stMsgData)
This function get the SMART capability of the storage service medium.
Definition: Service_Storage_PhyMedium.cpp:324
hostIf_PhysicalMedium::get_Device_Service_StorageMedium_Name
int get_Device_Service_StorageMedium_Name(HOSTIF_MsgData_t *stMsgData)
This function get the name of the storage service medium.
Definition: Service_Storage_PhyMedium.cpp:276
hostIf_PhysicalMedium::get_Device_Service_StorageMedium_Model
int get_Device_Service_StorageMedium_Model(HOSTIF_MsgData_t *stMsgData)
This function get the model number of the storage service medium. Currently not implemented.
Definition: Service_Storage_PhyMedium.cpp:384
physicalMediumMembers
It contains the members variables of the physicalMediumMembers structure.
Definition: Service_Storage_PhyMedium.h:70
hostIf_PhysicalMedium::releaseLock
void releaseLock()
This function use to release the lock before setting or getting the attributes of the host interface ...
Definition: Service_Storage_PhyMedium.cpp:112
hostIf_PhysicalMedium::get_Device_Service_StorageMedium_ConnectionType
int get_Device_Service_StorageMedium_ConnectionType(HOSTIF_MsgData_t *stMsgData)
This function get the connection type of the storage service medium. Currently not implemented.
Definition: Service_Storage_PhyMedium.cpp:438
hostIf_PhysicalMedium::get_Device_Service_StorageMedium_Uptime
int get_Device_Service_StorageMedium_Uptime(HOSTIF_MsgData_t *stMsgData)
This function get the uptime of the storage service medium. Currently not implemented.
Definition: Service_Storage_PhyMedium.cpp:492