diff options
Diffstat (limited to 'utils/loc_target.cpp')
-rw-r--r-- | utils/loc_target.cpp | 33 |
1 files changed, 31 insertions, 2 deletions
diff --git a/utils/loc_target.cpp b/utils/loc_target.cpp index a3ef6b3..e22e447 100644 --- a/utils/loc_target.cpp +++ b/utils/loc_target.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2012, The Linux Foundation. All rights reserved. +/* Copyright (c) 2012-2014, The Linux Foundation. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -141,6 +141,34 @@ static bool is_qca1530(void) return res; } +/*The character array passed to this function should have length + of atleast PROPERTY_VALUE_MAX*/ +void loc_get_target_baseband(char *baseband, int array_length) +{ + if(baseband && (array_length >= PROPERTY_VALUE_MAX)) { + property_get("ro.baseband", baseband, ""); + LOC_LOGD("%s:%d]: Baseband: %s\n", __func__, __LINE__, baseband); + } + else { + LOC_LOGE("%s:%d]: NULL parameter or array length less than PROPERTY_VALUE_MAX\n", + __func__, __LINE__); + } +} + +/*The character array passed to this function should have length + of atleast PROPERTY_VALUE_MAX*/ +void loc_get_platform_name(char *platform_name, int array_length) +{ + if(platform_name && (array_length >= PROPERTY_VALUE_MAX)) { + property_get("ro.board.platform", platform_name, ""); + LOC_LOGD("%s:%d]: Target name: %s\n", __func__, __LINE__, platform_name); + } + else { + LOC_LOGE("%s:%d]: Null parameter or array length less than PROPERTY_VALUE_MAX\n", + __func__, __LINE__); + } +} + unsigned int loc_get_target(void) { if (gTarget != (unsigned int)-1) @@ -163,7 +191,8 @@ unsigned int loc_get_target(void) goto detected; } - property_get("ro.baseband", baseband, ""); + loc_get_target_baseband(baseband, sizeof(baseband)); + if (!access(hw_platform, F_OK)) { read_a_line(hw_platform, rd_hw_platform, LINE_LEN); } else { |