|
发表于 2011-6-2 22:00:50
|
显示全部楼层
一、nvram_common_defs.h或Nvram_user_defs.h
1、 定义LID
a.在nvram_common_defs.h文件中nvram_lid_commapp_enum定义,
例如:typedef enum
{
NVRAM_EF_CUST_HW_LEVEL_TBL_LID,
。。。。。。
NVRAM_EF_SMS_SERVER_SMALL_LID,
}nvram_lid_commapp_enum
b.或在Nvram_user_defs.h文中nvram_lid_cust_enum;也可以定义
typedef enum
{
NVRAM_EF_CACHE_BYTE_LID = NVRAM_LID_CUST_BEGIN,
NVRAM_EF_CACHE_SHORT_LID,
NVRAM_EF_CACHE_DOUBLE_LID,
。。。。。。。。。。。。。。。。。。。。。。。。。。。。
NVRAM_EF_LAST_LID_CUST
} nvram_lid_cust_enum;
2、定义TOTAL和SIZE
#define NVRAM_EF_SMS_SERVER_SMALL_TOTAL 1
#define NVRAM_EF_SMS_SERVER_SMALL_SIZE sizeof(Nvram_SMS_CEN_SMALL)
二、nvram_common_config.c或Nvram_user_config.c
3、添加性属
a.在nvram_common_config.c中增加
ltable_entry_struct logical_data_item_table_comm_app[] =
{
//SMALL Server Centre
,{
NVRAM_EF_SMS_SERVER_SMALL_LID,
NVRAM_EF_SMS_SERVER_SMALL_SIZE,
NVRAM_EF_SMS_SERVER_SMALL_TOTAL,
NVRAM_NORMAL(NVRAM_EF_ZERO_DEFAULT),
NVRAM_ATTR_AVERAGE,
NVRAM_CATEGORY_USER,
"MPC2",
VER(NVRAM_EF_SMS_SERVER_SMALL_LID),
"SERVER_CENTRE\0",
NVRAM_RESERVED_VALUE
}
}
b.或者在Nvram_user_config.c也可以定义
ltable_entry_struct logical_data_item_table_cust[] =
{
{
NVRAM_EF_CACHE_BYTE_LID,
NVRAM_CACHE_SIZE,
NVRAM_CACHE_TOTAL,
NVRAM_EF_ZERO_DEFAULT,
NVRAM_ATTR_AVERAGE,
NVRAM_CATEGORY_USER | NVRAM_CATEGORY_CUSTPACK | NVRAM_CATEGORY_SHADOW_MS,
"CT00",
VER(NVRAM_EF_CACHE_BYTE_LID),
"1-byte Setting\0",
NVRAM_RESERVED_VALUE
}
,{
NVRAM_EF_CACHE_SHORT_LID,
NVRAM_CACHE_SIZE,
NVRAM_CACHE_TOTAL,
NVRAM_EF_ZERO_DEFAULT,
NVRAM_ATTR_AVERAGE,
NVRAM_CATEGORY_USER | NVRAM_CATEGORY_CUSTPACK | NVRAM_CATEGORY_SHADOW_MS,
"CT01",
VER(NVRAM_EF_CACHE_SHORT_LID),
"2-byte Setting\0",
NVRAM_RESERVED_VALUE
}
,{
NVRAM_EF_CACHE_DOUBLE_LID,
NVRAM_CACHE_SIZE,
NVRAM_CACHE_TOTAL,
NVRAM_EF_ZERO_DEFAULT,
NVRAM_ATTR_AVERAGE,
NVRAM_CATEGORY_USER | NVRAM_CATEGORY_CUSTPACK | NVRAM_CATEGORY_SHADOW_MS,
"CT02",
VER(NVRAM_EF_CACHE_DOUBLE_LID),
"8-byte Setting\0",
NVRAM_RESERVED_VALUE
}
……………………………………………………………………….
/* Watch out! There is no comma after last element! */
,{ NVRAM_EF_LAST_LID_CUST }
};
三、common_nvram_editor_data_item.h
4、关系地址空间
在Common_nvram_editor_data_item.h 中把Nvram的地址空间关系到自定义的数据块
LID_BIT VER_LID(NVRAM_EF_SMS_SERVER_SMALL_LID)
Nvram_SMS_CEN_SMALL*NVRAM_EF_SMS_SERVER_SMALL_TOTAL
{
};
5、增加数据空间版本
common_nvram_editor_data_item.h
在Custom_nvram_editor_data_item.h中,定义数据空间版本,格式一定要是:LID_ VERNO。其中LID为前面所定义的LID,红色部分必须是这样。
如:
#define NVRAM_EF_SMS_SERVER_SMALL_LID_VERNO "000" |
|