#include "wearable_log.h"
#include "custom_utils.h"
#include "language/font/ui_resource_string.h"
+#include "iostream"
+#include "string"
namespace OHOS
{
WatchQRCodeView::~WatchQRCodeView()
{
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "WatchQRCodeView::~WatchQRCodeView");
- ClearAll();
g_pWatchQRCodePresenter = nullptr;
}
}
}
+ extern "C"
+ {
+#include "build_version.h"
+
+ const char *get_version_string(void);
+ }
+
bool WatchQRCodeView::WatchQRCodeInitViewGroup(void)
{
WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "WatchQRCodeView::WatchQRCodeInitViewGroup");
return false;
}
Watch_QR_Code_View->SetPosition(93, 100, 280, 280);
- Watch_QR_Code_View->SetECCLevel(QrCode::Ecc::LOW);/*QR 码的 ECC(Error Correction Code ,错误纠正码)级别表示二维码的纠错能力或容错率*/
+ Watch_QR_Code_View->SetECCLevel(QrCode::Ecc::LOW); /*QR 码的 ECC(Error Correction Code ,错误纠正码)级别表示二维码的纠错能力或容错率*/
Watch_QR_Code_View->SetAutoEnable(false);
Watch_QR_Code_View->SetResizeMode(UIImageView::ImageResizeMode::CENTER);
std::string str = WatchQRCodePresenter::GetInstance()->WatchQRCodeGetQRCodeStr();
TitleLabel->SetPosition(83, 50, 300, 35);
TitleLabel->SetStyle(STYLE_TEXT_FONT, 30);
TitleLabel->SetStyle(STYLE_LINE_HEIGHT, 35);
- TitleLabel->SetTextId(STR_SCANNING_BINDING);
+ uint8_t ble_name[30] = {0};
+ uint32_t ble_name_len = sizeof(ble_name);
+ errcode_t ret = uapi_get_nv_btname(ble_name, &ble_name_len);
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "get btname %s ,ret 0x%X\n", ble_name, ret);
+ TitleLabel->SetText((char *)ble_name);
TitleLabel->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30);
TitleLabel->SetRollSpeed(70);
TitleLabel->SetLineBreakMode(UILabel::LINE_BREAK_OSCILLATION);
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "WatchQRCodeView::DeviceNameLabel new label fail");
return false;
}
-
- uint8_t ble_name[30] = {0};
- uint32_t ble_name_len = sizeof(ble_name);
- errcode_t ret = uapi_get_nv_btname(ble_name, &ble_name_len);
- WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "get btname %s ,ret 0x%X\n", ble_name, ret);
- DeviceNameLabel->SetText((char *)ble_name);
+ std::string temp = get_version_string();
+ std::string version_string = "V" + temp;
+ DeviceNameLabel->SetText(version_string.c_str());
DeviceNameLabel->SetPosition(83, 402, 300, 35);
DeviceNameLabel->SetStyle(STYLE_TEXT_FONT, 30);
DeviceNameLabel->SetStyle(STYLE_LINE_HEIGHT, 35);