每个ocd数据对应一个索引值。 您可以使用index获取ocd数据。 OCD指标值
枚举如下所示。
enum ocd_lockable_table
{
magic_number = 0, //ocd.index.0
magic_number_factory = 1, //ocd.index.1
revision = 2, //ocd.index.2 and so on...
system_ocd = 3,
modem = 4,
gps = 5,
module_sn = 6,
board_sn = 8,
product_sn = 10,
wifi_mac_ap = 12,
wifi_mac_sta = 13,
wifi_mac_p2p = 14,
wifi_cy_code = 15,
bt_mac = 16,
barcode = 17,
wifi_mac_go = 18,
ocd_last_stc, //Hold this in the last item
};
读取与设置ocd值
Get OCD in adb console terminal
getprop ro.ocd.index.5
Set OCD in adb console terminal (no need prefix ro.)
setprop ocd.index.5 123
Get OCD in framework layer
SystemProperties.get(“ro.ocd.index.5”, “0”)
ocd值含义
Member name | Significance |
magic_number | This magic number represents the existence of a successfully programmed OEM configuration data |
magic_number_factory | This magic number indicate factory mode flag present or not. If this item equal 0x 5A12E7A5 then go to normal mode, otherwise go to factory mode |
revision | OEM configuration data version If the table format changes or if add more member into structure, this version number can be incremented to keeptrack of the changes. |
system | Reserved. |
modem | Indicate which types of modem to be used. Zero means that ignore this item. |
gps | Indicate which types of GPS to be used. Zero means that ignore this item. |
module_sn | Module serial number. It is a one-dimensional array of characters which is terminated by a null character ‘\0’. Zero means that ignore this item. |
board_sn | Board/PCB serial number. It is a one-dimensional array of characters which is terminated by a null character ‘\0’. Zero means that ignore this item. |
product_sn | Product serial number. It is a one-dimensional array of characters which is terminated by a null character ‘\0’. Zero means that ignore this item. |
wifi_mac_ap | Wi-Fi MAC address for AP/STATION/P2P mode. It is a one-dimensional array of characters which is terminated by a null character ‘\0’. Zero means that ignore this item. Example: 001345B9860D |
wifi_mac_sta | 同上 |
wifi_mac_p2p | 同上 |
wifi_cy_code | Wi-Fi Country Code. Example: TW , US , BE … |
bt_mac | Bluetooth MAC address. Example: 003A856D7F90 |
barcode | Indicate which types of barcode to be used. Zero means that ignore this item. |
wifi_mac_go | P2P group mac. |