PLDM variables update.

Change-Id: I288ecac72bcfc71d0e6dfc55d0abcdb5e0054bd1
Signed-off-by: Sridevi Ramesh <sridevra@in.ibm.com>
diff --git a/data/pldm_variables.py b/data/pldm_variables.py
old mode 100644
new mode 100755
index edfa252..ab51392
--- a/data/pldm_variables.py
+++ b/data/pldm_variables.py
@@ -4,36 +4,54 @@
 Contains PLDM-related constants.
 """
 
+# PLDM types.
+PLDM_TYPE_BASE = {'VALUE': '00', 'STRING': 'base'}
+PLDM_TYPE_PLATFORM = {'VALUE': '02', 'STRING': 'platform'}
+PLDM_TYPE_BIOS = {'VALUE': '03', 'STRING': 'bios'}
+PLDM_TYPE_FRU = {'VALUE': '04', 'STRING': 'fru'}
+PLDM_TYPE_OEM = {'VALUE': '3F', 'STRING': 'oem'}
 
-PLDM_TYPE_BASE = '00'
-PLDM_TYPE_PLATFORM = '02'
-PLDM_TYPE_BIOS = '03'
-PLDM_TYPE_OEM = '3F'
+VERSION_BASE = {'VALUE': ['f1', 'f0', 'f0', '00'], 'STRING': '1.0.0'}
+VERSION_PLATFORM = {'VALUE': ['f1', 'f0', 'f0', '00'], 'STRING': '1.1.1'}
+VERSION_BIOS = {'VALUE': ['f1', 'f1', 'f1', '00'], 'STRING': '1.0.0'}
+VERSION_FRU = {'VALUE': ['f1', 'f0', 'f0', '00'], 'STRING': '1.0.0'}
 
+# PLDM base related variables.
 PLDM_BASE_CMD = {
-    'GET_TID': '2',
-    'GET_PLDM_VERSION': '3',
-    'GET_PLDM_TYPES': '4',
-    'GET_PLDM_COMMANDS': '5'}
+    'GET_TID': '02',
+    'GET_PLDM_VERSION': '03',
+    'GET_PLDM_TYPES': '04',
+    'GET_PLDM_COMMANDS': '05'}
 
-PLDM_SUCCESS = '00'
-PLDM_ERROR = '01'
-PLDM_ERROR_INVALID_DATA = '02'
-PLDM_ERROR_INVALID_LENGTH = '03'
-PLDM_ERROR_NOT_READY = '04'
-PLDM_ERROR_UNSUPPORTED_PLDM_CMD = '05'
-PLDM_ERROR_INVALID_PLDM_TYPE = '20'
+# Response lengths are inclusive of completion code.
+GET_TID_RESP_BYTES = 2
+GET_PLDM_VERSION_RESP_BYTES = 10
+GET_PLDM_TYPES_RESP_BYTES = 9
+GET_PLDM_COMMANDS_RESP_BYTES = 33
 
-BIOS_TABLE_UNAVAILABLE = '83',
-INVALID_BIOS_TABLE_DATA_INTEGRITY_CHECK = '84',
-INVALID_BIOS_TABLE_TYPE = '85'
-
+# PLDM bios related variables.
 PLDM_BIOS_CMD = {
     'GET_BIOS_TABLE': '01',
     'SET_BIOS_ATTRIBUTE_CURRENT_VALUE': '07',
     'GET_BIOS_ATTRIBUTE_CURRENT_VALUE_BY_HANDLE': '08',
     'GET_DATE_TIME': '0c'}
 
+PLDM_BIOS_TABLE_TYPES = {
+    'STRING_TABLE': '00',
+    'ATTRIBUTE_TABLE': '01',
+    'ATTRIBUTE_VAL_TABLE': '02'}
+
+TRANSFER_OPERATION_FLAG = {
+    'GETNEXTPART': '00',
+    'GETFIRSTPART': '01'}
+
+TRANSFER_RESP_FLAG = {
+    'PLDM_START': '01',
+    'PLDM_MIDDLE': '02',
+    'PLDM_END': '04',
+    'PLDM_START_AND_END': '05'}
+
+# PLDM platform related variables.
 PLDM_PLATFORM_CMD = {
     'SET_STATE_EFFECTER_STATES': '39',
     'GET_PDR': '51'}
@@ -56,3 +74,40 @@
     'INVALID_WRITE_LENGTH': '83',
     'FILE_TABLE_UNAVAILABLE': '84',
     'INVALID_FILE_TABLE_TYPE': '85'}
+
+# PLDM FRU related variables.
+PLDM_FRU_CMD = {
+    'PLDM_GET_FRU_RECORD_TABLE_METADATA': '01',
+    'PLDM_GET_FRU_RECORD_TABLE': '02'}
+
+# PLDM command format.
+
+CMD_GETPLDMTYPES = 'pldmtool base GetPLDMTypes'
+
+'''
+e.g. : GetPLDMVersion usage
+
+pldmtool base GetPLDMVersion -t <pldm_type>
+
+pldm supported types
+
+base->0,platform->2,bios->3,fru->4
+
+'''
+CMD_GETPLDMVERSION = 'pldmtool base GetPLDMVersion -t %s'
+
+'''
+e.g. : PLDM raw command usage
+
+pldmtool raw -d 0x80 0x00 0x03 0x00 0x00 0x00 0x00 0x01 0x00
+
+pldm raw -d 0x<header> 0x<pldm_type> 0x<pldm_cmd_type> 0x<payload_data>
+'''
+
+CMD_PLDMTOOL_RAW = 'pldmtool raw -d 0x80' + '0x%s' + ' ' + '0x%s'
+
+
+# PLDM command payload data.
+
+PAYLOAD_GetPLDMVersion = \
+    ' 0x00 0x00 0x00 0x00 0x%s 0x%s'    # %(TransferOperationFlag, PLDMType)