#endif\r
#include "cpu_trace.h"\r
#include "non_os_reboot.h"\r
+#include "memory_config.h"\r
+#include "chip_exception_utils.h"\r
/* after reboot system emmc need write exc info to the file system from sector */\r
#if defined(SAVE_EXC_INFO) && defined(CFG_DRIVERS_MMC)\r
#include "exception.h"\r
ztw523_host_init_sample();\r
#endif\r
uapi_lcd_init();\r
-#ifdef SUPPORT_GPU_GMMU\r
- drv_gmmu_module_init();\r
-#endif\r
uapi_vau_module_init();\r
uapi_dpu_module_init();\r
#ifdef SUPPORT_GPU_JPEG\r
}\r
#endif\r
\r
-#ifdef CFG_SDIO_EMMC_COEXIST\r
+#ifdef CFG_DRIVERS_SDIO\r
static void sdio_init(void)\r
{\r
init_sdio_pinmux();\r
sdio_drv_context_init();\r
+\r
+ /* sdio probe失败, NANDFLASH访问异常bugfix */\r
+#ifdef CFG_DRIVERS_NANDFLASH\r
+ clocks_clk_src_t clk_src = (clocks_clk_src_t)hal_clocks_ccrg_module_get_src(HAL_CLOCKS_MODULE_SDIOM);\r
+ if (clk_src == CLOCKS_CLK_SRC_TCXO) {\r
+ dprintf("sdio probe fail, switch sdiom clk to pll\r\n");\r
+ clocks_set_sdio_freq(CLOCKS_SDIO_FREQ_H);\r
+ }\r
+#endif\r
}\r
#endif\r
\r
#endif /* DSP_EXIST */\r
\r
#if DSP_EXIST == YES\r
+#ifdef CFG_LOAD_FROM_FS\r
+#define DSP_FILE_PATH "/user/dsp/"\r
+#endif\r
static void audio_init()\r
{\r
+ int32_t ret;\r
(void)osDelay(TICK_TEN_MS);\r
uapi_watchdog_kick();\r
\r
audio_smartpa_init();\r
\r
- uint32_t ret = (uint32_t)uapi_audio_init();\r
+ ret = uapi_audio_init();\r
if (ret != 0) {\r
- PRINT("audio init error:[%d]\r\n", ret);\r
+ PRINT("audio init error:[%x]\r\n", ret);\r
} else {\r
PRINT("audio init OK\r\n");\r
}\r
+\r
+#ifdef CFG_LOAD_FROM_FS\r
+ ret = uapi_audio_set_dsp_file_path(DSP_FILE_PATH, sizeof(DSP_FILE_PATH));\r
+ if (ret != 0) {\r
+ PRINT("audio set dsp file path error:[%x]\r\n", ret);\r
+ }\r
+#endif\r
}\r
#endif\r
\r
#ifdef CFG_DRIVERS_MMC\r
emmc_init_handle();\r
#endif\r
-#ifdef CFG_SDIO_EMMC_COEXIST\r
+#ifdef CFG_DRIVERS_SDIO\r
sdio_init();\r
#endif\r
+\r
#ifdef CFG_DRIVERS_NANDFLASH\r
nandflash_init_handle();\r
#endif\r
PRINT("nmi reboot cause: 0x%x, reason: 0x%x"NEWLINE, cause, get_fault_reason());\r
// save cputrace memory if chip watchdog reset\r
hal_cpu_trace_clock_enable();\r
- panic(PANIC_ASSERT, cause);\r
+ write_fileinfo("/user/exc/hard_watchdog_error.bin", 0, (const uint8_t *)MCPU_TRACE_MEM_REGION_START, CPU_TRACE_MEM_REGION_LENGTH);\r
+ cpu_trace_enable_mcpu_repeat();\r
}\r
\r
uapi_pm_control(PM_DISPLAY_POWER_UP_AND_RUN);\r
CLOCK_SOURCE_MAX\r
} clock_32k_source_t;\r
\r
-int32_t drv_gmmu_module_init(void);\r
int32_t uapi_vau_module_init(void);\r
int32_t uapi_dpu_module_init(void);\r
void los_vfs_init(void);\r
if (parent != nullptr) {
parent->Remove(this);
}
- ImageCacheFree(*const_cast<ImageInfo *>(GetImageInfo()));
+ const ImageInfo* info = GetImageInfo();
+ if (info != nullptr) {
+ ImageCacheFree(*const_cast<ImageInfo*>(info));
+ }
}
};
#ifdef JS_ENABLE
ElementName *elementName = OHOS::AbilityMsClient::GetInstance().GetTopAbility();
if (elementName != nullptr && strcmp(elementName->bundleName, "com.huawei.launcher") != 0) {
- OHOS::AbilityMsClient::GetInstance().ForceStop(elementName->bundleName, TransitionType::TRANSITION_ZOOM);
+ OHOS::AbilityMsClient::GetInstance().ForceStop(elementName->bundleName, type);
targetSliceIdFromJS_ = targetSliceId;
FreeElement(elementName);
return;
set(MODULE_NAME "app")
set(AUTO_DEF_FILE_ID TRUE)
set(NativeApp ${CMAKE_CURRENT_SOURCE_DIR})
+set(UIKIT_ROOT_DIR ${ROOT_DIR}/middleware/services/gui/uikit)
set(UI_SAMPLE_ROOT ${ROOT_DIR}/middleware/services/gui/uikit/sample/uitest)
set(PUBLIC_HEADER
${ROOT_DIR}/open_source/openharmony/foundation/multimedia/utils/include
${ROOT_DIR}/open_source/openharmony/utils/native/lite/include
${ROOT_DIR}/open_source/openharmony/utils/native/lite/kv_store/innerkits
+ ${ROOT_DIR}/open_source/openharmony/drivers/peripheral/format/interfaces/include
+ ${UIKIT_ROOT_DIR}/proprietary/src/ui/innerkits
+ ${ROOT_DIR}/application/wearable/service/dial_market
+ ${ROOT_DIR}/open_source/openharmony/third_party/cJSON
${ROOT_DIR}/zhihui/UI/CustomUIComponentTool/
list(REMOVE_ITEM SOURCES
${NativeApp}/nativeui/main/src/dial/parser/DialBinParser.cpp
${NativeApp}/nativeui/main/src/dial/parser/DialBinParserManager.cpp
+ ${NativeApp}/nativeui/main/src/dial/parser/DialBinParserV3.cpp
)
if("SUPPORT_ALIPAY_SEC" IN_LIST DEFINES)
${UIKIT_NATIVE_FWK}/src/TransitionRecord.cpp
${UIKIT_NATIVE_DIAL}/src/dial/parser/DialBinParser.cpp
${UIKIT_NATIVE_DIAL}/src/dial/parser/DialBinParserManager.cpp
+ ${UIKIT_NATIVE_DIAL}/src/dial/parser/DialBinParserV3.cpp
)
set(SOURCES
${ROOT_DIR}/middleware/services/gui/uikit/ui/frameworks
${ROOT_DIR}/application/wearable/nativeapp/nativeui/applist/include/
${ROOT_DIR}/open_source/openharmony/drivers/peripheral/display/interfaces/include
+ ${ROOT_DIR}/open_source/openharmony/drivers/peripheral/format/interfaces/include
${UIKIT_NATIVE_DIAL}/include/dial
${ROOT_DIR}/middleware/services/media/foundation/sample/wrapper
${ROOT_DIR}/middleware/services/media/foundation/player/interfaces/kits
+ ${UIKIT_ROOT_DIR}/proprietary/src/ui/innerkits
)
set(PRIVATE_DEFINES
void RegisterNative(const AppItem &nativeAppList, NativeRegisterCallback* native);
void RegisterSlice(const uint16_t id, SliceProxy* slice);
void RegisterMenu(const uint16_t id, const char *icon, const char *iconHexagon, const char *label);
+ bool IsSliceIdExist(AppViewId id);
void RegisterMenuPro(const uint16_t id, const char *iconLarge, const char *iconSmall,const char *iconHexagon, const char *label, uint16_t TextId);
private:
nativeAppLists_.PushBack(item);
}
+bool NativeRegisterManager::IsSliceIdExist(AppViewId id)
+{
+ for (uint16_t index = 0; index < slices_.Size(); index++) {
+ if (slices_[index].id == static_cast<uint16_t>(id)) {
+ return true;
+ }
+ }
+ return false;
+}
+
void NativeRegisterManager::RegisterMenuPro(const uint16_t id, const char *iconLarge, const char *iconSmall,
const char *iconHexagon, const char *label, uint16_t TextId)
{
\r
void AlipayPresenter::OnStart()\r
{\r
- WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "AlipayPresenter OnStart");\r
- Presenter<AlipayMainView>::OnStart();\r
alipayMode_->AlipayExitLpm();\r
if (!alipayMode_->AlipayInitModel()) {\r
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlipayPresenter::OnStart AlipayInitModel fail.");\r
#include "SetDesktopView.h"
#include "NativeRegisterManager.h"
+
+#ifdef XTS_SUPPORT
+#include "hal_tick.h"
+#ifdef __cplusplus
+#if __cplusplus
+extern "C"
+{
+#endif
+#endif
+#ifdef XTS_SUPPORT
+ extern uint8_t is_xts_test_done(void);
+#endif
+#ifdef __cplusplus
+#if __cplusplus
+}
+#endif
+#endif
+#endif
+
namespace OHOS {
#define FOOTBALL_PLANE_MAX_NUM 20
void ApplistModel::ResolvingJSAppItems(void)
{
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ResolvingJSAppItems start\r");
#ifdef JS_ENABLE
if (bundleInfos != nullptr) {
for (uint8_t i = 0; i < bundleLen; i++) {
#ifdef JS_ENABLE
int32_t len = 0;
uint8_t ret = BundleMsClient::GetInstance().GetBundleInfos(0, &bundleInfos, &len);
+ printf("ResolvingJSAppItems GetBundleInfos ret = %d ,len = %d\r\n", ret, len);
if ((ret == 0) && (len > 0) && (bundleInfos != nullptr)) {
bundleLen = len;
if (len > APP_MAX_NUM - nativeAppNumTotal) {
void ApplistView::OnStart()
{
- View<ApplistPresenter>::OnStart();
AppListStyle style = presenter_->GetCurrentStyle();
if (style == AppListStyle::FOOTBALL_STYLE) {
FootballStyleOnStart();
int16_t blankSize = waterfallList_->GetRelativeRect().GetWidth() > waterfallList_->GetRelativeRect().GetHeight() ?
waterfallList_->GetRelativeRect().GetWidth() / 2 : waterfallList_->GetRelativeRect().GetHeight() / 2; // 2, half
waterfallList_->SetThrowDrag(true);
- waterfallList_->SetReboundSize(imgDistance_ * Sin(60)); // 60, degree
- waterfallList_->SetScrollBlankSize(0);
+ uint16_t layoutHeight = static_cast<uint16_t>(imgDistance_ * Sin(60));
+ waterfallList_->SetReboundSize(layoutHeight); // 60: degree, row's layout height
+ waterfallList_->SetScrollBlankSize(layoutHeight, UIAbstractScroll::Direction::TOP);
+ waterfallList_->SetScrollBlankSize(Screen::GetInstance().GetHeight() / 2 - layoutHeight, // 2: half
+ UIAbstractScroll::Direction::BOTTOM);
waterfallList_->RequestFocus();
waterfallList_->SetRotateFactor(10); // 10, empirical coefficient
waterfallList_->SetOnRotateListener(presenter_);
} else {
ListStyleOnStop();
}
- FocusManager::GetInstance()->ClearFocus();
return;
}
#include "dfx_channel.h"\r
#include "tcxo.h"\r
#include "ui_service.h"\r
+#include "network/network_listener.h"\r
#include "font/ui_font_header.h"\r
\r
\r
SendMsgToMsgCenterService(BT_DISCONNECTED_TO_MSGCENTER, 0, nullptr, 0);\r
SendMsgToUIService(BT_DISCONNECTED_TO_UI, 0, nullptr, 0);\r
\r
- \r
+ /* ---------------------------------- 补丁合入 ---------------------------------- */\r
+ // send to ace network\r
+ // SetAclConnected(false);\r
+ net_connect_status_change(NETWORK_TYPE_BLUETOOTH, CONNECTION_STATUS_DISCONNECTED);\r
+ /* -------------------------------------------------------------------------- */\r
\r
gap_br_set_bt_scan_mode(GAP_SCAN_MODE_CONNECTABLE, 0);\r
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "GAP_SCAN_MODE_CONNECTABLE");\r
SendMsgToMsgCenterService(BT_CONNECTED_TO_MSGCENTER, 0, nullptr, 0);\r
SendMsgToUIService(BT_CONNECTED_TO_UI, 0, nullptr, 0);\r
\r
+ /* ---------------------------------- 补丁合入 ---------------------------------- */\r
+ // send to ace network\r
+ // SetAclConnected(true);\r
+ net_connect_status_change(NETWORK_TYPE_BLUETOOTH, CONNECTION_STATUS_CONNECTED);\r
+ /* -------------------------------------------------------------------------- */\r
+\r
uapi_set_ACL_br_address(bdAddr);\r
\r
gap_br_set_bt_scan_mode(GAP_SCAN_MODE_NONE, 0);\r
if (GAP_BLE_STATE_DISCONNECTED == connState) { // restart ble adv when disconnected\r
/* 通知msg_center,ble状态仍用bt状态,此处不区分 */\r
SendMsgToMsgCenterService(BT_DISCONNECTED_TO_MSGCENTER, 0, nullptr, 0);\r
+\r
+ /* ---------------------------------- 补丁合入 ---------------------------------- */\r
+ // send to ace network\r
+ net_connect_status_change(NETWORK_TYPE_BLUETOOTH_LE, CONNECTION_STATUS_DISCONNECTED);\r
+ /* -------------------------------------------------------------------------- */\r
} else {\r
SendMsgToMsgCenterService(BT_CONNECTED_TO_MSGCENTER, 0, nullptr, 0);\r
(void)memcpy_s(&g_bd_addr, sizeof(bd_addr_t), addr, sizeof(bd_addr_t));\r
+\r
+ /* ---------------------------------- 补丁合入 ---------------------------------- */\r
+ // send to ace network\r
+ net_connect_status_change(NETWORK_TYPE_BLUETOOTH_LE, CONNECTION_STATUS_CONNECTED);\r
+ /* -------------------------------------------------------------------------- */\r
}\r
#endif\r
}\r
memcpy_s(character.chara_uuid.uuid, sizeof(character.chara_uuid.uuid), (char *)&diag_id, sizeof(diag_id));\r
character.permissions = GATT_ATTRIBUTE_PERMISSION_WRITE | GATT_ATTRIBUTE_PERMISSION_READ;\r
character.properties = GATT_CHARACTER_PROPERTY_BIT_WRITE | GATT_CHARACTER_PROPERTY_BIT_READ;\r
+ /* -------------------------------- 下方注释为补丁合入不确定是否合入 ------------------------------- */\r
+ // character.properties = GATT_CHARACTER_PROPERTY_BIT_WRITE_NO_RSP | GATT_CHARACTER_PROPERTY_BIT_READ | GATT_CHARACTER_PROPERTY_BIT_NOTIFY;\r
character.value_len = (uint16_t)sizeof(value);\r
character.value = (uint8_t *)(&value);\r
\r
{
WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[CallModelResumePlayer] [ResumePlayer] start");
usleep(5000); // 延时等待通话释放媒体资源
- std::shared_ptr<PlayerInterruptListener> PlayerIntrptListener =
- OHOS::PlayersModel::GetInstance()->GetPlayerIntrptListener();
- if (PlayerIntrptListener != nullptr && PlayerIntrptListener->IsPaused()) {
- WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[CallModelResumePlayer] ResumePlayer ");
- PlayerIntrptListener->ResumePlayer();
- }
+ // std::shared_ptr<PlayerInterruptListener> PlayerIntrptListener =
+ // OHOS::PlayersModel::GetInstance()->GetPlayerIntrptListener();
+ // if (PlayerIntrptListener != nullptr && PlayerIntrptListener->IsPaused()) {
+ // WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[CallModelResumePlayer] ResumePlayer ");
+ // PlayerIntrptListener->ResumePlayer();
+ // }
}
static void CallModelPostGraphicEvent(void (*fun)(void))
class DialBinParserManager {
public:
- static DialBinParserManager* GetInstance(void);
- bool UpdateDial(const std::string& file, FILE* fp, DialViewGroup* group, DisplayState state);
- bool GetDialPreviewInfo(FILE* fp, DialPreviewInfo* info);
+ static DialBinParserManager *GetInstance(void);
+ bool UpdateDial(const std::string &file, FILE *fp, DialViewGroup *group, DisplayState state);
+ bool GetDialPreviewInfo(FILE *fp, DialPreviewInfo *info);
bool RegisterParser(const std::string &version, DialBinParserInterface *parser);
+ uint8_t GetSupportVersionCnt() const
+ {
+ return cnt_;
+ }
+
+ bool GetVersionByIndex(uint8_t index, std::string &version)
+ {
+ if (index >= cnt_) {
+ return false;
+ }
+ version = parsers_[index].version;
+ return true;
+ }
+
private:
DialBinParserManager();
virtual ~DialBinParserManager();
--- /dev/null
+/*
+ * Copyright (c) CompanyNameMagicTag 2025. All rights reserved.
+ * Description: DialBinParserV3
+ * Author:
+ * Create: 2025-02-06
+ */
+
+#ifndef GRAPHIC_LITE_DIAL_BIN_PARSER_V3_H
+#define GRAPHIC_LITE_DIAL_BIN_PARSER_V3_H
+#include "DialBinParserManager.h"
+#include "DialTimePublisher.h"
+#include "components/ui_abstract_progress.h"
+#include "DialViewContainer.h"
+#include "DialOHDataType.h"
+#include "DialOHSliceId.h"
+
+namespace OHOS {
+class DialBinParserV3 : public DialBinParserInterface {
+public:
+ DialBinParserV3();
+ ~DialBinParserV3() override;
+ bool UpdateDial(const std::string& file, FILE* fp, DialViewGroup* group, DisplayState state) override;
+ bool GetDialPreviewInfo(FILE* fp, DialPreviewInfo* info) override;
+
+protected:
+ bool ParseDialHeader(FILE* file);
+ bool ParserDialStaticImg(ContainerInterface &parent);
+ bool ParserDialSequenceImg(ContainerInterface &parent);
+ bool ParserDialRotateImg(ContainerInterface &parent);
+ bool ParserDialOptionImg(ContainerInterface &parent);
+ bool ParserDialDigitalImg(ContainerInterface &parent);
+ bool ParserDialLabel(ContainerInterface &parent);
+ bool ParserDialArcLabel(ContainerInterface &parent);
+ bool ParserDialBoxProgress(ContainerInterface &parent);
+ bool ParserDialArcProgress(ContainerInterface &parent);
+ bool ParserDialVideo(ContainerInterface &parent);
+ bool ParserDialClick(ContainerInterface &parent);
+ bool ParserDialKaleidoscope(ContainerInterface &parent);
+ bool ParserDialContainer(ContainerInterface &parent);
+ bool ParserDialOptions(ContainerInterface &parent);
+
+private:
+ void* MallocAndReadBuf(FILE* file, uint32_t readSize);
+ bool SetProgressType(FILE* fp, UIAbstractProgress* view, DialProgressType data);
+
+ static constexpr uint8_t DIAL_BIN_PARSER_FUNC_NUM = 14; // 14: func max value
+ bool (DialBinParserV3::*funcArray_[DIAL_BIN_PARSER_FUNC_NUM])(ContainerInterface&);
+ void AddToParentWithView(ContainerInterface &parent, uint8_t displayMode, UIView *view);
+ void AddToParentWithDialView(ContainerInterface &parent, uint8_t displayMode,
+ DialView *view, DialOHDataType bindData, bool isPeriodic);
+ struct {
+ uint8_t *viewType;
+ uint8_t dialViewCount;
+ FILE *file;
+ uint8_t curIndex;
+ } curViewType_;
+ bool ParseTimeIntervals(FILE* fp, uint8_t cnt, DialTimePublisher::TimeChangeListener *listener);
+ bool ParseViewType(uint8_t *viewType, uint8_t dialViewCount, FILE *file);
+ bool ParseContainerSubviews(DialViewContainer *container, uint8_t num);
+ bool ParseOptionsSubviews(ContainerInterface &parent);
+
+ DialViewGroup* dialGroup_ = nullptr;
+ std::string file_;
+ uint32_t dirId_ = 0xfef << 20; // 20: offset
+ uint32_t imageOffset_ = 0;
+ DisplayState state_ = DisplayState::NORMAL;
+}; // class DialBinParserV3
+} // namespace OHOS
+
+#endif // GRAPHIC_LITE_DIAL_BIN_PARSER_V3_H
\ No newline at end of file
uint32_t imgId;\r
uint32_t offset;\r
uint8_t capability;\r
+ uint32_t uuid;\r
+ char protocolVersion[DIAL_VERSION_MAX_LEN];\r
+ char watchVersion[DIAL_VERSION_MAX_LEN];\r
};\r
\r
struct DialRect {\r
#include "sleep/include/SleepCardView.h"
#include "set_card/include/SetMainView.h"
#include "heartrate/include/HeartRateCardView.h"
+
+#ifdef XTS_SUPPORT
+#include "hal_tick.h"
+#ifdef __cplusplus
+#if __cplusplus
+extern "C"
+{
+#endif
+#endif
+#ifdef XTS_SUPPORT
+ extern uint8_t is_xts_test_done(void);
+#endif
+#ifdef __cplusplus
+#if __cplusplus
+}
+#endif
+#endif
+#endif
+
namespace OHOS
{
+ #ifdef XTS_SUPPORT
+ class XTSCallback : public AnimatorCallback
+ {
+ public:
+ explicit XTSCallback(UILabel *XTSlabel) : XTSlabel(XTSlabel) {}
+ ~XTSCallback() {}
+ virtual void Callback(UIView *view)
+ {
+ uint8_t xts_testing = 1;
+#ifdef XTS_SUPPORT
+ xts_testing = is_xts_test_done();
+#endif
+ if (!xts_testing)
+ {
+ // XTS测试进行
+ xts_flag = 1;
+ XTSlabel->SetText("XTS测试进行中\n请勿操作表盘");
+ XTSlabel->SetTextColor(Color::GetColorFromRGBA(0xe6, 0x04, 0x09, 0xff));
+ }
+ else
+ {
+ // XTS测试结束
+ if (xts_flag)
+ {
+ XTSlabel->SetText("XTS测试结束");
+ XTSlabel->SetTextColor(Color::GetColorFromRGBA(0x4e, 0xe6, 0x04, 0xff));
+ xts_flag = 0; // 复位
+ }
+ }
+ }
+ private:
+ uint8_t xts_flag = 0; // 标志位
+ UILabel *XTSlabel{nullptr};
+ };
+ #endif
+
class MainPresenterSample;
class MainViewSample : public View<MainPresenterSample>
{
UIImageView *dialstateicon_{nullptr};
UIImageView *messageicon_{nullptr};
+
+#ifdef XTS_SUPPORT
+ /* --------------------------------- XTS监测标签 -------------------------------- */
+ UILabel *XTSLabel = nullptr;
+ AnimatorCallback *xtsCallback_ = nullptr;
+ Animator *xtsanimator_ = nullptr;
/* -------------------------------------------------------------------------- */
+#endif
UICardPage *recordCard[MAX_CARD]{nullptr};
bool pageStatus[MAX_CARD]{false};
UICrossView *mainSwipeGroup{nullptr};
#include <cstdint>
#include "DialView.h"
#include "components/ui_arc_label.h"
+#include "font/font_global_manager.h"
namespace OHOS {
-class DialArcLabelView : public UIArcLabel, public DialView {
+class DialArcLabelView : public UIArcLabel, public DialView, public FontGlobalManager::LangChangeListener {
public:
DialArcLabelView();
~DialArcLabelView() override;
void HandleTextData(const std::string* data, uint16_t num) override;
void HandleFloatData(const float* data, uint16_t num) override;
void HandleFloatData(float data) override;
+ void SetLang(uint8_t lang);
+ void OnLangChange(uint8_t langId) override;
private:
void SetTextWithWildcardInner(const char* text);
static const uint8_t MAX_BUF_SIZE = 255;
char* text_ = nullptr;
char dstBuf_[MAX_BUF_SIZE] = {0};
+ uint8_t language_ = FontGlobalManager::INVALID_LANG_ID;
};
}
#endif
DATA_TYPE_STEPS_GOAL_INT, // 运动步数百分比
DATA_TYPE_CALORIE_GOAL_INT, // 运动卡路里目标百分比
- DATA_TYPE_MULTI_FLOAT_BASE = 0x2fff, // 多个浮点数据类型基值
+ DATA_TYPE_MULTI_FLOAT_BASE = 0x4000, // 多个浮点数据类型基值
DATA_TYPE_HOUR_MIN, // 时分
- DATA_TYPE_TEXT_BASE = 0x4fff, // 文本数据类型基值
+ DATA_TYPE_TEXT_BASE = 0x2000, // 文本数据类型基值
DATA_TYPE_WEEK_STR, // 星期(string)
DATA_TYPE_DATE_STR, // 日期(string)
DATA_TYPE_WEATHER_STR, // 天气(string)
DATA_TYPE_STEPS_GOAL_STR, // 运动步数目标(string)
DATA_TYPE_CALORIE_GOAL_STR, // 卡路里目标(string)
- DATA_TYPE_MAX = 0x7fff, // 数据类型的最大值
+ DATA_TYPE_SWIVEL_GEAR_ONE = 20,
+ DATA_TYPE_SWIVEL_GEAR_TWO,
+ DATA_TYPE_SWIVEL_GEAR_THREE,
+ DATA_TYPE_SWIVEL_GEAR_FOUR,
+ DATA_TYPE_SWIVEL_GEAR_FIVE,
+ DATA_TYPE_SWIVEL_GEAR_SIX,
+
+ DATA_TYPE_MAX = 0x6000, // 数据类型的最大值
};
#endif
#include <cstdint>
#include "DialView.h"
+#include "DialTimePublisher.h"
#include "components/ui_image_view.h"
#include "gfx_utils/graphic_math.h"
#include "components/ui_view_group.h"
RIGHT,
};
-class DialDigitalImgView : public UIImageView, public DialView {
+class DialDigitalImgView : public UIImageView, public DialView, public DialTimePublisher::TimeChangeListener {
public:
DialDigitalImgView();
~DialDigitalImgView() override;
void SetAlignPos(Point pos);
void SetDecimalPrecision(uint8_t precision);
void SetParent(UIViewGroup* parent);
+ void OnTimeUpdate(const struct tm &curTime) override;
private:
void SetNumImg(UIImageView* img, const ImageInfo *info);
#include <cstdint>
#include "DialView.h"
#include "components/ui_label.h"
+#include "font/font_global_manager.h"
#include "components/ui_label_ext.h"
-
namespace OHOS {
-class DialLabelView : public UILabel, public DialView {
+class DialLabelView : public UILabel, public DialView, public FontGlobalManager::LangChangeListener {
public:
DialLabelView();
~DialLabelView() override;
void HandleTextData(const std::string* data, uint16_t num) override;
void HandleFloatData(const float* data, uint16_t num) override;
void HandleFloatData(float data) override;
+ void SetLang(uint8_t lang);
+ void OnLangChange(uint8_t langId) override;
private:
void SetTextWithWildcardInner(const char* text);
static const uint8_t MAX_BUF_SIZE = 255;
char* text_ = nullptr;
char dstBuf_[MAX_BUF_SIZE] = {0};
+ uint8_t language_ = FontGlobalManager::INVALID_LANG_ID;
};
}
#endif
#define DIAL_MODEL_TIME_H
#include "DialBaseModel.h"
+#include "DialTimePublisher.h"
+#include "gfx_utils/list.h"
namespace OHOS {
-class DialModelTime : public DialBaseModel {
+class DialModelTime : public DialBaseModel, public DialTimePublisher {
public:
- DialModelTime() {}
- ~DialModelTime() override {}
+ DialModelTime()
+ {
+ DialModelTime::SetPublisher(dynamic_cast<DialTimePublisher*>(this));
+ }
+ ~DialModelTime() override
+ {
+ listeners_.Clear();
+ }
static DialModelTime* GetInstance()
{
static DialModelTime instance;
return &instance;
}
bool GetDialFloatData(DialDataType& type, float& out) override;
- void UpdateTime();
+ void UpdateTime() override;
+ void Register(TimeChangeListener* listener) override;
+ void Unregister(TimeChangeListener* listener) override;
private:
- struct tm tblock_;
+ struct tm *tblock_;
uint16_t angleH_ = 0;
uint16_t angleM_ = 0;
uint16_t angleS_ = 0;
float angleMS_ = 0;
- uint8_t pm_ = 0;
+ List<TimeChangeListener*> listeners_;
};
}
#endif
--- /dev/null
+/*
+ * Copyright (c) CompanyNameMagicTag 2025. All rights reserved.
+ * Description: DialOHDataType
+ * Author:
+ * Create: 2025-02-15
+ */
+
+#ifndef DIAL_OH_DATATYPE_H
+#define DIAL_OH_DATATYPE_H
+
+#include <unordered_map>
+#include "DialDataBase.h"
+
+namespace OHOS {
+enum class DialOHDataType : int16_t {
+ CLOCK = 1,
+ CLOCK_HIGH_BIT = 2,
+ CLOCK_LOW_BIT = 3,
+ CLOCK_RATIO_12 = 4,
+ CLOCK_RATIO_24 = 5,
+ MINUTES = 6,
+ MINUTES_HIGH_BIT = 7,
+ MINUTES_LOW_BIT = 8,
+ MINUTES_RATIO = 9,
+ SECONDS = 10,
+ SECONDS_HIGH_BIT = 11,
+ SECONDS_LOW_BIT = 12,
+ SECONDS_RATIO = 13,
+ AM_PM = 14,
+ AMPM_TEXT = 15,
+ HOUR_MODE = 16,
+ PREVIOUS_HOUR = 17,
+ NEXT_HOUR = 18,
+ CLOCK_ANGLE = 19,
+ MINUTE_ANGLE = 20,
+ SECONDS_ANGLE = 21,
+ MILLISECOND_ANGLE = 22,
+ PREVIOUS_SECOND = 25,
+ NEXT_SECOND = 26,
+ PREVIOUS_SECOND_PREVIOUS_SECOND = 27,
+ PREVIOUS_MINUTE = 28,
+ NEXT_MINUTE = 29,
+ DUAL_TIME_ZONE_CLOCK = 30,
+ DUAL_TIME_ZONE_CLOCK_HIGH_BIT = 31,
+ DUAL_TIME_ZONE_CLOCK_LOW_BIT = 32,
+ DUAL_TIME_ZONE_CLOCK_RATIO_12 = 33,
+ DUAL_TIME_ZONE_CLOCK_RATIO_24 = 34,
+ DUAL_TIME_ZONE_MINUTES = 35,
+ DUAL_TIME_ZONE_MINUTES_HIGH_BIT = 36,
+ DUAL_TIME_ZONE_MINUTES_LOW_BIT = 37,
+ DUAL_TIME_ZONE_MINUTES_RATIO = 38,
+ DUAL_TIME_ZONE_ABBREVIATION_TEXT = 39,
+ DUAL_TIME_ZONE_TIME_MINUTE_TEXT = 40,
+ DUAL_TIME_ZONE_AMPM = 41,
+ DUAL_TIME_ZONE_AM_PM_TEXT = 42,
+ SUNRISE_SUNSET_PICTURE_SELECTION = 50,
+ SUNRISE_SUNSET_CLOCK_HIGH_BIT = 51,
+ SUNRISE_SUNSET_CLOCK_LOW_BIT = 52,
+ SUNRISE_SUNSET_MINUTES_HIGH_BIT = 53,
+ SUNRISE_SUNSET_MINUTES_LOW_BIT = 54,
+ SUNRISE_TEXT = 55,
+ SUNSET_TEXT = 56,
+ MOONRISE_TEXT = 60,
+ MOONSET_TEXT = 61,
+ DATE = 70,
+ DATE_HIGH_BIT = 71,
+ DATE_LOW_BIT = 72,
+ DATE_OCCUPIES_31_DAYS_RATIO = 73,
+ YESTERDAY = 74,
+ YESTERDAY_DATE_HIGH_BIT = 75,
+ YESTERDAY_DATE_LOW_BIT = 76,
+ TOMORROW = 77,
+ TOMORROW_DATE_HIGH_BIT = 78,
+ TOMORROW_DATE_LOW_BIT = 79,
+ MONTH_DATA = 80,
+ MONTH = 81,
+ MONTH_TEXT = 82,
+ WEEK_DATA = 83,
+ WEEK_RATIO = 84,
+ WEEK_TEXT = 85,
+ TWELVE_DIVISIONS = 86,
+ LUNAR_PHASE = 87,
+ PREVIOUS_MONTH = 88,
+ NEXT_MONTH = 89,
+ LUNAR_MONTH = 90,
+ LUNAR_DATE_HIGH_BIT = 91,
+ LUNAR_DATE_LOW_BIT = 92,
+ CHARGE = 100,
+ CHARGE_ENUMERATION = 102,
+ CHARGE_STATUS_ENUMERATION = 103,
+ CHARGE_RATIO = 104,
+ CHARGING_STATUS = 105,
+ STEPS = 110,
+ STEPS_UNIT_DIGIT = 111,
+ STEPS_TENS_DIGIT = 112,
+ STEPS_HUNDRED_DIGIT = 113,
+ STEPS_THOUSAND_DIGIT = 114,
+ STEPS_TEN_THOUSAND_DIGIT = 115,
+ STEPS_TARGET_ACHIEVEMENT_RATE = 116,
+ STEPS_TARGET_PROGRESS_ENUMERATION = 117,
+ CALORIES = 120,
+ CALORIES_RATIO = 121,
+ CALORIES_TARGET_PROGRESS_ENUMERATION = 122,
+ HEART_RATE = 130,
+ MAXIMUM_HEART_RATE = 131,
+ MINIMUM_HEART_RATE = 132,
+ HEART_RATE_RANGE = 133,
+ HEART_RATE_RATIO = 134,
+ STRESS = 140,
+ STRESS_RATIO = 141,
+ STRESS_LEVEL_TYPE = 142,
+ MODERATE_TO_VIGOROUS_INTENSITY_TIME = 150,
+ MODERATE_TO_VIGOROUS_INTENSITY_TIME_RATIO = 151,
+ STANDING_TIMES = 152,
+ STANDING_TIMES_RATIO = 153,
+ MAXIMUM_OXYGEN_UPTAKE = 160,
+ MAXIMUM_OXYGEN_UPTAKE_RATIO = 161,
+ SLEEP_TEXT = 165,
+ SLEEP_RATIO = 166,
+ SLEEP_TARGET_ACHIEVEMENT_RATE_ENUMERATION = 167,
+ TEMPERATURE = 170,
+ HIGHEST_TEMPERATURE = 171,
+ LOWEST_TEMPERATURE = 172,
+ CURRENT_TEMPERATURE_MINUS_ONE = 173,
+ CURRENT_TEMPERATURE_PLUS_ONE = 174,
+ TEMPERATURE_TYPE = 175,
+ WEATHER_TYPE = 176,
+ TEMPERATURE_RATIO = 177,
+ ATMOSPHERIC_PRESSURE = 180,
+ ATMOSPHERIC_PRESSURE_RATIO = 181,
+ AIR_QUALITY_INDEX = 182,
+ AIR_QUALITY_INDEX_LEVEL = 183,
+ AIR_QUALITY_INDEX_RATIO = 184,
+ ELEVATION = 190,
+ ELEVATION_HEIGHT_DATA = 191,
+ ELEVATION_HEIGHT_UNIT = 192,
+ HEIGHT_RATIO = 193,
+ DISTANCE_TEXT = 194,
+ DISTANCE_DATA = 195,
+ DISTANCE_UNIT = 196,
+ DISTANCE_TARGET_PROGRESS = 197,
+ HIGH_TIDE_TIME_TEXT = 200,
+ LOW_TIDE_TIME_TEXT = 201,
+ BLE_CONNECTION_STATUS = 210,
+ BT_CONNECTION_STATUS = 211,
+ BLOOD_OXYGEN = 220,
+ SYSTOLIC_BLOOD_PRESSURE = 221,
+ DIASTOLIC_BLOOD_PRESSURE = 222,
+ DUAL_LANGUAGE_SYSTEM = 230,
+ SWIVEL_GEAR_POSITIVE = (1 << 12) + 20, // private data, clockwise
+ SWIVEL_GEAR_NEGATIVE, // counterclockwise
+}; // enum class DialOHDataType
+
+struct HashOHDataType {
+ size_t operator()(DialOHDataType data) const
+ {
+ return std::hash<int16_t>()(static_cast<int16_t>(data));
+ }
+};
+
+const std::unordered_map<DialOHDataType, DialDataType, HashOHDataType> g_bindDataConverter = {
+ {DialOHDataType::CLOCK, DialDataType::DATA_TYPE_TIME_HOUR},
+ {DialOHDataType::MINUTES, DialDataType::DATA_TYPE_TIME_MINUTE},
+ {DialOHDataType::SECONDS, DialDataType::DATA_TYPE_TIME_SECOND},
+ {DialOHDataType::MILLISECOND_ANGLE, DialDataType::DATA_TYPE_CLOCK_ANGLE_MS},
+ {DialOHDataType::DATE, DialDataType::DATA_TYPE_TIME_DATE},
+ {DialOHDataType::WEEK_DATA, DialDataType::DATA_TYPE_TIME_WEEK},
+ {DialOHDataType::CHARGE, DialDataType::DATA_TYPE_POWER},
+ {DialOHDataType::STEPS, DialDataType::DATA_TYPE_STEPS},
+ {DialOHDataType::CALORIES, DialDataType::DATA_TYPE_CALORIE},
+ {DialOHDataType::HEART_RATE, DialDataType::DATA_TYPE_HEART_RATE},
+ {DialOHDataType::STRESS, DialDataType::DATA_TYPE_PRESSURE},
+ {DialOHDataType::TEMPERATURE, DialDataType::DATA_TYPE_TEMPERATURE},
+ {DialOHDataType::ELEVATION, DialDataType::DATA_TYPE_AILTITUDE},
+ {DialOHDataType::AIR_QUALITY_INDEX, DialDataType::DATA_TYPE_PM25},
+ {DialOHDataType::CLOCK_ANGLE, DialDataType::DATA_TYPE_CLOCK_ANGLE_H},
+ {DialOHDataType::MINUTE_ANGLE, DialDataType::DATA_TYPE_CLOCK_ANGLE_M},
+ {DialOHDataType::SECONDS_ANGLE, DialDataType::DATA_TYPE_CLOCK_ANGLE_S},
+ {DialOHDataType::MONTH, DialDataType::DATA_TYPE_TIME_MONTH},
+ {DialOHDataType::SWIVEL_GEAR_POSITIVE, DialDataType::DATA_TYPE_SWIVEL_GEAR_ONE},
+ {DialOHDataType::SWIVEL_GEAR_POSITIVE, DialDataType::DATA_TYPE_SWIVEL_GEAR_FOUR},
+ {DialOHDataType::SWIVEL_GEAR_POSITIVE, DialDataType::DATA_TYPE_SWIVEL_GEAR_SIX},
+ {DialOHDataType::SWIVEL_GEAR_NEGATIVE, DialDataType::DATA_TYPE_SWIVEL_GEAR_TWO},
+ {DialOHDataType::SWIVEL_GEAR_NEGATIVE, DialDataType::DATA_TYPE_SWIVEL_GEAR_THREE},
+ {DialOHDataType::SWIVEL_GEAR_NEGATIVE, DialDataType::DATA_TYPE_SWIVEL_GEAR_FIVE},
+};
+} // namespace OHOS
+
+#endif // DIAL_OH_DATATYPE_H
--- /dev/null
+/*
+ * Copyright (c) CompanyNameMagicTag 2025. All rights reserved.
+ * Description: DialOHSliceId
+ * Author:
+ * Create: 2025-02-15
+ */
+
+
+#ifndef DIALOHSLICEID_H
+#define DIALOHSLICEID_H
+
+#include <unordered_map>
+#include "AppViewIDs.h"
+
+namespace OHOS {
+enum class DialOHSliceId : uint16_t {
+ DUAL_TIME_ZONES = 0,
+ HEART_RATE = 1,
+ STANDING_TIMES = 2,
+ STRESS = 3,
+ MODERATE_TO_VIGOROUS_INTENSITY_TIME = 4,
+ WEATHER = 5,
+ AIR_QUALITY_ONLY_CHINA = 6,
+ ATMOSPHERIC_PRESSURE = 7,
+ ELEVATION_HEIGHT = 8,
+ SUNRISE_SUNSET_TIME = 9,
+ DISTANCE = 10,
+ SLEEP = 11,
+ EXERCISE = 12,
+ PAYMENT_ONLY_CHINA = 13,
+ ALARM_CLOCK = 14,
+ STOPWATCH = 15,
+ TIMER = 16,
+ EXERCISE_RECORD = 17,
+ TRAINING_STATUS = 18,
+ ACTIVITY_RECORD = 19,
+ AEROBIC_EXERCISE = 20,
+ CONTACTS = 21,
+ MUSIC = 22,
+ COMPASS = 23,
+ CALL_LOG = 24,
+ BLOOD_OXYGEN_SATURATION_ONLY_CHINA = 25,
+ ULTRAVIOLET_RAYS_ONLY_CHINA = 26,
+ PHASE_OF_THE_MOON = 27,
+ STAIR_CLIMBING = 28,
+ BLOOD_PRESSURE = 29,
+ MESSAGE_LIST = 30,
+ DIAL = 31,
+ AUDIO_SWITCH = 32,
+}; // enum class DialOHSliceId
+
+struct HashOhSliceId {
+ size_t operator()(DialOHSliceId id) const
+ {
+ return std::hash<uint16_t>()(static_cast<uint16_t>(id));
+ }
+};
+
+const std::unordered_map<DialOHSliceId, AppViewId, HashOhSliceId> g_sliceIdConverter = {
+ {DialOHSliceId::COMPASS, VIEW_COMPASS},
+ {DialOHSliceId::DIAL, VIEW_CALLER_SAMPLE},
+ {DialOHSliceId::ALARM_CLOCK, VIEW_MAIN_ALARM},
+ {DialOHSliceId::AUDIO_SWITCH, VIEW_VOLUME},
+};
+} // namespace OHOS
+#endif // DIALOHSLICEID_H
#include <cstdint>
#include "DialView.h"
+#include "DialTimePublisher.h"
#include "components/ui_image_view.h"
+#include "font/font_global_manager.h"
namespace OHOS {
-class DialOptionImgView : public UIImageView, public DialView {
+class DialOptionImgView : public UIImageView,
+ public DialView,
+ public FontGlobalManager::LangChangeListener,
+ public DialTimePublisher::TimeChangeListener {
public:
DialOptionImgView();
~DialOptionImgView() override;
bool SetOptionRes(const ImageInfo* src, uint16_t num);
+ void SetLang(uint8_t lang);
+
+ void OnLangChange(uint8_t langId) override;
+
+ void OnTimeUpdate(const struct tm &curTime) override;
+
private:
ImageInfo* info_ = nullptr;
uint16_t infoNum_ = 0;
int16_t selected_ = -1;
+ uint8_t language_ = FontGlobalManager::INVALID_LANG_ID;
+ bool langVisible_ = true;
+ bool timeVisible_ = true;
};
}
#endif
--- /dev/null
+/*
+ * Copyright (c) CompanyNameMagicTag 2025. All rights reserved.
+ * Description: DialSequenceContainer
+ * Author:
+ * Create: 2025-03-05
+ */
+
+#ifndef DIAL_SEQUENCE_CONTAINER_H
+#define DIAL_SEQUENCE_CONTAINER_H
+#include "components/ui_view_group.h"
+#include "components/ui_image_animator.h"
+
+namespace OHOS {
+class DialSequenceContainer : public UIViewGroup, public UIImageAnimatorView::AnimatorStopListener {
+public:
+ DialSequenceContainer();
+ ~DialSequenceContainer() override;
+ DialSequenceContainer(const DialSequenceContainer&) = delete;
+ DialSequenceContainer& operator=(const DialSequenceContainer&) = delete;
+ bool AddSequenceRes(uint16_t interval, bool repeat, const ImageAnimatorInfo *imgSrc, uint8_t imgNum);
+ bool OnClickEvent(const ClickEvent& event) override;
+ void Start();
+ void Stop();
+ void Pause();
+ void Resume();
+ void OnAnimatorStop(UIView& view) override;
+
+private:
+ void UpdateCurrentView();
+ UIImageAnimatorView *repeatView_ = nullptr;
+ UIImageAnimatorView *nonCycleView_[3]; // 3: max seqImg num
+ // if curView_ is not null, curView_ must be added into parent.
+ UIImageAnimatorView *curView_ = nullptr;
+ uint8_t nonCycleNum_ = 0;
+ uint8_t loop_ = 0;
+ bool isClick_ = false;
+}; // class DialSequenceContainer
+} // namespace OHOS
+#endif // DIAL_SEQUENCE_CONTAINER_H
\ No newline at end of file
#define DIAL_STATIC_IMG_VIEW_H
#include "components/ui_image_view.h"
+#include "font/font_global_manager.h"
+#include "DialTimePublisher.h"
namespace OHOS {
-class DialStaticImgView : public UIImageView {
+class DialStaticImgView : public UIImageView,
+ public FontGlobalManager::LangChangeListener,
+ public DialTimePublisher::TimeChangeListener {
public:
DialStaticImgView();
~DialStaticImgView() override;
+ void SetLang(uint8_t lang);
+ void OnLangChange(uint8_t langId) override;
+ bool SetImgs(const ImageInfo* src, uint8_t num);
+ bool OnClickEvent(const ClickEvent& event) override;
+ void OnTimeUpdate(const struct tm &curTime) override;
+
+private:
+ uint8_t language_ = FontGlobalManager::INVALID_LANG_ID;
+ ImageInfo* info_ = nullptr;
+ uint8_t infoNum_ = 0;
+ int16_t selected_ = -1;
+ bool langVisible_ = true;
+ bool timeVisible_ = true;
};
}
#endif
--- /dev/null
+/*
+ * Copyright (c) CompanyNameMagicTag 2025. All rights reserved.
+ * Description: DialTimePublisher
+ * Author:
+ * Create: 2025-03-04
+ */
+
+#ifndef DIAL_TIME_PUBLISHER_H
+#define DIAL_TIME_PUBLISHER_H
+#include <ctime>
+#include <cstdint>
+
+namespace OHOS {
+class DialTimePublisher {
+public:
+ struct TimeInterval {
+ uint8_t start;
+ uint8_t end;
+ };
+ class TimeChangeListener {
+ public:
+ virtual void OnTimeUpdate(const struct tm &curTime) = 0;
+ void SetTimeInervals(TimeInterval *intervals, uint8_t num);
+ bool IsInTimeInterval(const struct tm &curTime);
+ TimeChangeListener(const TimeChangeListener&) = delete;
+ TimeChangeListener& operator=(const TimeChangeListener&) = delete;
+ TimeChangeListener();
+ virtual ~TimeChangeListener();
+ private:
+ TimeInterval *intervals_ = nullptr;
+ uint8_t num_ = 0;
+ };
+
+ virtual void Register(TimeChangeListener *listener) = 0;
+ virtual void Unregister(TimeChangeListener *listener) = 0;
+ virtual void UpdateTime() = 0;
+ static void SetPublisher(DialTimePublisher *publisher);
+ static DialTimePublisher *GetPublisher();
+ virtual ~DialTimePublisher() {}
+
+private:
+ static DialTimePublisher *publisher_;
+}; // class DialTimePublisher
+} // namespace OHOS
+#endif // DIAL_TIME_PUBLISHER_H
\ No newline at end of file
--- /dev/null
+/*
+ * Copyright (c) CompanyNameMagicTag 2025. All rights reserved.
+ * Description: DialViewContainer
+ * Author:
+ * Create: 2025-02-06
+ */
+
+#ifndef DIAL_VIEW_CONTAINER_H
+#define DIAL_VIEW_CONTAINER_H
+#include "components/ui_view_group.h"
+#include "gfx_utils/list.h"
+#include "dial/DialView.h"
+#include "dial/DialDataBase.h"
+
+namespace OHOS {
+class ContainerInterface {
+public:
+ virtual void AddView(UIView* view) = 0;
+
+ virtual void AddView(DialDataType type, DialView* view, bool isPeriodic) = 0;
+
+ virtual ~ContainerInterface() {}
+};
+
+class DialViewContainer : public UIViewGroup, public ContainerInterface {
+public:
+ struct SubView {
+ UIView *view;
+ DialView *dialView;
+ DialDataType type;
+ bool isPeriodic;
+ };
+ DialViewContainer(uint8_t dialviewNum, uint16_t dataSize) :
+ dialViewNum_(dialviewNum), dataSize_(dataSize)
+ {
+ SetTouchable(true);
+ }
+ DialViewContainer() {}
+ ~DialViewContainer() override;
+ DialViewContainer(const DialViewContainer&) = delete;
+ DialViewContainer& operator=(const DialViewContainer&) = delete;
+
+ uint8_t GetDialviewNum() const
+ {
+ return dialViewNum_;
+ }
+
+ uint16_t GetDataSize() const
+ {
+ return dataSize_;
+ }
+
+ void AddView(UIView* view) override;
+
+ void AddView(DialDataType type, DialView* view, bool isPeriodic) override;
+
+ ListNode<SubView>* Begin()
+ {
+ return dialViews_.Begin();
+ }
+
+ const ListNode<SubView>* End()
+ {
+ return dialViews_.End();
+ }
+
+ bool HasInvalidBindData() const
+ {
+ return hasInvalidBindData_;
+ }
+
+ bool RemoveSubView(uint8_t index, SubView &subView);
+
+ bool IsInvalidateBindData(uint8_t index);
+
+private:
+ uint8_t dialViewNum_;
+ uint16_t dataSize_;
+ List<SubView> dialViews_;
+ bool hasInvalidBindData_ = false;
+}; // class DialViewContainer
+} // namesapce OHOS
+#endif // DIAL_VIEW_CONTAINER_H
\ No newline at end of file
#include <unordered_map>
#include "DialDataBase.h"
#include "components/ui_view_group.h"
+#include "components/ui_image_animator.h"
+#include "components/ui_label.h"
#include "OnDialDataUpdateListener.h"
#include "components/ui_card_page.h"
#include "components/ui_kaleidoscope_view.h"
#include "gfx_utils/list.h"
+#include "gfx_utils/vector.h"
#include "DialView.h"
#include "DialVideoView.h"
#include "DialBinTypesV2.h"
+#include "DialViewContainer.h"
+#include "DialSequenceContainer.h"
namespace OHOS {
-class DialViewGroup : public UICardPage, public OnDialDataUpdateListener {
+class DialViewGroup : public UICardPage, public OnDialDataUpdateListener, public ContainerInterface {
public:
DialViewGroup();
~DialViewGroup() override;
/**
* @brief Add a view which binds with data of a specific type and could be updated periodically.
*/
- void AddView(DialDataType type, DialView* view, bool isPeriodic = false);
+ void AddView(DialDataType type, DialView* view, bool isPeriodic) override;
/**
- * @brief Add a view. If the view is DialVideoView, the second parameter should be true.
+ * @brief Add a view.
*/
- void AddView(UIView* view, bool isDialVideoView = false);
+ void AddView(UIView* view) override;
/**
* @brief Add a click rect. When the rect is clicked, it will start a js app with the given bundleName.
*/
void OnActive(void) override;
- void OnInactive() override;
+ /**
+ * @brief This function is invoked when the function SetHorCurrentPage() is called.
+ */
+ void OnInactive(void) override;
+
+ /**
+ * @brief This function is invoked when SetVerCurrentPage is called and horizontal page is covered.
+ */
+ void OnCovered(void) override;
+
+ /**
+ * @brief This function is invoked when SetVerCurrentPage is called and horizontal page is not covered.
+ */
+ void OnUncovered(void) override;
+ void OnPause() override;
+
+ /* -------------------------------------------------------------------------- */
/*外部接口对表盘进行调用*/
void StopDial();
void StartDial();
/*外部接口更新表盘状态*/
void UpdateStateShow();
+ /* -------------------------------------------------------------------------- */
MediaVideoPlay* GetVideoPlay();
private:
void ProcessData(DialDataType type, DialView* view);
- std::unordered_map<int16_t, DialView*> dataTypeMap_;
+ void DoStop(void);
+ void DoStart(void);
+ void DoPause(void);
+ void RecordSpecial(UIView *view);
+ void RecordBindData(DialDataType type, DialView* view, bool isPeriodic);
+ void ClearViews();
+ using Views = Graphic::Vector<DialView*>;
+ std::unordered_map<int16_t, Views*> dataTypeMap_;
+ Graphic::Vector<Views*> viewsMemPool_;
List<DialDataType> periodicUpdateTypes_;
List<DialDataType> passiveUpdateTypes_;
List<UIView*> dialViews_;
List<DialClick> dialClicks_;
void ClearDial();
+
+ void SetLableAnimatorState(uint8_t state);
+ void SetImgAnimatorState(uint8_t state);
+ List<UILabel*> rollingLabelList_;
+ List<UIImageAnimatorView*> imgAnimList_;
+ List<DialSequenceContainer*> seqList_;
};
}
#endif
#include <unordered_map>
#include "DialBaseModel.h"
#include "DialDataBase.h"
+#include "DialOHDataType.h"
#include "ModelDialDataFactory.h"
namespace OHOS {
models_[static_cast<int16_t>(type)] = model;
}
+ bool IsOHBindDataExist(DialOHDataType type) const;
+ bool IsBindDataExist(DialDataType type) const;
bool RegisterDialDataListener(DialDataType type, OnDialDataUpdateListener* listener);
bool UnRegisterDialDataListener(DialDataType type);
bool GetDialTextData(DialDataType& type, std::string*& out, int16_t& strNum);
--- /dev/null
+/*
+ * Copyright (c) CompanyNameMagicTag 2025. All rights reserved.
+ * Description: WatchInterface
+ * Author:
+ * Create: 2025-03-17
+ */
+
+#ifndef WATCH_INTERFACE_H
+#define WATCH_INTERFACE_H
+#include <cstdint>
+#include "format_type.h"
+#include "dial_market.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * @brief Get all watch face information
+ * @param[out] info Pointer to store the watch face information
+ * @param[out] num Pointer to store the number of watch faces
+ * @param[in] maxCnt Maximum number of watch faces to retrieve
+ * @return bool Returns true if successful, false otherwise
+ */
+bool GetAllWatchFaceInfo(watch_dial_info *info, uint8_t *num, uint8_t maxCnt);
+
+/**
+ * @brief Get information of a specific watch face by UUID
+ * @param[in] uuid Unique identifier of the watch face
+ * @param[out] watch Pointer to store the watch face information
+ * @return bool Returns true if successful, false otherwise
+ */
+bool GetWatchFaceInfo(uint32_t uuid, watch_dial_info *watch);
+
+/**
+ * @brief Get the capability set of the watch
+ * @param[out] capability Pointer to store the watch capability information
+ * @return bool Returns true if successful, false otherwise
+ */
+bool GetWatchCapability(watch_dev_cap_info *capability);
+
+/**
+ * @brief Get system information
+ * @param[out] sysInfo Pointer to store the system information
+ * @return bool Returns true if successful, false otherwise
+ */
+bool GetWatchSystemInfo(watch_sys_info *sysInfo);
+
+/**
+ * @brief Get information of the currently active watch face
+ * @param[out] watch Pointer to store the watch face information
+ * @return bool Returns true if successful, false otherwise
+ */
+bool GetCurrentWatchFaceInfo(watch_dial_info *watch);
+
+/**
+ * @brief Set the currently active watch face by UUID
+ * @param[in] uuid Unique identifier of the watch face to set as active
+ * @return bool Returns true if successful, false otherwise
+ */
+bool SetCurrentWatchFace(uint32_t uuid);
+
+/**
+ * @brief Uninstall a watch face by UUID
+ * @param[in] uuid Unique identifier of the watch face to uninstall
+ * @return bool Returns true if successful, false otherwise
+ * @note If the UUID corresponds to the currently active watch face, it will switch to the default watch face
+ */
+bool UninstallWatch(uint32_t uuid);
+
+/**
+ * @brief Install a watch face from a specified path
+ * @param[in] path Path to the watch face file
+ * @param[out] uuid Pointer to store the unique identifier of the installed watch face
+ * @return bool Returns true if successful, false otherwise
+ * @note If a watch face with the same UUID already exists, it will be replaced
+ */
+bool InstallWatch(const char *path, uint32_t *uuid);
+
+#ifdef __cplusplus
+}
+#endif
+#endif // WATCH_INTERFACE_H
\ No newline at end of file
delete callback;
callback = nullptr;
}
+#ifdef XTS_SUPPORT
+ /* ----------------------------------- XTS ---------------------------------- */
+ if(XTSLabel)
+ {
+ delete XTSLabel;
+ XTSLabel = nullptr;
+ }
+ if (xtsCallback_ != nullptr)
+ {
+ delete xtsCallback_;
+ xtsCallback_ = nullptr;
+ }
+ if (xtsanimator_ != nullptr)
+ {
+ xtsanimator_->Stop();
+ delete xtsanimator_;
+ xtsanimator_ = nullptr;
+ }
+ /* -------------------------------------------------------------------------- */
+#endif
g_pMainView = nullptr;
}
MainViewSample *MainViewSample::GetInstance(void)
}
// }
+#ifdef XTS_SUPPORT
+ /* ----------------------------------- XTS ---------------------------------- */
+ if (XTSLabel == nullptr)
+ {
+ XTSLabel = new UILabel();
+ }
+ XTSLabel->SetPosition(130, 273); // widget's left position and top position
+ XTSLabel->Resize(200, 60); // widget's width and height
+ XTSLabel->SetViewId("label1"); // Set style
+ XTSLabel->SetStyle(STYLE_TEXT_FONT, 30);
+ XTSLabel->SetLineBreakMode(UILabel::LINE_BREAK_ADAPT);
+ XTSLabel->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER);
+ XTSLabel->SetRollSpeed(0);
+ XTSLabel->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30);
+ mainSwipeGroup->Add(XTSLabel);
+ xtsCallback_ = new XTSCallback(XTSLabel);
+ xtsanimator_ = new Animator(xtsCallback_, XTSLabel, 1000, true);
+ xtsanimator_->Start();
+#endif
+
AddViewToRootContainer(mainSwipeGroup);
}
}
SetTextWithWildcardInner(tempBuf);
}
+
+void DialArcLabelView::SetLang(uint8_t lang)
+{
+ language_ = lang;
+ OnLangChange(FontGlobalManager::GetInstance()->GetCurrentLangId());
+}
+
+void DialArcLabelView::OnLangChange(uint8_t langId)
+{
+ if (language_ == FontGlobalManager::INVALID_LANG_ID) {
+ SetVisible(true);
+ } else if (language_ == langId) {
+ SetVisible(true);
+ } else {
+ SetVisible(false);
+ }
+}
}
\ No newline at end of file
parent_ = parent;
}
+void DialDigitalImgView::OnTimeUpdate(const struct tm &curTime)
+{
+ bool isVisible = false;
+ if (IsInTimeInterval(curTime)) {
+ isVisible = true;
+ }
+ for (uint8_t i = 0; i < imgCnt_; ++i) {
+ imgs_[i]->SetVisible(isVisible);
+ }
+ SetVisible(isVisible);
+}
+
void DialDigitalImgView::SetDecimalPrecision(uint8_t precision)
{
decimalPrecision_ = precision;
void DialDigitalImgView::HandleFloatData(float data)
{
+ if (!IsVisible()) {
+ return;
+ }
if (isValueSet_ && FloatEqual(value_, data)) {
return;
}
}
SetTextWithWildcardInner(tempBuf);
}
+ void DialLabelView::SetLang(uint8_t lang)
+ {
+ language_ = lang;
+ OnLangChange(FontGlobalManager::GetInstance()->GetCurrentLangId());
+ }
+
+ void DialLabelView::OnLangChange(uint8_t langId)
+ {
+ if (language_ == FontGlobalManager::INVALID_LANG_ID)
+ {
+ SetVisible(true);
+ }
+ else if (language_ == langId)
+ {
+ SetVisible(true);
+ }
+ else
+ {
+ SetVisible(false);
+ }
+ }
}
\ No newline at end of file
#include "sys/time.h"
#include "RegisterDialModel.h"
#include "DialModelTime.h"
+#include "components/root_view.h"
#include "custom_runtime.h"
#define REGIST_DIAL_MODULE_ANGLE_H(type, func) static OHOS::RegisterDialModel(REGIST_ANGLE_H)(type, func)
#define REGIST_DIAL_MODULE_ANGLE_M(type, func) static OHOS::RegisterDialModel(REGIST_ANGLE_M)(type, func)
#define REGIST_DIAL_MODULE_WEEK(type, func) static OHOS::RegisterDialModel(REGIST_WEEK)(type, func)
#define REGIST_DIAL_MODULE_MOUNTH(type, func) static OHOS::RegisterDialModel(REGIST_MOUNTH)(type, func)
#define REGIST_DIAL_MODULE_YEAR(type, func) static OHOS::RegisterDialModel(REGIST_YEAR)(type, func)
+#define REGIST_DIAL_MODULE_GEAR_ONE(type, func) static OHOS::RegisterDialModel(REGIST_GEAR_ONE)(type, func)
+#define REGIST_DIAL_MODULE_GEAR_TWO(type, func) static OHOS::RegisterDialModel(REGIST_GEAR_TWO)(type, func)
+#define REGIST_DIAL_MODULE_GEAR_THREE(type, func) static OHOS::RegisterDialModel(REGIST_GEAR_THREE)(type, func)
+#define REGIST_DIAL_MODULE_GEAR_FOUR(type, func) static OHOS::RegisterDialModel(REGIST_GEAR_FOUR)(type, func)
+#define REGIST_DIAL_MODULE_GEAR_FIVE(type, func) static OHOS::RegisterDialModel(REGIST_GEAR_FIVE)(type, func)
+#define REGIST_DIAL_MODULE_GEAR_SIX(type, func) static OHOS::RegisterDialModel(REGIST_GEAR_SIX)(type, func)
REGIST_DIAL_MODULE_ANGLE_H(DialDataType::DATA_TYPE_CLOCK_ANGLE_H, OHOS::DialModelTime::GetInstance());
REGIST_DIAL_MODULE_ANGLE_M(DialDataType::DATA_TYPE_CLOCK_ANGLE_M, OHOS::DialModelTime::GetInstance());
REGIST_DIAL_MODULE_MOUNTH(DialDataType::DATA_TYPE_TIME_MONTH, OHOS::DialModelTime::GetInstance());
REGIST_DIAL_MODULE_YEAR(DialDataType::DATA_TYPE_TIME_YEAR, OHOS::DialModelTime::GetInstance());
+REGIST_DIAL_MODULE_GEAR_ONE(DialDataType::DATA_TYPE_SWIVEL_GEAR_ONE, OHOS::DialModelTime::GetInstance());
+REGIST_DIAL_MODULE_GEAR_TWO(DialDataType::DATA_TYPE_SWIVEL_GEAR_TWO, OHOS::DialModelTime::GetInstance());
+REGIST_DIAL_MODULE_GEAR_THREE(DialDataType::DATA_TYPE_SWIVEL_GEAR_THREE, OHOS::DialModelTime::GetInstance());
+REGIST_DIAL_MODULE_GEAR_FOUR(DialDataType::DATA_TYPE_SWIVEL_GEAR_FOUR, OHOS::DialModelTime::GetInstance());
+REGIST_DIAL_MODULE_GEAR_FIVE(DialDataType::DATA_TYPE_SWIVEL_GEAR_FIVE, OHOS::DialModelTime::GetInstance());
+REGIST_DIAL_MODULE_GEAR_SIX(DialDataType::DATA_TYPE_SWIVEL_GEAR_SIX, OHOS::DialModelTime::GetInstance());
+
namespace OHOS {
static constexpr int16_t S_MS_US_TRANS = 1000; // 1000: seconds, milliseconds, microsecond transform value
-static constexpr uint16_t CIRCLE_IN_DEGREE_UI = 360; // 360: A full rotation: 360 degrees
static constexpr uint8_t ONE_MINUTE_IN_SECOND = 60; // 60: 60 seconds per minute
static constexpr uint8_t ONE_HOUR_IN_MINUTE = 60; // 60: 60 minutes per hour
static constexpr uint8_t HALF_DAY_IN_HOUR = 12; // 60: 12 hours every half day
static uint16_t ConvertHandValueToAngle(int32_t handValue, uint8_t range, int32_t secondHandValue, uint16_t ratio)
{
+ #ifdef fd230_650
if ((range == 0) || (ratio == 0)) {
return 0;
}
degree = CIRCLE_IN_DEGREE_UI * degree / (static_cast<uint16_t>(range) * ratio);
return static_cast<uint16_t>(degree % CIRCLE_IN_DEGREE_UI);
+ #endif
+
+ /* -------------------------------- 0423补丁合入 -------------------------------- */
+ if ((range == 0) || (ratio == 0)) {
+ return 0;
+ }
+ /*
+ * Example: calculate the angle of hour hand
+ * Assume that the time is 5: 30, then range is 12, radio is 60
+ * angle is [(5 * 60 + 30) / (12 * 60)] * 360
+ */
+ int32_t degree = (handValue * ratio + secondHandValue);
+ degree = CIRCLE_IN_DEGREE * degree / (static_cast<uint16_t>(range) * ratio);
+
+ return static_cast<uint16_t>(degree % CIRCLE_IN_DEGREE);
}
static float ConvertHandSecondValueToAngle(int32_t handValue, uint16_t range)
{
+ #ifdef fd230_650
/*
* Example: calculate the angle of second hand without millisecond handle
* Assume that the time is 5:30:30, then range is 60
* angle is (30 / 60) * 360
*/
return (static_cast<float>(handValue * CIRCLE_IN_DEGREE_UI) / range);
+ #endif
+ /* -------------------------------- 0423补丁合入 -------------------------------- */
+ /*
+ * Example: calculate the angle of second hand without millisecond handle
+ * Assume that the time is 5:30:30, then range is 60
+ * angle is (30 / 60) * 360
+ */
+ return (static_cast<float>(handValue * CIRCLE_IN_DEGREE) / range);
}
void DialModelTime::UpdateTime()
{
+#ifdef fd230_650
#if 0
struct timeval tv;
gettimeofday(&tv, NULL);
angleM_ = ConvertHandValueToAngle(tblock_.tm_min, ONE_HOUR_IN_MINUTE, tblock_.tm_sec, ONE_MINUTE_IN_SECOND);
angleS_ = ConvertHandValueToAngle(tblock_.tm_sec, ONE_MINUTE_IN_SECOND, 0, 1);
angleMS_ = ConvertHandSecondValueToAngle(realMS, S_MS_US_TRANS * ONE_MINUTE_IN_SECOND);
+
+ #endif
+
+ /* --------------------------------- 0423补丁 --------------------------------- */
+ struct timeval tv;
+ gettimeofday(&tv, nullptr);
+ tblock_ = localtime(&tv.tv_sec);
+ int realMS = tblock_->tm_sec * S_MS_US_TRANS + tv.tv_usec / S_MS_US_TRANS;
+
+ angleH_ = ConvertHandValueToAngle(tblock_->tm_hour, HALF_DAY_IN_HOUR, tblock_->tm_min, ONE_HOUR_IN_MINUTE);
+ angleM_ = ConvertHandValueToAngle(tblock_->tm_min, ONE_HOUR_IN_MINUTE, tblock_->tm_sec, ONE_MINUTE_IN_SECOND);
+ angleS_ = ConvertHandValueToAngle(tblock_->tm_sec, ONE_MINUTE_IN_SECOND, 0, 1);
+ angleMS_ = ConvertHandSecondValueToAngle(realMS, S_MS_US_TRANS * ONE_MINUTE_IN_SECOND);
+ if (tblock_ == nullptr) {
+ return;
+ }
+ for (ListNode<TimeChangeListener*>* node = listeners_.Head(); node != listeners_.End(); node = node->next_) {
+ TimeChangeListener *listener = node->data_;
+ if (listener != nullptr) {
+ listener->OnTimeUpdate(*tblock_);
+ }
+ }
+ RootView::GetInstance()->Invalidate();
+ /* -------------------------------------------------------------------------- */
}
-bool DialModelTime::GetDialFloatData(DialDataType& type, float& out)
+void DialModelTime::Register(TimeChangeListener* listener)
+{
+ if (listener == nullptr) {
+ return;
+ }
+ for (ListNode<TimeChangeListener*>* node = listeners_.Head(); node != listeners_.End(); node = node->next_) {
+ TimeChangeListener *tmp = node->data_;
+ if (tmp == listener) {
+ return;
+ }
+ }
+ listeners_.PushBack(listener);
+}
+
+void DialModelTime::Unregister(TimeChangeListener* listener)
{
+ if (listener == nullptr) {
+ return;
+ }
+ for (ListNode<TimeChangeListener*>* node = listeners_.Head(); node != listeners_.End(); node = node->next_) {
+ TimeChangeListener *tmp = node->data_;
+ if (tmp == listener) {
+ listeners_.Remove(node);
+ return;
+ }
+ }
+}
+bool DialModelTime::GetDialFloatData(DialDataType& type, float& out)
+{
+ #ifdef fd230_650
UpdateTime();
switch (type) {
return false;
}
return true;
+ #endif
+
+ /* --------------------------------- 0423补丁 --------------------------------- */
+ if (tblock_ == nullptr) {
+ UpdateTime();
+ }
+
+ switch (type) {
+ case DialDataType::DATA_TYPE_CLOCK_ANGLE_H:
+ out = static_cast<float>(angleH_);
+ break;
+ case DialDataType::DATA_TYPE_CLOCK_ANGLE_M:
+ out = static_cast<float>(angleM_);
+ break;
+ case DialDataType::DATA_TYPE_CLOCK_ANGLE_S:
+ out = static_cast<float>(angleS_);
+ break;
+ case DialDataType::DATA_TYPE_CLOCK_ANGLE_MS:
+ out = static_cast<float>(angleMS_);
+ break;
+ case DialDataType::DATA_TYPE_TIME_YEAR:
+ out = static_cast<float>(tblock_->tm_year);
+ break;
+ case DialDataType::DATA_TYPE_TIME_MONTH:
+ out = static_cast<float>(tblock_->tm_mon);
+ break;
+ case DialDataType::DATA_TYPE_TIME_WEEK:
+ out = static_cast<float>(tblock_->tm_wday);
+ break;
+ case DialDataType::DATA_TYPE_TIME_DATE:
+ out = static_cast<float>(tblock_->tm_mday);
+ break;
+ case DialDataType::DATA_TYPE_TIME_HOUR:
+ out = static_cast<float>(tblock_->tm_hour);
+ break;
+ case DialDataType::DATA_TYPE_TIME_MINUTE:
+ out = static_cast<float>(tblock_->tm_min);
+ break;
+ case DialDataType::DATA_TYPE_TIME_SECOND:
+ out = static_cast<float>(tblock_->tm_sec);
+ break;
+ case DialDataType::DATA_TYPE_SWIVEL_GEAR_TWO:
+ case DialDataType::DATA_TYPE_SWIVEL_GEAR_THREE:
+ case DialDataType::DATA_TYPE_SWIVEL_GEAR_FIVE: {
+ float coeff = 6.0f; // 6.0: coeff
+ float accleratedAngle = angleMS_ * coeff - floor(angleMS_ * coeff / CIRCLE_IN_DEGREE) * CIRCLE_IN_DEGREE;
+ out = static_cast<float>(accleratedAngle * -1.0 + CIRCLE_IN_DEGREE);
+ break;
+ }
+ case DialDataType::DATA_TYPE_SWIVEL_GEAR_ONE:
+ case DialDataType::DATA_TYPE_SWIVEL_GEAR_FOUR:
+ case DialDataType::DATA_TYPE_SWIVEL_GEAR_SIX: {
+ float coeff = 6.0f; // 6.0: coeff
+ float accleratedAngle = angleMS_ * coeff - floor(angleMS_ * coeff / CIRCLE_IN_DEGREE) * CIRCLE_IN_DEGREE;
+ out = static_cast<float>(accleratedAngle);
+ break;
+ }
+ default:
+ return false;
+ }
+ return true;
}
}
selected_ = selected;
SetSrc(&info_[selected_]);
}
+
+void DialOptionImgView::SetLang(uint8_t lang)
+{
+ language_ = lang;
+ OnLangChange(FontGlobalManager::GetInstance()->GetCurrentLangId());
+}
+
+void DialOptionImgView::OnLangChange(uint8_t langId)
+{
+ if (language_ == FontGlobalManager::INVALID_LANG_ID) {
+ langVisible_ = true;
+ } else if (language_ == langId) {
+ langVisible_ = true;
+ } else {
+ langVisible_ = false;
+ }
+ SetVisible(langVisible_ && timeVisible_);
+}
+
+void DialOptionImgView::OnTimeUpdate(const struct tm &curTime)
+{
+ if (IsInTimeInterval(curTime)) {
+ timeVisible_ = true;
+ } else {
+ timeVisible_ = false;
+ }
+ SetVisible(langVisible_ && timeVisible_);
+}
}
\ No newline at end of file
--- /dev/null
+/*
+ * Copyright (c) CompanyNameMagicTag 2025. All rights reserved.
+ * Description: DialSequenceContainer
+ * Author:
+ * Create: 2025-03-05
+ */
+
+#include "DialSequenceContainer.h"
+
+namespace OHOS {
+DialSequenceContainer::DialSequenceContainer()
+{
+ SetTouchable(true);
+ SetStyle(STYLE_BACKGROUND_OPA, OPA_TRANSPARENT);
+ memset_s(nonCycleView_, sizeof(nonCycleView_), 0, sizeof(nonCycleView_));
+}
+
+DialSequenceContainer::~DialSequenceContainer()
+{
+ if (repeatView_ != nullptr) {
+ delete repeatView_;
+ repeatView_ = nullptr;
+ }
+
+ for (uint8_t i = 0; i < nonCycleNum_; ++i) {
+ delete nonCycleView_[i];
+ nonCycleView_[i] = nullptr;
+ }
+ nonCycleNum_ = 0;
+ curView_ = nullptr;
+}
+
+bool DialSequenceContainer::AddSequenceRes(uint16_t interval, bool repeat,
+ const ImageAnimatorInfo *imgSrc, uint8_t imgNum)
+{
+ if (imgSrc == nullptr || imgNum == 0) {
+ return false;
+ }
+
+ // add animator images to view
+ if (repeat) {
+ if (repeatView_ != nullptr) {
+ GRAPHIC_LOGE("the repeat seq view has existed!");
+ return false;
+ }
+ repeatView_ = new UIImageAnimatorView;
+ repeatView_->SetImageAnimatorSrc(imgSrc, imgNum, interval);
+ repeatView_->SetRepeat(false);
+ } else {
+ if (nonCycleNum_ >= sizeof(nonCycleView_) / sizeof(nonCycleView_[0])) {
+ GRAPHIC_LOGE("non cycle seq views have been exceedeed!");
+ return false;
+ }
+ nonCycleView_[nonCycleNum_] = new UIImageAnimatorView;
+ nonCycleView_[nonCycleNum_]->SetImageAnimatorSrc(imgSrc, imgNum, interval);
+ nonCycleView_[nonCycleNum_]->SetRepeat(false);
+ ++nonCycleNum_;
+ }
+
+ // update rect area
+ Rect rect(GetRelativeRect());
+ for (uint8_t i = 0; i < imgNum; ++i) {
+ rect.JoinRect(rect,
+ Rect(rect.GetX(),
+ rect.GetY(),
+ rect.GetX() + imgSrc[i].width - 1,
+ rect.GetY() + imgSrc[i].height - 1));
+ }
+ rect.JoinRect(rect, GetRelativeRect());
+ SetPosition(rect.GetX(), rect.GetY());
+ SetWidth(rect.GetWidth());
+ SetHeight(rect.GetHeight());
+ Invalidate();
+
+ return true;
+}
+
+bool DialSequenceContainer::OnClickEvent(const ClickEvent& event)
+{
+ if (curView_ == nullptr) {
+ return false;
+ }
+ uint8_t curState = curView_->GetState();
+ switch (curState) {
+ case Animator::STOP: {
+ if (curView_ == repeatView_) {
+ isClick_ = true;
+ } else {
+ UpdateCurrentView();
+ Start();
+ }
+ break;
+ }
+ case Animator::PAUSE: {
+ return false;
+ }
+ case Animator::RUNNING:
+ case Animator::START: {
+ if (curView_ == repeatView_) {
+ isClick_ = true;
+ }
+ break;
+ }
+ default: {
+ GRAPHIC_LOGE("error state");
+ }
+ }
+
+ return UIViewGroup::OnClickEvent(event);
+}
+
+void DialSequenceContainer::Start()
+{
+ if (curView_ != nullptr) {
+ curView_->Start();
+ return;
+ }
+
+ UpdateCurrentView();
+ if (curView_ == nullptr) {
+ return;
+ }
+ curView_->Start();
+}
+
+void DialSequenceContainer::Stop()
+{
+ if (curView_ != nullptr) {
+ curView_->Stop();
+ return;
+ }
+
+ UpdateCurrentView();
+ if (curView_ == nullptr) {
+ return;
+ }
+ curView_->Stop();
+}
+
+void DialSequenceContainer::Pause()
+{
+ if (curView_ != nullptr) {
+ curView_->Pause();
+ return;
+ }
+
+ UpdateCurrentView();
+ if (curView_ == nullptr) {
+ return;
+ }
+ curView_->Pause();
+}
+
+void DialSequenceContainer::Resume()
+{
+ if (curView_ != nullptr) {
+ curView_->Resume();
+ return;
+ }
+
+ UpdateCurrentView();
+ if (curView_ == nullptr) {
+ return;
+ }
+ curView_->Resume();
+}
+
+void DialSequenceContainer::OnAnimatorStop(UIView& view)
+{
+ bool isClick = isClick_;
+ isClick_ = false;
+ bool isRepeat = (curView_ == repeatView_);
+ if (isRepeat && isClick) {
+ UpdateCurrentView();
+ Start();
+ } else if (isRepeat && !isClick) {
+ Start();
+ } else {
+ if (repeatView_ != nullptr) {
+ UpdateCurrentView();
+ Start();
+ }
+ }
+}
+
+void DialSequenceContainer::UpdateCurrentView()
+{
+ if (curView_ != nullptr) {
+ if (repeatView_ != nullptr && nonCycleNum_ == 0) {
+ return;
+ } else if (repeatView_ == nullptr && nonCycleNum_ != 0) {
+ Remove(curView_);
+ curView_ = nonCycleView_[loop_];
+ loop_ = (loop_ + 1) % nonCycleNum_;
+ curView_->SetAnimatorStopListener(this);
+ Add(curView_);
+ Invalidate();
+ return;
+ }
+
+ // both repeat and noncycle exist
+ Remove(curView_);
+ if (curView_ == repeatView_) {
+ curView_ = nonCycleView_[loop_];
+ loop_ = (loop_ + 1) % nonCycleNum_;
+ } else {
+ curView_ = repeatView_;
+ }
+ curView_->SetAnimatorStopListener(this);
+ Add(curView_);
+ Invalidate();
+ return;
+ }
+
+ if (repeatView_ != nullptr) {
+ curView_ = repeatView_;
+ } else if (nonCycleNum_ != 0) {
+ curView_ = nonCycleView_[loop_];
+ loop_ = (loop_ + 1) % nonCycleNum_;
+ } else {
+ GRAPHIC_LOGE("sequence img has not been added!");
+ return;
+ }
+ curView_->SetAnimatorStopListener(this);
+ Add(curView_);
+ Invalidate();
+}
+} // namespace OHOS
SetAutoEnable(true);
}
-DialStaticImgView::~DialStaticImgView() {}
+DialStaticImgView::~DialStaticImgView()
+{
+ if (info_ != nullptr) {
+ UIFree(info_);
+ info_ = nullptr;
+ }
+}
+
+void DialStaticImgView::SetLang(uint8_t lang)
+{
+ language_ = lang;
+ OnLangChange(FontGlobalManager::GetInstance()->GetCurrentLangId());
+}
+
+void DialStaticImgView::OnLangChange(uint8_t langId)
+{
+ if (language_ == FontGlobalManager::INVALID_LANG_ID) {
+ langVisible_ = true;
+ } else if (language_ == langId) {
+ langVisible_ = true;
+ } else {
+ langVisible_ = false;
+ }
+ SetVisible(langVisible_ && timeVisible_);
+}
+
+bool DialStaticImgView::SetImgs(const ImageInfo* src, uint8_t num)
+{
+ if (src == nullptr || num == 0) {
+ return false;
+ }
+ if (info_ != nullptr) {
+ UIFree(info_);
+ info_ = nullptr;
+ }
+ uint32_t size = sizeof(ImageInfo) * num;
+ info_ = static_cast<ImageInfo*>(UIMalloc(size));
+ if (info_ == nullptr) {
+ return false;
+ }
+ if (memcpy_s(info_, size, src, size) != EOK) {
+ UIFree(info_);
+ return false;
+ }
+ infoNum_ = num;
+ selected_ = 0;
+ SetSrc(&info_[selected_]);
+ SetTouchable(infoNum_ > 1);
+ return true;
+}
+
+bool DialStaticImgView::OnClickEvent(const ClickEvent& event)
+{
+ if (selected_ < 0 || info_ == nullptr || infoNum_ == 0) {
+ return false;
+ }
+ selected_ = (selected_ + 1) % infoNum_;
+ SetSrc(&info_[selected_]);
+ return true;
+}
+
+void DialStaticImgView::OnTimeUpdate(const struct tm &curTime)
+{
+ if (IsInTimeInterval(curTime)) {
+ timeVisible_ = true;
+ } else {
+ timeVisible_ = false;
+ }
+ SetVisible(langVisible_ && timeVisible_);
+}
}
\ No newline at end of file
--- /dev/null
+/*
+ * Copyright (c) CompanyNameMagicTag 2025. All rights reserved.
+ * Description: DialTimePublisher
+ * Author:
+ * Create: 2025-03-04
+ */
+
+#include "DialTimePublisher.h"
+#include "securec.h"
+#include "gfx_utils/mem_api.h"
+#include "gfx_utils/graphic_log.h"
+
+namespace OHOS {
+DialTimePublisher *DialTimePublisher::publisher_ = nullptr;
+
+void DialTimePublisher::TimeChangeListener::SetTimeInervals(TimeInterval *intervals, uint8_t num)
+{
+ if (intervals == nullptr || num == 0) {
+ return;
+ }
+ if (intervals_ != nullptr) {
+ UIFree(intervals_);
+ intervals_ = nullptr;
+ }
+ num_ = 0;
+
+ intervals_ = static_cast<TimeInterval*>(UIMalloc(sizeof(TimeInterval) * num));
+ if (intervals_ == nullptr) {
+ GRAPHIC_LOGE("failed to malloc!");
+ return;
+ }
+ num_ = num;
+ memcpy_s(intervals_, sizeof(TimeInterval) * num, intervals, sizeof(TimeInterval) * num);
+}
+
+bool DialTimePublisher::TimeChangeListener::IsInTimeInterval(const struct tm &curTime)
+{
+ if (num_ == 0) { // 0-24
+ return true;
+ }
+ for (uint8_t i = 0; i < num_; ++i) {
+ if (intervals_[i].start <= curTime.tm_hour && intervals_[i].end > curTime.tm_hour) {
+ return true;
+ }
+ }
+ return false;
+}
+
+DialTimePublisher::TimeChangeListener::TimeChangeListener()
+{
+ if (DialTimePublisher::GetPublisher() != nullptr) {
+ DialTimePublisher::GetPublisher()->Register(this);
+ }
+}
+
+DialTimePublisher::TimeChangeListener::~TimeChangeListener()
+{
+ if (intervals_ != nullptr) {
+ UIFree(intervals_);
+ intervals_ = nullptr;
+ }
+ num_ = 0;
+ if (DialTimePublisher::GetPublisher() != nullptr) {
+ DialTimePublisher::GetPublisher()->Unregister(this);
+ }
+}
+
+void DialTimePublisher::SetPublisher(DialTimePublisher *publisher)
+{
+ publisher_ = publisher;
+}
+
+DialTimePublisher *DialTimePublisher::GetPublisher()
+{
+ return publisher_;
+}
+} // namespace OHOS
\ No newline at end of file
--- /dev/null
+/*
+ * Copyright (c) CompanyNameMagicTag 2025. All rights reserved.
+ * Description: DialViewContainer
+ * Author:
+ * Create: 2025-02-06
+ */
+
+#include "DialViewContainer.h"
+#include "DialDigitalImgView.h"
+
+namespace OHOS {
+DialViewContainer::~DialViewContainer()
+{
+ ListNode<SubView>* viewNode = dialViews_.Head();
+ while (viewNode != dialViews_.End()) {
+ UIViewGroup::Remove(viewNode->data_.view);
+ delete viewNode->data_.view;
+ viewNode = viewNode->next_;
+ }
+ dialViews_.Clear();
+}
+
+void DialViewContainer::AddView(UIView* view)
+{
+ if (view == nullptr) {
+ return;
+ }
+ Add(view);
+ SubView info = {
+ .view = view,
+ .dialView = nullptr,
+ };
+ DialViewContainer *container = dynamic_cast<DialViewContainer*>(view);
+ if (container != nullptr && container->HasInvalidBindData()) {
+ hasInvalidBindData_ = true;
+ }
+ dialViews_.PushBack(info);
+}
+
+void DialViewContainer::AddView(DialDataType type, DialView* view, bool isPeriodic)
+{
+ if (view == nullptr) {
+ return;
+ }
+ UIView *uiView = dynamic_cast<UIView*>(view);
+ if (uiView == nullptr) {
+ return;
+ }
+ Add(uiView);
+ DialDigitalImgView *digital = dynamic_cast<DialDigitalImgView*>(view);
+ if (digital != nullptr) {
+ digital->SetParent(this);
+ }
+ SubView info = {
+ .view = uiView,
+ .dialView = view,
+ .type = type,
+ .isPeriodic = isPeriodic
+ };
+ if (type == DialDataType::DATA_TYPE_MAX) {
+ hasInvalidBindData_ = true;
+ }
+ dialViews_.PushBack(info);
+}
+
+bool DialViewContainer::RemoveSubView(uint8_t index, SubView &subView)
+{
+ if (index >= dialViews_.Size()) {
+ return false;
+ }
+ ListNode<SubView> *it = Begin();
+ for (uint8_t i = 0; i < index; ++i) {
+ it = it->next_;
+ }
+ subView = it->data_;
+ Remove(subView.view);
+ DialDigitalImgView *digital = dynamic_cast<DialDigitalImgView*>(subView.view);
+ if (digital != nullptr) {
+ digital->SetParent(nullptr);
+ }
+ dialViews_.Remove(it);
+ return true;
+}
+
+bool DialViewContainer::IsInvalidateBindData(uint8_t index)
+{
+ if (index >= dialViews_.Size()) {
+ return false;
+ }
+ ListNode<SubView> *it = Begin();
+ for (uint8_t i = 0; i < index; ++i) {
+ it = it->next_;
+ }
+ if (it->data_.dialView != nullptr && it->data_.type == DialDataType::DATA_TYPE_MAX) {
+ return true;
+ }
+ DialViewContainer *container = dynamic_cast<DialViewContainer*>(it->data_.view);
+ if (container != nullptr) {
+ return container->HasInvalidBindData();
+ }
+ return false;
+}
+} // namespace OHOS
\ No newline at end of file
#ifdef SUPPORT_OHOSFWK
#include "ui_screennotify.h"
#endif
+#include "DialDigitalImgView.h"
namespace OHOS
{
-static DialVideoView *g_video = nullptr;
+ static DialVideoView *g_video = nullptr;
static constexpr const char *DISTURBICON = "user/res/dial_state/disturbicon.bin";
static constexpr const char *MESSAGEICON = "user/res/dial_state/unread.bin";
{
if (g_video->IsPaused())
{
- g_video->ResumePlay();
- // printf("恢复视频\n");
+ g_video->ResumePlay();
+ // printf("恢复视频\n");
}
else if (!g_video->IsPlayed())
{
- g_video->StartPlay();
- // printf("开始播放\n");
+ g_video->StartPlay();
+ // printf("开始播放\n");
}
}
}
video_ = nullptr;
- if (dialstateicon_ != nullptr) {
- delete dialstateicon_;
- dialstateicon_ = nullptr;
+ if (dialstateicon_ != nullptr)
+ {
+ delete dialstateicon_;
+ dialstateicon_ = nullptr;
}
- if (messageicon_ != nullptr) {
- delete messageicon_;
- messageicon_ = nullptr;
+ if (messageicon_ != nullptr)
+ {
+ delete messageicon_;
+ messageicon_ = nullptr;
}
-
+
if (fp_ != nullptr)
{
fclose(fp_);
GRAPHIC_LOGE("cannot open file: %s\n", filePath_.c_str());
return;
}
- DialBinParserManager::GetInstance()->UpdateDial(filePath_, fp_, this,state_); // 添加主表盘卡片内容
+ DialBinParserManager::GetInstance()->UpdateDial(filePath_, fp_, this, state_); // 添加主表盘卡片内容
// 添加自定义logo,例如勿扰模式
/*增加手表状态图标*/
WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "DialViewGroup::GetElapseTime %d", elapseTime);
}
-
void DialViewGroup::ProcessData(DialDataType type, DialView *view)
{
int16_t value = static_cast<int16_t>(type) >> 14; // 14: bit shift
}
}
- void DialViewGroup::AddView(UIView *view, bool isDialVideoView)
+ void DialViewGroup::DoStop(void)
{
- if (view == nullptr)
+ SetLableAnimatorState(Animator::PAUSE);
+ SetImgAnimatorState(Animator::PAUSE);
+ if (video_ != nullptr && !video_->IsStopped())
{
- GRAPHIC_LOGE("Parameter is nullptr.\n");
- return;
+ video_->StopPlay();
}
- dialViews_.PushBack(view);
- Add(view);
+ if (kaleidoscope_ != nullptr)
+ {
+ kaleidoscope_->StopRotateAnimator();
+ kaleidoscope_->ClearFocus();
+ }
+ }
- if (view->GetViewType() == UI_KALEIDOSCOPE_VIEW)
+ void DialViewGroup::DoStart(void)
+ {
+ SetLableAnimatorState(Animator::START);
+ SetImgAnimatorState(Animator::START);
+ if (video_ != nullptr)
{
- kaleidoscope_ = dynamic_cast<UIKaleidoscopeView *>(view);
+ if (video_->IsPaused())
+ {
+ video_->ResumePlay();
+ }
+ else if (!video_->IsPlayed())
+ {
+ video_->StartPlay();
+ }
+ }
+ if (kaleidoscope_ != nullptr)
+ {
+ kaleidoscope_->RequestFocus();
+ kaleidoscope_->StartRotateAnimator();
}
+ }
- if (isDialVideoView)
+ void DialViewGroup::DoPause(void)
+ {
+ SetLableAnimatorState(Animator::PAUSE);
+ SetImgAnimatorState(Animator::PAUSE);
+ if (kaleidoscope_ != nullptr)
+ {
+ kaleidoscope_->StopRotateAnimator();
+ kaleidoscope_->ClearFocus();
+ }
+ if (video_ != nullptr)
+ {
+ video_->PausePlay();
+ }
+ }
+
+ void DialViewGroup::RecordSpecial(UIView *view)
+ {
+ if (dynamic_cast<UILabel *>(view) != nullptr)
+ {
+ UILabel *label = dynamic_cast<UILabel *>(view);
+ uint8_t mode = label->GetLineBreakMode();
+ if (mode == UILabel::LINE_BREAK_MARQUEE || mode == UILabel::LINE_BREAK_OSCILLATION)
+ {
+ rollingLabelList_.PushBack(label);
+ }
+ }
+ else if (dynamic_cast<UIImageAnimatorView *>(view) != nullptr)
+ {
+ UIImageAnimatorView *imgAnim = dynamic_cast<UIImageAnimatorView *>(view);
+ imgAnimList_.PushBack(imgAnim);
+ }
+ else if (dynamic_cast<UIKaleidoscopeView *>(view) != nullptr)
+ {
+ kaleidoscope_ = dynamic_cast<UIKaleidoscopeView *>(view);
+ }
+ else if (dynamic_cast<UILiteSurfaceView *>(view) != nullptr)
{
if (video_ != nullptr)
{
return;
}
video_ = reinterpret_cast<DialVideoView *>(view);
- g_video = video_;
-#ifdef SUPPORT_OHOSFWK
- registerNotifyScreenStatus(ScreenStatusNotify);
-#endif
+ }
+ else if (dynamic_cast<DialSequenceContainer *>(view) != nullptr)
+ {
+ DialSequenceContainer *seq = dynamic_cast<DialSequenceContainer *>(view);
+ seqList_.PushBack(seq);
}
}
- void DialViewGroup::AddView(DialDataType type, DialView *view, bool isPeriodic)
+ void DialViewGroup::RecordBindData(DialDataType type, DialView *view, bool isPeriodic)
{
- if (view == nullptr)
+ if (dynamic_cast<UILabel *>(view) != nullptr)
{
- GRAPHIC_LOGE("Parameter is nullptr.\n");
- return;
+ UILabel *label = dynamic_cast<UILabel *>(view);
+ uint8_t mode = label->GetLineBreakMode();
+ if (mode == UILabel::LINE_BREAK_MARQUEE || mode == UILabel::LINE_BREAK_OSCILLATION)
+ {
+ rollingLabelList_.PushBack(label);
+ }
}
- dataTypeMap_.insert(std::make_pair(static_cast<int16_t>(type), view));
+ auto it = dataTypeMap_.find(static_cast<int16_t>(type));
+ if (it != dataTypeMap_.end())
+ {
+ it->second->PushBack(view);
+ }
+ else
+ {
+ Views *container = new Views;
+ if (container == nullptr)
+ {
+ GRAPHIC_LOGE("failed to alloc binddata container");
+ return;
+ }
+ container->PushBack(view);
+ dataTypeMap_.insert(std::make_pair(static_cast<int16_t>(type), container));
+ viewsMemPool_.PushBack(container);
+ }
if (isPeriodic)
{
periodicUpdateTypes_.PushBack(type);
ModelDialDataFactory::GetInstance().RegisterDialDataListener(type, this);
passiveUpdateTypes_.PushBack(type);
}
+ }
+
+ void DialViewGroup::ClearViews()
+ {
+ dataTypeMap_.clear();
+ for (uint16_t i = 0; i < viewsMemPool_.Size(); ++i)
+ {
+ delete viewsMemPool_[i];
+ }
+ viewsMemPool_.Clear();
+ }
+
+ void DialViewGroup::AddView(UIView *view)
+ {
+ if (view == nullptr)
+ {
+ GRAPHIC_LOGE("Parameter is nullptr.\n");
+ return;
+ }
+ dialViews_.PushBack(view);
+ Add(view);
+ DialViewContainer *container = dynamic_cast<DialViewContainer *>(view);
+ if (container != nullptr)
+ {
+ ListNode<DialViewContainer::SubView> *head = container->Begin();
+ for (; head != container->End(); head = head->next_)
+ {
+ DialViewContainer::SubView &subView = head->data_;
+ if (subView.dialView != nullptr)
+ {
+ RecordBindData(subView.type, subView.dialView, subView.isPeriodic);
+ ProcessData(subView.type, subView.dialView);
+ }
+ else if (subView.view != nullptr)
+ {
+ RecordSpecial(subView.view);
+ }
+ }
+ }
+ else
+ {
+ RecordSpecial(view);
+ }
+ }
+
+ void DialViewGroup::AddView(DialDataType type, DialView *view, bool isPeriodic)
+ {
+ if (view == nullptr)
+ {
+ GRAPHIC_LOGE("Parameter is nullptr.\n");
+ return;
+ }
+
+ DialDigitalImgView *digital = dynamic_cast<DialDigitalImgView *>(view);
+ if (digital != nullptr)
+ {
+ digital->SetParent(this);
+ }
+ RecordBindData(type, view, isPeriodic);
dialViews_.PushBack(dynamic_cast<UIView *>(view));
Add(dynamic_cast<UIView *>(view));
- ProcessData(type, view);
+ ProcessData(type, view);
}
void DialViewGroup::SetPeriod(uint32_t period)
return period_;
}
-
void DialViewGroup::OnDialFloatDataUpdate(DialDataType type, float data)
{
auto iter = dataTypeMap_.find(static_cast<int16_t>(type));
if (iter != dataTypeMap_.end())
{
- DialView *view = iter->second;
- view->HandleFloatData(data);
+ Views *container = iter->second;
+ for (uint16_t i = 0; i < container->Size(); ++i)
+ {
+ DialView *view = (*container)[i];
+ view->HandleFloatData(data);
+ }
}
}
auto iter = dataTypeMap_.find(static_cast<int16_t>(type));
if (iter != dataTypeMap_.end())
{
- DialView *view = iter->second;
- view->HandleFloatData(data, num);
+ Views *container = iter->second;
+ for (uint16_t i = 0; i < container->Size(); ++i)
+ {
+ DialView *view = (*container)[i];
+ view->HandleFloatData(data, num);
+ }
}
}
auto iter = dataTypeMap_.find(static_cast<int16_t>(type));
if (iter != dataTypeMap_.end())
{
- DialView *view = iter->second;
- view->HandleTextData(data, num);
+ Views *container = iter->second;
+ for (uint16_t i = 0; i < container->Size(); ++i)
+ {
+ DialView *view = (*container)[i];
+ view->HandleTextData(data, num);
+ }
}
}
DialClick dialClick = node->data_;
if (dialClick.area.IsContains(point))
{
- if (dialClick.isSliceType) {
- //支付宝需要先判断
+ if (dialClick.isSliceType)
+ {
+ // 支付宝需要先判断
#ifdef SUPPORT_ALIPAY_SEC
- // if(dialClick.sliceId == VIEW_MAIN_ALIPAY && Alipay_is_init()==false)
- // {
- // return false;
- // }
-#endif
- NativeAbility::GetInstance().ChangeSlice(dialClick.sliceId);
+ // if(dialClick.sliceId == VIEW_MAIN_ALIPAY && Alipay_is_init()==false)
+ // {
+ // return false;
+ // }
+#endif
+ NativeAbility::GetInstance().ChangeSlice(dialClick.sliceId);
}
else
{
void DialViewGroup::ScrollBegin(bool isActive)
{
- if (kaleidoscope_ != nullptr)
+ if (isActive)
+ {
+ DoPause();
+ }
+ }
+
+ void DialViewGroup::ScrollEnd(bool isActive)
+ {
+ MainPresenterSample *mainPresenter = MainPresenterSample::GetInstance();
+ if ((mainPresenter == nullptr) || (mainPresenter->GetMainPresenterState() != MainPresenterState::RESUME))
{
- if (isActive)
+ return;
+ }
+
+ if (isActive)
+ {
+ DoStart();
+ }
+ else
+ {
+ if (video_ != nullptr && !video_->IsStopped())
{
- kaleidoscope_->ClearFocus();
- kaleidoscope_->StopRotateAnimator();
+ video_->StopPlay();
+ }
+ if (video_ != nullptr)
+ {
+ ClearCache();
}
- return;
}
+ }
- if (video_ == nullptr)
+ void DialViewGroup::CoverBegin(bool isCovered)
+ {
+ if (!isCovered)
+ {
+ DoPause();
+ }
+ }
+
+ void DialViewGroup::CoverEnd(bool isCovered)
+ {
+ MainPresenterSample *mainPresenter = MainPresenterSample::GetInstance();
+ if ((mainPresenter == nullptr) || (mainPresenter->GetMainPresenterState() != MainPresenterState::RESUME))
{
return;
}
- if (video_->IsPlayed())
+
+ if (!isCovered)
{
- video_->PausePlay();
+ DoStart();
}
}
- void DialViewGroup::ScrollEnd(bool isActive)
+ void DialViewGroup::OnActive(void)
{
- if (kaleidoscope_ != nullptr)
+ MainPresenterSample *mainPresenter = MainPresenterSample::GetInstance();
+ if ((mainPresenter == nullptr) || (mainPresenter->GetMainPresenterState() != MainPresenterState::RESUME))
{
- if (isActive)
- {
- kaleidoscope_->StartRotateAnimator();
- kaleidoscope_->RequestFocus();
- }
return;
}
- if (video_ == nullptr)
+ DoStart();
+ }
+
+ void DialViewGroup::OnInactive(void)
+ {
+ DoStop();
+ }
+
+ void DialViewGroup::OnCovered(void)
+ {
+ MainPresenterSample *mainPresenter = MainPresenterSample::GetInstance();
+ if ((mainPresenter == nullptr) || (mainPresenter->GetMainPresenterState() != MainPresenterState::RESUME))
{
return;
}
- if (isActive)
+ DoPause();
+ }
+
+ void DialViewGroup::OnUncovered(void)
+ {
+ MainPresenterSample *mainPresenter = MainPresenterSample::GetInstance();
+ if ((mainPresenter == nullptr) || (mainPresenter->GetMainPresenterState() != MainPresenterState::RESUME))
{
- if (video_->IsPaused())
- {
- video_->ResumePlay();
- }
- else if (!video_->IsPlayed())
- {
- video_->StartPlay();
- }
- g_video = video_;
+ return;
}
- else
+
+ DoStart();
+ }
+
+ void DialViewGroup::OnPause()
+ {
+ DoPause();
+ }
+
+ void DialViewGroup::SetLableAnimatorState(uint8_t state)
+ {
+ if (rollingLabelList_.IsEmpty())
{
- if (video_->IsPaused() || video_->IsPlayed())
+ return;
+ }
+
+ ListNode<UILabel *> *node = rollingLabelList_.Begin();
+ while (node != rollingLabelList_.End())
+ {
+ if (node->data_ != nullptr)
{
- video_->StopPlay();
+ UILabel *label = node->data_;
+ label->SetAnimState(state);
}
- ClearCache();
- g_video = nullptr;
+ node = node->next_;
}
}
- void DialViewGroup::CoverBegin(bool isCovered)
+ void DialViewGroup::SetImgAnimatorState(uint8_t state)
{
- if (kaleidoscope_ != nullptr)
+ if (imgAnimList_.IsEmpty() && seqList_.IsEmpty())
{
- if (!isCovered)
- {
- kaleidoscope_->StopRotateAnimator();
- kaleidoscope_->ClearFocus();
- }
return;
}
- if (video_ == nullptr)
+ ListNode<UIImageAnimatorView *> *node = imgAnimList_.Begin();
+ while (node != imgAnimList_.End())
{
- return;
+ if (node->data_ != nullptr)
+ {
+ UIImageAnimatorView *imgAnim = node->data_;
+ switch (state)
+ {
+ case Animator::PAUSE:
+ imgAnim->Pause();
+ break;
+ case Animator::START:
+ imgAnim->Resume();
+ break;
+ }
+ }
+ node = node->next_;
}
- if (video_->IsPlayed())
+ ListNode<DialSequenceContainer *> *it = seqList_.Begin();
+ while (it != seqList_.End())
{
- video_->PausePlay();
+ if (it->data_ != nullptr)
+ {
+ switch (state)
+ {
+ case Animator::PAUSE:
+ it->data_->Pause();
+ break;
+ case Animator::START:
+ it->data_->Resume();
+ break;
+ }
+ }
+ it = it->next_;
}
}
- void DialViewGroup::CoverEnd(bool isCovered)
+ MediaVideoPlay *DialViewGroup::GetVideoPlay()
{
- if (kaleidoscope_ != nullptr)
+ if (video_ != nullptr)
{
- if (!isCovered)
- {
- kaleidoscope_->RequestFocus();
- kaleidoscope_->StartRotateAnimator();
- }
- return;
+ return video_->GetVideoPlay();
}
- if (video_ == nullptr)
+ return nullptr;
+ }
+
+ void DialViewGroup::StopDial()
+ {
+ #if 0
+ if (MainModel::GetInstance().getVideostate() != false)
{
return;
}
- if (isCovered)
+ MainModel::GetInstance().setVideostate(true);
+ if (video_ != nullptr)
{
+ if (!video_->IsStopped())
+ {
+ video_->StopPlay();
+ }
g_video = nullptr;
}
- else
+ else if (kaleidoscope_ != nullptr)
{
- if (video_->IsPaused())
- {
- video_->ResumePlay();
- }
- else if (!video_->IsPlayed())
- {
- video_->StartPlay();
- }
- g_video = video_;
+ kaleidoscope_->StopRotateAnimator();
+ kaleidoscope_->ClearFocus();
}
+ #endif
}
-
- void DialViewGroup::OnActive(void)
+ void DialViewGroup::StartDial()
{
+ #if 0
+ if (MainModel::GetInstance().getVideostate() != true)
+ {
+ return;
+ }
+ MainModel::GetInstance().setVideostate(false);
if (video_ != nullptr)
{
if (video_->IsPaused())
kaleidoscope_->RequestFocus();
kaleidoscope_->StartRotateAnimator();
}
+ #endif
}
-
- void DialViewGroup::OnInactive(void)
+
+ // 更新数据
+ void DialViewGroup::UpdateViewsByPeriodicUpdateData()
{
- if (video_ != nullptr)
+ ListNode<DialDataType> *node = periodicUpdateTypes_.Head();
+ while (node != periodicUpdateTypes_.End())
{
- if (!video_->IsStopped())
+ DialDataType type = node->data_;
+ auto iter = dataTypeMap_.find(static_cast<int16_t>(type));
+ if (iter != dataTypeMap_.end())
{
- video_->StopPlay();
+ Views *container = iter->second;
+ for (uint16_t i = 0; i < container->Size(); ++i)
+ {
+ ProcessData(type, (*container)[i]);
+ }
}
- g_video = nullptr;
+ node = node->next_;
}
- else if (kaleidoscope_ != nullptr)
+ if (LowPowerManager::GetInstance()->IsLiteSurfaceInRootView())
{
- kaleidoscope_->StopRotateAnimator();
- kaleidoscope_->ClearFocus();
+ Invalidate();
+ }
+ // ota进行视频暂停
+ if (uapi_dev_runtime_get_transmitting_status() == 1 || uapi_dev_runtime_get_restore_factory_status() == 1)
+ {
+ // 暂停视频
+ StopDial();
+ }
+ else
+ {
+ // 获取视频
+ StartDial();
}
}
-void DialViewGroup::StopDial() {
- if (MainModel::GetInstance().getVideostate() != false) {
- return;
- }
- MainModel::GetInstance().setVideostate(true);
- if (video_ != nullptr) {
- if (!video_->IsStopped()) {
- video_->StopPlay();
- }
- g_video = nullptr;
- } else if (kaleidoscope_ != nullptr) {
- kaleidoscope_->StopRotateAnimator();
- kaleidoscope_->ClearFocus();
- }
-}
-void DialViewGroup::StartDial() {
- if (MainModel::GetInstance().getVideostate() != true) {
- return;
- }
- MainModel::GetInstance().setVideostate(false);
- if (video_ != nullptr) {
- if (video_->IsPaused()) {
- video_->ResumePlay();
- } else if (!video_->IsPlayed()) {
- video_->StartPlay();
- }
- g_video = video_;
- } else if (kaleidoscope_ != nullptr) {
- kaleidoscope_->RequestFocus();
- kaleidoscope_->StartRotateAnimator();
- }
-}
-MediaVideoPlay* DialViewGroup::GetVideoPlay()
-{
- if (video_ != nullptr) {
- return video_->GetVideoPlay();
- }
- return nullptr;
-}
-//更新数据
-void DialViewGroup::UpdateViewsByPeriodicUpdateData() {
- ListNode<DialDataType> *node = periodicUpdateTypes_.Head();
- while (node != periodicUpdateTypes_.End()) {
- DialDataType type = node->data_;
- auto iter = dataTypeMap_.find(static_cast<int16_t>(type));
- if (iter != dataTypeMap_.end()) {
- ProcessData(type, iter->second);
- }
- node = node->next_;
- }
- if (LowPowerManager::GetInstance()->IsLiteSurfaceInRootView()) {
- Invalidate();
- }
- // ota进行视频暂停
- if (uapi_dev_runtime_get_transmitting_status() == 1 || uapi_dev_runtime_get_restore_factory_status() == 1 ) {
- //暂停视频
- StopDial();
- } else {
- //获取视频
- StartDial();
- }
-}
}
\ No newline at end of file
if (model == nullptr) {
return false;
}
- // printf("type %d strNum %d\r\n",type,strNum);
return model->GetDialTextData(type, out, strNum);
}
return iter->second;
}
+bool ModelDialDataFactory::IsOHBindDataExist(DialOHDataType type) const
+{
+ auto it = g_bindDataConverter.find(type);
+ if (it == g_bindDataConverter.end()) {
+ return false;
+ }
+ return IsBindDataExist(it->second);
+}
+
+bool ModelDialDataFactory::IsBindDataExist(DialDataType type) const
+{
+ auto it = models_.find(static_cast<int16_t>(type));
+ if (it != models_.end() && it->second != nullptr) {
+ return true;
+ }
+ return false;
+}
+
bool ModelDialDataFactory::RegisterDialDataListener(DialDataType type, OnDialDataUpdateListener* listener)
{
DialBaseModel* model = GetModuleByType(type);
--- /dev/null
+/*
+ * Copyright (c) CompanyNameMagicTag 2025. All rights reserved.
+ * Description: WatchInterface
+ * Author:
+ * Create: 2025-03-17
+ */
+
+#include <string>
+#include "dirent.h"
+#include "DialBinParser.h"
+#include "UiConfig.h"
+#include "WatchInterface.h"
+#include "gfx_utils/vector.h"
+#include "common/screen.h"
+#include "MainModel.h"
+#include "MainViewSample.h"
+#include "SetDialModel.h"
+#include "graphic_service.h"
+#include "NativeAbility.h"
+
+using namespace OHOS;
+namespace {
+struct {
+ Graphic::Vector<std::string> fileNames; // only for 3.0
+ Graphic::Vector<watch_dial_info> watchInfo; // only for 3.0
+} g_info;
+
+bool GetActiveWatchPath(std::string &path)
+{
+ if (MainModel::GetInstance().GetDialSetting().dialFlag == 1) {
+ path = MainModel::GetInstance().GetDialSetting().dialFullName;
+ return true;
+ }
+ return false;
+}
+
+bool GetPreviewInfo(const std::string &fileName, DialPreviewInfo &preview)
+{
+ const std::string type(".bin");
+ if (!(fileName.length() > type.length() &&
+ fileName.substr(fileName.length() - type.length(), type.length()) == type)) {
+ return false;
+ }
+ memset_s(&preview, sizeof(preview), 0, sizeof(preview));
+ FILE *file = fopen(fileName.c_str(), "rb");
+ bool isSuccess = false;
+ if (file != nullptr) {
+ isSuccess = DialBinParserManager::GetInstance()->GetDialPreviewInfo(file, &preview);
+ fclose(file);
+ }
+ return isSuccess;
+}
+
+bool ConvertPreview2WatchDialInfo(const DialPreviewInfo &preview, watch_dial_info &info)
+{
+ errno_t ret = strcpy_s(reinterpret_cast<char *>(info.watch_protocol_version),
+ sizeof(info.watch_protocol_version),
+ preview.protocolVersion);
+ if (ret != 0) {
+ GRAPHIC_LOGE("failed to copy protocol version.");
+ return false;
+ }
+
+ ret = strcpy_s(reinterpret_cast<char *>(info.watch_version), sizeof(info.watch_version), preview.watchVersion);
+ if (ret != 0) {
+ GRAPHIC_LOGE("failed to copy watch version.");
+ return false;
+ }
+ info.uuid = preview.uuid;
+ return true;
+}
+
+#define APP_DIAL_PATH "user/dial/" //为了编译过加的
+
+bool GetAllWatchInfo()
+{
+ g_info.fileNames.Clear();
+ g_info.watchInfo.Clear();
+ struct dirent *direntp = nullptr;
+
+
+ // ��Ŀ¼
+ DIR *dirp = opendir(APP_DIAL_PATH);
+ bool isSuccess = true;
+ // �����ļ�
+ DialPreviewInfo info;
+ watch_dial_info watchInfo;
+ std::string activePath;
+ bool isActiveExist = GetActiveWatchPath(activePath);
+ if (dirp != nullptr) {
+ while ((direntp = readdir(dirp)) != nullptr) {
+ std::string fileName = std::string(APP_DIAL_PATH) + std::string("/") + std::string(direntp->d_name);
+ isSuccess = GetPreviewInfo(fileName, info);
+ if (!isSuccess) {
+ continue;
+ }
+
+ const std::string lowestVersion("3.0");
+ std::string curVersion(info.protocolVersion);
+ if (curVersion >= lowestVersion) {
+ isSuccess = ConvertPreview2WatchDialInfo(info, watchInfo);
+ if (!isSuccess) {
+ break;
+ }
+ watchInfo.install_state = true;
+ watchInfo.is_current_watch = isActiveExist ? (activePath == fileName) : false;
+ g_info.fileNames.PushBack(fileName);
+ g_info.watchInfo.PushBack(watchInfo);
+ }
+ }
+ }
+ // �ر�Ŀ¼
+ closedir(dirp);
+ return isSuccess;
+}
+} // namespace
+
+bool GetAllWatchFaceInfo(watch_dial_info *info, uint8_t *num, uint8_t maxCnt)
+{
+ if (info == nullptr || num == nullptr) {
+ GRAPHIC_LOGE("para error!");
+ return false;
+ }
+ if (!GetAllWatchInfo()) {
+ GRAPHIC_LOGE("failed to get all watch info.");
+ return false;
+ }
+ if (g_info.watchInfo.Size() > maxCnt) {
+ GRAPHIC_LOGE("mem is not enough.");
+ return false;
+ }
+ *num = g_info.watchInfo.Size();
+ if (*num == 0) {
+ return false;
+ }
+ if (memcpy_s(info,
+ g_info.watchInfo.Size() * sizeof(watch_dial_info),
+ &g_info.watchInfo[0],
+ g_info.watchInfo.Size() * sizeof(watch_dial_info)) != 0) {
+ GRAPHIC_LOGE("copy info error!");
+ return false;
+ }
+ return true;
+}
+
+bool GetWatchFaceInfo(uint32_t uuid, watch_dial_info *watch)
+{
+ if (watch == nullptr) {
+ GRAPHIC_LOGE("para error!");
+ return false;
+ }
+ if (!GetAllWatchInfo()) {
+ GRAPHIC_LOGE("failed to get all watch info.");
+ return false;
+ }
+ for (uint16_t i = 0; i < g_info.watchInfo.Size(); ++i) {
+ if (g_info.watchInfo[i].uuid == uuid) {
+ *watch = g_info.watchInfo[i];
+ return true;
+ }
+ }
+ return false;
+}
+
+bool GetWatchCapability(watch_dev_cap_info *capability)
+{
+ if (capability == nullptr) {
+ GRAPHIC_LOGE("para error!");
+ return false;
+ }
+ capability->kaleidoscope = true;
+ capability->effect_3D = false;
+ capability->interaction = true;
+ capability->video = true;
+ capability->video_format = (1 << CODEC_JPEG);
+ return true;
+}
+
+bool GetWatchSystemInfo(watch_sys_info *sysInfo)
+{
+ if (sysInfo == nullptr) {
+ GRAPHIC_LOGE("para error!");
+ return false;
+ }
+ sysInfo->watch_proto_support_cnt = DialBinParserManager::GetInstance()->GetSupportVersionCnt();
+ for (uint8_t i = 0; i < sysInfo->watch_proto_support_cnt; ++i) {
+ std::string version;
+ bool isSuccess = DialBinParserManager::GetInstance()->GetVersionByIndex(i, version);
+ if (!isSuccess) {
+ return false;
+ }
+ errno_t ret =
+ strcpy_s(sysInfo->watch_protocol_verion[i], sizeof(sysInfo->watch_protocol_verion[i]), version.c_str());
+ if (ret != 0) {
+ GRAPHIC_LOGE("get protocal version error!");
+ return false;
+ }
+ }
+ int ret = sprintf_s(sysInfo->resolution,
+ sizeof(sysInfo->resolution),
+ "%u*%u",
+ Screen::GetInstance().GetWidth(),
+ Screen::GetInstance().GetHeight());
+ if (ret == -1) {
+ GRAPHIC_LOGE("get resolution error!");
+ return false;
+ }
+
+ return true;
+}
+
+bool GetCurrentWatchFaceInfo(watch_dial_info *watch)
+{
+ if (watch == nullptr) {
+ GRAPHIC_LOGE("para error!");
+ return false;
+ }
+ std::string activePath;
+ if (!GetActiveWatchPath(activePath)) {
+ return false;
+ }
+
+ DialPreviewInfo preview;
+ if (!GetPreviewInfo(activePath, preview)) {
+ return false;
+ }
+
+ if (std::string(preview.protocolVersion) < std::string("3.0")) {
+ return false;
+ }
+ if (!ConvertPreview2WatchDialInfo(preview, *watch)) {
+ return false;
+ }
+ watch->install_state = true;
+ watch->is_current_watch = true;
+ return true;
+}
+
+bool SetCurrentWatchFace(uint32_t uuid)
+{
+ if (!GetAllWatchInfo()) {
+ GRAPHIC_LOGE("failed to get all watch info.");
+ return false;
+ }
+ watch_dial_info info;
+ uint16_t index = 0;
+ bool isExists = false;
+ for (uint16_t i = 0; i < g_info.watchInfo.Size(); ++i) {
+ if (uuid == g_info.watchInfo[i].uuid) {
+ isExists = true;
+ info = g_info.watchInfo[i];
+ index = i;
+ break;
+ }
+ }
+ if (!isExists) {
+ GRAPHIC_LOGE("uuid does not exist!");
+ return false;
+ }
+ if (info.is_current_watch) {
+ return true;
+ }
+
+ DialSetting setting = MainModel::GetInstance().GetDialSetting();
+ setting.dialFlag = 1;
+ setting.dialFullName = g_info.fileNames[index];
+ GraphicService::GetInstance()->PostGraphicEvent([setting]() {
+ MainModel::GetInstance().GetDialSetting() = setting;
+ #ifdef fd230_650
+ MainModel::GetInstance().AddDialSetting(setting);
+ #endif
+ if (NativeAbility::GetInstance().GetCurSliceId() == VIEW_MAIN) {
+ #ifdef fd230_650
+ MainViewSample::GetInstance()->ReloadWatchFace();
+ #endif
+ }
+ });
+
+ return true;
+}
+
+bool UninstallWatch(uint32_t uuid)
+{
+ if (!GetAllWatchInfo()) {
+ GRAPHIC_LOGE("failed to get all watch info.");
+ return false;
+ }
+ watch_dial_info info;
+ uint16_t index = 0;
+ bool isExists = false;
+ for (uint16_t i = 0; i < g_info.watchInfo.Size(); ++i) {
+ if (uuid == g_info.watchInfo[i].uuid) {
+ isExists = true;
+ info = g_info.watchInfo[i];
+ index = i;
+ break;
+ }
+ }
+ if (!isExists) {
+ GRAPHIC_LOGE("uuid does not exist!");
+ return false;
+ }
+
+ if (info.is_current_watch) {
+ DialSetting setting = MainModel::GetInstance().GetDialSetting();
+ setting.dialFlag = 0;
+ setting.dialId = 0;
+ std::string fileName = g_info.fileNames[index];
+ GraphicService::GetInstance()->PostGraphicEvent([setting, fileName]() {
+ MainModel::GetInstance().GetDialSetting() = setting;
+ #ifdef fd230_650
+ MainModel::GetInstance().AddDialSetting(setting,0);
+ #endif
+ if (NativeAbility::GetInstance().GetCurSliceId() == VIEW_MAIN) {
+ #ifdef fd230_650
+ MainViewSample::GetInstance()->ReloadWatchFace();
+ #endif
+ }
+ if (remove(fileName.c_str()) != 0) {
+ GRAPHIC_LOGE("failed to remove file %s", fileName.c_str());
+ }
+ });
+ } else {
+ if (remove(g_info.fileNames[index].c_str()) != 0) {
+ GRAPHIC_LOGE("failed to remove file %s", g_info.fileNames[index].c_str());
+ return false;
+ }
+ }
+ return true;
+}
+
+bool InstallWatch(const char *path, uint32_t *uuid)
+{
+ if (path == nullptr || uuid == nullptr) {
+ GRAPHIC_LOGE("para error!");
+ return false;
+ }
+
+ DialPreviewInfo preview;
+ if (!GetPreviewInfo(std::string(path), preview)) {
+ return false;
+ }
+ if (std::string(preview.protocolVersion) < std::string("3.0")) {
+ return false;
+ }
+ *uuid = preview.uuid;
+
+ if (!GetAllWatchInfo()) {
+ GRAPHIC_LOGE("failed to get all watchinfo!");
+ return false;
+ }
+ for (uint16_t i = 0; i < g_info.watchInfo.Size(); ++i) {
+ const std::string &fileName = g_info.fileNames[i];
+ const watch_dial_info &info = g_info.watchInfo[i];
+ if (!(info.uuid == *uuid && std::string(path) != fileName)) {
+ continue;
+ }
+
+ if (info.is_current_watch) {
+ DialSetting setting = MainModel::GetInstance().GetDialSetting();
+ setting.dialFlag = 1;
+ setting.dialFullName = std::string(path);
+ GraphicService::GetInstance()->PostGraphicEvent([setting, fileName]() {
+ MainModel::GetInstance().GetDialSetting() = setting;
+ #ifdef fd230_650
+ MainModel::GetInstance().AddDialSetting(setting);
+ #endif
+ if (NativeAbility::GetInstance().GetCurSliceId() == VIEW_MAIN) {
+ #ifdef fd230_650
+ MainViewSample::GetInstance()->ReloadWatchFace();
+ #endif
+ }
+ if (remove(fileName.c_str()) != 0) {
+ GRAPHIC_LOGE("failed to remove file %s", fileName.c_str());
+ }
+ });
+ } else {
+ if (remove(fileName.c_str()) != 0) {
+ return false;
+ }
+ }
+ }
+
+ return true;
+}
\ No newline at end of file
void VocassistPresenter::OnStop(void)
{
- Presenter<MainVocassistView>::OnStop();
ScreenTurnOff();
}
}
}
} else if (playerState == PlayerStates::PLAYER_PAUSED || (playerState == PlayerStates::PLAYER_IDLE)) {
ret = playerCtr->Reset();
+ AudioManager::GetInstance().DeactivateAudioInterrupt(interrupt);
+ ClearActivateAudioInterrupt();
WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "Reset, ret:%d", ret);
}
}
#include <custom_save_runtime.h>\r
#include "NativeRegisterManager.h"\r
\r
+#include "MainViewSample.h"\r
\r
\r
namespace OHOS\r
return false;\r
}\r
container[thisView] = group;\r
- RootView::GetInstance()->Add(container[thisView]);\r
+ MainViewSample::GetInstance()->GetRootContainer()->Add(container[thisView]);\r
}\r
// 动画开始\r
bluetoothEarPhoneView->BtAnimatorStart();\r
return false;\r
}\r
container[thisView] = group;\r
- RootView::GetInstance()->Add(container[thisView]);\r
+ MainViewSample::GetInstance()->GetRootContainer()->Add(container[thisView]);\r
} else {\r
// 刷新列表\r
UIList *scanList = bluetoothEarListView->GetScanUIList();\r
return false;\r
}\r
container[thisView] = group;\r
- RootView::GetInstance()->Add(container[thisView]);\r
+ MainViewSample::GetInstance()->GetRootContainer()->Add(container[thisView]);\r
}\r
WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "JumpView::ChangeBluetoothView");\r
BluetoothModel::GetInstance()->SetTagConnectView(false);\r
return false;\r
}\r
container[thisView] = group;\r
- RootView::GetInstance()->Add(container[thisView]);\r
+ MainViewSample::GetInstance()->GetRootContainer()->Add(container[thisView]);\r
}\r
return true;\r
}\r
return false;\r
}\r
container[thisView] = group;\r
- RootView::GetInstance()->Add(container[thisView]);\r
+ MainViewSample::GetInstance()->GetRootContainer()->Add(container[thisView]);\r
} else {\r
// 刷新列表\r
UIList *deviceList = bluetoothDeviceListView->GetDeviceUIList();\r
return false;\r
}\r
container[thisView] = group;\r
- RootView::GetInstance()->Add(container[thisView]);\r
+ MainViewSample::GetInstance()->GetRootContainer()->Add(container[thisView]);\r
}\r
BluetoothModel::GetInstance()->SetTagDisconnectView(true);\r
BluetoothReconnectView::GetInstance()->RefreshBluetoothNameLabel();\r
} else if (hideView == TIPSCONNFAILMESSAGEVIEW) {\r
bluetoothEarListView->SetTitleLabel("扫描完成");\r
bluetoothEarListView->SetNewEquipmentButtonAdd();\r
- RootView::GetInstance()->Invalidate();\r
+ MainViewSample::GetInstance()->GetRootContainer()->Invalidate();\r
}\r
}\r
\r
return false;\r
}\r
container[thisView] = group;\r
- RootView::GetInstance()->Add(container[thisView]);\r
+ MainViewSample::GetInstance()->GetRootContainer()->Add(container[thisView]);\r
}\r
return true;\r
}\r
return false;\r
}\r
container[thisView] = group;\r
- RootView::GetInstance()->Add(container[thisView]);\r
+ MainViewSample::GetInstance()->GetRootContainer()->Add(container[thisView]);\r
}\r
BluetoothReconnectView *bluetoothReconnectView = BluetoothReconnectView::GetInstance();\r
if (bluetoothReconnectView == nullptr) {\r
return false;\r
}\r
container[thisView] = group;\r
- RootView::GetInstance()->Add(container[thisView]);\r
+ MainViewSample::GetInstance()->GetRootContainer()->Add(container[thisView]);\r
}\r
return true;\r
}\r
}\r
container[showView]->SetVisible(true);\r
WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "JumpView:: ChangeView end!!!%d", showView);\r
- RootView::GetInstance()->Invalidate();\r
+ MainViewSample::GetInstance()->GetRootContainer()->Invalidate();\r
BluetoothModel::GetInstance()->SetCurView(showView);\r
}\r
\r
\r
void PlayerInterruptListener::PausePlayer(void)\r
{\r
- PlayerPostGraphicEvent(Pause);\r
+ Pause();\r
}\r
\r
static void Resume(void)\r
void PlayerInterruptListener::ResumePlayer(void)\r
{\r
WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[PlayerInterruptListener::ResumePlayer] start");\r
- usleep(50000); // 确保界面切换完成\r
+ usleep(500000); // 确保界面切换完成\r
if (NativeAbility::GetInstance().GetCurSliceId() == VIEW_INCOMING_CALL ||\r
(GetCurrCallState() != HFP_HF_CALL_STATE_FINISHED && GetScoConnectState() == HFP_SCO_STATE_CONNECTED)) {\r
WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[PlayerInterruptListener::ResumePlayer] this is in calling");\r
return; // 通话界面,禁止音乐恢复播放\r
}\r
- AudioRelease(); // 适配某些机型不触发SCO\r
-\r
- PlayerPostGraphicEvent(Resume);\r
+ Resume();\r
}\r
\r
static void Stop(void)\r
pbItermView->ConnectAnimatorStop();\r
BluetoothModel::GetInstance()->SetConnectionView(nullptr);\r
bluetoothEarListView->SetNewEquipmentButtonAdd();\r
- RootView::GetInstance()->Invalidate();\r
+ MainViewSample::GetInstance()->GetRootContainer()->Invalidate();\r
return;\r
}\r
\r
add_subdirectory_if_exist(smart_voice)
endif()
add_subdirectory_if_exist(power_manager)
+add_subdirectory_if_exist(dial_market)
#include "bundle_install_msg.h"
#include "bundlems_slite_client.h"
#include "appexecfwk_errors.h"
-#include "sign_mode.h"
#include "ui_service.h"
void AppStoreReplyAck(uint8_t cmd_id, uint8_t type, uint32_t ack)
SendMsgToUIService(JS_UNINSTALL_SUCESS_TO_UI, 0, &bundleData, sizeof(BundleData));
report.operationResult = UNINSTALL_OK;
}
- OHOS::SignMode::GetInstance().SetSignMode(true);
} else if (resultCode == ERR_APPEXECFWK_INSTALL_FAILED_EXCEED_MAX_BUNDLE_NUMBER) {
report.operationResult = INSTALL_OVER_LIMIT;
- OHOS::SignMode::GetInstance().SetSignMode(true);
} else {
report.operationResult = (status == INSTALL_CALLBACK) ? INSTALL_FAILED : UNINSTALL_FAILED;
- OHOS::SignMode::GetInstance().SetSignMode(true);
}
AdapterFree(installMsg);
WEARABLE_LOGD(WEARABLE_LOG_MODULE_MSG_CENTER, "SendMsgToAppStore operationResult = %u", report.operationResult);
if (pkgFullName != nullptr) {
(void)sprintf_s(pkgFullName, len, "%s%s", FS_DIR_APP_STORE, (char *)operInfo->pkgName);
WEARABLE_LOGI(WEARABLE_LOG_MODULE_MSG_CENTER, "AppStorePkgOperation install pkgFullName=%s", pkgFullName);
- OHOS::SignMode::GetInstance().SetSignMode(false);
InstallParam installParam = { .installLocation = 1, .keepData = false };
ret = OHOS::BundleMsClient::GetInstance().Install(pkgFullName, &installParam, InstallCallbackFunc);
free(pkgFullName);
} else if (operInfo->operationType == PKG_OPERATION_TYPE_UNINSTALL) {
StopJsApp((char*)operInfo->pkgName);
WEARABLE_LOGI(WEARABLE_LOG_MODULE_MSG_CENTER, "AppStorePkgOperation uninstall pkgName=%s", operInfo->pkgName);
- OHOS::SignMode::GetInstance().SetSignMode(false);
InstallParam installParam = { .installLocation = 1, .keepData = false };
ret = OHOS::BundleMsClient::GetInstance().Uninstall((char*)operInfo->pkgName, &installParam, UninstallCallbackFunc);
}
(void)strncpy_s((char*)unitInfo[i].pkgName, PKG_NAME_MAX_LENGTH,
bundleInfos[i].bundleName, strlen(bundleInfos[i].bundleName));
WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "AppStoreGetPkgList pkgName[%d] = %s", i, unitInfo[i].pkgName);
+ unitInfo[i].versionCode = bundleInfos[i].versionCode;
}
ret = msg_center_send_data(MSGCENTER_CMD_APP_STORE, type, infoList, len);
free(infoList);
typedef struct {
uint8_t pkgName[PKG_NAME_MAX_LENGTH];
+ int32_t versionCode;
} PkgUnitInfo;
errcode_t AppStorePkgOperation(uint8_t cmd_id, uint8_t type, void *usr_data, uint16_t usr_len);
--- /dev/null
+set(COMPONENT_NAME "dial_market")
+
+set(PUBLIC_HEADER
+ ${CMAKE_CURRENT_SOURCE_DIR}/
+)
+
+set(PRIVATE_HEADER
+ ${CMAKE_CURRENT_SOURCE_DIR}/../../ohos_deps
+ ${ROOT_DIR}/middleware/services/gui/uikit/utils/interfaces/innerkits
+ ${ROOT_DIR}/middleware/services/gui/uikit/utils/interfaces/kits
+ ${ROOT_DIR}/middleware/services/gui/uikit/utils/interfaces/kits/gfx_utils
+ ${ROOT_DIR}/open_source/openharmony/base/startup/syspara_lite/include
+ ${ROOT_DIR}/open_source/openharmony/drivers/peripheral/format/interfaces/include
+ ${ROOT_DIR}/application/wearable/nativeapp/nativeui/main/include/dial
+)
+
+set(SOURCES
+ ${CMAKE_CURRENT_SOURCE_DIR}/dial_market_msg.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/dial_market.cpp
+)
+
+set(COMPONENT_PUBLIC_CCFLAGS
+)
+
+set(COMPONENT_CCFLAGS
+ -std=c++11
+)
+
+set(WHOLE_LINK
+ true
+)
+
+set(PUBLIC_DEFINES
+)
+
+set(PRIVATE_DEFINES
+ APP_PLATFORM_WATCHGT
+ CONFIG_ACELITE_ENABLE
+)
+
+build_component()
+
+
--- /dev/null
+/*
+ * Copyright (c) CompanyNameMagicTag 2021-2021. All rights reserved.
+ * Description: broadcast service api
+ * Author: CompanyName
+ * Create: 2021-11-11
+ */
+
+#ifndef DIAL_MARKET_H
+#define DIAL_MARKET_H
+
+#include "msg_center_protocol.h"
+
+#ifdef __cplusplus
+#if __cplusplus
+extern "C" {
+#endif
+#endif
+
+#define MAX_CHIP_PLAT_LEN 5
+#define MAX_CHIP_MODEL_LEN 5
+#define MAX_OS_LEN 23
+#define MAX_API_LEVEL_LEN 3
+#define MAX_WATCH_PROTO_VER_LEN 4
+#define MAX_WATCH_INTERNAL_VER 6
+#define MAX_RESOLUTION_LEN 8
+#define MAX_SUPPORT_PROTOCOL 8
+#define MAX_WATCH_CNT 64
+
+typedef enum msg_center_dial_market_type_id {
+ MSGCENTER_TYPE_ID_DM_GET_SYS_INFO = 0x1,
+ MSGCENTER_TYPE_ID_DM_GET_DEV_CAP = 0x2,
+ MSGCENTER_TYPE_ID_DM_GET_ONE_WATCH_INFO = 0x3,
+ MSGCENTER_TYPE_ID_DM_INSTALL_WATCH = 0x4,
+ MSGCENTER_TYPE_ID_DM_UNINSTALL_WATCH = 0x5,
+ MSGCENTER_TYPE_ID_DM_SET_WATCH = 0x6,
+ MSGCENTER_TYPE_ID_DM_GET_ALL_WATCH_INFO = 0x7,
+ MSGCENTER_TYPE_ID_DM_GET_CUR_WATCH_INFO = 0x8,
+} msg_center_dial_market_type_id_t;
+
+typedef struct {
+ char chip_platform[MAX_CHIP_PLAT_LEN];
+ char chip_model[MAX_CHIP_MODEL_LEN];
+ char os_version[MAX_OS_LEN];
+ char api_level[MAX_API_LEVEL_LEN];
+ uint8_t watch_proto_support_cnt;
+ char watch_protocol_verion[MAX_SUPPORT_PROTOCOL][MAX_WATCH_PROTO_VER_LEN];
+ char resolution[MAX_RESOLUTION_LEN];
+} watch_sys_info;
+
+typedef struct {
+ uint8_t kaleidoscope;
+ uint8_t effect_3D;
+ uint8_t interaction;
+ uint8_t video;
+ uint16_t video_format; /* 按照CodecFormat做位映射形成能力集 */
+} watch_dev_cap_info;
+
+typedef struct {
+ uint32_t uuid;
+ uint8_t install_state;
+ uint8_t is_current_watch;
+ uint8_t watch_protocol_version[MAX_WATCH_PROTO_VER_LEN];
+ uint8_t watch_version[MAX_WATCH_INTERNAL_VER];
+} watch_dial_info;
+
+errcode_t msg_center_dial_market_get_sys_info(uint8_t cmd_id, uint8_t type, void *usr_data, uint16_t usr_len);
+errcode_t msg_center_dial_market_get_dev_cap(uint8_t cmd_id, uint8_t type, void *usr_data, uint16_t usr_len);
+errcode_t msg_center_dial_market_get_one_watch_info(uint8_t cmd_id, uint8_t type, void *usr_data, uint16_t usr_len);
+errcode_t msg_center_dial_market_install_watch(uint8_t cmd_id, uint8_t type, void *usr_data, uint16_t usr_len);
+errcode_t msg_center_dial_market_uninstall_watch(uint8_t cmd_id, uint8_t type, void *usr_data, uint16_t usr_len);
+errcode_t msg_center_dial_market_set_watch(uint8_t cmd_id, uint8_t type, void *usr_data, uint16_t usr_len);
+errcode_t msg_center_dial_market_get_all_watch_info(uint8_t cmd_id, uint8_t type, void *usr_data, uint16_t usr_len);
+errcode_t msg_center_dial_market_get_cur_watch_info(uint8_t cmd_id, uint8_t type, void *usr_data, uint16_t usr_len);
+
+#ifdef __cplusplus
+#if __cplusplus
+}
+#endif
+#endif
+#endif /* DIAL_MARKET_H */
${ROOT_DIR}/application/wearable/service/xiaodu_navi_vector
${ROOT_DIR}/application/wearable/service/xiaodu_navi_vector/libs
${ROOT_DIR}/application/wearable/service/msg_center/src/notify/ketinput/include
- ${ROOT_DIR}/application/wearable/nativeapp/nativelauncher/include
- ${ROOT_DIR}/application/wearable/nativeabilityfwk/include
- ${ROOT_DIR}/application/wearable/nativeapp/nativeui/alarm/include
- ${ROOT_DIR}/application/wearable/nativeapp/nativeui/key/include
- ${ROOT_DIR}/application/wearable/nativeapp/nativeui/alarmclockmanage/include
- ${ROOT_DIR}/application/wearable/nativeapp/nativeui/alarmclocktimerconfig/include
- ${ROOT_DIR}/application/wearable/nativeapp/nativeui/main/include
- ${ROOT_DIR}/application/wearable/nativeapp/nativeui/callerlog/include
- ${ROOT_DIR}/application/wearable/nativeapp/nativeui/phoneservice/include
- ${ROOT_DIR}/application/wearable/nativeapp/nativeui/makephone/include
- ${ROOT_DIR}/application/wearable/nativeapp/nativeui/player/include
- ${ROOT_DIR}/application/wearable/nativeapp/nativeui/applist/include
- ${ROOT_DIR}/open_source/openharmony/foundation/multimedia/player/interfaces/kits
)
set(SOURCES
${CMAKE_CURRENT_SOURCE_DIR}/src/msg_center.cpp
- ${CMAKE_CURRENT_SOURCE_DIR}/src/notify/ketinput/src/NotifyOnKeyListener.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/notify/notification_manager.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/msg_center_protocol.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/client/msg_center_client.cpp
${ROOT_DIR}/include/middleware/services/bts/common
${ROOT_DIR}/application/auto_ota
${ROOT_DIR}/application/wearable/service/xiaodu_navi_vector
+ ${ROOT_DIR}/application/wearable/service/msg_center/src/notify/ketinput/include
+ ${ROOT_DIR}/application/wearable/nativeapp/nativelauncher/include
+ ${ROOT_DIR}/application/wearable/nativeabilityfwk/include
+ ${ROOT_DIR}/application/wearable/nativeapp/nativeui/alarm/include
+ ${ROOT_DIR}/application/wearable/nativeapp/nativeui/key/include
+ ${ROOT_DIR}/application/wearable/nativeapp/nativeui/alarmclockmanage/include
+ ${ROOT_DIR}/application/wearable/nativeapp/nativeui/alarmclocktimerconfig/include
+ ${ROOT_DIR}/application/wearable/nativeapp/nativeui/main/include
+ ${ROOT_DIR}/application/wearable/nativeapp/nativeui/callerlog/include
+ ${ROOT_DIR}/application/wearable/nativeapp/nativeui/phoneservice/include
+ ${ROOT_DIR}/application/wearable/nativeapp/nativeui/makephone/include
+ ${ROOT_DIR}/application/wearable/nativeapp/nativeui/player/include
+ ${ROOT_DIR}/application/wearable/nativeapp/nativeui/applist/include
+ ${ROOT_DIR}/open_source/openharmony/foundation/multimedia/player/interfaces/kits
)
if("JS_ENABLE" IN_LIST DEFINES)
${CMAKE_CURRENT_SOURCE_DIR}/src/notify/makephone_notification.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/common/msg_center_common.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/common/msg_center_utils.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/src/notify/ketinput/src/NotifyOnKeyListener.cpp
)
else()
set(SOURCES
${CMAKE_CURRENT_SOURCE_DIR}/src/msg_center_self_cmd.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/notify/alarm_notification.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/notify/makephone_notification.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/src/notify/ketinput/src/NotifyOnKeyListener.cpp
)
endif()
void StartJsApp(char *bundleName);\r
void StopJsApp(char *bundleName);\r
void MsgCenterReportBtStatusToJS(uint16_t msgId);\r
+bool MsgCenterNotifyProc(const Topic topic, Request* req);\r
#endif\r
\r
#ifdef __cplusplus\r
MSGCENTER_CMD_PING = 0x7,\r
MSGCENTER_CMD_WATCH_CONNECT = 0x8,\r
MSGCENTER_CMD_APP_STORE = 0x9,\r
+ MSGCENTER_CMD_DIAL_MARKET = 0xa,\r
MSGCENTER_CMD_MAX\r
} msg_center_cmd_id_t;\r
\r
--- /dev/null
+/*\r
+ * Copyright (c) CompanyNameMagicTag 2024-2024. All rights reserved.\r
+ * Description: NotifyOnKeyListener.h\r
+ * Author: g30037431\r
+ * Create: 2024-12-12\r
+ */\r
+\r
+#ifndef KEY_NOTIFY_INPUT_LISTENER_H\r
+#define KEY_NOTIFY_INPUT_LISTENER_H\r
+\r
+#include "components/root_view.h"\r
+#include "events/key_event.h"\r
+#include "ohos_types.h"\r
+\r
+namespace OHOS {\r
+class NotifyOnKeyListener : public RootView::OnKeyActListener {\r
+public:\r
+ static NotifyOnKeyListener* GetInstance();\r
+ bool OnKeyAct(UIView& view, const KeyEvent& event) override;\r
+\r
+private:\r
+ NotifyOnKeyListener() {}\r
+ ~NotifyOnKeyListener() {}\r
+ void OnKeyPress(void);\r
+ void OnKeyLongPress(const KeyEvent& event);\r
+ void OnKeyRelease(const KeyEvent& event);\r
+ void CallVolumeDipSwitchControl(uint8_t status);\r
+ void PlayerVolumeDipSwitchControl(uint8_t status);\r
+private:\r
+ int32 pressFlag{0};\r
+ int32 longPressFlag{0};\r
+};\r
+}\r
+#endif // KEY_NOTIFY_INPUT_LISTENER_H
\ No newline at end of file
--- /dev/null
+/*
+ * Copyright (c) CompanyNameMagicTag 2024-2024. All rights reserved.
+ * Description: NotifyOnKeyListener.cpp
+ * Author:g30037431
+ * Create: 2024-12-14
+ */
+
+#include "NotifyOnKeyListener.h"
+#include "common/key_code.h"
+#include "AppViewIDs.h"
+#include "View.h"
+#include "KeyInputListener.h"
+#include "VolumeSettingView.h"
+#include "VolumeSettingPresenter.h"
+#include "VolumeSettingView.h"
+#include "wearable_log.h"
+#include "UiConfig.h"
+#include "dock/input_device.h"
+#include "notification_manager.h"
+#include "AlarmPopUpPresenter.h"
+#include "CallerLogModel.h"
+#include "MainCallingPresenter.h"
+#include "ApplistModel.h"
+namespace OHOS {
+static bool IsNotifyCallStatus()
+{
+ uint16_t notifyId = NotificationManager::GetInstance()->GetShowingNotifyId();
+ if (NotificationManager::GetInstance()->HasNotifyShowing() &&
+ (notifyId == TOPIC_EVENT_HFP_WATCH_ACTIVE || notifyId == TOPIC_EVENT_HFP_PHONE_TO_WATCH)) {
+ return true;
+ } else {
+ return false;
+ }
+}
+
+static void PressAlarmNotify()
+{
+ AlarmClockModel::GetInstance()->AlarmGetClockNum();
+ AlarmPopUpPresenter::GetInstance()->DelayAlarmRing();
+ NotificationManager::GetInstance()->StopNotify();
+}
+
+NotifyOnKeyListener *NotifyOnKeyListener::GetInstance()
+{
+ static NotifyOnKeyListener instance;
+ return &instance;
+}
+
+void NotifyOnKeyListener::OnKeyPress(void)
+{
+ pressFlag = 1; // Short press the logo
+ return;
+}
+
+void NotifyOnKeyListener::OnKeyLongPress(const KeyEvent &event)
+{
+ longPressFlag = 1; // Long press the logo
+
+ uint16 keyID = event.GetKeyId();
+ if (keyID == static_cast<uint16_t>(ZliteKeyCode::ZLITE_KEY_POWER)) { // Power button
+ NativeAbility::GetInstance().ChangeSlice(VIEW_REBOOT); // Switch to shutdown/restart card
+ } else if (keyID == static_cast<uint16_t>(ZliteKeyCode::ZLITE_KEY_FUNC)) { // Function buttons
+ // Switch to View System Version Card
+ }
+ return;
+}
+
+void NotifyOnKeyListener::CallVolumeDipSwitchControl(uint8_t status)
+{
+ VolumeSliderEventListener *volumeSliderEventListener = nullptr;
+ if (NotificationManager::GetInstance()->GetVolumeScreenStatus()) {
+ VolumeSettingView *settingView = GetvolumeSetting();
+ if (settingView == nullptr) {
+ return;
+ }
+ volumeSliderEventListener = settingView->GetVolumeEventListener();
+ if (volumeSliderEventListener == nullptr) {
+ return;
+ }
+ volumeSliderEventListener->ChangeVolume(static_cast<VolumeChangeStatus>(status));
+ } else {
+ HonrsViewChange();
+ NotificationManager::GetInstance()->SetVolumeScreenStatus(true);
+ }
+ return;
+}
+
+void NotifyOnKeyListener::OnKeyRelease(const KeyEvent &event)
+{
+ uint16_t currentViewId = NativeAbility::GetInstance().GetCurSliceId();
+ uint16 keyID = event.GetKeyId();
+ uint16_t notifyId = NotificationManager::GetInstance()->GetShowingNotifyId();
+ if (keyID == static_cast<uint16_t>(ZliteKeyCode::ZLITE_KEY_POWER)) { // Power button
+ if (longPressFlag == 0 && pressFlag == 1 &&
+ NotificationManager::GetInstance()->HasNotifyShowing()) { // Short press the power button
+ if (NotificationManager::GetInstance()->GetWatchCallStatus()) { // Call notify
+ CallVolumeDipSwitchControl(VOLUMEUP); // Volume+
+ } else if (notifyId == TOPIC_EVENT_ALARM_RING) { // Main dial
+ PressAlarmNotify(); // When currently on the alarm notification page, process the alarm first before switching pages
+ }
+ }
+ } else if (keyID == static_cast<uint16_t>(ZliteKeyCode::ZLITE_KEY_FUNC)) { // Function buttons
+ if (longPressFlag == 0 && pressFlag == 1) { // Short press the function key
+ if (NotificationManager::GetInstance()->GetWatchCallStatus()) { // Volume card
+ CallVolumeDipSwitchControl(VOLUMEDOWN); // Volume-
+ } else {
+ // Switch to user configured shortcut card
+ }
+ }
+ }
+
+ pressFlag = 0;
+ longPressFlag = 0;
+ return;
+}
+
+bool NotifyOnKeyListener::OnKeyAct(UIView &view, const KeyEvent &event)
+{
+ UNUSED(view);
+ uint8 state = event.GetState();
+
+ switch (state) {
+ case InputDevice::STATE_PRESS: // Short press
+ OnKeyPress();
+ break;
+#ifdef __LITEOS_M__
+ case InputDevice::STATE_LONG_PRESS: // Long press
+ OnKeyLongPress(event);
+ break;
+#endif
+ case InputDevice::STATE_RELEASE: // Release
+ OnKeyRelease(event);
+ break;
+ default:
+ break;
+ }
+ return true;
+}
+} // namespace OHOS
#include "soc_dpu_type.h"\r
#include "soc_mipi_tx.h"\r
#include "pmu_ldo.h"\r
-#include "soc_gmmu_api.h"\r
#include "pm_lp_stub.h"\r
#include "hal_pmu_ldo.h"\r
#include "cmsis_os2.h"\r
POWER_DISPLAY_PRINT_ERR(0, "drv vau resume error ret=%x\r\n", ret);\r
return ERRCODE_FAIL;\r
}\r
-#ifdef SUPPORT_GPU_GMMU\r
- ret = drv_gmmu_resume(NULL);\r
- if (ret != 0) {\r
- POWER_DISPLAY_PRINT_ERR(0, "drv gmmu resume error ret=%x\r\n", ret);\r
- return ERRCODE_FAIL;\r
- }\r
-#endif\r
ret = uapi_lcd_init();\r
if (ret != 0 && ret != EXT_ERR_MIPI_ALREADY_INIT) {\r
POWER_DISPLAY_PRINT_ERR(0, "LCD init error ret=%x\r\n", ret);\r
POWER_DISPLAY_PRINT_ERR(0, "drv dpu suspend error ret=%x\r\n", ret);\r
}\r
#endif\r
-#ifdef SUPPORT_GPU_GMMU\r
- ret = drv_gmmu_suspend(NULL);\r
- if (ret != 0) {\r
- POWER_DISPLAY_PRINT_ERR(0, "drv gmmu suspend error ret=%x\r\n", ret);\r
- return ERRCODE_FAIL;\r
- }\r
-#endif\r
+\r
ret = uapi_lcd_deinit();\r
if (ret != 0) {\r
POWER_DISPLAY_PRINT_ERR(0, "lcd deinit error ret=%x\r\n", ret);\r
}\r
POWER_DISPLAY_PRINT_DEBUG(0, "turn off success.");\r
}\r
+ sc->press_state = false;\r
sc->current_state = new_state;\r
\r
return ret;\r
for (;;) {\r
osStatus_t ret = osMessageQueueGet(g_pcm_stream_msg_queue_id, &msg, nullptr, osWaitForever);\r
if (ret != osOK) {\r
- continue;\r
+ msg.msg_id = MSGCENTER_TYPE_ID_XIAODU_END_RECORD;\r
+ msg.data = nullptr;\r
}\r
if (msg.msg_id == MSGCENTER_TYPE_ID_XIAODU_SEND_PCM_STREAM) {\r
res = msg_center_xiaodu_send_pcm_stream(MSGCENTER_CMD_XIAODU, MSGCENTER_TYPE_ID_XIAODU_SEND_PCM_STREAM,\r
if (parent != nullptr) {
parent->Remove(this);
}
- ImageCacheFree(*const_cast<ImageInfo *>(GetImageInfo()));
+ const ImageInfo* info = GetImageInfo();
+ if (info != nullptr) {
+ ImageCacheFree(*const_cast<ImageInfo*>(info));
+ }
}
};
void SyncStopAnimator();
void AsyncStopAnimator();
void EndTransition(bool success);
- void SetRunDirectlyTransition(TransitionCaller caller, TransitionTarget target);
bool IsCurrentSnapshotEnabled()
{
return isCurrentSnapShotEnabled_;
#ifdef JS_ENABLE
ElementName *elementName = OHOS::AbilityMsClient::GetInstance().GetTopAbility();
if (elementName != nullptr && strcmp(elementName->bundleName, "com.huawei.launcher") != 0) {
- OHOS::AbilityMsClient::GetInstance().ForceStop(elementName->bundleName, TransitionType::TRANSITION_ZOOM);
+ OHOS::AbilityMsClient::GetInstance().ForceStop(elementName->bundleName, type);
targetSliceIdFromJS_ = targetSliceId;
FreeElement(elementName);
return;
set(MODULE_NAME "app")
set(AUTO_DEF_FILE_ID TRUE)
set(NativeApp ${CMAKE_CURRENT_SOURCE_DIR})
+set(UIKIT_ROOT_DIR ${ROOT_DIR}/middleware/services/gui/uikit)
set(UI_SAMPLE_ROOT ${ROOT_DIR}/middleware/services/gui/uikit/sample/uitest)
set(PUBLIC_HEADER
${NativeApp}/nativeui/alipay/include/AlipayTrans
${NativeApp}/nativeui/restoredefaults/include
+ ${NativeApp}/nativeui/videocard/include
+
${UI_SAMPLE_ROOT}/components
${NativeApp}/../service/smart_voice/smart_voice_service/interfaces/innerkits/native_c/include
${NativeApp}/../service/smart_voice/voice_engine_hal/interfaces/innerkits/native_c/include
${ROOT_DIR}/open_source/openharmony/foundation/multimedia/utils/include
${ROOT_DIR}/open_source/openharmony/utils/native/lite/include
${ROOT_DIR}/open_source/openharmony/utils/native/lite/kv_store/innerkits
+ ${ROOT_DIR}/open_source/openharmony/drivers/peripheral/format/interfaces/include
+ ${UIKIT_ROOT_DIR}/proprietary/src/ui/innerkits
+ ${ROOT_DIR}/application/wearable/service/dial_market
+ ${ROOT_DIR}/open_source/openharmony/third_party/cJSON
)
file(GLOB_RECURSE SOURCES "${NativeApp}/nativeui/*.cpp")
list(REMOVE_ITEM SOURCES
${NativeApp}/nativeui/main/src/dial/parser/DialBinParser.cpp
${NativeApp}/nativeui/main/src/dial/parser/DialBinParserManager.cpp
+ ${NativeApp}/nativeui/main/src/dial/parser/DialBinParserV3.cpp
)
if("SUPPORT_ALIPAY_SEC" IN_LIST DEFINES)
${UIKIT_NATIVE_FWK}/src/TransitionRecord.cpp
${UIKIT_NATIVE_DIAL}/src/dial/parser/DialBinParser.cpp
${UIKIT_NATIVE_DIAL}/src/dial/parser/DialBinParserManager.cpp
+ ${UIKIT_NATIVE_DIAL}/src/dial/parser/DialBinParserV3.cpp
)
set(SOURCES
${ROOT_DIR}/middleware/services/gui/uikit/ui/frameworks
${ROOT_DIR}/application/wearable/nativeapp/nativeui/applist/include/
${ROOT_DIR}/open_source/openharmony/drivers/peripheral/display/interfaces/include
+ ${ROOT_DIR}/open_source/openharmony/drivers/peripheral/format/interfaces/include
${UIKIT_NATIVE_DIAL}/include/dial
${ROOT_DIR}/middleware/services/media/foundation/sample/wrapper
${ROOT_DIR}/middleware/services/media/foundation/player/interfaces/kits
+ ${UIKIT_ROOT_DIR}/proprietary/src/ui/innerkits
)
set(PRIVATE_DEFINES
void RegisterNative(const AppItem &nativeAppList, NativeRegisterCallback* native);
void RegisterSlice(const uint16_t id, SliceProxy* slice);
void RegisterMenu(const uint16_t id, const char *icon, const char *iconHexagon, const char *label);
+ bool IsSliceIdExist(AppViewId id);
private:
NativeRegisterManager() {};
#include "graphic_config.h"
namespace OHOS {
- static const int CARD_SETTING_COUNT_MAX = 5;
typedef enum {
WATCH_FACE = 0, /* 主表盘枚举值不能修改 */
HEART_RATE,
COMPASS,
ACTIVITY,
MUSIC_PLAYER,
+ VIDEO_CARD1,
+ VIDEO_CARD2,
+ VIDEO_CARD3,
MAX_CARD,
} CardId;
+ static const int CARD_SETTING_COUNT_MAX = MAX_CARD;
typedef enum {
DIAL_CLOCK = 0,
static constexpr const char *PNG_SET_CARD_COMPASS = APP_RES_PATH"/CARD_COMPASS.bin";
static constexpr const char *PNG_SET_CARD_ACTIVITY = APP_RES_PATH"/CARD_ACTIVITY.bin";
static constexpr const char *PNG_SET_CARD_PLAYER = APP_RES_PATH"/CARD_PLAYER.bin";
+ static constexpr const char *PNG_SET_CARD_VIDEO = APP_RES_PATH"/noaudio_5_set.bin";
+ static constexpr const char *PNG_PREVIEW_CARD_VIDEO = APP_RES_PATH"/noaudio_05.bin";
static constexpr const char *PNG_SET_DIAL_CLOCK = APP_RES_PATH"/DIAL_CLOCK.bin";
}
}
nativeAppLists_.PushBack(item);
}
+
+bool NativeRegisterManager::IsSliceIdExist(AppViewId id)
+{
+ for (uint16_t index = 0; index < slices_.Size(); index++) {
+ if (slices_[index].id == static_cast<uint16_t>(id)) {
+ return true;
+ }
+ }
+ return false;
+}
} // namespace OHOS
\r
void AlipayPresenter::OnStart()\r
{\r
- WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "AlipayPresenter OnStart");\r
- Presenter<AlipayMainView>::OnStart();\r
alipayMode_->AlipayExitLpm();\r
if (!alipayMode_->AlipayInitModel()) {\r
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlipayPresenter::OnStart AlipayInitModel fail.");\r
void ApplistView::OnStart()
{
- View<ApplistPresenter>::OnStart();
AppListStyle style = presenter_->GetCurrentStyle();
if (style == AppListStyle::FOOTBALL_STYLE) {
FootballStyleOnStart();
int16_t blankSize = waterfallList_->GetRelativeRect().GetWidth() > waterfallList_->GetRelativeRect().GetHeight() ?
waterfallList_->GetRelativeRect().GetWidth() / 2 : waterfallList_->GetRelativeRect().GetHeight() / 2; // 2, half
waterfallList_->SetThrowDrag(true);
- waterfallList_->SetReboundSize(imgDistance_ * Sin(60)); // 60, degree
- waterfallList_->SetScrollBlankSize(0);
+ uint16_t layoutHeight = static_cast<uint16_t>(imgDistance_ * Sin(60));
+ waterfallList_->SetReboundSize(layoutHeight); // 60: degree, row's layout height
+ waterfallList_->SetScrollBlankSize(layoutHeight, UIAbstractScroll::Direction::TOP);
+ waterfallList_->SetScrollBlankSize(Screen::GetInstance().GetHeight() / 2 - layoutHeight, // 2: half
+ UIAbstractScroll::Direction::BOTTOM);
waterfallList_->RequestFocus();
waterfallList_->SetRotateFactor(10); // 10, empirical coefficient
waterfallList_->SetOnRotateListener(presenter_);
} else {
ListStyleOnStop();
}
- FocusManager::GetInstance()->ClearFocus();
return;
}
#include "dfx_channel.h"\r
#include "tcxo.h"\r
#include "ui_service.h"\r
-\r
+#include "network/network_listener.h"\r
namespace OHOS {\r
\r
#define BT_SPP_TASK_STACK_SIZE 2048\r
/* 通知msg_center,ble状态仍用bt状态,此处不区分 */\r
MsgCenterSendMsg(BT_DISCONNECTED_TO_MSGCENTER, 0, nullptr, 0);\r
SendMsgToUIService(BT_DISCONNECTED_TO_UI, 0, nullptr, 0);\r
+ // send to ace network\r
+ // SetAclConnected(false);\r
+ net_connect_status_change(NETWORK_TYPE_BLUETOOTH, CONNECTION_STATUS_DISCONNECTED);\r
} else if (state == GAP_ACL_STATE_CONNECTED) {\r
(void)memcpy_s(gapAclConnectAddr.addr, BD_ADDR_LEN, bdAddr->addr, BD_ADDR_LEN);\r
MsgCenterSendMsg(BT_CONNECTED_TO_MSGCENTER, 0, nullptr, 0);\r
SendMsgToUIService(BT_CONNECTED_TO_UI, 0, nullptr, 0);\r
+ // send to ace network\r
+ // SetAclConnected(true);\r
+ net_connect_status_change(NETWORK_TYPE_BLUETOOTH, CONNECTION_STATUS_CONNECTED);\r
}\r
return;\r
}\r
/* 通知msg_center,ble状态仍用bt状态,此处不区分 */\r
MsgCenterSendMsg(BT_DISCONNECTED_TO_MSGCENTER, 0, nullptr, 0);\r
msg_center_set_ble_conn_state(GAP_BLE_STATE_DISCONNECTED);\r
+ // send to ace network\r
+ net_connect_status_change(NETWORK_TYPE_BLUETOOTH_LE, CONNECTION_STATUS_DISCONNECTED);\r
} else {\r
MsgCenterSendMsg(BT_CONNECTED_TO_MSGCENTER, 0, nullptr, 0);\r
msg_center_set_ble_conn_state(GAP_BLE_STATE_CONNECTED);\r
(void)memcpy_s(&g_bd_addr, sizeof(bd_addr_t), addr, sizeof(bd_addr_t));\r
+ // send to ace network\r
+ net_connect_status_change(NETWORK_TYPE_BLUETOOTH_LE, CONNECTION_STATUS_CONNECTED);\r
}\r
+ // send to ace network\r
}\r
\r
static void BleAdvStartCallback(uint8_t advId, adv_status_t status)\r
character.chara_uuid.uuid_len = sizeof(diag_id);\r
memcpy_s(character.chara_uuid.uuid, sizeof(character.chara_uuid.uuid), (char *)&diag_id, sizeof(diag_id));\r
character.permissions = GATT_ATTRIBUTE_PERMISSION_WRITE | GATT_ATTRIBUTE_PERMISSION_READ;\r
- character.properties = GATT_CHARACTER_PROPERTY_BIT_WRITE | GATT_CHARACTER_PROPERTY_BIT_READ | GATT_CHARACTER_PROPERTY_BIT_NOTIFY;\r
+ character.properties = GATT_CHARACTER_PROPERTY_BIT_WRITE_NO_RSP | GATT_CHARACTER_PROPERTY_BIT_READ | GATT_CHARACTER_PROPERTY_BIT_NOTIFY;\r
character.value_len = (uint16_t)sizeof(value);\r
character.value = (uint8_t *)(&value);\r
\r
{
WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[CallModelResumePlayer] [ResumePlayer] start");
usleep(5000); // 延时等待通话释放媒体资源
- std::shared_ptr<PlayerInterruptListener> PlayerIntrptListener =
- OHOS::PlayersModel::GetInstance()->GetPlayerIntrptListener();
- if (PlayerIntrptListener != nullptr && PlayerIntrptListener->IsPaused()) {
- WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[CallModelResumePlayer] ResumePlayer ");
- PlayerIntrptListener->ResumePlayer();
- }
}
static void CallModelPostGraphicEvent(void (*fun)(void))
UNUSED(view);
uint8 state = event.GetState();
-
switch (state) {
case InputDevice::STATE_PRESS: // 短按
OnKeyPress();
class DialBinParserManager {
public:
- static DialBinParserManager* GetInstance(void);
- bool UpdateDial(const std::string& file, FILE* fp, DialViewGroup* group, DisplayState state);
- bool GetDialPreviewInfo(FILE* fp, DialPreviewInfo* info);
+ static DialBinParserManager *GetInstance(void);
+ bool UpdateDial(const std::string &file, FILE *fp, DialViewGroup *group, DisplayState state);
+ bool GetDialPreviewInfo(FILE *fp, DialPreviewInfo *info);
bool RegisterParser(const std::string &version, DialBinParserInterface *parser);
+ uint8_t GetSupportVersionCnt() const
+ {
+ return cnt_;
+ }
+
+ bool GetVersionByIndex(uint8_t index, std::string &version)
+ {
+ if (index >= cnt_) {
+ return false;
+ }
+ version = parsers_[index].version;
+ return true;
+ }
+
private:
DialBinParserManager();
virtual ~DialBinParserManager();
--- /dev/null
+/*
+ * Copyright (c) CompanyNameMagicTag 2025. All rights reserved.
+ * Description: DialBinParserV3
+ * Author:
+ * Create: 2025-02-06
+ */
+
+#ifndef GRAPHIC_LITE_DIAL_BIN_PARSER_V3_H
+#define GRAPHIC_LITE_DIAL_BIN_PARSER_V3_H
+#include "DialBinParserManager.h"
+#include "DialTimePublisher.h"
+#include "components/ui_abstract_progress.h"
+#include "DialViewContainer.h"
+#include "DialOHDataType.h"
+#include "DialOHSliceId.h"
+
+namespace OHOS {
+class DialBinParserV3 : public DialBinParserInterface {
+public:
+ DialBinParserV3();
+ ~DialBinParserV3() override;
+ bool UpdateDial(const std::string& file, FILE* fp, DialViewGroup* group, DisplayState state) override;
+ bool GetDialPreviewInfo(FILE* fp, DialPreviewInfo* info) override;
+
+protected:
+ bool ParseDialHeader(FILE* file);
+ bool ParserDialStaticImg(ContainerInterface &parent);
+ bool ParserDialSequenceImg(ContainerInterface &parent);
+ bool ParserDialRotateImg(ContainerInterface &parent);
+ bool ParserDialOptionImg(ContainerInterface &parent);
+ bool ParserDialDigitalImg(ContainerInterface &parent);
+ bool ParserDialLabel(ContainerInterface &parent);
+ bool ParserDialArcLabel(ContainerInterface &parent);
+ bool ParserDialBoxProgress(ContainerInterface &parent);
+ bool ParserDialArcProgress(ContainerInterface &parent);
+ bool ParserDialVideo(ContainerInterface &parent);
+ bool ParserDialClick(ContainerInterface &parent);
+ bool ParserDialKaleidoscope(ContainerInterface &parent);
+ bool ParserDialContainer(ContainerInterface &parent);
+ bool ParserDialOptions(ContainerInterface &parent);
+
+private:
+ void* MallocAndReadBuf(FILE* file, uint32_t readSize);
+ bool SetProgressType(FILE* fp, UIAbstractProgress* view, DialProgressType data);
+
+ static constexpr uint8_t DIAL_BIN_PARSER_FUNC_NUM = 14; // 14: func max value
+ bool (DialBinParserV3::*funcArray_[DIAL_BIN_PARSER_FUNC_NUM])(ContainerInterface&);
+ void AddToParentWithView(ContainerInterface &parent, uint8_t displayMode, UIView *view);
+ void AddToParentWithDialView(ContainerInterface &parent, uint8_t displayMode,
+ DialView *view, DialOHDataType bindData, bool isPeriodic);
+ struct {
+ uint8_t *viewType;
+ uint8_t dialViewCount;
+ FILE *file;
+ uint8_t curIndex;
+ } curViewType_;
+ bool ParseTimeIntervals(FILE* fp, uint8_t cnt, DialTimePublisher::TimeChangeListener *listener);
+ bool ParseViewType(uint8_t *viewType, uint8_t dialViewCount, FILE *file);
+ bool ParseContainerSubviews(DialViewContainer *container, uint8_t num);
+ bool ParseOptionsSubviews(ContainerInterface &parent);
+
+ DialViewGroup* dialGroup_ = nullptr;
+ std::string file_;
+ uint32_t dirId_ = 0xfef << 20; // 20: offset
+ uint32_t imageOffset_ = 0;
+ DisplayState state_ = DisplayState::NORMAL;
+}; // class DialBinParserV3
+} // namespace OHOS
+
+#endif // GRAPHIC_LITE_DIAL_BIN_PARSER_V3_H
\ No newline at end of file
uint32_t imgId;\r
uint32_t offset;\r
uint8_t capability;\r
+ uint32_t uuid;\r
+ char protocolVersion[DIAL_VERSION_MAX_LEN];\r
+ char watchVersion[DIAL_VERSION_MAX_LEN];\r
};\r
\r
struct DialRect {\r
#include "PullUpDownView.h"
#include "components/ui_cross_view.h"
#include "SetCardModel.h"
+#include "VideoCard.h"
namespace OHOS {
class MainPresenterSample;
UICardPage *InitActivityPage(void);
UICardPage *InitCompassPage(void);
UICardPage *InitMusicPlayerPage(void);
+ UICardPage *InitVideoCardPage1(void);
+ UICardPage *InitVideoCardPage2(void);
+ UICardPage *InitVideoCardPage3(void);
void AnimatorStart(int pageIndex);
void AnimatorStop(void);
CardId GetHorCurrentCard() const;
UICardPage* GetViewById(int16_t id) const
{
+ if (id >= MAX_CARD) {
+ return nullptr;
+ }
return recordCard[id];
}
}
void SwitchToCard(uint8_t cardId, bool loadAdjacent = true);
bool IsMainClockPage(void);
- void SetDragFg(bool continFg);
- bool GetDragFg(void);
void SetPage(int16_t page, bool loadAdjacent = true);
+ void ReloadWatchFace();
private:
PullUpDownView *dropDownView{nullptr};
bool pageStatus[MAX_CARD]{false};
UICrossView *mainSwipeGroup{nullptr};
ZoomEffect* callback{nullptr};
+ VideoCard *videoCard1{nullptr};
+ VideoCard *videoCard2{nullptr};
+ VideoCard *videoCard3{nullptr};
bool HorizontalViewInit(void);
void VerticalViewInit(void);
void HorViewLoad(void);
UICardPage *InitWatchOffDial(DialSetting &setting);
UICardPage *InitWatchDial(DialSetting &setting);
+ UICardPage *InitVideoCardPage(const std::string &video, const std::string &preview);
};
} // namespace OHOS
#endif // MAIN_VIEW_SAMPLE_H
#include <cstdint>
#include "DialView.h"
#include "components/ui_arc_label.h"
+#include "font/font_global_manager.h"
namespace OHOS {
-class DialArcLabelView : public UIArcLabel, public DialView {
+class DialArcLabelView : public UIArcLabel, public DialView, public FontGlobalManager::LangChangeListener {
public:
DialArcLabelView();
~DialArcLabelView() override;
void HandleTextData(const std::string* data, uint16_t num) override;
void HandleFloatData(const float* data, uint16_t num) override;
void HandleFloatData(float data) override;
+ void SetLang(uint8_t lang);
+ void OnLangChange(uint8_t langId) override;
private:
void SetTextWithWildcardInner(const char* text);
static const uint8_t MAX_BUF_SIZE = 255;
char* text_ = nullptr;
char dstBuf_[MAX_BUF_SIZE] = {0};
+ uint8_t language_ = FontGlobalManager::INVALID_LANG_ID;
};
}
#endif
DATA_TYPE_TIME_MONTH,
DATA_TYPE_TIME_YEAR,
- DATA_TYPE_MULTI_FLOAT_BASE = 0x2fff,
+ DATA_TYPE_SWIVEL_GEAR_ONE = 20,
+ DATA_TYPE_SWIVEL_GEAR_TWO,
+ DATA_TYPE_SWIVEL_GEAR_THREE,
+ DATA_TYPE_SWIVEL_GEAR_FOUR,
+ DATA_TYPE_SWIVEL_GEAR_FIVE,
+ DATA_TYPE_SWIVEL_GEAR_SIX,
- DATA_TYPE_TEXT_BASE = 0x4fff,
+ DATA_TYPE_TEXT_BASE = 0x2000,
- DATA_TYPE_MAX = 0x7fff,
+ DATA_TYPE_MULTI_FLOAT_BASE = 0x4000,
+
+ DATA_TYPE_MAX = 0x6000
};
#endif
#include <cstdint>
#include "DialView.h"
+#include "DialTimePublisher.h"
#include "components/ui_image_view.h"
#include "gfx_utils/graphic_math.h"
#include "components/ui_view_group.h"
RIGHT,
};
-class DialDigitalImgView : public UIImageView, public DialView {
+class DialDigitalImgView : public UIImageView, public DialView, public DialTimePublisher::TimeChangeListener {
public:
DialDigitalImgView();
~DialDigitalImgView() override;
void SetAlignPos(Point pos);
void SetDecimalPrecision(uint8_t precision);
void SetParent(UIViewGroup* parent);
+ void OnTimeUpdate(const struct tm &curTime) override;
private:
void SetNumImg(UIImageView* img, const ImageInfo *info);
#include <cstdint>
#include "DialView.h"
#include "components/ui_label.h"
+#include "font/font_global_manager.h"
namespace OHOS {
-class DialLabelView : public UILabel, public DialView {
+class DialLabelView : public UILabel, public DialView, public FontGlobalManager::LangChangeListener {
public:
DialLabelView();
~DialLabelView() override;
void HandleTextData(const std::string* data, uint16_t num) override;
void HandleFloatData(const float* data, uint16_t num) override;
void HandleFloatData(float data) override;
+ void SetLang(uint8_t lang);
+ void OnLangChange(uint8_t langId) override;
private:
void SetTextWithWildcardInner(const char* text);
static const uint8_t MAX_BUF_SIZE = 255;
char* text_ = nullptr;
char dstBuf_[MAX_BUF_SIZE] = {0};
+ uint8_t language_ = FontGlobalManager::INVALID_LANG_ID;
};
}
#endif
#define DIAL_MODEL_TIME_H
#include "DialBaseModel.h"
+#include "DialTimePublisher.h"
+#include "gfx_utils/list.h"
namespace OHOS {
-class DialModelTime : public DialBaseModel {
+class DialModelTime : public DialBaseModel, public DialTimePublisher {
public:
- DialModelTime() {}
- ~DialModelTime() override {}
+ DialModelTime()
+ {
+ DialModelTime::SetPublisher(dynamic_cast<DialTimePublisher*>(this));
+ }
+ ~DialModelTime() override
+ {
+ listeners_.Clear();
+ }
static DialModelTime* GetInstance()
{
static DialModelTime instance;
return &instance;
}
bool GetDialFloatData(DialDataType& type, float& out) override;
- void UpdateTime();
+ void UpdateTime() override;
+ void Register(TimeChangeListener* listener) override;
+ void Unregister(TimeChangeListener* listener) override;
private:
struct tm *tblock_;
uint16_t angleM_ = 0;
uint16_t angleS_ = 0;
float angleMS_ = 0;
+ List<TimeChangeListener*> listeners_;
};
}
#endif
--- /dev/null
+/*
+ * Copyright (c) CompanyNameMagicTag 2025. All rights reserved.
+ * Description: DialOHDataType
+ * Author:
+ * Create: 2025-02-15
+ */
+
+#ifndef DIAL_OH_DATATYPE_H
+#define DIAL_OH_DATATYPE_H
+
+#include <unordered_map>
+#include "DialDataBase.h"
+
+namespace OHOS {
+enum class DialOHDataType : int16_t {
+ CLOCK = 1,
+ CLOCK_HIGH_BIT = 2,
+ CLOCK_LOW_BIT = 3,
+ CLOCK_RATIO_12 = 4,
+ CLOCK_RATIO_24 = 5,
+ MINUTES = 6,
+ MINUTES_HIGH_BIT = 7,
+ MINUTES_LOW_BIT = 8,
+ MINUTES_RATIO = 9,
+ SECONDS = 10,
+ SECONDS_HIGH_BIT = 11,
+ SECONDS_LOW_BIT = 12,
+ SECONDS_RATIO = 13,
+ AM_PM = 14,
+ AMPM_TEXT = 15,
+ HOUR_MODE = 16,
+ PREVIOUS_HOUR = 17,
+ NEXT_HOUR = 18,
+ CLOCK_ANGLE = 19,
+ MINUTE_ANGLE = 20,
+ SECONDS_ANGLE = 21,
+ MILLISECOND_ANGLE = 22,
+ PREVIOUS_SECOND = 25,
+ NEXT_SECOND = 26,
+ PREVIOUS_SECOND_PREVIOUS_SECOND = 27,
+ PREVIOUS_MINUTE = 28,
+ NEXT_MINUTE = 29,
+ DUAL_TIME_ZONE_CLOCK = 30,
+ DUAL_TIME_ZONE_CLOCK_HIGH_BIT = 31,
+ DUAL_TIME_ZONE_CLOCK_LOW_BIT = 32,
+ DUAL_TIME_ZONE_CLOCK_RATIO_12 = 33,
+ DUAL_TIME_ZONE_CLOCK_RATIO_24 = 34,
+ DUAL_TIME_ZONE_MINUTES = 35,
+ DUAL_TIME_ZONE_MINUTES_HIGH_BIT = 36,
+ DUAL_TIME_ZONE_MINUTES_LOW_BIT = 37,
+ DUAL_TIME_ZONE_MINUTES_RATIO = 38,
+ DUAL_TIME_ZONE_ABBREVIATION_TEXT = 39,
+ DUAL_TIME_ZONE_TIME_MINUTE_TEXT = 40,
+ DUAL_TIME_ZONE_AMPM = 41,
+ DUAL_TIME_ZONE_AM_PM_TEXT = 42,
+ SUNRISE_SUNSET_PICTURE_SELECTION = 50,
+ SUNRISE_SUNSET_CLOCK_HIGH_BIT = 51,
+ SUNRISE_SUNSET_CLOCK_LOW_BIT = 52,
+ SUNRISE_SUNSET_MINUTES_HIGH_BIT = 53,
+ SUNRISE_SUNSET_MINUTES_LOW_BIT = 54,
+ SUNRISE_TEXT = 55,
+ SUNSET_TEXT = 56,
+ MOONRISE_TEXT = 60,
+ MOONSET_TEXT = 61,
+ DATE = 70,
+ DATE_HIGH_BIT = 71,
+ DATE_LOW_BIT = 72,
+ DATE_OCCUPIES_31_DAYS_RATIO = 73,
+ YESTERDAY = 74,
+ YESTERDAY_DATE_HIGH_BIT = 75,
+ YESTERDAY_DATE_LOW_BIT = 76,
+ TOMORROW = 77,
+ TOMORROW_DATE_HIGH_BIT = 78,
+ TOMORROW_DATE_LOW_BIT = 79,
+ MONTH_DATA = 80,
+ MONTH = 81,
+ MONTH_TEXT = 82,
+ WEEK_DATA = 83,
+ WEEK_RATIO = 84,
+ WEEK_TEXT = 85,
+ TWELVE_DIVISIONS = 86,
+ LUNAR_PHASE = 87,
+ PREVIOUS_MONTH = 88,
+ NEXT_MONTH = 89,
+ LUNAR_MONTH = 90,
+ LUNAR_DATE_HIGH_BIT = 91,
+ LUNAR_DATE_LOW_BIT = 92,
+ CHARGE = 100,
+ CHARGE_ENUMERATION = 102,
+ CHARGE_STATUS_ENUMERATION = 103,
+ CHARGE_RATIO = 104,
+ CHARGING_STATUS = 105,
+ STEPS = 110,
+ STEPS_UNIT_DIGIT = 111,
+ STEPS_TENS_DIGIT = 112,
+ STEPS_HUNDRED_DIGIT = 113,
+ STEPS_THOUSAND_DIGIT = 114,
+ STEPS_TEN_THOUSAND_DIGIT = 115,
+ STEPS_TARGET_ACHIEVEMENT_RATE = 116,
+ STEPS_TARGET_PROGRESS_ENUMERATION = 117,
+ CALORIES = 120,
+ CALORIES_RATIO = 121,
+ CALORIES_TARGET_PROGRESS_ENUMERATION = 122,
+ HEART_RATE = 130,
+ MAXIMUM_HEART_RATE = 131,
+ MINIMUM_HEART_RATE = 132,
+ HEART_RATE_RANGE = 133,
+ HEART_RATE_RATIO = 134,
+ STRESS = 140,
+ STRESS_RATIO = 141,
+ STRESS_LEVEL_TYPE = 142,
+ MODERATE_TO_VIGOROUS_INTENSITY_TIME = 150,
+ MODERATE_TO_VIGOROUS_INTENSITY_TIME_RATIO = 151,
+ STANDING_TIMES = 152,
+ STANDING_TIMES_RATIO = 153,
+ MAXIMUM_OXYGEN_UPTAKE = 160,
+ MAXIMUM_OXYGEN_UPTAKE_RATIO = 161,
+ SLEEP_TEXT = 165,
+ SLEEP_RATIO = 166,
+ SLEEP_TARGET_ACHIEVEMENT_RATE_ENUMERATION = 167,
+ TEMPERATURE = 170,
+ HIGHEST_TEMPERATURE = 171,
+ LOWEST_TEMPERATURE = 172,
+ CURRENT_TEMPERATURE_MINUS_ONE = 173,
+ CURRENT_TEMPERATURE_PLUS_ONE = 174,
+ TEMPERATURE_TYPE = 175,
+ WEATHER_TYPE = 176,
+ TEMPERATURE_RATIO = 177,
+ ATMOSPHERIC_PRESSURE = 180,
+ ATMOSPHERIC_PRESSURE_RATIO = 181,
+ AIR_QUALITY_INDEX = 182,
+ AIR_QUALITY_INDEX_LEVEL = 183,
+ AIR_QUALITY_INDEX_RATIO = 184,
+ ELEVATION = 190,
+ ELEVATION_HEIGHT_DATA = 191,
+ ELEVATION_HEIGHT_UNIT = 192,
+ HEIGHT_RATIO = 193,
+ DISTANCE_TEXT = 194,
+ DISTANCE_DATA = 195,
+ DISTANCE_UNIT = 196,
+ DISTANCE_TARGET_PROGRESS = 197,
+ HIGH_TIDE_TIME_TEXT = 200,
+ LOW_TIDE_TIME_TEXT = 201,
+ BLE_CONNECTION_STATUS = 210,
+ BT_CONNECTION_STATUS = 211,
+ BLOOD_OXYGEN = 220,
+ SYSTOLIC_BLOOD_PRESSURE = 221,
+ DIASTOLIC_BLOOD_PRESSURE = 222,
+ DUAL_LANGUAGE_SYSTEM = 230,
+ SWIVEL_GEAR_POSITIVE = (1 << 12) + 20, // private data, clockwise
+ SWIVEL_GEAR_NEGATIVE, // counterclockwise
+}; // enum class DialOHDataType
+
+struct HashOHDataType {
+ size_t operator()(DialOHDataType data) const
+ {
+ return std::hash<int16_t>()(static_cast<int16_t>(data));
+ }
+};
+
+const std::unordered_map<DialOHDataType, DialDataType, HashOHDataType> g_bindDataConverter = {
+ {DialOHDataType::CLOCK, DialDataType::DATA_TYPE_TIME_HOUR},
+ {DialOHDataType::MINUTES, DialDataType::DATA_TYPE_TIME_MINUTE},
+ {DialOHDataType::SECONDS, DialDataType::DATA_TYPE_TIME_SECOND},
+ {DialOHDataType::MILLISECOND_ANGLE, DialDataType::DATA_TYPE_CLOCK_ANGLE_MS},
+ {DialOHDataType::DATE, DialDataType::DATA_TYPE_TIME_DATE},
+ {DialOHDataType::WEEK_DATA, DialDataType::DATA_TYPE_TIME_WEEK},
+ {DialOHDataType::CHARGE, DialDataType::DATA_TYPE_POWER},
+ {DialOHDataType::STEPS, DialDataType::DATA_TYPE_STEPS},
+ {DialOHDataType::CALORIES, DialDataType::DATA_TYPE_CALORIE},
+ {DialOHDataType::HEART_RATE, DialDataType::DATA_TYPE_HEART_RATE},
+ {DialOHDataType::STRESS, DialDataType::DATA_TYPE_PRESSURE},
+ {DialOHDataType::TEMPERATURE, DialDataType::DATA_TYPE_TEMPERATURE},
+ {DialOHDataType::ELEVATION, DialDataType::DATA_TYPE_AILTITUDE},
+ {DialOHDataType::AIR_QUALITY_INDEX, DialDataType::DATA_TYPE_PM25},
+ {DialOHDataType::CLOCK_ANGLE, DialDataType::DATA_TYPE_CLOCK_ANGLE_H},
+ {DialOHDataType::MINUTE_ANGLE, DialDataType::DATA_TYPE_CLOCK_ANGLE_M},
+ {DialOHDataType::SECONDS_ANGLE, DialDataType::DATA_TYPE_CLOCK_ANGLE_S},
+ {DialOHDataType::MONTH, DialDataType::DATA_TYPE_TIME_MONTH},
+ {DialOHDataType::SWIVEL_GEAR_POSITIVE, DialDataType::DATA_TYPE_SWIVEL_GEAR_ONE},
+ {DialOHDataType::SWIVEL_GEAR_POSITIVE, DialDataType::DATA_TYPE_SWIVEL_GEAR_FOUR},
+ {DialOHDataType::SWIVEL_GEAR_POSITIVE, DialDataType::DATA_TYPE_SWIVEL_GEAR_SIX},
+ {DialOHDataType::SWIVEL_GEAR_NEGATIVE, DialDataType::DATA_TYPE_SWIVEL_GEAR_TWO},
+ {DialOHDataType::SWIVEL_GEAR_NEGATIVE, DialDataType::DATA_TYPE_SWIVEL_GEAR_THREE},
+ {DialOHDataType::SWIVEL_GEAR_NEGATIVE, DialDataType::DATA_TYPE_SWIVEL_GEAR_FIVE},
+};
+} // namespace OHOS
+
+#endif // DIAL_OH_DATATYPE_H
--- /dev/null
+/*
+ * Copyright (c) CompanyNameMagicTag 2025. All rights reserved.
+ * Description: DialOHSliceId
+ * Author:
+ * Create: 2025-02-15
+ */
+
+
+#ifndef DIALOHSLICEID_H
+#define DIALOHSLICEID_H
+
+#include <unordered_map>
+#include "AppViewIDs.h"
+
+namespace OHOS {
+enum class DialOHSliceId : uint16_t {
+ DUAL_TIME_ZONES = 0,
+ HEART_RATE = 1,
+ STANDING_TIMES = 2,
+ STRESS = 3,
+ MODERATE_TO_VIGOROUS_INTENSITY_TIME = 4,
+ WEATHER = 5,
+ AIR_QUALITY_ONLY_CHINA = 6,
+ ATMOSPHERIC_PRESSURE = 7,
+ ELEVATION_HEIGHT = 8,
+ SUNRISE_SUNSET_TIME = 9,
+ DISTANCE = 10,
+ SLEEP = 11,
+ EXERCISE = 12,
+ PAYMENT_ONLY_CHINA = 13,
+ ALARM_CLOCK = 14,
+ STOPWATCH = 15,
+ TIMER = 16,
+ EXERCISE_RECORD = 17,
+ TRAINING_STATUS = 18,
+ ACTIVITY_RECORD = 19,
+ AEROBIC_EXERCISE = 20,
+ CONTACTS = 21,
+ MUSIC = 22,
+ COMPASS = 23,
+ CALL_LOG = 24,
+ BLOOD_OXYGEN_SATURATION_ONLY_CHINA = 25,
+ ULTRAVIOLET_RAYS_ONLY_CHINA = 26,
+ PHASE_OF_THE_MOON = 27,
+ STAIR_CLIMBING = 28,
+ BLOOD_PRESSURE = 29,
+ MESSAGE_LIST = 30,
+ DIAL = 31,
+ AUDIO_SWITCH = 32,
+}; // enum class DialOHSliceId
+
+struct HashOhSliceId {
+ size_t operator()(DialOHSliceId id) const
+ {
+ return std::hash<uint16_t>()(static_cast<uint16_t>(id));
+ }
+};
+
+const std::unordered_map<DialOHSliceId, AppViewId, HashOhSliceId> g_sliceIdConverter = {
+ {DialOHSliceId::COMPASS, VIEW_COMPASS},
+ {DialOHSliceId::DIAL, VIEW_CALLER_SAMPLE},
+ {DialOHSliceId::ALARM_CLOCK, VIEW_MAIN_ALARM},
+ {DialOHSliceId::AUDIO_SWITCH, VIEW_VOLUME},
+};
+} // namespace OHOS
+#endif // DIALOHSLICEID_H
#include <cstdint>
#include "DialView.h"
+#include "DialTimePublisher.h"
#include "components/ui_image_view.h"
+#include "font/font_global_manager.h"
namespace OHOS {
-class DialOptionImgView : public UIImageView, public DialView {
+class DialOptionImgView : public UIImageView,
+ public DialView,
+ public FontGlobalManager::LangChangeListener,
+ public DialTimePublisher::TimeChangeListener {
public:
DialOptionImgView();
~DialOptionImgView() override;
bool SetOptionRes(const ImageInfo* src, uint16_t num);
+ void SetLang(uint8_t lang);
+
+ void OnLangChange(uint8_t langId) override;
+
+ void OnTimeUpdate(const struct tm &curTime) override;
+
private:
ImageInfo* info_ = nullptr;
uint16_t infoNum_ = 0;
int16_t selected_ = -1;
+ uint8_t language_ = FontGlobalManager::INVALID_LANG_ID;
+ bool langVisible_ = true;
+ bool timeVisible_ = true;
};
}
#endif
--- /dev/null
+/*
+ * Copyright (c) CompanyNameMagicTag 2025. All rights reserved.
+ * Description: DialSequenceContainer
+ * Author:
+ * Create: 2025-03-05
+ */
+
+#ifndef DIAL_SEQUENCE_CONTAINER_H
+#define DIAL_SEQUENCE_CONTAINER_H
+#include "components/ui_view_group.h"
+#include "components/ui_image_animator.h"
+
+namespace OHOS {
+class DialSequenceContainer : public UIViewGroup, public UIImageAnimatorView::AnimatorStopListener {
+public:
+ DialSequenceContainer();
+ ~DialSequenceContainer() override;
+ DialSequenceContainer(const DialSequenceContainer&) = delete;
+ DialSequenceContainer& operator=(const DialSequenceContainer&) = delete;
+ bool AddSequenceRes(uint16_t interval, bool repeat, const ImageAnimatorInfo *imgSrc, uint8_t imgNum);
+ bool OnClickEvent(const ClickEvent& event) override;
+ void Start();
+ void Stop();
+ void Pause();
+ void Resume();
+ void OnAnimatorStop(UIView& view) override;
+
+private:
+ void UpdateCurrentView();
+ UIImageAnimatorView *repeatView_ = nullptr;
+ UIImageAnimatorView *nonCycleView_[3]; // 3: max seqImg num
+ // if curView_ is not null, curView_ must be added into parent.
+ UIImageAnimatorView *curView_ = nullptr;
+ uint8_t nonCycleNum_ = 0;
+ uint8_t loop_ = 0;
+ bool isClick_ = false;
+}; // class DialSequenceContainer
+} // namespace OHOS
+#endif // DIAL_SEQUENCE_CONTAINER_H
\ No newline at end of file
#define DIAL_STATIC_IMG_VIEW_H
#include "components/ui_image_view.h"
+#include "font/font_global_manager.h"
+#include "DialTimePublisher.h"
namespace OHOS {
-class DialStaticImgView : public UIImageView {
+class DialStaticImgView : public UIImageView,
+ public FontGlobalManager::LangChangeListener,
+ public DialTimePublisher::TimeChangeListener {
public:
DialStaticImgView();
~DialStaticImgView() override;
+ void SetLang(uint8_t lang);
+ void OnLangChange(uint8_t langId) override;
+ bool SetImgs(const ImageInfo* src, uint8_t num);
+ bool OnClickEvent(const ClickEvent& event) override;
+ void OnTimeUpdate(const struct tm &curTime) override;
+
+private:
+ uint8_t language_ = FontGlobalManager::INVALID_LANG_ID;
+ ImageInfo* info_ = nullptr;
+ uint8_t infoNum_ = 0;
+ int16_t selected_ = -1;
+ bool langVisible_ = true;
+ bool timeVisible_ = true;
};
}
#endif
--- /dev/null
+/*
+ * Copyright (c) CompanyNameMagicTag 2025. All rights reserved.
+ * Description: DialTimePublisher
+ * Author:
+ * Create: 2025-03-04
+ */
+
+#ifndef DIAL_TIME_PUBLISHER_H
+#define DIAL_TIME_PUBLISHER_H
+#include <ctime>
+#include <cstdint>
+
+namespace OHOS {
+class DialTimePublisher {
+public:
+ struct TimeInterval {
+ uint8_t start;
+ uint8_t end;
+ };
+ class TimeChangeListener {
+ public:
+ virtual void OnTimeUpdate(const struct tm &curTime) = 0;
+ void SetTimeInervals(TimeInterval *intervals, uint8_t num);
+ bool IsInTimeInterval(const struct tm &curTime);
+ TimeChangeListener(const TimeChangeListener&) = delete;
+ TimeChangeListener& operator=(const TimeChangeListener&) = delete;
+ TimeChangeListener();
+ virtual ~TimeChangeListener();
+ private:
+ TimeInterval *intervals_ = nullptr;
+ uint8_t num_ = 0;
+ };
+
+ virtual void Register(TimeChangeListener *listener) = 0;
+ virtual void Unregister(TimeChangeListener *listener) = 0;
+ virtual void UpdateTime() = 0;
+ static void SetPublisher(DialTimePublisher *publisher);
+ static DialTimePublisher *GetPublisher();
+ virtual ~DialTimePublisher() {}
+
+private:
+ static DialTimePublisher *publisher_;
+}; // class DialTimePublisher
+} // namespace OHOS
+#endif // DIAL_TIME_PUBLISHER_H
\ No newline at end of file
--- /dev/null
+/*
+ * Copyright (c) CompanyNameMagicTag 2025. All rights reserved.
+ * Description: DialViewContainer
+ * Author:
+ * Create: 2025-02-06
+ */
+
+#ifndef DIAL_VIEW_CONTAINER_H
+#define DIAL_VIEW_CONTAINER_H
+#include "components/ui_view_group.h"
+#include "gfx_utils/list.h"
+#include "dial/DialView.h"
+#include "dial/DialDataBase.h"
+
+namespace OHOS {
+class ContainerInterface {
+public:
+ virtual void AddView(UIView* view) = 0;
+
+ virtual void AddView(DialDataType type, DialView* view, bool isPeriodic) = 0;
+
+ virtual ~ContainerInterface() {}
+};
+
+class DialViewContainer : public UIViewGroup, public ContainerInterface {
+public:
+ struct SubView {
+ UIView *view;
+ DialView *dialView;
+ DialDataType type;
+ bool isPeriodic;
+ };
+ DialViewContainer(uint8_t dialviewNum, uint16_t dataSize) :
+ dialViewNum_(dialviewNum), dataSize_(dataSize)
+ {
+ SetTouchable(true);
+ }
+ DialViewContainer() {}
+ ~DialViewContainer() override;
+ DialViewContainer(const DialViewContainer&) = delete;
+ DialViewContainer& operator=(const DialViewContainer&) = delete;
+
+ uint8_t GetDialviewNum() const
+ {
+ return dialViewNum_;
+ }
+
+ uint16_t GetDataSize() const
+ {
+ return dataSize_;
+ }
+
+ void AddView(UIView* view) override;
+
+ void AddView(DialDataType type, DialView* view, bool isPeriodic) override;
+
+ ListNode<SubView>* Begin()
+ {
+ return dialViews_.Begin();
+ }
+
+ const ListNode<SubView>* End()
+ {
+ return dialViews_.End();
+ }
+
+ bool HasInvalidBindData() const
+ {
+ return hasInvalidBindData_;
+ }
+
+ bool RemoveSubView(uint8_t index, SubView &subView);
+
+ bool IsInvalidateBindData(uint8_t index);
+
+private:
+ uint8_t dialViewNum_;
+ uint16_t dataSize_;
+ List<SubView> dialViews_;
+ bool hasInvalidBindData_ = false;
+}; // class DialViewContainer
+} // namesapce OHOS
+#endif // DIAL_VIEW_CONTAINER_H
\ No newline at end of file
#include <unordered_map>
#include "DialDataBase.h"
#include "components/ui_view_group.h"
+#include "components/ui_image_animator.h"
+#include "components/ui_label.h"
#include "OnDialDataUpdateListener.h"
#include "components/ui_card_page.h"
#include "components/ui_kaleidoscope_view.h"
#include "gfx_utils/list.h"
+#include "gfx_utils/vector.h"
#include "DialView.h"
#include "DialVideoView.h"
#include "DialBinTypesV2.h"
+#include "DialViewContainer.h"
+#include "DialSequenceContainer.h"
namespace OHOS {
-class DialViewGroup : public UICardPage, public OnDialDataUpdateListener {
+class DialViewGroup : public UICardPage, public OnDialDataUpdateListener, public ContainerInterface {
public:
DialViewGroup();
~DialViewGroup() override;
/**
* @brief Add a view which binds with data of a specific type and could be updated periodically.
*/
- void AddView(DialDataType type, DialView* view, bool isPeriodic = false);
+ void AddView(DialDataType type, DialView* view, bool isPeriodic) override;
/**
- * @brief Add a view. If the view is DialVideoView, the second parameter should be true.
+ * @brief Add a view.
*/
- void AddView(UIView* view, bool isDialVideoView = false);
+ void AddView(UIView* view) override;
/**
* @brief Add a click rect. When the rect is clicked, it will start a js app with the given bundleName.
*/
void OnActive(void) override;
- void OnInactive() override;
+ /**
+ * @brief This function is invoked when the function SetHorCurrentPage() is called.
+ */
+ void OnInactive(void) override;
+
+ /**
+ * @brief This function is invoked when SetVerCurrentPage is called and horizontal page is covered.
+ */
+ void OnCovered(void) override;
+
+ /**
+ * @brief This function is invoked when SetVerCurrentPage is called and horizontal page is not covered.
+ */
+ void OnUncovered(void) override;
+
+ void OnPause() override;
MediaVideoPlay* GetVideoPlay();
private:
void ProcessData(DialDataType type, DialView* view);
- std::unordered_map<int16_t, DialView*> dataTypeMap_;
+ void DoStop(void);
+ void DoStart(void);
+ void DoPause(void);
+ void RecordSpecial(UIView *view);
+ void RecordBindData(DialDataType type, DialView* view, bool isPeriodic);
+ void ClearViews();
+ using Views = Graphic::Vector<DialView*>;
+ std::unordered_map<int16_t, Views*> dataTypeMap_;
+ Graphic::Vector<Views*> viewsMemPool_;
List<DialDataType> periodicUpdateTypes_;
List<DialDataType> passiveUpdateTypes_;
List<UIView*> dialViews_;
List<DialClick> dialClicks_;
void ClearDial();
+
+ void SetLableAnimatorState(uint8_t state);
+ void SetImgAnimatorState(uint8_t state);
+ List<UILabel*> rollingLabelList_;
+ List<UIImageAnimatorView*> imgAnimList_;
+ List<DialSequenceContainer*> seqList_;
};
}
#endif
#include <unordered_map>
#include "DialBaseModel.h"
#include "DialDataBase.h"
+#include "DialOHDataType.h"
#include "ModelDialDataFactory.h"
namespace OHOS {
models_[static_cast<int16_t>(type)] = model;
}
+ bool IsOHBindDataExist(DialOHDataType type) const;
+ bool IsBindDataExist(DialDataType type) const;
bool RegisterDialDataListener(DialDataType type, OnDialDataUpdateListener* listener);
bool UnRegisterDialDataListener(DialDataType type);
bool GetDialTextData(DialDataType& type, std::string*& out, int16_t& strNum);
--- /dev/null
+/*
+ * Copyright (c) CompanyNameMagicTag 2025. All rights reserved.
+ * Description: WatchInterface
+ * Author:
+ * Create: 2025-03-17
+ */
+
+#ifndef WATCH_INTERFACE_H
+#define WATCH_INTERFACE_H
+#include <cstdint>
+#include "format_type.h"
+#include "dial_market.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * @brief Get all watch face information
+ * @param[out] info Pointer to store the watch face information
+ * @param[out] num Pointer to store the number of watch faces
+ * @param[in] maxCnt Maximum number of watch faces to retrieve
+ * @return bool Returns true if successful, false otherwise
+ */
+bool GetAllWatchFaceInfo(watch_dial_info *info, uint8_t *num, uint8_t maxCnt);
+
+/**
+ * @brief Get information of a specific watch face by UUID
+ * @param[in] uuid Unique identifier of the watch face
+ * @param[out] watch Pointer to store the watch face information
+ * @return bool Returns true if successful, false otherwise
+ */
+bool GetWatchFaceInfo(uint32_t uuid, watch_dial_info *watch);
+
+/**
+ * @brief Get the capability set of the watch
+ * @param[out] capability Pointer to store the watch capability information
+ * @return bool Returns true if successful, false otherwise
+ */
+bool GetWatchCapability(watch_dev_cap_info *capability);
+
+/**
+ * @brief Get system information
+ * @param[out] sysInfo Pointer to store the system information
+ * @return bool Returns true if successful, false otherwise
+ */
+bool GetWatchSystemInfo(watch_sys_info *sysInfo);
+
+/**
+ * @brief Get information of the currently active watch face
+ * @param[out] watch Pointer to store the watch face information
+ * @return bool Returns true if successful, false otherwise
+ */
+bool GetCurrentWatchFaceInfo(watch_dial_info *watch);
+
+/**
+ * @brief Set the currently active watch face by UUID
+ * @param[in] uuid Unique identifier of the watch face to set as active
+ * @return bool Returns true if successful, false otherwise
+ */
+bool SetCurrentWatchFace(uint32_t uuid);
+
+/**
+ * @brief Uninstall a watch face by UUID
+ * @param[in] uuid Unique identifier of the watch face to uninstall
+ * @return bool Returns true if successful, false otherwise
+ * @note If the UUID corresponds to the currently active watch face, it will switch to the default watch face
+ */
+bool UninstallWatch(uint32_t uuid);
+
+/**
+ * @brief Install a watch face from a specified path
+ * @param[in] path Path to the watch face file
+ * @param[out] uuid Pointer to store the unique identifier of the installed watch face
+ * @return bool Returns true if successful, false otherwise
+ * @note If a watch face with the same UUID already exists, it will be replaced
+ */
+bool InstallWatch(const char *path, uint32_t *uuid);
+
+#ifdef __cplusplus
+}
+#endif
+#endif // WATCH_INTERFACE_H
\ No newline at end of file
{ COMPASS, PNG_SET_CARD_COMPASS },\r
{ ACTIVITY, PNG_SET_CARD_ACTIVITY },\r
{ MUSIC_PLAYER, PNG_SET_CARD_PLAYER },\r
+ { VIDEO_CARD1, PNG_SET_CARD_VIDEO },\r
+ { VIDEO_CARD2, PNG_SET_CARD_VIDEO },\r
+ { VIDEO_CARD3, PNG_SET_CARD_VIDEO },\r
};\r
\r
const DialInfo dialInfoMap[] = {\r
if (index >= CARD_SETTING_COUNT_MAX) {\r
break;\r
}\r
- cardSettings[index++] = (CardId)atoi(setValue);\r
+ int val = atoi(setValue);\r
+ if (val >= 0 && val < CARD_SETTING_COUNT_MAX) {\r
+ cardSettings[index++] = static_cast<CardId>(val);\r
+ }\r
setValue = strtok_s(nullptr, ",", &setBuffer);\r
}\r
cardSettingCount = index;\r
cardSettings[index++] = COMPASS;\r
cardSettings[index++] = ACTIVITY;\r
cardSettings[index++] = MUSIC_PLAYER;\r
+ cardSettings[index++] = VIDEO_CARD1;\r
+ cardSettings[index++] = VIDEO_CARD2;\r
+ cardSettings[index++] = VIDEO_CARD3;\r
cardSettingCount = index;\r
}\r
}\r
PageTransitionMgr::GetInstance().SaveSlideBackSnapShotIfNecessary(watchFace);
watchFace->SetOpaScale(opaScale);
+ uint8_t curCardId = view_->GetHorCurrentCard();
+ UICardPage *card = view_->GetViewById(curCardId);
+ if (card != nullptr) {
+ card->OnPause();
+ }
mainPresenterState_ = MainPresenterState::PAUSE;
}
void MainPresenterSample::SetTaskPeroid(CardId cardId)
{
+ SetLastRun(0);
if (cardId == COMPASS) {
SetPeriod(DEFAULT_TASK_PERIOD);
} else if (cardId == WATCH_FACE) {
#include "wearable_log.h"
#include "MainViewSample.h"
#include "graphic_service.h"
+#include "common/image_cache_manager.h"
namespace OHOS {
static MainViewSample *g_pMainView = nullptr;
{COMPASS, &MainViewSample::InitCompassPage},
{ACTIVITY, &MainViewSample::InitActivityPage},
{MUSIC_PLAYER, &MainViewSample::InitMusicPlayerPage},
+ {VIDEO_CARD1, &MainViewSample::InitVideoCardPage1},
+ {VIDEO_CARD2, &MainViewSample::InitVideoCardPage2},
+ {VIDEO_CARD3, &MainViewSample::InitVideoCardPage3},
};
MainViewSample::MainViewSample()
playersView = nullptr;
}
+ bool hasVideo = false;
+ if (videoCard1 != nullptr) {
+ hasVideo = true;
+ delete videoCard1;
+ videoCard1 = nullptr;
+ }
+
+ if (videoCard2 != nullptr) {
+ hasVideo = true;
+ delete videoCard2;
+ videoCard2 = nullptr;
+ }
+
+ if (videoCard3 != nullptr) {
+ hasVideo = true;
+ delete videoCard3;
+ videoCard3 = nullptr;
+ }
+
+ if (hasVideo) {
+ ImageCacheManager::GetInstance().UnloadSingleRes(PNG_PREVIEW_CARD_VIDEO);
+ }
+
if (heartRateView != nullptr) {
delete heartRateView;
heartRateView = nullptr;
void MainViewSample::OnStart()
{
- WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "MainViewSample::OnStart");
- View<MainPresenterSample>::OnStart();
-
mainSwipeGroup = new UICrossView();
if (mainSwipeGroup == nullptr) {
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "mainSwipeGroup new fail");
return playersView;
}
+UICardPage *MainViewSample::InitVideoCardPage1(void)
+{
+ videoCard1 = dynamic_cast<VideoCard*>(InitVideoCardPage(APP_VIDEO_PATH"/noaudio_05.mp4", PNG_PREVIEW_CARD_VIDEO));
+ return videoCard1;
+}
+
+UICardPage *MainViewSample::InitVideoCardPage2(void)
+{
+ videoCard2 = dynamic_cast<VideoCard*>(InitVideoCardPage(APP_VIDEO_PATH"/noaudio_05.mp4", PNG_PREVIEW_CARD_VIDEO));
+ return videoCard2;
+}
+
+UICardPage *MainViewSample::InitVideoCardPage3(void)
+{
+ videoCard3 = dynamic_cast<VideoCard*>(InitVideoCardPage(APP_VIDEO_PATH"/noaudio_05.mp4", PNG_PREVIEW_CARD_VIDEO));
+ return videoCard3;
+}
+
+UICardPage *MainViewSample::InitVideoCardPage(const std::string &video, const std::string &preview)
+{
+ VideoCard *page = new VideoCard;
+ if (page == nullptr) {
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "videocard new fail");
+ return nullptr;
+ }
+ page->SetFilePath(video);
+ page->SetPreviewFile(preview);
+ return page;
+}
+
void MainViewSample::SetPage(int16_t page, bool loadAdjacent)
{
if (mainSwipeGroup != nullptr) {
if (presenter_ != nullptr) {
CardId *cardSettings = presenter_->GetCardSettings();
/* page 与CardId 没有对应关系,需要一次转换 */
- presenter_->SetTaskPeroid(cardSettings[page]);
+ CardId id = MAX_CARD;
+ for (uint8_t i = 0; i < presenter_->GetCardSettingCount(); ++i) {
+ if (cardSettings[i] < MAX_CARD && recordCard[cardSettings[i]] != nullptr &&
+ recordCard[cardSettings[i]]->GetViewIndex() == page) {
+ id = cardSettings[i];
+ }
+ }
+ presenter_->SetTaskPeroid(id);
}
}
+void MainViewSample::ReloadWatchFace()
+{
+ if (mainSwipeGroup == nullptr) {
+ return;
+ }
+ mainSwipeGroup->Remove(mainClockView, UISwipeView::HORIZONTAL);
+
+ delete mainClockView;
+ mainClockView = nullptr;
+ recordCard[WATCH_FACE] = InitWatchFacePage();
+ if (recordCard[WATCH_FACE] == nullptr) {
+ GRAPHIC_LOGE("failed to reload main clock");
+ return;
+ }
+ mainSwipeGroup->HorInsert(nullptr, mainClockView);
+
+ SwitchToCard(WATCH_FACE);
+ Draw();
+}
+
bool MainViewSample::IsMainClockPage(void)
{
if (mainSwipeGroup->GetCurrentPageId(0) == mainClockView->GetViewIndex() &&
CardId *cardSettings = presenter_->GetCardSettings();
int pageId = mainSwipeGroup->GetCurrentPageId(UISwipeView::HORIZONTAL); // 0: horizontal; 1: vertical
/* pageId 与CardId 没有对应关系,需要一次转换 */
- return cardSettings[pageId];
+ for (uint8_t i = 0; i < presenter_->GetCardSettingCount(); ++i) {
+ if (cardSettings[i] < MAX_CARD && recordCard[cardSettings[i]] != nullptr &&
+ recordCard[cardSettings[i]]->GetViewIndex() == pageId) {
+ return cardSettings[i];
+ }
+ }
+ return MAX_CARD;
}
void MainViewSample::SwitchToCard(uint8_t cardId, bool loadAdjacent)
SwitchToClockPage(loadAdjacent);
}
}
-
-}
+} // OHOS
}
SetTextWithWildcardInner(tempBuf);
}
+
+void DialArcLabelView::SetLang(uint8_t lang)
+{
+ language_ = lang;
+ OnLangChange(FontGlobalManager::GetInstance()->GetCurrentLangId());
+}
+
+void DialArcLabelView::OnLangChange(uint8_t langId)
+{
+ if (language_ == FontGlobalManager::INVALID_LANG_ID) {
+ SetVisible(true);
+ } else if (language_ == langId) {
+ SetVisible(true);
+ } else {
+ SetVisible(false);
+ }
+}
}
\ No newline at end of file
parent_ = parent;
}
+void DialDigitalImgView::OnTimeUpdate(const struct tm &curTime)
+{
+ bool isVisible = false;
+ if (IsInTimeInterval(curTime)) {
+ isVisible = true;
+ }
+ for (uint8_t i = 0; i < imgCnt_; ++i) {
+ imgs_[i]->SetVisible(isVisible);
+ }
+ SetVisible(isVisible);
+}
+
void DialDigitalImgView::SetDecimalPrecision(uint8_t precision)
{
decimalPrecision_ = precision;
void DialDigitalImgView::HandleFloatData(float data)
{
+ if (!IsVisible()) {
+ return;
+ }
if (isValueSet_ && FloatEqual(value_, data)) {
return;
}
}
SetTextWithWildcardInner(tempBuf);
}
+
+void DialLabelView::SetLang(uint8_t lang)
+{
+ language_ = lang;
+ OnLangChange(FontGlobalManager::GetInstance()->GetCurrentLangId());
+}
+
+void DialLabelView::OnLangChange(uint8_t langId)
+{
+ if (language_ == FontGlobalManager::INVALID_LANG_ID) {
+ SetVisible(true);
+ } else if (language_ == langId) {
+ SetVisible(true);
+ } else {
+ SetVisible(false);
+ }
+}
}
\ No newline at end of file
#include "sys/time.h"
#include "RegisterDialModel.h"
#include "DialModelTime.h"
+#include "components/root_view.h"
#define REGIST_DIAL_MODULE_ANGLE_H(type, func) static OHOS::RegisterDialModel(REGIST_ANGLE_H)(type, func)
#define REGIST_DIAL_MODULE_ANGLE_M(type, func) static OHOS::RegisterDialModel(REGIST_ANGLE_M)(type, func)
#define REGIST_DIAL_MODULE_WEEK(type, func) static OHOS::RegisterDialModel(REGIST_WEEK)(type, func)
#define REGIST_DIAL_MODULE_MOUNTH(type, func) static OHOS::RegisterDialModel(REGIST_MOUNTH)(type, func)
#define REGIST_DIAL_MODULE_YEAR(type, func) static OHOS::RegisterDialModel(REGIST_YEAR)(type, func)
+#define REGIST_DIAL_MODULE_GEAR_ONE(type, func) static OHOS::RegisterDialModel(REGIST_GEAR_ONE)(type, func)
+#define REGIST_DIAL_MODULE_GEAR_TWO(type, func) static OHOS::RegisterDialModel(REGIST_GEAR_TWO)(type, func)
+#define REGIST_DIAL_MODULE_GEAR_THREE(type, func) static OHOS::RegisterDialModel(REGIST_GEAR_THREE)(type, func)
+#define REGIST_DIAL_MODULE_GEAR_FOUR(type, func) static OHOS::RegisterDialModel(REGIST_GEAR_FOUR)(type, func)
+#define REGIST_DIAL_MODULE_GEAR_FIVE(type, func) static OHOS::RegisterDialModel(REGIST_GEAR_FIVE)(type, func)
+#define REGIST_DIAL_MODULE_GEAR_SIX(type, func) static OHOS::RegisterDialModel(REGIST_GEAR_SIX)(type, func)
REGIST_DIAL_MODULE_ANGLE_H(DialDataType::DATA_TYPE_CLOCK_ANGLE_H, OHOS::DialModelTime::GetInstance());
REGIST_DIAL_MODULE_ANGLE_M(DialDataType::DATA_TYPE_CLOCK_ANGLE_M, OHOS::DialModelTime::GetInstance());
REGIST_DIAL_MODULE_MOUNTH(DialDataType::DATA_TYPE_TIME_MONTH, OHOS::DialModelTime::GetInstance());
REGIST_DIAL_MODULE_YEAR(DialDataType::DATA_TYPE_TIME_YEAR, OHOS::DialModelTime::GetInstance());
+REGIST_DIAL_MODULE_GEAR_ONE(DialDataType::DATA_TYPE_SWIVEL_GEAR_ONE, OHOS::DialModelTime::GetInstance());
+REGIST_DIAL_MODULE_GEAR_TWO(DialDataType::DATA_TYPE_SWIVEL_GEAR_TWO, OHOS::DialModelTime::GetInstance());
+REGIST_DIAL_MODULE_GEAR_THREE(DialDataType::DATA_TYPE_SWIVEL_GEAR_THREE, OHOS::DialModelTime::GetInstance());
+REGIST_DIAL_MODULE_GEAR_FOUR(DialDataType::DATA_TYPE_SWIVEL_GEAR_FOUR, OHOS::DialModelTime::GetInstance());
+REGIST_DIAL_MODULE_GEAR_FIVE(DialDataType::DATA_TYPE_SWIVEL_GEAR_FIVE, OHOS::DialModelTime::GetInstance());
+REGIST_DIAL_MODULE_GEAR_SIX(DialDataType::DATA_TYPE_SWIVEL_GEAR_SIX, OHOS::DialModelTime::GetInstance());
+
namespace OHOS {
static constexpr int16_t S_MS_US_TRANS = 1000; // 1000: seconds, milliseconds, microsecond transform value
-static constexpr uint16_t CIRCLE_IN_DEGREE = 360; // 360: A full rotation: 360 degrees
static constexpr uint8_t ONE_MINUTE_IN_SECOND = 60; // 60: 60 seconds per minute
static constexpr uint8_t ONE_HOUR_IN_MINUTE = 60; // 60: 60 minutes per hour
static constexpr uint8_t HALF_DAY_IN_HOUR = 12; // 60: 12 hours every half day
angleM_ = ConvertHandValueToAngle(tblock_->tm_min, ONE_HOUR_IN_MINUTE, tblock_->tm_sec, ONE_MINUTE_IN_SECOND);
angleS_ = ConvertHandValueToAngle(tblock_->tm_sec, ONE_MINUTE_IN_SECOND, 0, 1);
angleMS_ = ConvertHandSecondValueToAngle(realMS, S_MS_US_TRANS * ONE_MINUTE_IN_SECOND);
+
+ if (tblock_ == nullptr) {
+ return;
+ }
+ for (ListNode<TimeChangeListener*>* node = listeners_.Head(); node != listeners_.End(); node = node->next_) {
+ TimeChangeListener *listener = node->data_;
+ if (listener != nullptr) {
+ listener->OnTimeUpdate(*tblock_);
+ }
+ }
+ RootView::GetInstance()->Invalidate();
+}
+
+void DialModelTime::Register(TimeChangeListener* listener)
+{
+ if (listener == nullptr) {
+ return;
+ }
+ for (ListNode<TimeChangeListener*>* node = listeners_.Head(); node != listeners_.End(); node = node->next_) {
+ TimeChangeListener *tmp = node->data_;
+ if (tmp == listener) {
+ return;
+ }
+ }
+ listeners_.PushBack(listener);
+}
+
+void DialModelTime::Unregister(TimeChangeListener* listener)
+{
+ if (listener == nullptr) {
+ return;
+ }
+ for (ListNode<TimeChangeListener*>* node = listeners_.Head(); node != listeners_.End(); node = node->next_) {
+ TimeChangeListener *tmp = node->data_;
+ if (tmp == listener) {
+ listeners_.Remove(node);
+ return;
+ }
+ }
}
bool DialModelTime::GetDialFloatData(DialDataType& type, float& out)
case DialDataType::DATA_TYPE_TIME_SECOND:
out = static_cast<float>(tblock_->tm_sec);
break;
+ case DialDataType::DATA_TYPE_SWIVEL_GEAR_TWO:
+ case DialDataType::DATA_TYPE_SWIVEL_GEAR_THREE:
+ case DialDataType::DATA_TYPE_SWIVEL_GEAR_FIVE: {
+ float coeff = 6.0f; // 6.0: coeff
+ float accleratedAngle = angleMS_ * coeff - floor(angleMS_ * coeff / CIRCLE_IN_DEGREE) * CIRCLE_IN_DEGREE;
+ out = static_cast<float>(accleratedAngle * -1.0 + CIRCLE_IN_DEGREE);
+ break;
+ }
+ case DialDataType::DATA_TYPE_SWIVEL_GEAR_ONE:
+ case DialDataType::DATA_TYPE_SWIVEL_GEAR_FOUR:
+ case DialDataType::DATA_TYPE_SWIVEL_GEAR_SIX: {
+ float coeff = 6.0f; // 6.0: coeff
+ float accleratedAngle = angleMS_ * coeff - floor(angleMS_ * coeff / CIRCLE_IN_DEGREE) * CIRCLE_IN_DEGREE;
+ out = static_cast<float>(accleratedAngle);
+ break;
+ }
default:
return false;
}
selected_ = selected;
SetSrc(&info_[selected_]);
}
+
+void DialOptionImgView::SetLang(uint8_t lang)
+{
+ language_ = lang;
+ OnLangChange(FontGlobalManager::GetInstance()->GetCurrentLangId());
+}
+
+void DialOptionImgView::OnLangChange(uint8_t langId)
+{
+ if (language_ == FontGlobalManager::INVALID_LANG_ID) {
+ langVisible_ = true;
+ } else if (language_ == langId) {
+ langVisible_ = true;
+ } else {
+ langVisible_ = false;
+ }
+ SetVisible(langVisible_ && timeVisible_);
+}
+
+void DialOptionImgView::OnTimeUpdate(const struct tm &curTime)
+{
+ if (IsInTimeInterval(curTime)) {
+ timeVisible_ = true;
+ } else {
+ timeVisible_ = false;
+ }
+ SetVisible(langVisible_ && timeVisible_);
+}
}
\ No newline at end of file
--- /dev/null
+/*
+ * Copyright (c) CompanyNameMagicTag 2025. All rights reserved.
+ * Description: DialSequenceContainer
+ * Author:
+ * Create: 2025-03-05
+ */
+
+#include "DialSequenceContainer.h"
+
+namespace OHOS {
+DialSequenceContainer::DialSequenceContainer()
+{
+ SetTouchable(true);
+ SetStyle(STYLE_BACKGROUND_OPA, OPA_TRANSPARENT);
+ memset_s(nonCycleView_, sizeof(nonCycleView_), 0, sizeof(nonCycleView_));
+}
+
+DialSequenceContainer::~DialSequenceContainer()
+{
+ if (repeatView_ != nullptr) {
+ delete repeatView_;
+ repeatView_ = nullptr;
+ }
+
+ for (uint8_t i = 0; i < nonCycleNum_; ++i) {
+ delete nonCycleView_[i];
+ nonCycleView_[i] = nullptr;
+ }
+ nonCycleNum_ = 0;
+ curView_ = nullptr;
+}
+
+bool DialSequenceContainer::AddSequenceRes(uint16_t interval, bool repeat,
+ const ImageAnimatorInfo *imgSrc, uint8_t imgNum)
+{
+ if (imgSrc == nullptr || imgNum == 0) {
+ return false;
+ }
+
+ // add animator images to view
+ if (repeat) {
+ if (repeatView_ != nullptr) {
+ GRAPHIC_LOGE("the repeat seq view has existed!");
+ return false;
+ }
+ repeatView_ = new UIImageAnimatorView;
+ repeatView_->SetImageAnimatorSrc(imgSrc, imgNum, interval);
+ repeatView_->SetRepeat(false);
+ } else {
+ if (nonCycleNum_ >= sizeof(nonCycleView_) / sizeof(nonCycleView_[0])) {
+ GRAPHIC_LOGE("non cycle seq views have been exceedeed!");
+ return false;
+ }
+ nonCycleView_[nonCycleNum_] = new UIImageAnimatorView;
+ nonCycleView_[nonCycleNum_]->SetImageAnimatorSrc(imgSrc, imgNum, interval);
+ nonCycleView_[nonCycleNum_]->SetRepeat(false);
+ ++nonCycleNum_;
+ }
+
+ // update rect area
+ Rect rect(GetRelativeRect());
+ for (uint8_t i = 0; i < imgNum; ++i) {
+ rect.JoinRect(rect,
+ Rect(rect.GetX(),
+ rect.GetY(),
+ rect.GetX() + imgSrc[i].width - 1,
+ rect.GetY() + imgSrc[i].height - 1));
+ }
+ rect.JoinRect(rect, GetRelativeRect());
+ SetPosition(rect.GetX(), rect.GetY());
+ SetWidth(rect.GetWidth());
+ SetHeight(rect.GetHeight());
+ Invalidate();
+
+ return true;
+}
+
+bool DialSequenceContainer::OnClickEvent(const ClickEvent& event)
+{
+ if (curView_ == nullptr) {
+ return false;
+ }
+ uint8_t curState = curView_->GetState();
+ switch (curState) {
+ case Animator::STOP: {
+ if (curView_ == repeatView_) {
+ isClick_ = true;
+ } else {
+ UpdateCurrentView();
+ Start();
+ }
+ break;
+ }
+ case Animator::PAUSE: {
+ return false;
+ }
+ case Animator::RUNNING:
+ case Animator::START: {
+ if (curView_ == repeatView_) {
+ isClick_ = true;
+ }
+ break;
+ }
+ default: {
+ GRAPHIC_LOGE("error state");
+ }
+ }
+
+ return UIViewGroup::OnClickEvent(event);
+}
+
+void DialSequenceContainer::Start()
+{
+ if (curView_ != nullptr) {
+ curView_->Start();
+ return;
+ }
+
+ UpdateCurrentView();
+ if (curView_ == nullptr) {
+ return;
+ }
+ curView_->Start();
+}
+
+void DialSequenceContainer::Stop()
+{
+ if (curView_ != nullptr) {
+ curView_->Stop();
+ return;
+ }
+
+ UpdateCurrentView();
+ if (curView_ == nullptr) {
+ return;
+ }
+ curView_->Stop();
+}
+
+void DialSequenceContainer::Pause()
+{
+ if (curView_ != nullptr) {
+ curView_->Pause();
+ return;
+ }
+
+ UpdateCurrentView();
+ if (curView_ == nullptr) {
+ return;
+ }
+ curView_->Pause();
+}
+
+void DialSequenceContainer::Resume()
+{
+ if (curView_ != nullptr) {
+ curView_->Resume();
+ return;
+ }
+
+ UpdateCurrentView();
+ if (curView_ == nullptr) {
+ return;
+ }
+ curView_->Resume();
+}
+
+void DialSequenceContainer::OnAnimatorStop(UIView& view)
+{
+ bool isClick = isClick_;
+ isClick_ = false;
+ bool isRepeat = (curView_ == repeatView_);
+ if (isRepeat && isClick) {
+ UpdateCurrentView();
+ Start();
+ } else if (isRepeat && !isClick) {
+ Start();
+ } else {
+ if (repeatView_ != nullptr) {
+ UpdateCurrentView();
+ Start();
+ }
+ }
+}
+
+void DialSequenceContainer::UpdateCurrentView()
+{
+ if (curView_ != nullptr) {
+ if (repeatView_ != nullptr && nonCycleNum_ == 0) {
+ return;
+ } else if (repeatView_ == nullptr && nonCycleNum_ != 0) {
+ Remove(curView_);
+ curView_ = nonCycleView_[loop_];
+ loop_ = (loop_ + 1) % nonCycleNum_;
+ curView_->SetAnimatorStopListener(this);
+ Add(curView_);
+ Invalidate();
+ return;
+ }
+
+ // both repeat and noncycle exist
+ Remove(curView_);
+ if (curView_ == repeatView_) {
+ curView_ = nonCycleView_[loop_];
+ loop_ = (loop_ + 1) % nonCycleNum_;
+ } else {
+ curView_ = repeatView_;
+ }
+ curView_->SetAnimatorStopListener(this);
+ Add(curView_);
+ Invalidate();
+ return;
+ }
+
+ if (repeatView_ != nullptr) {
+ curView_ = repeatView_;
+ } else if (nonCycleNum_ != 0) {
+ curView_ = nonCycleView_[loop_];
+ loop_ = (loop_ + 1) % nonCycleNum_;
+ } else {
+ GRAPHIC_LOGE("sequence img has not been added!");
+ return;
+ }
+ curView_->SetAnimatorStopListener(this);
+ Add(curView_);
+ Invalidate();
+}
+} // namespace OHOS
SetAutoEnable(true);
}
-DialStaticImgView::~DialStaticImgView() {}
+DialStaticImgView::~DialStaticImgView()
+{
+ if (info_ != nullptr) {
+ UIFree(info_);
+ info_ = nullptr;
+ }
+}
+
+void DialStaticImgView::SetLang(uint8_t lang)
+{
+ language_ = lang;
+ OnLangChange(FontGlobalManager::GetInstance()->GetCurrentLangId());
+}
+
+void DialStaticImgView::OnLangChange(uint8_t langId)
+{
+ if (language_ == FontGlobalManager::INVALID_LANG_ID) {
+ langVisible_ = true;
+ } else if (language_ == langId) {
+ langVisible_ = true;
+ } else {
+ langVisible_ = false;
+ }
+ SetVisible(langVisible_ && timeVisible_);
+}
+
+bool DialStaticImgView::SetImgs(const ImageInfo* src, uint8_t num)
+{
+ if (src == nullptr || num == 0) {
+ return false;
+ }
+ if (info_ != nullptr) {
+ UIFree(info_);
+ info_ = nullptr;
+ }
+ uint32_t size = sizeof(ImageInfo) * num;
+ info_ = static_cast<ImageInfo*>(UIMalloc(size));
+ if (info_ == nullptr) {
+ return false;
+ }
+ if (memcpy_s(info_, size, src, size) != EOK) {
+ UIFree(info_);
+ return false;
+ }
+ infoNum_ = num;
+ selected_ = 0;
+ SetSrc(&info_[selected_]);
+ SetTouchable(infoNum_ > 1);
+ return true;
+}
+
+bool DialStaticImgView::OnClickEvent(const ClickEvent& event)
+{
+ if (selected_ < 0 || info_ == nullptr || infoNum_ == 0) {
+ return false;
+ }
+ selected_ = (selected_ + 1) % infoNum_;
+ SetSrc(&info_[selected_]);
+ return true;
+}
+
+void DialStaticImgView::OnTimeUpdate(const struct tm &curTime)
+{
+ if (IsInTimeInterval(curTime)) {
+ timeVisible_ = true;
+ } else {
+ timeVisible_ = false;
+ }
+ SetVisible(langVisible_ && timeVisible_);
+}
}
\ No newline at end of file
--- /dev/null
+/*
+ * Copyright (c) CompanyNameMagicTag 2025. All rights reserved.
+ * Description: DialTimePublisher
+ * Author:
+ * Create: 2025-03-04
+ */
+
+#include "DialTimePublisher.h"
+#include "securec.h"
+#include "gfx_utils/mem_api.h"
+#include "gfx_utils/graphic_log.h"
+
+namespace OHOS {
+DialTimePublisher *DialTimePublisher::publisher_ = nullptr;
+
+void DialTimePublisher::TimeChangeListener::SetTimeInervals(TimeInterval *intervals, uint8_t num)
+{
+ if (intervals == nullptr || num == 0) {
+ return;
+ }
+ if (intervals_ != nullptr) {
+ UIFree(intervals_);
+ intervals_ = nullptr;
+ }
+ num_ = 0;
+
+ intervals_ = static_cast<TimeInterval*>(UIMalloc(sizeof(TimeInterval) * num));
+ if (intervals_ == nullptr) {
+ GRAPHIC_LOGE("failed to malloc!");
+ return;
+ }
+ num_ = num;
+ memcpy_s(intervals_, sizeof(TimeInterval) * num, intervals, sizeof(TimeInterval) * num);
+}
+
+bool DialTimePublisher::TimeChangeListener::IsInTimeInterval(const struct tm &curTime)
+{
+ if (num_ == 0) { // 0-24
+ return true;
+ }
+ for (uint8_t i = 0; i < num_; ++i) {
+ if (intervals_[i].start <= curTime.tm_hour && intervals_[i].end > curTime.tm_hour) {
+ return true;
+ }
+ }
+ return false;
+}
+
+DialTimePublisher::TimeChangeListener::TimeChangeListener()
+{
+ if (DialTimePublisher::GetPublisher() != nullptr) {
+ DialTimePublisher::GetPublisher()->Register(this);
+ }
+}
+
+DialTimePublisher::TimeChangeListener::~TimeChangeListener()
+{
+ if (intervals_ != nullptr) {
+ UIFree(intervals_);
+ intervals_ = nullptr;
+ }
+ num_ = 0;
+ if (DialTimePublisher::GetPublisher() != nullptr) {
+ DialTimePublisher::GetPublisher()->Unregister(this);
+ }
+}
+
+void DialTimePublisher::SetPublisher(DialTimePublisher *publisher)
+{
+ publisher_ = publisher;
+}
+
+DialTimePublisher *DialTimePublisher::GetPublisher()
+{
+ return publisher_;
+}
+} // namespace OHOS
\ No newline at end of file
--- /dev/null
+/*
+ * Copyright (c) CompanyNameMagicTag 2025. All rights reserved.
+ * Description: DialViewContainer
+ * Author:
+ * Create: 2025-02-06
+ */
+
+#include "DialViewContainer.h"
+#include "DialDigitalImgView.h"
+
+namespace OHOS {
+DialViewContainer::~DialViewContainer()
+{
+ ListNode<SubView>* viewNode = dialViews_.Head();
+ while (viewNode != dialViews_.End()) {
+ UIViewGroup::Remove(viewNode->data_.view);
+ delete viewNode->data_.view;
+ viewNode = viewNode->next_;
+ }
+ dialViews_.Clear();
+}
+
+void DialViewContainer::AddView(UIView* view)
+{
+ if (view == nullptr) {
+ return;
+ }
+ Add(view);
+ SubView info = {
+ .view = view,
+ .dialView = nullptr,
+ };
+ DialViewContainer *container = dynamic_cast<DialViewContainer*>(view);
+ if (container != nullptr && container->HasInvalidBindData()) {
+ hasInvalidBindData_ = true;
+ }
+ dialViews_.PushBack(info);
+}
+
+void DialViewContainer::AddView(DialDataType type, DialView* view, bool isPeriodic)
+{
+ if (view == nullptr) {
+ return;
+ }
+ UIView *uiView = dynamic_cast<UIView*>(view);
+ if (uiView == nullptr) {
+ return;
+ }
+ Add(uiView);
+ DialDigitalImgView *digital = dynamic_cast<DialDigitalImgView*>(view);
+ if (digital != nullptr) {
+ digital->SetParent(this);
+ }
+ SubView info = {
+ .view = uiView,
+ .dialView = view,
+ .type = type,
+ .isPeriodic = isPeriodic
+ };
+ if (type == DialDataType::DATA_TYPE_MAX) {
+ hasInvalidBindData_ = true;
+ }
+ dialViews_.PushBack(info);
+}
+
+bool DialViewContainer::RemoveSubView(uint8_t index, SubView &subView)
+{
+ if (index >= dialViews_.Size()) {
+ return false;
+ }
+ ListNode<SubView> *it = Begin();
+ for (uint8_t i = 0; i < index; ++i) {
+ it = it->next_;
+ }
+ subView = it->data_;
+ Remove(subView.view);
+ DialDigitalImgView *digital = dynamic_cast<DialDigitalImgView*>(subView.view);
+ if (digital != nullptr) {
+ digital->SetParent(nullptr);
+ }
+ dialViews_.Remove(it);
+ return true;
+}
+
+bool DialViewContainer::IsInvalidateBindData(uint8_t index)
+{
+ if (index >= dialViews_.Size()) {
+ return false;
+ }
+ ListNode<SubView> *it = Begin();
+ for (uint8_t i = 0; i < index; ++i) {
+ it = it->next_;
+ }
+ if (it->data_.dialView != nullptr && it->data_.type == DialDataType::DATA_TYPE_MAX) {
+ return true;
+ }
+ DialViewContainer *container = dynamic_cast<DialViewContainer*>(it->data_.view);
+ if (container != nullptr) {
+ return container->HasInvalidBindData();
+ }
+ return false;
+}
+} // namespace OHOS
\ No newline at end of file
#include "ui_screennotify.h"
#endif
#include "MainPresenterSample.h"
+#include "DialDigitalImgView.h"
namespace OHOS {
-static DialVideoView* g_video = nullptr;
-
-#ifdef SUPPORT_OHOSFWK
-static void ScreenStatusNotify(ScreenStatus status)
-{
- if (g_video == nullptr) {
- return;
- }
- if (status == SCREEN_STATUS_OFF) {
- g_video->PausePlay();
- } else if (status == SCREEN_STATUS_ON) {
- if (g_video->IsPaused()) {
- g_video->ResumePlay();
- } else if (!g_video->IsPlayed()) {
- g_video->StartPlay();
- }
- }
-}
-#endif
-
DialViewGroup::DialViewGroup(void)
{
SetTouchable(true);
DialViewGroup::~DialViewGroup(void)
{
- if (video_ != nullptr) {
-#ifdef SUPPORT_OHOSFWK
- deregisterNotifyScreenStatus(ScreenStatusNotify);
-#endif
- g_video = nullptr;
- }
if (kaleidoscope_ != nullptr) {
kaleidoscope_->ClearFocus();
kaleidoscope_ = nullptr;
periodicUpdateTypes_.Clear();
- dataTypeMap_.clear();
+ ClearViews();
ListNode<UIView*>* viewNode = dialViews_.Head();
while (viewNode != dialViews_.End()) {
}
dialViews_.Clear();
+ rollingLabelList_.Clear();
+ imgAnimList_.Clear();
+ seqList_.Clear();
+
period_ = DEFAULT_TASK_PERIOD;
video_ = nullptr;
view->HandleFloatData(floatsData, num);
}
}
+void DialViewGroup::DoStop(void)
+{
+ SetLableAnimatorState(Animator::PAUSE);
+ SetImgAnimatorState(Animator::PAUSE);
+ if (video_ != nullptr && !video_->IsStopped()) {
+ video_->StopPlay();
+ }
+ if (kaleidoscope_ != nullptr) {
+ kaleidoscope_->StopRotateAnimator();
+ kaleidoscope_->ClearFocus();
+ }
+}
-void DialViewGroup::AddView(UIView* view, bool isDialVideoView)
+void DialViewGroup::DoStart(void)
{
- if (view == nullptr) {
- GRAPHIC_LOGE("Parameter is nullptr.\n");
- return;
+ SetLableAnimatorState(Animator::START);
+ SetImgAnimatorState(Animator::START);
+ if (video_ != nullptr) {
+ if (video_->IsPaused()) {
+ video_->ResumePlay();
+ } else if (!video_->IsPlayed()) {
+ video_->StartPlay();
+ }
}
- dialViews_.PushBack(view);
- Add(view);
+ if (kaleidoscope_ != nullptr) {
+ kaleidoscope_->RequestFocus();
+ kaleidoscope_->StartRotateAnimator();
+ }
+}
- if (view->GetViewType() == UI_KALEIDOSCOPE_VIEW) {
- kaleidoscope_ = dynamic_cast<UIKaleidoscopeView*>(view);
+void DialViewGroup::DoPause(void)
+{
+ SetLableAnimatorState(Animator::PAUSE);
+ SetImgAnimatorState(Animator::PAUSE);
+ if (kaleidoscope_ != nullptr) {
+ kaleidoscope_->StopRotateAnimator();
+ kaleidoscope_->ClearFocus();
}
+ if (video_ != nullptr) {
+ video_->PausePlay();
+ }
+}
- if (isDialVideoView) {
+void DialViewGroup::RecordSpecial(UIView *view)
+{
+ if (dynamic_cast<UILabel*>(view) != nullptr) {
+ UILabel* label = dynamic_cast<UILabel*>(view);
+ uint8_t mode = label->GetLineBreakMode();
+ if (mode == UILabel::LINE_BREAK_MARQUEE || mode == UILabel::LINE_BREAK_OSCILLATION) {
+ rollingLabelList_.PushBack(label);
+ }
+ } else if (dynamic_cast<UIImageAnimatorView*>(view) != nullptr) {
+ UIImageAnimatorView* imgAnim = dynamic_cast<UIImageAnimatorView*>(view);
+ imgAnimList_.PushBack(imgAnim);
+ } else if (dynamic_cast<UIKaleidoscopeView*>(view) != nullptr) {
+ kaleidoscope_ = dynamic_cast<UIKaleidoscopeView*>(view);
+ } else if (dynamic_cast<UILiteSurfaceView*>(view) != nullptr) {
if (video_ != nullptr) {
GRAPHIC_LOGE("Already added a video view.\n");
return;
}
video_ = reinterpret_cast<DialVideoView*>(view);
- g_video = video_;
-#ifdef SUPPORT_OHOSFWK
- registerNotifyScreenStatus(ScreenStatusNotify);
-#endif
+ } else if (dynamic_cast<DialSequenceContainer*>(view) != nullptr) {
+ DialSequenceContainer *seq = dynamic_cast<DialSequenceContainer*>(view);
+ seqList_.PushBack(seq);
}
}
-void DialViewGroup::AddView(DialDataType type, DialView* view, bool isPeriodic)
+void DialViewGroup::RecordBindData(DialDataType type, DialView* view, bool isPeriodic)
{
- if (view == nullptr) {
- GRAPHIC_LOGE("Parameter is nullptr.\n");
- return;
+ if (dynamic_cast<UILabel*>(view) != nullptr) {
+ UILabel* label = dynamic_cast<UILabel*>(view);
+ uint8_t mode = label->GetLineBreakMode();
+ if (mode == UILabel::LINE_BREAK_MARQUEE || mode == UILabel::LINE_BREAK_OSCILLATION) {
+ rollingLabelList_.PushBack(label);
+ }
}
- dataTypeMap_.insert(std::make_pair(static_cast<int16_t>(type), view));
+ auto it = dataTypeMap_.find(static_cast<int16_t>(type));
+ if (it != dataTypeMap_.end()) {
+ it->second->PushBack(view);
+ } else {
+ Views *container = new Views;
+ if (container == nullptr) {
+ GRAPHIC_LOGE("failed to alloc binddata container");
+ return;
+ }
+ container->PushBack(view);
+ dataTypeMap_.insert(std::make_pair(static_cast<int16_t>(type), container));
+ viewsMemPool_.PushBack(container);
+ }
if (isPeriodic) {
periodicUpdateTypes_.PushBack(type);
} else {
ModelDialDataFactory::GetInstance().RegisterDialDataListener(type, this);
passiveUpdateTypes_.PushBack(type);
}
+}
+
+void DialViewGroup::ClearViews()
+{
+ dataTypeMap_.clear();
+ for (uint16_t i = 0; i < viewsMemPool_.Size(); ++i) {
+ delete viewsMemPool_[i];
+ }
+ viewsMemPool_.Clear();
+}
+
+void DialViewGroup::AddView(UIView* view)
+{
+ if (view == nullptr) {
+ GRAPHIC_LOGE("Parameter is nullptr.\n");
+ return;
+ }
+ dialViews_.PushBack(view);
+ Add(view);
+ DialViewContainer *container = dynamic_cast<DialViewContainer*>(view);
+ if (container != nullptr) {
+ ListNode<DialViewContainer::SubView> *head = container->Begin();
+ for (;head != container->End(); head = head->next_) {
+ DialViewContainer::SubView &subView = head->data_;
+ if (subView.dialView != nullptr) {
+ RecordBindData(subView.type, subView.dialView, subView.isPeriodic);
+ ProcessData(subView.type, subView.dialView);
+ } else if (subView.view != nullptr) {
+ RecordSpecial(subView.view);
+ }
+ }
+ } else {
+ RecordSpecial(view);
+ }
+}
+
+void DialViewGroup::AddView(DialDataType type, DialView* view, bool isPeriodic)
+{
+ if (view == nullptr) {
+ GRAPHIC_LOGE("Parameter is nullptr.\n");
+ return;
+ }
+
+ DialDigitalImgView *digital = dynamic_cast<DialDigitalImgView*>(view);
+ if (digital != nullptr) {
+ digital->SetParent(this);
+ }
+ RecordBindData(type, view, isPeriodic);
dialViews_.PushBack(dynamic_cast<UIView*>(view));
Add(dynamic_cast<UIView*>(view));
ProcessData(type, view);
DialDataType type = node->data_;
auto iter = dataTypeMap_.find(static_cast<int16_t>(type));
if (iter != dataTypeMap_.end()) {
- ProcessData(type, iter->second);
+ Views *container = iter->second;
+ for (uint16_t i = 0; i < container->Size(); ++i) {
+ ProcessData(type, (*container)[i]);
+ }
}
node = node->next_;
}
{
auto iter = dataTypeMap_.find(static_cast<int16_t>(type));
if (iter != dataTypeMap_.end()) {
- DialView* view = iter->second;
- view->HandleFloatData(data);
+ Views *container = iter->second;
+ for (uint16_t i = 0; i < container->Size(); ++i) {
+ DialView* view = (*container)[i];
+ view->HandleFloatData(data);
+ }
}
}
{
auto iter = dataTypeMap_.find(static_cast<int16_t>(type));
if (iter != dataTypeMap_.end()) {
- DialView* view = iter->second;
- view->HandleFloatData(data, num);
+ Views *container = iter->second;
+ for (uint16_t i = 0; i < container->Size(); ++i) {
+ DialView* view = (*container)[i];
+ view->HandleFloatData(data, num);
+ }
}
}
{
auto iter = dataTypeMap_.find(static_cast<int16_t>(type));
if (iter != dataTypeMap_.end()) {
- DialView* view = iter->second;
- view->HandleTextData(data, num);
+ Views *container = iter->second;
+ for (uint16_t i = 0; i < container->Size(); ++i) {
+ DialView* view = (*container)[i];
+ view->HandleTextData(data, num);
+ }
}
}
void DialViewGroup::ScrollBegin(bool isActive)
{
- if (kaleidoscope_ != nullptr) {
- if (isActive) {
- kaleidoscope_->ClearFocus();
- kaleidoscope_->StopRotateAnimator();
- }
- return;
- }
-
- if (video_ == nullptr) {
- return;
+ if (isActive) {
+ DoPause();
}
- video_->PausePlay();
}
void DialViewGroup::ScrollEnd(bool isActive)
return;
}
- if (kaleidoscope_ != nullptr) {
- if (isActive) {
- kaleidoscope_->StartRotateAnimator();
- kaleidoscope_->RequestFocus();
- }
- return;
- }
-
- if (video_ == nullptr) {
- return;
- }
-
if (isActive) {
- if (video_->IsPaused()) {
- video_->ResumePlay();
- } else if (!video_->IsPlayed()) {
- video_->StartPlay();
- }
- g_video = video_;
+ DoStart();
} else {
- if (!video_->IsStopped()) {
+ if (video_ != nullptr && !video_->IsStopped()) {
video_->StopPlay();
}
- ClearCache();
- g_video = nullptr;
+ if (video_ != nullptr) {
+ ClearCache();
+ }
}
}
void DialViewGroup::CoverBegin(bool isCovered)
{
- if (kaleidoscope_ != nullptr) {
- if (!isCovered) {
- kaleidoscope_->StopRotateAnimator();
- kaleidoscope_->ClearFocus();
- }
- return;
+ if (!isCovered) {
+ DoPause();
}
+}
- if (video_ == nullptr) {
+void DialViewGroup::CoverEnd(bool isCovered)
+{
+ MainPresenterSample* mainPresenter = MainPresenterSample::GetInstance();
+ if ((mainPresenter == nullptr) || (mainPresenter->GetMainPresenterState() != MainPresenterState::RESUME)) {
return;
}
- video_->PausePlay();
+ if (!isCovered) {
+ DoStart();
+ }
}
-void DialViewGroup::CoverEnd(bool isCovered)
+void DialViewGroup::OnActive(void)
{
MainPresenterSample* mainPresenter = MainPresenterSample::GetInstance();
if ((mainPresenter == nullptr) || (mainPresenter->GetMainPresenterState() != MainPresenterState::RESUME)) {
return;
}
- if (kaleidoscope_ != nullptr) {
- if (!isCovered) {
- kaleidoscope_->RequestFocus();
- kaleidoscope_->StartRotateAnimator();
- }
- return;
- }
- if (video_ == nullptr) {
+ DoStart();
+}
+
+void DialViewGroup::OnInactive(void)
+{
+ DoStop();
+}
+
+void DialViewGroup::OnCovered(void)
+{
+ MainPresenterSample* mainPresenter = MainPresenterSample::GetInstance();
+ if ((mainPresenter == nullptr) || (mainPresenter->GetMainPresenterState() != MainPresenterState::RESUME)) {
return;
}
- if (isCovered) {
- g_video = nullptr;
- } else {
- if (video_->IsPaused()) {
- video_->ResumePlay();
- } else if (!video_->IsPlayed()) {
- video_->StartPlay();
- }
- g_video = video_;
- }
+
+ DoPause();
}
-void DialViewGroup::OnActive(void)
+void DialViewGroup::OnUncovered(void)
{
MainPresenterSample* mainPresenter = MainPresenterSample::GetInstance();
if ((mainPresenter == nullptr) || (mainPresenter->GetMainPresenterState() != MainPresenterState::RESUME)) {
return;
}
- if (video_ != nullptr) {
- if (video_->IsPaused()) {
- video_->ResumePlay();
- } else if (!video_->IsPlayed()) {
- video_->StartPlay();
- }
- g_video = video_;
- } else if (kaleidoscope_ != nullptr) {
- kaleidoscope_->RequestFocus();
- kaleidoscope_->StartRotateAnimator();
- }
+ DoStart();
}
-void DialViewGroup::OnInactive(void)
+void DialViewGroup::OnPause()
{
- if (video_ != nullptr) {
- if (!video_->IsStopped()) {
- video_->StopPlay();
- }
- g_video = nullptr;
- } else if (kaleidoscope_ != nullptr) {
- kaleidoscope_->StopRotateAnimator();
- kaleidoscope_->ClearFocus();
- }
+ DoPause();
}
MediaVideoPlay* DialViewGroup::GetVideoPlay()
}
return nullptr;
}
-}
\ No newline at end of file
+
+void DialViewGroup::SetLableAnimatorState(uint8_t state)
+{
+ if (rollingLabelList_.IsEmpty()) {
+ return;
+ }
+
+ ListNode<UILabel*>* node = rollingLabelList_.Begin();
+ while (node != rollingLabelList_.End()) {
+ if (node->data_ != nullptr) {
+ UILabel* label = node->data_;
+ label->SetAnimState(state);
+ }
+ node = node->next_;
+ }
+}
+
+void DialViewGroup::SetImgAnimatorState(uint8_t state)
+{
+ if (imgAnimList_.IsEmpty() && seqList_.IsEmpty()) {
+ return;
+ }
+
+ ListNode<UIImageAnimatorView*>* node = imgAnimList_.Begin();
+ while (node != imgAnimList_.End()) {
+ if (node->data_ != nullptr) {
+ UIImageAnimatorView* imgAnim = node->data_;
+ switch (state) {
+ case Animator::PAUSE:
+ imgAnim->Pause();
+ break;
+ case Animator::START:
+ imgAnim->Resume();
+ break;
+ }
+ }
+ node = node->next_;
+ }
+
+ ListNode<DialSequenceContainer*>* it = seqList_.Begin();
+ while (it != seqList_.End()) {
+ if (it->data_ != nullptr) {
+ switch (state) {
+ case Animator::PAUSE:
+ it->data_->Pause();
+ break;
+ case Animator::START:
+ it->data_->Resume();
+ break;
+ }
+ }
+ it = it->next_;
+ }
+}
+} // namespace OHOS
return iter->second;
}
+bool ModelDialDataFactory::IsOHBindDataExist(DialOHDataType type) const
+{
+ auto it = g_bindDataConverter.find(type);
+ if (it == g_bindDataConverter.end()) {
+ return false;
+ }
+ return IsBindDataExist(it->second);
+}
+
+bool ModelDialDataFactory::IsBindDataExist(DialDataType type) const
+{
+ auto it = models_.find(static_cast<int16_t>(type));
+ if (it != models_.end() && it->second != nullptr) {
+ return true;
+ }
+ return false;
+}
+
bool ModelDialDataFactory::RegisterDialDataListener(DialDataType type, OnDialDataUpdateListener* listener)
{
DialBaseModel* model = GetModuleByType(type);
--- /dev/null
+/*
+ * Copyright (c) CompanyNameMagicTag 2025. All rights reserved.
+ * Description: WatchInterface
+ * Author:
+ * Create: 2025-03-17
+ */
+
+#include <string>
+#include "dirent.h"
+#include "DialBinParser.h"
+#include "UiConfig.h"
+#include "WatchInterface.h"
+#include "gfx_utils/vector.h"
+#include "common/screen.h"
+#include "MainModel.h"
+#include "MainViewSample.h"
+#include "SetDialModel.h"
+#include "graphic_service.h"
+#include "NativeAbility.h"
+
+using namespace OHOS;
+namespace {
+struct {
+ Graphic::Vector<std::string> fileNames; // only for 3.0
+ Graphic::Vector<watch_dial_info> watchInfo; // only for 3.0
+} g_info;
+
+bool GetActiveWatchPath(std::string &path)
+{
+ if (MainModel::GetInstance().GetDialSetting().dialFlag == 1) {
+ path = MainModel::GetInstance().GetDialSetting().dialFullName;
+ return true;
+ }
+ return false;
+}
+
+bool GetPreviewInfo(const std::string &fileName, DialPreviewInfo &preview)
+{
+ const std::string type(".bin");
+ if (!(fileName.length() > type.length() &&
+ fileName.substr(fileName.length() - type.length(), type.length()) == type)) {
+ return false;
+ }
+ memset_s(&preview, sizeof(preview), 0, sizeof(preview));
+ FILE *file = fopen(fileName.c_str(), "rb");
+ bool isSuccess = false;
+ if (file != nullptr) {
+ isSuccess = DialBinParserManager::GetInstance()->GetDialPreviewInfo(file, &preview);
+ fclose(file);
+ }
+ return isSuccess;
+}
+
+bool ConvertPreview2WatchDialInfo(const DialPreviewInfo &preview, watch_dial_info &info)
+{
+ errno_t ret = strcpy_s(reinterpret_cast<char *>(info.watch_protocol_version),
+ sizeof(info.watch_protocol_version),
+ preview.protocolVersion);
+ if (ret != 0) {
+ GRAPHIC_LOGE("failed to copy protocol version.");
+ return false;
+ }
+
+ ret = strcpy_s(reinterpret_cast<char *>(info.watch_version), sizeof(info.watch_version), preview.watchVersion);
+ if (ret != 0) {
+ GRAPHIC_LOGE("failed to copy watch version.");
+ return false;
+ }
+ info.uuid = preview.uuid;
+ return true;
+}
+
+bool GetAllWatchInfo()
+{
+ g_info.fileNames.Clear();
+ g_info.watchInfo.Clear();
+ struct dirent *direntp = nullptr;
+
+ // ´ò¿ªÄ¿Â¼
+ DIR *dirp = opendir(APP_DIAL_PATH);
+ bool isSuccess = true;
+ // ±éÀúÎļþ
+ DialPreviewInfo info;
+ watch_dial_info watchInfo;
+ std::string activePath;
+ bool isActiveExist = GetActiveWatchPath(activePath);
+ if (dirp != nullptr) {
+ while ((direntp = readdir(dirp)) != nullptr) {
+ std::string fileName = std::string(APP_DIAL_PATH) + std::string("/") + std::string(direntp->d_name);
+ isSuccess = GetPreviewInfo(fileName, info);
+ if (!isSuccess) {
+ continue;
+ }
+
+ const std::string lowestVersion("3.0");
+ std::string curVersion(info.protocolVersion);
+ if (curVersion >= lowestVersion) {
+ isSuccess = ConvertPreview2WatchDialInfo(info, watchInfo);
+ if (!isSuccess) {
+ break;
+ }
+ watchInfo.install_state = true;
+ watchInfo.is_current_watch = isActiveExist ? (activePath == fileName) : false;
+ g_info.fileNames.PushBack(fileName);
+ g_info.watchInfo.PushBack(watchInfo);
+ }
+ }
+ }
+ // ¹Ø±ÕĿ¼
+ closedir(dirp);
+ return isSuccess;
+}
+} // namespace
+
+bool GetAllWatchFaceInfo(watch_dial_info *info, uint8_t *num, uint8_t maxCnt)
+{
+ if (info == nullptr || num == nullptr) {
+ GRAPHIC_LOGE("para error!");
+ return false;
+ }
+ if (!GetAllWatchInfo()) {
+ GRAPHIC_LOGE("failed to get all watch info.");
+ return false;
+ }
+ if (g_info.watchInfo.Size() > maxCnt) {
+ GRAPHIC_LOGE("mem is not enough.");
+ return false;
+ }
+ *num = g_info.watchInfo.Size();
+ if (*num == 0) {
+ return false;
+ }
+ if (memcpy_s(info,
+ g_info.watchInfo.Size() * sizeof(watch_dial_info),
+ &g_info.watchInfo[0],
+ g_info.watchInfo.Size() * sizeof(watch_dial_info)) != 0) {
+ GRAPHIC_LOGE("copy info error!");
+ return false;
+ }
+ return true;
+}
+
+bool GetWatchFaceInfo(uint32_t uuid, watch_dial_info *watch)
+{
+ if (watch == nullptr) {
+ GRAPHIC_LOGE("para error!");
+ return false;
+ }
+ if (!GetAllWatchInfo()) {
+ GRAPHIC_LOGE("failed to get all watch info.");
+ return false;
+ }
+ for (uint16_t i = 0; i < g_info.watchInfo.Size(); ++i) {
+ if (g_info.watchInfo[i].uuid == uuid) {
+ *watch = g_info.watchInfo[i];
+ return true;
+ }
+ }
+ return false;
+}
+
+bool GetWatchCapability(watch_dev_cap_info *capability)
+{
+ if (capability == nullptr) {
+ GRAPHIC_LOGE("para error!");
+ return false;
+ }
+ capability->kaleidoscope = true;
+ capability->effect_3D = false;
+ capability->interaction = true;
+ capability->video = true;
+ capability->video_format = (1 << CODEC_JPEG);
+ return true;
+}
+
+bool GetWatchSystemInfo(watch_sys_info *sysInfo)
+{
+ if (sysInfo == nullptr) {
+ GRAPHIC_LOGE("para error!");
+ return false;
+ }
+ sysInfo->watch_proto_support_cnt = DialBinParserManager::GetInstance()->GetSupportVersionCnt();
+ for (uint8_t i = 0; i < sysInfo->watch_proto_support_cnt; ++i) {
+ std::string version;
+ bool isSuccess = DialBinParserManager::GetInstance()->GetVersionByIndex(i, version);
+ if (!isSuccess) {
+ return false;
+ }
+ errno_t ret =
+ strcpy_s(sysInfo->watch_protocol_verion[i], sizeof(sysInfo->watch_protocol_verion[i]), version.c_str());
+ if (ret != 0) {
+ GRAPHIC_LOGE("get protocal version error!");
+ return false;
+ }
+ }
+ int ret = sprintf_s(sysInfo->resolution,
+ sizeof(sysInfo->resolution),
+ "%u*%u",
+ Screen::GetInstance().GetWidth(),
+ Screen::GetInstance().GetHeight());
+ if (ret == -1) {
+ GRAPHIC_LOGE("get resolution error!");
+ return false;
+ }
+
+ return true;
+}
+
+bool GetCurrentWatchFaceInfo(watch_dial_info *watch)
+{
+ if (watch == nullptr) {
+ GRAPHIC_LOGE("para error!");
+ return false;
+ }
+ std::string activePath;
+ if (!GetActiveWatchPath(activePath)) {
+ return false;
+ }
+
+ DialPreviewInfo preview;
+ if (!GetPreviewInfo(activePath, preview)) {
+ return false;
+ }
+
+ if (std::string(preview.protocolVersion) < std::string("3.0")) {
+ return false;
+ }
+ if (!ConvertPreview2WatchDialInfo(preview, *watch)) {
+ return false;
+ }
+ watch->install_state = true;
+ watch->is_current_watch = true;
+ return true;
+}
+
+bool SetCurrentWatchFace(uint32_t uuid)
+{
+ if (!GetAllWatchInfo()) {
+ GRAPHIC_LOGE("failed to get all watch info.");
+ return false;
+ }
+ watch_dial_info info;
+ uint16_t index = 0;
+ bool isExists = false;
+ for (uint16_t i = 0; i < g_info.watchInfo.Size(); ++i) {
+ if (uuid == g_info.watchInfo[i].uuid) {
+ isExists = true;
+ info = g_info.watchInfo[i];
+ index = i;
+ break;
+ }
+ }
+ if (!isExists) {
+ GRAPHIC_LOGE("uuid does not exist!");
+ return false;
+ }
+ if (info.is_current_watch) {
+ return true;
+ }
+
+ DialSetting setting = MainModel::GetInstance().GetDialSetting();
+ setting.dialFlag = 1;
+ setting.dialFullName = g_info.fileNames[index];
+ GraphicService::GetInstance()->PostGraphicEvent([setting]() {
+ MainModel::GetInstance().GetDialSetting() = setting;
+ MainModel::GetInstance().AddDialSetting(setting);
+ if (NativeAbility::GetInstance().GetCurSliceId() == VIEW_MAIN_SAMPLE) {
+ MainViewSample::GetInstance()->ReloadWatchFace();
+ }
+ });
+
+ return true;
+}
+
+bool UninstallWatch(uint32_t uuid)
+{
+ if (!GetAllWatchInfo()) {
+ GRAPHIC_LOGE("failed to get all watch info.");
+ return false;
+ }
+ watch_dial_info info;
+ uint16_t index = 0;
+ bool isExists = false;
+ for (uint16_t i = 0; i < g_info.watchInfo.Size(); ++i) {
+ if (uuid == g_info.watchInfo[i].uuid) {
+ isExists = true;
+ info = g_info.watchInfo[i];
+ index = i;
+ break;
+ }
+ }
+ if (!isExists) {
+ GRAPHIC_LOGE("uuid does not exist!");
+ return false;
+ }
+
+ if (info.is_current_watch) {
+ DialSetting setting = MainModel::GetInstance().GetDialSetting();
+ setting.dialFlag = 0;
+ setting.dialId = 0;
+ std::string fileName = g_info.fileNames[index];
+ GraphicService::GetInstance()->PostGraphicEvent([setting, fileName]() {
+ MainModel::GetInstance().GetDialSetting() = setting;
+ MainModel::GetInstance().AddDialSetting(setting);
+ if (NativeAbility::GetInstance().GetCurSliceId() == VIEW_MAIN_SAMPLE) {
+ MainViewSample::GetInstance()->ReloadWatchFace();
+ }
+ if (remove(fileName.c_str()) != 0) {
+ GRAPHIC_LOGE("failed to remove file %s", fileName.c_str());
+ }
+ });
+ } else {
+ if (remove(g_info.fileNames[index].c_str()) != 0) {
+ GRAPHIC_LOGE("failed to remove file %s", g_info.fileNames[index].c_str());
+ return false;
+ }
+ }
+ return true;
+}
+
+bool InstallWatch(const char *path, uint32_t *uuid)
+{
+ if (path == nullptr || uuid == nullptr) {
+ GRAPHIC_LOGE("para error!");
+ return false;
+ }
+
+ DialPreviewInfo preview;
+ if (!GetPreviewInfo(std::string(path), preview)) {
+ return false;
+ }
+ if (std::string(preview.protocolVersion) < std::string("3.0")) {
+ return false;
+ }
+ *uuid = preview.uuid;
+
+ if (!GetAllWatchInfo()) {
+ GRAPHIC_LOGE("failed to get all watchinfo!");
+ return false;
+ }
+ for (uint16_t i = 0; i < g_info.watchInfo.Size(); ++i) {
+ const std::string &fileName = g_info.fileNames[i];
+ const watch_dial_info &info = g_info.watchInfo[i];
+ if (!(info.uuid == *uuid && std::string(path) != fileName)) {
+ continue;
+ }
+
+ if (info.is_current_watch) {
+ DialSetting setting = MainModel::GetInstance().GetDialSetting();
+ setting.dialFlag = 1;
+ setting.dialFullName = std::string(path);
+ GraphicService::GetInstance()->PostGraphicEvent([setting, fileName]() {
+ MainModel::GetInstance().GetDialSetting() = setting;
+ MainModel::GetInstance().AddDialSetting(setting);
+ if (NativeAbility::GetInstance().GetCurSliceId() == VIEW_MAIN_SAMPLE) {
+ MainViewSample::GetInstance()->ReloadWatchFace();
+ }
+ if (remove(fileName.c_str()) != 0) {
+ GRAPHIC_LOGE("failed to remove file %s", fileName.c_str());
+ }
+ });
+ } else {
+ if (remove(fileName.c_str()) != 0) {
+ return false;
+ }
+ }
+ }
+
+ return true;
+}
\ No newline at end of file
MainCallingPresenter::~MainCallingPresenter()\r
{\r
WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "MainCallingPresenter::~MainCallingPresenter");\r
- RootView::GetInstance()->RemoveAll();\r
if (volumeSetting != nullptr) {\r
delete volumeSetting;\r
volumeSetting = nullptr;\r
void VocassistPresenter::OnStop(void)
{
- Presenter<MainVocassistView>::OnStop();
ScreenTurnOff();
}
}
}\r
} else if (playerState == PlayerStates::PLAYER_PAUSED || (playerState == PlayerStates::PLAYER_IDLE)) {\r
ret = playerCtr->Reset();\r
+ AudioManager::GetInstance().DeactivateAudioInterrupt(interrupt);\r
+ ClearActivateAudioInterrupt();\r
WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "Reset, ret:%d", ret);\r
}\r
}\r
#include "BluetoothPresenter.h"
#include "graphic_service.h"
#include "PhoneService.h"
+#include "MainViewSample.h"
#include "bts_avrcp_controller.h"
#include "bts_avrcp_target.h"
return false;
}
container[thisView] = group;
- RootView::GetInstance()->Add(container[thisView]);
+ MainViewSample::GetInstance()->GetRootContainer()->Add(container[thisView]);
}
// 动画开始
bluetoothEarPhoneView->BtAnimatorStart();
return false;
}
container[thisView] = group;
- RootView::GetInstance()->Add(container[thisView]);
+ MainViewSample::GetInstance()->GetRootContainer()->Add(container[thisView]);
} else {
// 刷新列表
UIList *scanList = bluetoothEarListView->GetScanUIList();
return false;
}
container[thisView] = group;
- RootView::GetInstance()->Add(container[thisView]);
+ MainViewSample::GetInstance()->GetRootContainer()->Add(container[thisView]);
}
WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "JumpView::ChangeBluetoothView");
BluetoothModel::GetInstance()->SetTagConnectView(false);
return false;
}
container[thisView] = group;
- RootView::GetInstance()->Add(container[thisView]);
+ MainViewSample::GetInstance()->GetRootContainer()->Add(container[thisView]);
}
return true;
}
return false;
}
container[thisView] = group;
- RootView::GetInstance()->Add(container[thisView]);
+ MainViewSample::GetInstance()->GetRootContainer()->Add(container[thisView]);
} else {
// 刷新列表
UIList *deviceList = bluetoothDeviceListView->GetDeviceUIList();
return false;
}
container[thisView] = group;
- RootView::GetInstance()->Add(container[thisView]);
+ MainViewSample::GetInstance()->GetRootContainer()->Add(container[thisView]);
}
BluetoothModel::GetInstance()->SetTagDisconnectView(true);
bluetoothReconnectView->RefreshBluetoothNameLabel();
return false;
}
container[thisView] = group;
- RootView::GetInstance()->Add(container[thisView]);
+ MainViewSample::GetInstance()->GetRootContainer()->Add(container[thisView]);
}
return true;
}
return false;
}
container[thisView] = group;
- RootView::GetInstance()->Add(container[thisView]);
+ MainViewSample::GetInstance()->GetRootContainer()->Add(container[thisView]);
}
if (bluetoothReconnectView == nullptr) {
WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "GapAclStateChangedCallback bluetoothReconnectView == nullptr");
return false;
}
container[thisView] = group;
- RootView::GetInstance()->Add(container[thisView]);
+ MainViewSample::GetInstance()->GetRootContainer()->Add(container[thisView]);
}
return true;
}
if (GetCurrCallNum() != 0 && GetScoConnectState() == HFP_SCO_STATE_CONNECTED) {
if (state == UICheckBox::UICheckBoxState::SELECTED) {
playersView->SetPlayerButtonState(UICheckBox::UICheckBoxState::UNSELECTED);
- playersView->GetPlayerButton()->Invalidate();
} else {
playersView->SetPlayerButtonState(UICheckBox::UICheckBoxState::SELECTED);
- playersView->GetPlayerButton()->Invalidate();
}
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[PlayerButtonOnClick] calling phone");
return;
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "volumeSetting SetUpVolume fail");
return;
}
- RootView::GetInstance()->Add(volumeSettingView);
+ MainViewSample::GetInstance()->GetRootContainer()->Add(volumeSettingView);
}
int32_t volume = AudioManager::GetInstance().GetVolume(AUDIO_STREAM_MUSIC);
WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "current volume = %d", volume);
PlayersModel::GetInstance()->SetPlayButtonState(false);
} else {
playersView->SetPlayerButtonState(UICheckBox::UICheckBoxState::UNSELECTED);
- playersView->GetPlayerButton()->Invalidate();
}
PlayerIntrptListener->RestFlag();
PlayerIntrptListener->SetPaused(true);
void PlayerInterruptListener::PausePlayer(void)
{
- PlayerPostGraphicEvent(Pause);
+ Pause();
}
static void Resume(void)
PlayersModel::GetInstance()->SetPlayButtonState(true);
} else {
playersView->SetPlayerButtonState(UICheckBox::UICheckBoxState::SELECTED);
- playersView->GetPlayerButton()->Invalidate();
}
PlayerIntrptListener->RestFlag();
PlayerIntrptListener->SetResumed(true);
void PlayerInterruptListener::ResumePlayer(void)
{
WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[PlayerInterruptListener::ResumePlayer] start");
- usleep(50000); // 确保界面切换完成
+ usleep(500000); // 确保界面切换完成
if (NativeAbility::GetInstance().GetCurSliceId() == VIEW_MAEKPHONE_SAMPLE ||
(GetCurrCallState() != HFP_HF_CALL_STATE_FINISHED && GetScoConnectState() == HFP_SCO_STATE_CONNECTED)) {
WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[PlayerInterruptListener::ResumePlayer] this is in calling");
return; // 通话界面,禁止音乐恢复播放
}
- PlayerPostGraphicEvent(Resume);
+ Resume();
}
static void Stop(void)
return;
}
playersView->SetPlayerButtonState(UICheckBox::UICheckBoxState::UNSELECTED);
- playersView->GetPlayerButton()->Invalidate();
}
// 播放器按钮复位
playersView->SetPlayerButtonState(UICheckBox::UICheckBoxState::UNSELECTED);
}
- playersView->GetPlayerButton()->Invalidate();
}
void PlayersPresenter::ShowPlayerListGroup()
if (state_ == UICheckBox::UICheckBoxState::SELECTED) {
PlayersModel::GetInstance()->SetPlayButtonState(true);
}
- RootView::GetInstance()->RemoveAll();
RemoveAll();
listGroup->RemoveAll();
delete list;
list->SetAdapter(adapterText);
}
listGroup->Add(list);
- RootView::GetInstance()->Add(listGroup);
+ MainViewSample::GetInstance()->GetRootContainer()->Add(listGroup);
UIView::OnDragListener *dragListener = (UIView::OnDragListener*)OHOS::PlayerOnDragListener::GetInstance();
if (dragListener == nullptr) {
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "PlayersView::OnDragListener fail");
void RebootView::OnStart()
{
- WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "RebootView::~OnStart");
if (RebootModel::GetInstance()->GetSelectView() == REBOOT) {
ChangeView(REBOOT_MAX, REBOOTVIEW);
} else if (RebootModel::GetInstance()->GetSelectView() == REBOOTDEVICE) {
}
}
dialInfoList.clear();
+ aodDialInfoList.clear();
}
uint8_t SetDialModel::GetPageIndex(void)
--- /dev/null
+/*
+ * Copyright (c) CompanyNameMagicTag 2023. All rights reserved.
+ */
+
+#ifndef VIDEO_CARD_H
+#define VIDEO_CARD_H
+
+#include <string>
+#include "DialDataBase.h"
+#include "components/ui_view_group.h"
+#include "OnDialDataUpdateListener.h"
+#include "components/ui_card_page.h"
+#include "components/ui_lite_surface_view.h"
+#include "video_play_wrapper.h"
+#include "DialView.h"
+
+namespace OHOS {
+class VideoCard : public UICardPage {
+public:
+ VideoCard(const VideoCard &) = delete;
+ VideoCard &operator=(const VideoCard &) = delete;
+
+ VideoCard();
+
+ ~VideoCard() override;
+
+ /**
+ * @brief This function is invoked when the function SetHorCurrentPage() is called.
+ */
+ void OnActive(void) override;
+
+ void OnInactive() override;
+
+ void PreLoad(void) override;
+
+ void ScrollBegin(bool isActive) override;
+
+ void ScrollEnd(bool isActive) override;
+
+ void SetFilePath(const std::string &path);
+
+ void SetPreviewFile(const std::string &path);
+
+ void OnPause(void) override;
+
+private:
+ void StopVideo();
+
+ void StartVideo();
+
+ void PauseVideo();
+
+ void Deinit();
+
+ void Init();
+
+ UILiteSurfaceView *surfaceView_ = nullptr;
+ MediaVideoPlay *video_ = nullptr;
+ bool resPreloaded_ = false;
+ bool hasPreview_ = false;
+ std::string path_;
+ std::string previewPath_;
+};
+} // OHOS
+#endif // VIDEO_CARD_H
--- /dev/null
+#include <cstdio>
+#include <iostream>
+#include "VideoCard.h"
+#include "NativeAbility.h"
+#include "msg_center.h"
+#include "securec.h"
+#include "DialBinParser.h"
+#include "ModelDialDataFactory.h"
+#include "common/low_power_manager.h"
+#include "common/image_cache_manager.h"
+#ifdef SUPPORT_OHOSFWK
+#include "ui_screennotify.h"
+#endif
+#include "MainPresenterSample.h"
+#include "common/graphic_utils.h"
+
+namespace OHOS {
+static constexpr int16_t JPEG_HEIGHT_DIVISOR = 2;
+static constexpr int16_t JPEG_WIDTH_BYTE_ALIGNMENT = 128;
+static constexpr int16_t JPEG_HEIGHT_BYTE_ALIGNMENT = 16;
+static constexpr int16_t BUFFER_QUEUE_SIZE = 3;
+static constexpr int16_t STRIDE_ALIGNMENT_VALUE = 128;
+
+static inline int32_t MediaByteAlign(int16_t value, int16_t align)
+{
+ return (((value) + (align) - 1) & (~((align) - 1)));
+}
+
+VideoCard::VideoCard()
+{
+ SetTouchable(true);
+ SetPosition(0, 0, HORIZONTAL_RESOLUTION, VERTICAL_RESOLUTION);
+}
+
+VideoCard::~VideoCard()
+{
+ Deinit();
+}
+
+void VideoCard::OnActive(void)
+{
+ StartVideo();
+}
+
+void VideoCard::OnInactive()
+{
+ StopVideo();
+}
+
+void VideoCard::PreLoad(void)
+{
+ if (!resPreloaded_) {
+ Init();
+ resPreloaded_ = true;
+ }
+}
+
+void VideoCard::ScrollBegin(bool isActive)
+{
+ PauseVideo();
+}
+
+void VideoCard::ScrollEnd(bool isActive)
+{
+ if (isActive) {
+ StartVideo();
+ } else {
+ StopVideo();
+ ClearCache();
+ }
+}
+
+void VideoCard::SetFilePath(const std::string &path)
+{
+ Deinit();
+ path_ = path;
+ resPreloaded_ = false;
+}
+
+void VideoCard::SetPreviewFile(const std::string &path)
+{
+ hasPreview_ = true;
+ previewPath_ = path;
+}
+
+void VideoCard::OnPause(void)
+{
+ PauseVideo();
+}
+
+void VideoCard::StopVideo()
+{
+ if (video_ == nullptr) {
+ return;
+ }
+
+ if (video_->isPlayed_ || video_->isPause_) {
+ video_->StopVideoPlay();
+ }
+}
+
+void VideoCard::StartVideo()
+{
+ if (video_ == nullptr) {
+ return;
+ }
+
+ if (video_->isPause_) {
+ video_->ResumeVideoPlay();
+ } else if (!video_->isPlayed_) {
+ video_->StartVideoPlay();
+ }
+}
+
+void VideoCard::PauseVideo()
+{
+ if (video_ == nullptr) {
+ return;
+ }
+
+ if (video_->isPlayed_) {
+ video_->PauseVideoPlay();
+ }
+}
+void VideoCard::Deinit()
+{
+ Remove(surfaceView_);
+ if (video_ != nullptr) {
+ delete video_;
+ video_ = nullptr;
+ }
+ if (surfaceView_ != nullptr) {
+ delete surfaceView_;
+ surfaceView_ = nullptr;
+ }
+}
+
+void VideoCard::Init()
+{
+ if (surfaceView_ != nullptr || video_ != nullptr) {
+ return;
+ }
+ surfaceView_ = new UILiteSurfaceView;
+ if (surfaceView_ == nullptr) {
+ return;
+ }
+ Rect area = GetRect();
+ int16_t w = area.GetWidth();
+ int16_t h = area.GetHeight();
+ surfaceView_->SetPosition(0, 0, w, h);
+ ColorType color;
+ color.full = 0xff3d3a3c;
+ surfaceView_->SetSurfaceColorkey(color);
+
+ Surface* surface = surfaceView_->GetSurface();
+ surface->SetStrideAlignment(STRIDE_ALIGNMENT_VALUE);
+ surface->SetWidthAndHeight(w, h);
+ surface->SetQueueSize(BUFFER_QUEUE_SIZE);
+ surface->SetFormat(PIXEL_FMT_YCBCR_420_SP);
+
+ // jpeg decoder output buffer size calculation formula
+ int32_t ySize = MediaByteAlign(w, JPEG_WIDTH_BYTE_ALIGNMENT) * h;
+ int32_t uvSize = MediaByteAlign(w, JPEG_WIDTH_BYTE_ALIGNMENT) *
+ MediaByteAlign(h, JPEG_HEIGHT_BYTE_ALIGNMENT) / JPEG_HEIGHT_DIVISOR;
+ int32_t bufferSize = ySize + uvSize;
+ surface->SetSize(bufferSize);
+
+ video_ = new MediaVideoPlay(surface, nullptr, path_, true);
+ if (video_ == nullptr) {
+ delete surfaceView_;
+ surfaceView_ = nullptr;
+ return;
+ }
+ if (hasPreview_) {
+ ImageInfo *imgInfo = ImageCacheManager::GetInstance().LoadSingleRes(previewPath_.c_str());
+ if (imgInfo != nullptr) {
+ surfaceView_->SetPreview(imgInfo);
+ }
+ }
+ Add(surfaceView_);
+ video_->SetSyncExitMode(true);
+}
+} // OHOS
add_subdirectory_if_exist(smart_voice)
endif()
add_subdirectory_if_exist(power_manager)
+add_subdirectory_if_exist(dial_market)
#include "bundle_install_msg.h"
#include "bundlems_slite_client.h"
#include "appexecfwk_errors.h"
-#include "sign_mode.h"
#include "ui_service.h"
void AppStoreReplyAck(uint8_t cmd_id, uint8_t type, uint32_t ack)
SendMsgToUIService(JS_UNINSTALL_SUCESS_TO_UI, 0, &bundleData, sizeof(BundleData));
report.operationResult = UNINSTALL_OK;
}
- OHOS::SignMode::GetInstance().SetSignMode(true);
} else if (resultCode == ERR_APPEXECFWK_INSTALL_FAILED_EXCEED_MAX_BUNDLE_NUMBER) {
report.operationResult = INSTALL_OVER_LIMIT;
- OHOS::SignMode::GetInstance().SetSignMode(true);
} else {
report.operationResult = (status == INSTALL_CALLBACK) ? INSTALL_FAILED : UNINSTALL_FAILED;
- OHOS::SignMode::GetInstance().SetSignMode(true);
}
AdapterFree(installMsg);
WEARABLE_LOGD(WEARABLE_LOG_MODULE_MSG_CENTER, "SendMsgToAppStore operationResult = %u", report.operationResult);
if (pkgFullName != nullptr) {
(void)sprintf_s(pkgFullName, len, "%s%s", FS_DIR_APP_STORE, (char *)operInfo->pkgName);
WEARABLE_LOGI(WEARABLE_LOG_MODULE_MSG_CENTER, "AppStorePkgOperation install pkgFullName=%s", pkgFullName);
- OHOS::SignMode::GetInstance().SetSignMode(false);
InstallParam installParam = { .installLocation = 1, .keepData = false };
ret = OHOS::BundleMsClient::GetInstance().Install(pkgFullName, &installParam, InstallCallbackFunc);
free(pkgFullName);
} else if (operInfo->operationType == PKG_OPERATION_TYPE_UNINSTALL) {
StopJsApp((char*)operInfo->pkgName);
WEARABLE_LOGI(WEARABLE_LOG_MODULE_MSG_CENTER, "AppStorePkgOperation uninstall pkgName=%s", operInfo->pkgName);
- OHOS::SignMode::GetInstance().SetSignMode(false);
InstallParam installParam = { .installLocation = 1, .keepData = false };
ret = OHOS::BundleMsClient::GetInstance().Uninstall((char*)operInfo->pkgName, &installParam, UninstallCallbackFunc);
}
(void)strncpy_s((char*)unitInfo[i].pkgName, PKG_NAME_MAX_LENGTH,
bundleInfos[i].bundleName, strlen(bundleInfos[i].bundleName));
WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "AppStoreGetPkgList pkgName[%d] = %s", i, unitInfo[i].pkgName);
+ unitInfo[i].versionCode = bundleInfos[i].versionCode;
}
ret = msg_center_send_data(MSGCENTER_CMD_APP_STORE, type, infoList, len);
free(infoList);
typedef struct {
uint8_t pkgName[PKG_NAME_MAX_LENGTH];
+ int32_t versionCode;
} PkgUnitInfo;
errcode_t AppStorePkgOperation(uint8_t cmd_id, uint8_t type, void *usr_data, uint16_t usr_len);
--- /dev/null
+set(COMPONENT_NAME "dial_market")
+
+set(PUBLIC_HEADER
+ ${CMAKE_CURRENT_SOURCE_DIR}/
+)
+
+set(PRIVATE_HEADER
+ ${CMAKE_CURRENT_SOURCE_DIR}/../../ohos_deps
+ ${ROOT_DIR}/middleware/services/gui/uikit/utils/interfaces/innerkits
+ ${ROOT_DIR}/middleware/services/gui/uikit/utils/interfaces/kits
+ ${ROOT_DIR}/middleware/services/gui/uikit/utils/interfaces/kits/gfx_utils
+ ${ROOT_DIR}/open_source/openharmony/base/startup/syspara_lite/include
+ ${ROOT_DIR}/open_source/openharmony/drivers/peripheral/format/interfaces/include
+ ${ROOT_DIR}/application/wearable/nativeapp/nativeui/main/include/dial
+)
+
+set(SOURCES
+ ${CMAKE_CURRENT_SOURCE_DIR}/dial_market_msg.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/dial_market.cpp
+)
+
+set(COMPONENT_PUBLIC_CCFLAGS
+)
+
+set(COMPONENT_CCFLAGS
+ -std=c++11
+)
+
+set(WHOLE_LINK
+ true
+)
+
+set(PUBLIC_DEFINES
+)
+
+set(PRIVATE_DEFINES
+ APP_PLATFORM_WATCHGT
+ CONFIG_ACELITE_ENABLE
+)
+
+build_component()
+
+
--- /dev/null
+/*
+ * Copyright (c) CompanyNameMagicTag 2021-2021. All rights reserved.
+ * Description: broadcast service api
+ * Author: CompanyName
+ * Create: 2021-11-11
+ */
+
+#ifndef DIAL_MARKET_H
+#define DIAL_MARKET_H
+
+#include "msg_center_protocol.h"
+
+#ifdef __cplusplus
+#if __cplusplus
+extern "C" {
+#endif
+#endif
+
+#define MAX_CHIP_PLAT_LEN 5
+#define MAX_CHIP_MODEL_LEN 5
+#define MAX_OS_LEN 23
+#define MAX_API_LEVEL_LEN 3
+#define MAX_WATCH_PROTO_VER_LEN 4
+#define MAX_WATCH_INTERNAL_VER 6
+#define MAX_RESOLUTION_LEN 8
+#define MAX_SUPPORT_PROTOCOL 8
+#define MAX_WATCH_CNT 64
+
+typedef enum msg_center_dial_market_type_id {
+ MSGCENTER_TYPE_ID_DM_GET_SYS_INFO = 0x1,
+ MSGCENTER_TYPE_ID_DM_GET_DEV_CAP = 0x2,
+ MSGCENTER_TYPE_ID_DM_GET_ONE_WATCH_INFO = 0x3,
+ MSGCENTER_TYPE_ID_DM_INSTALL_WATCH = 0x4,
+ MSGCENTER_TYPE_ID_DM_UNINSTALL_WATCH = 0x5,
+ MSGCENTER_TYPE_ID_DM_SET_WATCH = 0x6,
+ MSGCENTER_TYPE_ID_DM_GET_ALL_WATCH_INFO = 0x7,
+ MSGCENTER_TYPE_ID_DM_GET_CUR_WATCH_INFO = 0x8,
+} msg_center_dial_market_type_id_t;
+
+typedef struct {
+ char chip_platform[MAX_CHIP_PLAT_LEN];
+ char chip_model[MAX_CHIP_MODEL_LEN];
+ char os_version[MAX_OS_LEN];
+ char api_level[MAX_API_LEVEL_LEN];
+ uint8_t watch_proto_support_cnt;
+ char watch_protocol_verion[MAX_SUPPORT_PROTOCOL][MAX_WATCH_PROTO_VER_LEN];
+ char resolution[MAX_RESOLUTION_LEN];
+} watch_sys_info;
+
+typedef struct {
+ uint8_t kaleidoscope;
+ uint8_t effect_3D;
+ uint8_t interaction;
+ uint8_t video;
+ uint16_t video_format; /* 按照CodecFormat做位映射形成能力集 */
+} watch_dev_cap_info;
+
+typedef struct {
+ uint32_t uuid;
+ uint8_t install_state;
+ uint8_t is_current_watch;
+ uint8_t watch_protocol_version[MAX_WATCH_PROTO_VER_LEN];
+ uint8_t watch_version[MAX_WATCH_INTERNAL_VER];
+} watch_dial_info;
+
+errcode_t msg_center_dial_market_get_sys_info(uint8_t cmd_id, uint8_t type, void *usr_data, uint16_t usr_len);
+errcode_t msg_center_dial_market_get_dev_cap(uint8_t cmd_id, uint8_t type, void *usr_data, uint16_t usr_len);
+errcode_t msg_center_dial_market_get_one_watch_info(uint8_t cmd_id, uint8_t type, void *usr_data, uint16_t usr_len);
+errcode_t msg_center_dial_market_install_watch(uint8_t cmd_id, uint8_t type, void *usr_data, uint16_t usr_len);
+errcode_t msg_center_dial_market_uninstall_watch(uint8_t cmd_id, uint8_t type, void *usr_data, uint16_t usr_len);
+errcode_t msg_center_dial_market_set_watch(uint8_t cmd_id, uint8_t type, void *usr_data, uint16_t usr_len);
+errcode_t msg_center_dial_market_get_all_watch_info(uint8_t cmd_id, uint8_t type, void *usr_data, uint16_t usr_len);
+errcode_t msg_center_dial_market_get_cur_watch_info(uint8_t cmd_id, uint8_t type, void *usr_data, uint16_t usr_len);
+
+#ifdef __cplusplus
+#if __cplusplus
+}
+#endif
+#endif
+#endif /* DIAL_MARKET_H */
${ROOT_DIR}/application/wearable/service/xiaodu_navi_vector
${ROOT_DIR}/application/wearable/service/xiaodu_navi_vector/libs
${ROOT_DIR}/application/wearable/service/msg_center/src/notify/ketinput/include
- ${ROOT_DIR}/application/wearable/nativeapp/nativelauncher/include
- ${ROOT_DIR}/application/wearable/nativeabilityfwk/include
- ${ROOT_DIR}/application/wearable/nativeapp/nativeui/alarm/include
- ${ROOT_DIR}/application/wearable/nativeapp/nativeui/key/include
- ${ROOT_DIR}/application/wearable/nativeapp/nativeui/alarmclockmanage/include
- ${ROOT_DIR}/application/wearable/nativeapp/nativeui/alarmclocktimerconfig/include
- ${ROOT_DIR}/application/wearable/nativeapp/nativeui/main/include
- ${ROOT_DIR}/application/wearable/nativeapp/nativeui/callerlog/include
- ${ROOT_DIR}/application/wearable/nativeapp/nativeui/phoneservice/include
- ${ROOT_DIR}/application/wearable/nativeapp/nativeui/makephone/include
- ${ROOT_DIR}/application/wearable/nativeapp/nativeui/player/include
- ${ROOT_DIR}/application/wearable/nativeapp/nativeui/applist/include
- ${ROOT_DIR}/open_source/openharmony/foundation/multimedia/player/interfaces/kits
)
set(SOURCES
${CMAKE_CURRENT_SOURCE_DIR}/src/msg_center.cpp
- ${CMAKE_CURRENT_SOURCE_DIR}/src/notify/ketinput/src/NotifyOnKeyListener.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/notify/notification_manager.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/msg_center_protocol.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/client/msg_center_client.cpp
${ROOT_DIR}/include/middleware/services/bts/common
${ROOT_DIR}/application/auto_ota
${ROOT_DIR}/application/wearable/service/xiaodu_navi_vector
+ ${ROOT_DIR}/application/wearable/service/msg_center/src/notify/ketinput/include
+ ${ROOT_DIR}/application/wearable/nativeapp/nativelauncher/include
+ ${ROOT_DIR}/application/wearable/nativeabilityfwk/include
+ ${ROOT_DIR}/application/wearable/nativeapp/nativeui/alarm/include
+ ${ROOT_DIR}/application/wearable/nativeapp/nativeui/key/include
+ ${ROOT_DIR}/application/wearable/nativeapp/nativeui/alarmclockmanage/include
+ ${ROOT_DIR}/application/wearable/nativeapp/nativeui/alarmclocktimerconfig/include
+ ${ROOT_DIR}/application/wearable/nativeapp/nativeui/main/include
+ ${ROOT_DIR}/application/wearable/nativeapp/nativeui/callerlog/include
+ ${ROOT_DIR}/application/wearable/nativeapp/nativeui/phoneservice/include
+ ${ROOT_DIR}/application/wearable/nativeapp/nativeui/makephone/include
+ ${ROOT_DIR}/application/wearable/nativeapp/nativeui/player/include
+ ${ROOT_DIR}/application/wearable/nativeapp/nativeui/applist/include
+ ${ROOT_DIR}/open_source/openharmony/foundation/multimedia/player/interfaces/kits
)
if("JS_ENABLE" IN_LIST DEFINES)
${CMAKE_CURRENT_SOURCE_DIR}/src/notify/makephone_notification.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/common/msg_center_common.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/common/msg_center_utils.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/src/notify/ketinput/src/NotifyOnKeyListener.cpp
)
else()
set(SOURCES
${CMAKE_CURRENT_SOURCE_DIR}/src/msg_center_self_cmd.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/notify/alarm_notification.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/notify/makephone_notification.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/src/notify/ketinput/src/NotifyOnKeyListener.cpp
)
endif()
void StartJsApp(char *bundleName);\r
void StopJsApp(char *bundleName);\r
void MsgCenterReportBtStatusToJS(uint16_t msgId);\r
+bool MsgCenterNotifyProc(const Topic topic, Request* req);\r
#endif\r
\r
#ifdef __cplusplus\r
MSGCENTER_CMD_PING = 0x7,\r
MSGCENTER_CMD_WATCH_CONNECT = 0x8,\r
MSGCENTER_CMD_APP_STORE = 0x9,\r
+ MSGCENTER_CMD_DIAL_MARKET = 0xa,\r
MSGCENTER_CMD_MAX\r
} msg_center_cmd_id_t;\r
\r
--- /dev/null
+/*\r
+ * Copyright (c) CompanyNameMagicTag 2024-2024. All rights reserved.\r
+ * Description: NotifyOnKeyListener.h\r
+ * Author: g30037431\r
+ * Create: 2024-12-12\r
+ */\r
+\r
+#ifndef KEY_NOTIFY_INPUT_LISTENER_H\r
+#define KEY_NOTIFY_INPUT_LISTENER_H\r
+\r
+#include "components/root_view.h"\r
+#include "events/key_event.h"\r
+#include "ohos_types.h"\r
+\r
+namespace OHOS {\r
+class NotifyOnKeyListener : public RootView::OnKeyActListener {\r
+public:\r
+ static NotifyOnKeyListener* GetInstance();\r
+ bool OnKeyAct(UIView& view, const KeyEvent& event) override;\r
+\r
+private:\r
+ NotifyOnKeyListener() {}\r
+ ~NotifyOnKeyListener() {}\r
+ void OnKeyPress(void);\r
+ void OnKeyLongPress(const KeyEvent& event);\r
+ void OnKeyRelease(const KeyEvent& event);\r
+ void CallVolumeDipSwitchControl(uint8_t status);\r
+ void PlayerVolumeDipSwitchControl(uint8_t status);\r
+private:\r
+ int32 pressFlag{0};\r
+ int32 longPressFlag{0};\r
+};\r
+}\r
+#endif // KEY_NOTIFY_INPUT_LISTENER_H
\ No newline at end of file
--- /dev/null
+/*
+ * Copyright (c) CompanyNameMagicTag 2024-2024. All rights reserved.
+ * Description: NotifyOnKeyListener.cpp
+ * Author:g30037431
+ * Create: 2024-12-14
+ */
+
+#include "NotifyOnKeyListener.h"
+#include "common/key_code.h"
+#include "AppViewIDs.h"
+#include "View.h"
+#include "KeyInputListener.h"
+#include "VolumeSettingView.h"
+#include "VolumeSettingPresenter.h"
+#include "VolumeSettingView.h"
+#include "wearable_log.h"
+#include "UiConfig.h"
+#include "dock/input_device.h"
+#include "notification_manager.h"
+#include "AlarmPopUpPresenter.h"
+#include "CallerLogModel.h"
+#include "MainCallingPresenter.h"
+#include "ApplistModel.h"
+namespace OHOS {
+static bool IsNotifyCallStatus()
+{
+ uint16_t notifyId = NotificationManager::GetInstance()->GetShowingNotifyId();
+ if (NotificationManager::GetInstance()->HasNotifyShowing() &&
+ (notifyId == TOPIC_EVENT_HFP_WATCH_ACTIVE || notifyId == TOPIC_EVENT_HFP_PHONE_TO_WATCH)) {
+ return true;
+ } else {
+ return false;
+ }
+}
+
+static void PressAlarmNotify()
+{
+ AlarmClockModel::GetInstance()->AlarmGetClockNum();
+ AlarmPopUpPresenter::GetInstance()->DelayAlarmRing();
+ NotificationManager::GetInstance()->StopNotify();
+}
+
+NotifyOnKeyListener *NotifyOnKeyListener::GetInstance()
+{
+ static NotifyOnKeyListener instance;
+ return &instance;
+}
+
+void NotifyOnKeyListener::OnKeyPress(void)
+{
+ pressFlag = 1; // Short press the logo
+ return;
+}
+
+void NotifyOnKeyListener::OnKeyLongPress(const KeyEvent &event)
+{
+ longPressFlag = 1; // Long press the logo
+
+ uint16 keyID = event.GetKeyId();
+ if (keyID == static_cast<uint16_t>(ZliteKeyCode::ZLITE_KEY_POWER)) { // Power button
+ NativeAbility::GetInstance().ChangeSlice(VIEW_REBOOT); // Switch to shutdown/restart card
+ } else if (keyID == static_cast<uint16_t>(ZliteKeyCode::ZLITE_KEY_FUNC)) { // Function buttons
+ // Switch to View System Version Card
+ }
+ return;
+}
+
+void NotifyOnKeyListener::CallVolumeDipSwitchControl(uint8_t status)
+{
+ VolumeSliderEventListener *volumeSliderEventListener = nullptr;
+ if (NotificationManager::GetInstance()->GetVolumeScreenStatus()) {
+ VolumeSettingView *settingView = GetvolumeSetting();
+ if (settingView == nullptr) {
+ return;
+ }
+ volumeSliderEventListener = settingView->GetVolumeEventListener();
+ if (volumeSliderEventListener == nullptr) {
+ return;
+ }
+ volumeSliderEventListener->ChangeVolume(static_cast<VolumeChangeStatus>(status));
+ } else {
+ HonrsViewChange();
+ NotificationManager::GetInstance()->SetVolumeScreenStatus(true);
+ }
+ return;
+}
+
+void NotifyOnKeyListener::OnKeyRelease(const KeyEvent &event)
+{
+ uint16_t currentViewId = NativeAbility::GetInstance().GetCurSliceId();
+ uint16 keyID = event.GetKeyId();
+ uint16_t notifyId = NotificationManager::GetInstance()->GetShowingNotifyId();
+ if (keyID == static_cast<uint16_t>(ZliteKeyCode::ZLITE_KEY_POWER)) { // Power button
+ if (longPressFlag == 0 && pressFlag == 1 &&
+ NotificationManager::GetInstance()->HasNotifyShowing()) { // Short press the power button
+ if (NotificationManager::GetInstance()->GetWatchCallStatus()) { // Call notify
+ CallVolumeDipSwitchControl(VOLUMEUP); // Volume+
+ } else if (notifyId == TOPIC_EVENT_ALARM_RING) { // Main dial
+ PressAlarmNotify(); // When currently on the alarm notification page, process the alarm first before switching pages
+ }
+ }
+ } else if (keyID == static_cast<uint16_t>(ZliteKeyCode::ZLITE_KEY_FUNC)) { // Function buttons
+ if (longPressFlag == 0 && pressFlag == 1) { // Short press the function key
+ if (NotificationManager::GetInstance()->GetWatchCallStatus()) { // Volume card
+ CallVolumeDipSwitchControl(VOLUMEDOWN); // Volume-
+ } else {
+ // Switch to user configured shortcut card
+ }
+ }
+ }
+
+ pressFlag = 0;
+ longPressFlag = 0;
+ return;
+}
+
+bool NotifyOnKeyListener::OnKeyAct(UIView &view, const KeyEvent &event)
+{
+ UNUSED(view);
+ uint8 state = event.GetState();
+
+ switch (state) {
+ case InputDevice::STATE_PRESS: // Short press
+ OnKeyPress();
+ break;
+#ifdef __LITEOS_M__
+ case InputDevice::STATE_LONG_PRESS: // Long press
+ OnKeyLongPress(event);
+ break;
+#endif
+ case InputDevice::STATE_RELEASE: // Release
+ OnKeyRelease(event);
+ break;
+ default:
+ break;
+ }
+ return true;
+}
+} // namespace OHOS
#include "soc_dpu_type.h"\r
#include "soc_mipi_tx.h"\r
#include "pmu_ldo.h"\r
-#include "soc_gmmu_api.h"\r
#include "pm_lp_stub.h"\r
#include "hal_pmu_ldo.h"\r
#include "cmsis_os2.h"\r
POWER_DISPLAY_PRINT_ERR(0, "drv vau resume error ret=%x\r\n", ret);\r
return ERRCODE_FAIL;\r
}\r
-#ifdef SUPPORT_GPU_GMMU\r
- ret = drv_gmmu_resume(NULL);\r
- if (ret != 0) {\r
- POWER_DISPLAY_PRINT_ERR(0, "drv gmmu resume error ret=%x\r\n", ret);\r
- return ERRCODE_FAIL;\r
- }\r
-#endif\r
ret = uapi_lcd_init();\r
if (ret != 0 && ret != EXT_ERR_MIPI_ALREADY_INIT) {\r
POWER_DISPLAY_PRINT_ERR(0, "LCD init error ret=%x\r\n", ret);\r
POWER_DISPLAY_PRINT_ERR(0, "drv dpu suspend error ret=%x\r\n", ret);\r
}\r
#endif\r
-#ifdef SUPPORT_GPU_GMMU\r
- ret = drv_gmmu_suspend(NULL);\r
- if (ret != 0) {\r
- POWER_DISPLAY_PRINT_ERR(0, "drv gmmu suspend error ret=%x\r\n", ret);\r
- return ERRCODE_FAIL;\r
- }\r
-#endif\r
+\r
ret = uapi_lcd_deinit();\r
if (ret != 0) {\r
POWER_DISPLAY_PRINT_ERR(0, "lcd deinit error ret=%x\r\n", ret);\r
}\r
POWER_DISPLAY_PRINT_DEBUG(0, "turn off success.");\r
}\r
+ sc->press_state = false;\r
sc->current_state = new_state;\r
\r
return ret;\r
for (;;) {\r
osStatus_t ret = osMessageQueueGet(g_pcm_stream_msg_queue_id, &msg, nullptr, osWaitForever);\r
if (ret != osOK) {\r
- continue;\r
+ msg.msg_id = MSGCENTER_TYPE_ID_XIAODU_END_RECORD;\r
+ msg.data = nullptr;\r
}\r
if (msg.msg_id == MSGCENTER_TYPE_ID_XIAODU_SEND_PCM_STREAM) {\r
res = msg_center_xiaodu_send_pcm_stream(MSGCENTER_CMD_XIAODU, MSGCENTER_TYPE_ID_XIAODU_SEND_PCM_STREAM,\r
#include "lpc_core.h"\r
#include "diag_msg.h"\r
#include "pmu_ldo.h"\r
-#include "soc_gmmu_api.h"\r
#include "pinctrl.h"\r
#include "non_os_reboot.h"\r
#include "km.h"\r
wstp_print("drv vau resume error ret=%x\r\n", ret);\r
return ERRCODE_FAIL;\r
}\r
-#ifdef SUPPORT_GPU_GMMU\r
- ret = drv_gmmu_resume(NULL);\r
- if (ret != 0) {\r
- wstp_print("drv gmmu resume error ret=%x\r\n", ret);\r
- return ERRCODE_FAIL;\r
- }\r
-#endif\r
ret = uapi_lcd_init();\r
if (ret != 0 && ret != EXT_ERR_MIPI_ALREADY_INIT) {\r
wstp_print("LCD init error ret=%x\r\n", ret);\r
wstp_print("drv dpu suspend error ret=%x\r\n", ret);\r
return ERRCODE_FAIL;\r
}\r
-#endif\r
-#ifdef SUPPORT_GPU_GMMU\r
- ret = drv_gmmu_suspend(NULL);\r
- if (ret != 0) {\r
- wstp_print("drv gmmu suspend error ret=%x\r\n", ret);\r
- return ERRCODE_FAIL;\r
- }\r
#endif\r
ret = uapi_lcd_deinit();\r
if (ret != 0) {\r
unused(para_len);\r
\r
uint8_t cnt = pm_veto_get_id_cnt(PM_ID_DEBUG);\r
- if (cnt == 1) {\r
+ if (cnt > 0) {\r
+ wstp_print("MCU remove pm_id_debug vote\r\n");\r
uapi_pm_remove_sleep_veto(PM_ID_DEBUG);\r
} else {\r
wstp_print("MCU has delete pm_id_debug vote\r\n");\r
}\r
#endif\r
\r
+#ifdef CFG_DRIVERS_SDIO\r
+typedef enum {\r
+ SDIO_TEST_READ_BYTE = 1,\r
+ SDIO_TEST_RESET,\r
+\r
+ SDIO_TEST_BUTT,\r
+} SDIO_TEST_CASE_T;\r
+\r
+static uint32_t mcu_sdio_test(uint8_t *para, uint32_t para_len)\r
+{\r
+ unused(para_len);\r
+ char *ptr = (char *)para;\r
+ uint32_t inputpara = strtoul(ptr, NULL, 0);\r
+\r
+ wstp_print("enter mcu_sdio_test input %u \r\n", inputpara);\r
+ switch (inputpara) {\r
+ case SDIO_TEST_READ_BYTE:\r
+ mmc_test_sdio_read_byte();\r
+ break;\r
+ case SDIO_TEST_RESET:\r
+ mmc_test_sdio_reset();\r
+ break;\r
+ default:\r
+ break;\r
+ }\r
+\r
+ return ERRCODE_SUCC;\r
+}\r
+#endif\r
+\r
static const app_process_table g_app_funcs[] = {\r
{ RESET, mcu_os_sys_reset },\r
{ FSTEST, mcu_fs_test },\r
{ SCHEDSTART, mcu_sched_statistis_start },\r
{ SCHEDSTOP, mcu_sched_statistis_stop },\r
#endif\r
+#ifdef CFG_DRIVERS_SDIO\r
+ { SDIOTEST, mcu_sdio_test},\r
+#endif\r
};\r
\r
void app_at_process(uint8_t *data, uint32_t data_len)\r
}\r
#endif\r
\r
+#ifdef CFG_DRIVERS_SDIO\r
+static uint32_t app_sdio_test(uint8_t *para, uint32_t para_len, char *str_cmd)\r
+{\r
+ unused(str_cmd);\r
+ if (para == NULL) {\r
+ return ERRCODE_FAIL;\r
+ }\r
+\r
+ app_pkg_msg_send(SDIOTEST, DIAG_CONTROL_FALSE, para, para_len);\r
+ return ERRCODE_SUCC;\r
+}\r
+#endif\r
+\r
static const at_cmd_table_t g_app_cmd[] = {\r
/* 无参数无特殊处理AT命令 */\r
{ "AT^HEAPINFO", parse_heap_info_handle, "" },\r
{ "AT^SCHEDSTART", app_sched_statistis_start, "" },\r
{ "AT^SCHEDSTOP", app_sched_statistis_stop, "" },\r
#endif\r
+#ifdef CFG_DRIVERS_SDIO\r
+ { "AT^SDIOTEST", app_sdio_test, "" },\r
+#endif\r
};\r
\r
at_cmd_table_t *get_app_cmd_table(uint32_t *cmd_count)\r
PERFSTOP = 0x55,\r
SCHEDSTART = 0x56,\r
SCHEDSTOP = 0x57,\r
+ SDIOTEST = 0x58,\r
MSG_ID_MAX_BUTT,\r
} app_msg_id;\r
\r
#define GRAPHIC_MAX_PARAM_LEN 128\r
\r
typedef int32_t (*GraphicProcessFunc)(commu_inter_info_t *cmd);\r
-typedef int32_t (*pfn_gmmu_suspend)(void);\r
-typedef int32_t (*pfn_gmmu_resume)(void);\r
\r
-typedef struct {\r
- pfn_gmmu_suspend suspend;\r
- pfn_gmmu_resume resume;\r
-} drv_gmmu_export_func;\r
-\r
-int32_t drv_gmmu_module_init(void);\r
-void drv_gmmu_module_exit(void);\r
int32_t uapi_vau_module_init(void);\r
void uapi_vau_module_exit(void);\r
int32_t uapi_dpu_module_init(void);\r
extern td_s32 vau_dfx_proc_read(int argc, const char *argv[]);
extern td_s32 jpeg_dfx_proc_read(int argc, const char *argv[]);
-extern td_s32 gmmu_dfx_print_proc_info(int argc, const char *argv[]);
static td_void wstp_draw_box(ext_rect *rect, td_u32 stride, td_char *mem_start, td_u32 color, td_u32 bpp)
{
} else if (strcmp((char *)argv[0], "jpeg_proc") == 0) {\r
#ifdef SUPPORT_GPU_JPEG\r
jpeg_dfx_proc_read(argc - 1, argv + 1);\r
-#endif\r
- } else if (strcmp((char *)argv[0], "gmmu_proc") == 0) {\r
-#ifdef SUPPORT_GPU_GMMU\r
- gmmu_dfx_print_proc_info(argc - 1, argv + 1);\r
#endif\r
} else {\r
#ifdef SUPPORT_GPU_TEST
#include "ability_manager.h"
#include "js_fwk_common.h"
#include "global.h"
-#include "gt_bundle_manager_service.h"
+#include "msg_center_customer.h"
#include "ApplistModel.h"
#include "bundle_manager.h"
+#include <unistd.h>
#ifdef SUPPORT_AT_LOCATION
#include "location_sample.h"
#include <cmsis_os.h>
#ifdef SUPPORT_AT_SENSOR
#include "sensor_sample.h"
#endif
+#include <msg_center.h>
#define ARRAY_COUNT(array) (sizeof(array) / sizeof(array[0]))
-#define OHOSFWK_MAX_ARGC 8
-#define OHOSFWK_MAX_ARGV_LEN 64
+#define OHOSFWK_MAX_ARGC 8
+#define OHOSFWK_MAX_ARGV_LEN 64
-#define OHOSFWK_SUCCESS 0
-#define OHOSFWK_FAILED (-1)
+#define OHOSFWK_SUCCESS 0
+#define OHOSFWK_FAILED (-1)
static void ReceiveCallback(const uint8_t resultCode, const void *resultMessage)
{
AdapterFree(installMsg);
}
-static int ConvertCmdToParam(uint8_t *para, uint32_t paraLen,
- uint8_t argv[OHOSFWK_MAX_ARGC][OHOSFWK_MAX_ARGV_LEN], uint32_t* argc)
+static int ConvertCmdToParam(
+ uint8_t *para, uint32_t paraLen, uint8_t argv[OHOSFWK_MAX_ARGC][OHOSFWK_MAX_ARGV_LEN], uint32_t *argc)
{
uint32_t pos = 0;
*argc = 0;
static uint32_t OhosfwkATCmdBmInstall(uint8_t *para, uint32_t paraLen, char *strCommonCmd)
{
unused(strCommonCmd);
- uint8_t argv[OHOSFWK_MAX_ARGC][OHOSFWK_MAX_ARGV_LEN] = { 0 };
+ uint8_t argv[OHOSFWK_MAX_ARGC][OHOSFWK_MAX_ARGV_LEN] = {0};
uint32_t argc = 0;
int ret = ConvertCmdToParam(para, paraLen, argv, &argc);
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "OHOSFWK ATCMD Installing Package Failed\n");
return ERRCODE_FAIL;
}
- InstallParam installParam = { .installLocation = 1, .keepData = true };
- if (strcmp("rmdata", (char*)argv[1]) == 0) {
+ InstallParam installParam = {.installLocation = 1, .keepData = true};
+ if (strcmp("rmdata", (char *)argv[1]) == 0) {
installParam.keepData = false;
}
- OHOS::BundleMsClient::GetInstance().Install((char*)argv[0], &installParam, ReceiveCallback);
+ OHOS::BundleMsClient::GetInstance().Install((char *)argv[0], &installParam, ReceiveCallback);
return ERRCODE_SUCC;
}
static uint32_t OhosfwkATCmdBmUninstall(uint8_t *para, uint32_t paraLen, char *strCommonCmd)
{
unused(strCommonCmd);
- uint8_t argv[OHOSFWK_MAX_ARGC][OHOSFWK_MAX_ARGV_LEN] = { 0 };
+ uint8_t argv[OHOSFWK_MAX_ARGC][OHOSFWK_MAX_ARGV_LEN] = {0};
uint32_t argc = 0;
-
+
int ret = ConvertCmdToParam(para, paraLen, argv, &argc);
if (ret != OHOSFWK_SUCCESS) {
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "OHOSFWK ATCMD Convert Command Failed\n");
return ERRCODE_FAIL;
}
-
+
if (argc != 1) {
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "OHOSFWK ATCMD Uninstalling Package Failed\n");
return ERRCODE_FAIL;
}
-
+
char *bundleName = (char *)argv[0];
- ElementName* topAbility = OHOS::AbilityMsClient::GetInstance().GetTopAbility();
+ ElementName *topAbility = OHOS::AbilityMsClient::GetInstance().GetTopAbility();
if ((topAbility != nullptr) && (strcmp(topAbility->bundleName, bundleName) == 0)) {
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "js app is active, first need terminate");
OHOS::AbilityMsClient::GetInstance().TerminateAbility(token);
}
- InstallParam installParam = { .installLocation = 1, .keepData = false };
+ InstallParam installParam = {.installLocation = 1, .keepData = false};
OHOS::BundleMsClient::GetInstance().Uninstall(bundleName, &installParam, ReceiveCallback);
FreeElement(topAbility);
return ERRCODE_SUCC;
static uint32_t OhosfwkATCmdBmSet(uint8_t *para, uint32_t paraLen, char *strCommonCmd)
{
unused(strCommonCmd);
- uint8_t argv[OHOSFWK_MAX_ARGC][OHOSFWK_MAX_ARGV_LEN] = { 0 };
+ uint8_t argv[OHOSFWK_MAX_ARGC][OHOSFWK_MAX_ARGV_LEN] = {0};
uint32_t argc = 0;
int ret = ConvertCmdToParam(para, paraLen, argv, &argc);
static uint32_t OhosfwkATCmdAmChangeNativeSlice(uint8_t *para, uint32_t paraLen, char *strCommonCmd)
{
unused(strCommonCmd);
- uint8_t argv[OHOSFWK_MAX_ARGC][OHOSFWK_MAX_ARGV_LEN] = { 0 };
+ uint8_t argv[OHOSFWK_MAX_ARGC][OHOSFWK_MAX_ARGV_LEN] = {0};
uint32_t argc = 0;
int ret = ConvertCmdToParam(para, paraLen, argv, &argc);
if (ret != OHOSFWK_SUCCESS) {
static uint32_t OhosfwkATCmdAmStartJsApp(uint8_t *para, uint32_t paraLen, char *strCommonCmd)
{
unused(strCommonCmd);
- uint8_t argv[OHOSFWK_MAX_ARGC][OHOSFWK_MAX_ARGV_LEN] = { 0 };
+ uint8_t argv[OHOSFWK_MAX_ARGC][OHOSFWK_MAX_ARGV_LEN] = {0};
uint32_t argc = 0;
int ret = ConvertCmdToParam(para, paraLen, argv, &argc);
static uint32_t OhosfwkATCmdBmGetAppInfo(uint8_t *para, uint32_t paraLen, char *strCommonCmd)
{
unused(strCommonCmd);
- uint8_t argv[OHOSFWK_MAX_ARGC][OHOSFWK_MAX_ARGV_LEN] = { 0 };
+ uint8_t argv[OHOSFWK_MAX_ARGC][OHOSFWK_MAX_ARGV_LEN] = {0};
uint32_t argc = 0;
-
+
int ret = ConvertCmdToParam(para, paraLen, argv, &argc);
if (ret != OHOSFWK_SUCCESS) {
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "OHOSFWK ATCMD Convert Command Failed\n");
if (ret != OHOSFWK_SUCCESS) {
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "failed to get bundleInfo!");
} else {
- WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "\n"
- "-----------------AppInfo----------------\n"
- "bundleName: %s\n"
- "appId: %s\n"
- "label: %s\n"
- "versionCode: %d\n"
- "targetApi: %d\n"
- "isSystemApp: %s\n"
- "compatibleApi: %d\n"
- "versionName: %s\n"
- "vendor: %s\n"
- "numOfModule: %d",
- bundleInfo.bundleName,
- bundleInfo.appId,
- bundleInfo.label,
- bundleInfo.versionCode,
- bundleInfo.targetApi,
- bundleInfo.isSystemApp ? "true" : "false",
- bundleInfo.compatibleApi,
- bundleInfo.versionName,
- bundleInfo.vendor,
- bundleInfo.numOfModule
- );
-
- WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "\n"
- "bigIconPath: %s\n"
- "codePath: %s\n"
- "dataPath: %s\n"
- "--------------AppInfo End---------------\n",
- bundleInfo.bigIconPath,
- bundleInfo.codePath,
- bundleInfo.dataPath
- );
+ WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP,
+ "\n"
+ "-----------------AppInfo----------------\n"
+ "bundleName: %s\n"
+ "appId: %s\n"
+ "label: %s\n"
+ "versionCode: %d\n"
+ "targetApi: %d\n"
+ "isSystemApp: %s\n"
+ "compatibleApi: %d\n"
+ "versionName: %s\n"
+ "vendor: %s\n"
+ "numOfModule: %d",
+ bundleInfo.bundleName,
+ bundleInfo.appId,
+ bundleInfo.label,
+ bundleInfo.versionCode,
+ bundleInfo.targetApi,
+ bundleInfo.isSystemApp ? "true" : "false",
+ bundleInfo.compatibleApi,
+ bundleInfo.versionName,
+ bundleInfo.vendor,
+ bundleInfo.numOfModule);
+
+ WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP,
+ "\n"
+ "bigIconPath: %s\n"
+ "codePath: %s\n"
+ "dataPath: %s\n"
+ "--------------AppInfo End---------------\n",
+ bundleInfo.bigIconPath,
+ bundleInfo.codePath,
+ bundleInfo.dataPath);
}
return ERRCODE_SUCC;
}
if (ret != OHOSFWK_SUCCESS) {
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "Get bundleInfos Failed\n");
return ERRCODE_FAIL;
- }else {
- WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "\n"
+ } else {
+ WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP,
+ "\n"
"----------------- AppList Start --------------------\n");
for (int32_t i = 0; i < count; i++) {
-
+
WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP,
- "App:%d-----------------\n"
- "label: %s\n"
- "bundleName: %s\n",
- i+1,
- bundleInfos[i].bundleName,
- bundleInfos[i].label
- );
+ "App:%d-----------------\n"
+ "label: %s\n"
+ "bundleName: %s\n",
+ i + 1,
+ bundleInfos[i].bundleName,
+ bundleInfos[i].label);
}
- WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "\n"
+ WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP,
+ "\n"
"----------------- AppList End -----------------------\n");
}
return ERRCODE_SUCC;
}
+void ScanPackagesResultCallback(const uint8_t resultCode, const void* resultMessage)
+{
+ if (resultCode == 0) {
+ WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "Scan Packages Succeeded.\n");
+ OHOS::ApplistModel::GetInstance().SetInitFlag(false);
+ WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "Set InitFlag false Succeeded\n");
+ } else {
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "Scan Packages Failed.\n");
+ if (resultMessage != nullptr) {
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[ERROR] %s\n", reinterpret_cast<const char *>(resultMessage));
+ }
+ }
+}
+
static uint32_t OhosfwkATCmdChangeLanguage(uint8_t *para, uint32_t paraLen, char *strCommonCmd)
{
unused(strCommonCmd);
- uint8_t argv[OHOSFWK_MAX_ARGC][OHOSFWK_MAX_ARGV_LEN] = { 0 };
+ uint8_t argv[OHOSFWK_MAX_ARGC][OHOSFWK_MAX_ARGV_LEN] = {0};
uint32_t argc = 0;
int ret = ConvertCmdToParam(para, paraLen, argv, &argc);
WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "Language changed to %s\n", languageRegion);
- bool scanResult = ScanPackages(nullptr);
+ ScanPackages(ScanPackagesResultCallback);
- if (scanResult) {
- WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "Scan Packages Succeeded");
- } else {
- WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "Scan Packages Failed");
+ return ERRCODE_SUCC;
+}
+
+static uint32_t OhosfwkATStartNotify(uint8_t *para, uint32_t paraLen, char *strCommonCmd)
+{
+ WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "in OhosfwkATStartNotify para:%s\n", para);
+ uint8_t argv[OHOSFWK_MAX_ARGC][OHOSFWK_MAX_ARGV_LEN] = {0};
+ uint32_t argc = 0;
+ int ret = ConvertCmdToParam(para, paraLen, argv, &argc);
+ if (ret != OHOSFWK_SUCCESS) {
return ERRCODE_FAIL;
}
-
- OHOS::ApplistModel::GetInstance().SetInitFlag(false);
- WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "Set InitFlag false Succeeded");
-
+ uint32_t times = 1;
+ uint32_t msleepTime = 500;
+ if (argc == 2) {
+ char *strtimes = (char *)argv[1];
+ times = atoi(strtimes);
+ } else if (argc == 3) {
+ char *strtimes = (char *)argv[1];
+ times = atoi(strtimes);
+ char *strMsleepTime = (char *)argv[2];
+ msleepTime = atoi(strMsleepTime);
+ } else if (argc < 1) {
+ return ERRCODE_FAIL;
+ }
+ char *topicstr = (char *)argv[0];
+ uint16_t topicId = atoi(topicstr);
+ times = ((msleepTime * times) > 60000) ? 1 : times;
+ for (uint32_t i = 0; i < times; i++) {
+ ret = MsgCenterNotifyProc(topicId, nullptr);
+ if (ret != true) {
+ WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "times:%d faild\n", i);
+ return ERRCODE_FAIL;
+ }
+ if (i != times - 1) {
+ usleep(1000 * msleepTime);
+ }
+ }
return ERRCODE_SUCC;
}
{
WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "in OhosfwkATCmdLocation para:%s\n", para);
unused(strCommonCmd);
- uint8_t argv[OHOSFWK_MAX_ARGC][OHOSFWK_MAX_ARGV_LEN] = { 0 };
+ uint8_t argv[OHOSFWK_MAX_ARGC][OHOSFWK_MAX_ARGV_LEN] = {0};
uint32_t argc = 0;
int ret = ConvertCmdToParam(para, paraLen, argv, &argc);
}
#endif
static const at_cmd_table_t g_ohosfwk_cmd[] = {
- { (char *)"AT^OHOSFWK_AM_EXIT_JSAPP", OhosfwkATCmdAmExitJsApp, (char *)"00 00 00 00" },
- { (char *)"AT^OHOSFWK_BM_INSTALL", OhosfwkATCmdBmInstall, (char *)"00 00 00 01" },
- { (char *)"AT^OHOSFWK_BM_SET", OhosfwkATCmdBmSet, (char *)"00 00 00 02" },
- { (char *)"AT^OHOSFWK_BM_UNINSTALL", OhosfwkATCmdBmUninstall, (char *)"00 00 00 03" },
- { (char *)"AT^OHOSFWK_AM_CHANGENATIVESLICE", OhosfwkATCmdAmChangeNativeSlice, (char *)"00 00 00 04" },
- { (char *)"AT^OHOSFWK_AM_START_JS_APP", OhosfwkATCmdAmStartJsApp, (char *)"00 00 00 05" },
- { (char *)"AT^OHOSFWK_DFX_JS_MEMORY_INFO", OhosfwkATCmdDfxJsMemoryInfo, (char *)"00 00 00 06" },
- { (char *)"AT^OHOSFWK_CHANGE_LANGUAGE", OhosfwkATCmdChangeLanguage, (char *)"00 00 00 07" },
- { (char *)"AT^OHOSFWK_BM_GET_APPINFO", OhosfwkATCmdBmGetAppInfo, (char *)"00 00 00 10" },
- { (char *)"AT^OHOSFWK_BM_GET_APPLIST", OhosfwkATCmdBmGetAppList, (char *)"00 00 00 11" },
+ {(char *)"AT^OHOSFWK_AM_EXIT_JSAPP", OhosfwkATCmdAmExitJsApp, (char *)"00 00 00 00"},
+ {(char *)"AT^OHOSFWK_BM_INSTALL", OhosfwkATCmdBmInstall, (char *)"00 00 00 01"},
+ {(char *)"AT^OHOSFWK_BM_SET", OhosfwkATCmdBmSet, (char *)"00 00 00 02"},
+ {(char *)"AT^OHOSFWK_BM_UNINSTALL", OhosfwkATCmdBmUninstall, (char *)"00 00 00 03"},
+ {(char *)"AT^OHOSFWK_AM_CHANGENATIVESLICE", OhosfwkATCmdAmChangeNativeSlice, (char *)"00 00 00 04"},
+ {(char *)"AT^OHOSFWK_AM_START_JS_APP", OhosfwkATCmdAmStartJsApp, (char *)"00 00 00 05"},
+ {(char *)"AT^OHOSFWK_DFX_JS_MEMORY_INFO", OhosfwkATCmdDfxJsMemoryInfo, (char *)"00 00 00 06"},
+ {(char *)"AT^OHOSFWK_CHANGE_LANGUAGE", OhosfwkATCmdChangeLanguage, (char *)"00 00 00 07"},
+ {(char *)"AT^OHOSFWK_BM_GET_APPINFO", OhosfwkATCmdBmGetAppInfo, (char *)"00 00 00 10"},
+ {(char *)"AT^OHOSFWK_BM_GET_APPLIST", OhosfwkATCmdBmGetAppList, (char *)"00 00 00 11"},
+ {(char *)"AT^OHOSFWK_MSG_START_NOTIFY", OhosfwkATStartNotify, (char *)"00 00 00 12"},
#ifdef SUPPORT_AT_LOCATION
- { (char *)"AT^OHOSFWK_LOCATION", OhosfwkATCmdLocation, (char *)"00 00 00 08" },
+ {(char *)"AT^OHOSFWK_LOCATION", OhosfwkATCmdLocation, (char *)"00 00 00 08"},
#endif
#ifdef SUPPORT_AT_SENSOR
{(char *)"AT^OHOSFWK_SENSOR", OhosfwkATCmdSensor, (char *)"00 00 00 09"},
#define RCXO_32K_SEL_MASK 12\r
#define CALIBRATION_CYCLE_MUL 0x200\r
#define CALIBRATION_CLOCK_MUL 100\r
+#define ULP_LOCK_REG 0x5702c510\r
\r
calendar_regs_t *g_calendar_reg = SSB_CALENDAR_BASE_ADDR;\r
\r
static uint64_t uapi_ulp_systick_get_count(void)\r
{\r
uint64_t count = 0;\r
-\r
+ writew(ULP_LOCK_REG, 0x1);\r
count = (uint64_t)readw(ULP_SYSTICK_VAL3) << 48U;\r
count |= (uint64_t)readw(ULP_SYSTICK_VAL2) << 32U;\r
count |= (uint64_t)readw(ULP_SYSTICK_VAL1) << 16U;\r
count |= (uint64_t)readw(ULP_SYSTICK_VAL0);\r
-\r
+ writew(ULP_LOCK_REG, 0x0);\r
return count;\r
}\r
\r
'CONFIG_ZDIAG_AUDIO_PROC_SUPPORT', 'CONFIG_ZDIAG_AUDIO_DUMP_SUPPORT', 'CONFIG_ZDIAG_AUDIO_PROBE_SUPPORT', 'CONFIG_SEA_PHS_SUPPORT',
'SUPPORT_BLE', 'SUPPORT_BREDR', 'ENABLE_UIKIT', 'SUPPORT_GPU_JPEG', 'SUPPORT_GPU_GMMU', 'SUPPORT_GPU_OPENVG', 'CONFIG_DIAG_GPU_PROC_SUPPORT',
'SW_UART_DEBUG', 'SAVE_EXC_INFO', 'HASH_MEM_COPY', 'JS_ENABLE', 'CONFIG_LOW_POWER_TEST', 'SUPPORT_OHOSFWK',
- 'ENABLE_ECC', 'XTS_SUPPORT', 'SUPPORT_ALIPAY_SEC'],
+ 'ENABLE_ECC', 'XTS_SUPPORT', 'SUPPORT_ALIPAY_SEC','SUPPORT_RC_CALIBRATION'],
'ram_component': ["algorithm", "dfx_port_brandy", "dfx_update", 'dfx_nv', "osal", "arch_port", "-:testsuite",
"liteos_port", 'lcd', 'qspi_display', 'dfx_file_operation',
'psram', 'hal_mipi', 'mipi_tx', 'non_os', 'touch',
--- /dev/null
+{
+ "Partition_Tbl":{
+ "image_id" : "0x4B87A52D",
+ "stru_ver" : "0x00010000",
+ "version" : "0x00000000",
+ "param_info_description" : [
+ "Address Constraints: flash type must fill with relative address, RAM regions must fill with absolute address.",
+ "Item ID Constraints: ssb type: 0x00 ~ 0x0F, Relative address, Size",
+ " root public key and signature: 0x10 ~ 0x1F, Relative address, Size",
+ " firmware on flash: 0x20 ~ 0x2F, Relative address, Size",
+ " data on flash: 0x30 ~ 0x3F, Relative address, Size",
+
+ "Fixed item id: 0x00: ssb",
+ " 0x01: ssb_backup",
+ " 0x10: configure RootPubKey",
+ " 0x11: signature certificate",
+ " 0x12: ssb image signature",
+ " 0x13: signature certificate backup",
+ " 0x14: ssb image backup signature",
+ " 0x15: algorithm signature",
+ " 0x16: recovery signature",
+ " 0x17: bt_image signature",
+ " 0x18: dsp_main_image signature",
+ " 0x19: dsp_overlay_image signature",
+ " 0x1A: acpu_image signature",
+ " 0x20: recovery",
+ " 0x21: bt_image",
+ " 0x22: dsp_main_image",
+ " 0x23: dsp_overlay_image",
+ " 0x24: acpu_image",
+ " 0x30: nv_data",
+ " 0x31: fota_data"
+ ],
+ "param_info" : [
+ ["0x00", "0x00000000", "0x00020000"],
+ ["0x01", "0x00020000", "0x00020000"],
+ ["0x10", "0x00040000", "0x00001000"],
+ ["0x11", "0x00041000", "0x00001000"],
+ ["0x12", "0x00042000", "0x00001000"],
+ ["0x13", "0x00043000", "0x00001000"],
+ ["0x14", "0x00044000", "0x00001000"],
+ ["0x15", "0x00045000", "0x00001000"],
+ ["0x16", "0x00046000", "0x00001000"],
+ ["0x17", "0x00047000", "0x00001000"],
+ ["0x18", "0xFFFFFFFF", "0x00000000"],
+ ["0x19", "0xFFFFFFFF", "0x00000000"],
+ ["0x1a", "0x0004A000", "0x00001000"],
+ ["0x20", "0x00050000", "0x00040000"],
+ ["0x21", "0x00090000", "0x00070000"],
+ ["0x22", "0xFFFFFFFF", "0x00000000"],
+ ["0x23", "0xFFFFFFFF", "0x00000000"],
+ ["0x24", "0x00100000", "0x006F9000"],
+ ["0x30", "0x007F9000", "0x00004000"],
+ ["0x31", "0x007FD000", "0x00003000"]
+ ]
+ },
+ "Output_file_prefix":"AIoT"
+}
'plugin_demuxer_mjpeg', 'plugin_protocol_https', 'audio_port_common', 'plugin_demuxer_raw'],
'media_target4': ['audio_manager', 'audio_service', 'audio_stream', 'audio_utils', 'media_common', 'audio_hw',
'audio_primary_port', 'audio_bluetooth_port', 'audio_modem_port', 'media_hal_common',
- 'audio_port_common', 'media_sample_wrapper'],
+ 'audio_port_common', 'media_sample_wrapper', 'audio_decrypt'],
'gpu': ['gfx_rm', 'gpu'],
'gpu_test': ['test_gpu'],
'graphic_uikit': ['cjson_static', 'display_gfx', 'display_gralloc', 'display_layer', 'graphic_input', 'graphic_service',
if "CFG_FLASH_SIZE=16" in defines:
self.pack_fwpkg(env.get('chip'), target, "0x1000000")
else:
- self.pack_fwpkg(env.get('chip'), target, "0x800000")
+ if "CFG_LOAD_FROM_FS" in defines:
+ self.pack_fwpkg(env.get('chip'), target, "0x800000", "True")
+ else:
+ self.pack_fwpkg(env.get('chip'), target, "0x800000")
if not run_custom_cmd(env, target, 'build_post'):
self.print_build_result(target, 1)
print(f"ERROR! :{bin1} is not same with {bin2}")
sys.exit(1)
- def pack_fwpkg(self, chip, target_name, flash_size):
+ def pack_fwpkg(self, chip, target_name, flash_size, no_dsp="False"):
# bin packet all in one
packet_script_path = os.path.join(pkg_tools_path, 'packet.py')
print("packet ing...")
- errcode = exec_shell([self.python_path, packet_script_path, chip, target_name, flash_size], None, True)
+ errcode = exec_shell([self.python_path, packet_script_path, chip, target_name, flash_size, no_dsp], None, True)
if errcode != 0:
print("packet error!")
self.print_build_result(target_name, errcode)
static void GpioCallbackFunc(pin_t id, uintptr_t arg)\r
{\r
unused(arg);\r
+ if (id >= PIN_NONE) {\r
+ return;\r
+ }\r
if (g_iot_gpio_callback[id].func) {\r
g_iot_gpio_callback[id].func(g_iot_gpio_callback[id].arg);\r
}\r
} else {\r
return IOT_FAILURE;\r
}\r
+ if (id >= PIN_NONE) {\r
+ return IOT_FAILURE;\r
+ }\r
g_iot_gpio_callback[id].func = func;\r
g_iot_gpio_callback[id].arg = arg;\r
if (uapi_gpio_register_isr_func((pin_t)id, trigger, (gpio_callback_t)GpioCallbackFunc) != ERRCODE_SUCC) {\r
\r
unsigned int IoTGpioUnregisterIsrFunc(unsigned int id)\r
{\r
+ if (id >= PIN_NONE) {\r
+ return IOT_FAILURE;\r
+ }\r
if (uapi_gpio_unregister_isr_func((pin_t)id) != ERRCODE_SUCC) {\r
return IOT_FAILURE;\r
}\r
{ HAL_PIO_FUNC_OPI, HAL_PIO_DRIVE_MAX, HAL_PIO_PULL_DOWN, HAL_PIO_IE_ENBALE }, // S_EGPIO24
{ HAL_PIO_FUNC_OPI, HAL_PIO_DRIVE_MAX, HAL_PIO_PULL_DOWN, HAL_PIO_IE_ENBALE }, // S_EGPIO25
+#ifndef CFG_DRIVERS_SDIO
{ HAL_PIO_FUNC_GPIO, HAL_PIO_DRIVE_MAX, HAL_PIO_PULL_DOWN, HAL_PIO_IE_DISABLE }, // S_HGPIO0 sdio
{ HAL_PIO_FUNC_GPIO, HAL_PIO_DRIVE_MAX, HAL_PIO_PULL_DOWN, HAL_PIO_IE_DISABLE }, // S_HGPIO1
{ HAL_PIO_FUNC_GPIO, HAL_PIO_DRIVE_MAX, HAL_PIO_PULL_DOWN, HAL_PIO_IE_DISABLE }, // S_HGPIO2
{ HAL_PIO_FUNC_GPIO, HAL_PIO_DRIVE_MAX, HAL_PIO_PULL_DOWN, HAL_PIO_IE_DISABLE }, // S_HGPIO3
{ HAL_PIO_FUNC_GPIO, HAL_PIO_DRIVE_MAX, HAL_PIO_PULL_DOWN, HAL_PIO_IE_DISABLE }, // S_HGPIO4
{ HAL_PIO_FUNC_GPIO, HAL_PIO_DRIVE_MAX, HAL_PIO_PULL_DOWN, HAL_PIO_IE_DISABLE }, // S_HGPIO5
+#else
+ { HAL_PIO_FUNC_SDIO, HAL_PIO_DRIVE_MAX, HAL_PIO_PULL_UP, HAL_PIO_IE_ENBALE }, // S_HGPIO0 sdio
+ { HAL_PIO_FUNC_SDIO, HAL_PIO_DRIVE_MAX, HAL_PIO_PULL_UP, HAL_PIO_IE_ENBALE }, // S_HGPIO1
+ { HAL_PIO_FUNC_SDIO, HAL_PIO_DRIVE_MAX, HAL_PIO_PULL_UP, HAL_PIO_IE_ENBALE }, // S_HGPIO2
+ { HAL_PIO_FUNC_SDIO, HAL_PIO_DRIVE_MAX, HAL_PIO_PULL_UP, HAL_PIO_IE_ENBALE }, // S_HGPIO3
+ { HAL_PIO_FUNC_SDIO, HAL_PIO_DRIVE_MAX, HAL_PIO_PULL_MAX, HAL_PIO_IE_ENBALE }, // S_HGPIO4
+ { HAL_PIO_FUNC_SDIO, HAL_PIO_DRIVE_MAX, HAL_PIO_PULL_UP, HAL_PIO_IE_ENBALE }, // S_HGPIO5
+#endif
#if (defined CFG_DRIVERS_NANDFLASH)
{ HAL_PIO_FUNC_QSPI1, HAL_PIO_DRIVE_MAX, HAL_PIO_PULL_MAX, HAL_PIO_IE_ENBALE }, // S_HGPIO6
{ HAL_PIO_FUNC_QSPI1, HAL_PIO_DRIVE_MAX, HAL_PIO_PULL_DOWN, HAL_PIO_IE_ENBALE }, // S_HGPIO7
* 分区表配置:\r
* 16M:build\config\target_config\brandy\param_sector\param_sector_16M.json\r
* 8M:build\config\target_config\brandy\param_sector\param_sector.json\r
+ * 8M no_dsp:build\config\target_config\brandy\param_sector\param_sector_no_dsp.json\r
* 打包脚本:\r
* tools\pkg\chip_packet\brandy\packet.py\r
*/\r
#define HIFI0_CODEC_PAGES 448
#define APP_IMAGE_PAGES 2048
#else
+#if defined(CFG_LOAD_FROM_FS)
+#define DTB_IMAGE_PAGES 0
+#define RECOVERY_IMAGE_PAGES 64
+#define RESERVE_IMAGE_PAGES 0
+#define BT_IMAGE_PAGES 112
+#define HIFI0_IMAGE_PAGES 0
+#define HIFI0_CODEC_PAGES 0
+#define APP_IMAGE_PAGES 1785
+#else
#define DTB_IMAGE_PAGES 0
#define RECOVERY_IMAGE_PAGES 64
#define RESERVE_IMAGE_PAGES 0
#define HIFI0_CODEC_PAGES 320
#define APP_IMAGE_PAGES 1353
#endif
+#endif
#define NV_IMAGE_PAGES 4
#define FOTA_IMAGE_PAGES 3
#define FOTA_IMAGE_START 0x770000
#define SND_PORT_AEF_TYPE 0x180 // 参考 soc_uapi_aef.h 中 UAPI_AEF_TYPE_SMARTPA 枚举
#endif
#define SND_PORT_AEF_ENABLE true // true代表开启aef算法,false代表关闭aef算法
+
+#define OPUS_ENC_BIT_RATE 16000 // opus编码码率
+#define MP3_ENC_BIT_RATE 16000 // mp3编码码率
/**
* @}
*/
#define SND_PORT_AEF_TYPE 0x180 // 参考 soc_uapi_aef.h 中 UAPI_AEF_TYPE_SMARTPA 枚举
#endif
#define SND_PORT_AEF_ENABLE true // true代表开启aef算法,false代表关闭aef算法
+
+#define OPUS_ENC_BIT_RATE 16000 // opus编码码率
+#define MP3_ENC_BIT_RATE 16000 // mp3编码码率
/**
* @}
*/
static void mcu_clocks_set_freq(system_mcu_core_clk_cfg_t sys_mcu_clks)
{
- uint16_t level = CLOCKS_SDIO_FREQ_32M;
clocks_clk_src_t mcu_core_clk = sys_mcu_clks.mcu_clk.clk_src;
uint8_t mcu_clk_div = sys_mcu_clks.mcu_clk.clk_div;
clocks_clk_src_t psram_clk = sys_mcu_clks.psram_clk.clk_src;
uint8_t mem_clk_div = sys_mcu_clks.mem_clk.clk_div;
clocks_clk_src_t flash_clk = sys_mcu_clks.flash_clk.clk_src;
uint8_t flash_clk_div = sys_mcu_clks.flash_clk.clk_div;
- clocks_clk_src_t sdiom_clk = sys_mcu_clks.sdiom_clk.clk_src;
- uint8_t sdiom_clk_div = sys_mcu_clks.sdiom_clk.clk_div;
clocks_clk_src_t gpu_clk = sys_mcu_clks.gpu_clk.clk_src;
uint8_t gpu_clk_div = sys_mcu_clks.gpu_clk.clk_div;
clocks_clk_src_t spi_clk = sys_mcu_clks.spi_clk.clk_src;
uint8_t spi_clk_div = sys_mcu_clks.spi_clk.clk_div;
+ clocks_clk_src_t sdiom_clk = sys_mcu_clks.sdiom_clk.clk_src;
+ uint8_t sdiom_clk_div = sys_mcu_clks.sdiom_clk.clk_div;
mcu_clock_set_freq(mcu_core_clk, mcu_clk_div);
uint32_t irq_status = osal_irq_lock();
system_ccrg_clock_config(CLOCKS_CCRG_MODULE_XIP_OPI, psram_clk, psram_clk_div);
system_ccrg_clock_config(CLOCKS_CCRG_MODULE_MEM_BUS, mem_clk, mem_clk_div);
system_ccrg_clock_config(CLOCKS_CCRG_MODULE_XIP_QSPI, flash_clk, flash_clk_div);
-#ifdef CFG_DRIVERS_MMC
- level = get_sdiom_freq_level(sdiom_clk);
- if (g_sdiom_handler != NULL) { g_sdiom_handler(level); }
-#else
- system_ccrg_clock_config(CLOCKS_CCRG_MODULE_SDIOM, sdiom_clk, sdiom_clk_div);
+ /* NANDFLASH对SDIOM有依赖,如果不配置的话,sdiom会固定选择PLL时钟源,功耗有损失 */
+#ifdef CFG_DRIVERS_NANDFLASH
+ if (is_sdio_working() == false) {
+ system_ccrg_clock_config(CLOCKS_CCRG_MODULE_SDIOM, sdiom_clk, sdiom_clk_div);
+ }
#endif
system_ccrg_clock_config(CLOCKS_CCRG_MODULE_GPU, gpu_clk, gpu_clk_div);
system_ccrg_clock_config(CLOCKS_CCRG_MODULE_MCU_PERP_SPI, spi_clk, spi_clk_div);
bool g_startup_finish_flag = false;\r
uint16_t g_ulp_wkup_flag = 0;\r
static uint32_t g_clock_ulp = 3276800;\r
+static uint8_t g_button_vetoed = 0;\r
\r
void set_startup_finish_flag(void)\r
{\r
}\r
}\r
\r
+/*porting_button_add_veto和porting_button_remove_veto为补丁合入*/\r
+#if 0\r
+static void porting_button_add_veto(void)\r
+{\r
+ if (g_button_vetoed == 0) {\r
+ uapi_pm_add_sleep_veto(PM_ID_BUTTON);\r
+ g_button_vetoed = 1;\r
+ }\r
+}\r
+\r
+static void porting_button_remove_veto(void)\r
+{\r
+ if (g_button_vetoed == 1) {\r
+ uapi_pm_remove_sleep_veto(PM_ID_BUTTON);\r
+ g_button_vetoed = 0;\r
+ }\r
+}\r
+#endif\r
+\r
button_peripheral_api g_brandy_button_api = {\r
.button_pmu_pwr_cfg = porting_button_pmu_pwr_cfg,\r
.button_check_interrupt = porting_button_check_int,\r
elseif(EXISTS ${BIN_DIR}/${PROJECT_CHIP_DIR}/libs/audio/CMakeLists.txt)
set(PUBLIC_HEADER ${CMAKE_CURRENT_SOURCE_DIR}/include)
add_subdirectory(${BIN_DIR}/${PROJECT_CHIP_DIR}/libs/audio audio)
+else()
+ set(PUBLIC_HEADER ${CMAKE_CURRENT_SOURCE_DIR}/include)
+ set(AUDIO_LIST "audio_api" "audio_core" "audio_drv" "audio_sample" "audio_vendor")
+
+ set(COMPONENT_LIST ${AUDIO_LIST})
+ set(AUDIO_LIB_LIST)
+
+ set(SAP_BOARD ${BOARD})
+ # Switch audio libs dir for brandy evb4
+ if("BRANDY_PRODUCT_EVB4" IN_LIST DEFINES)
+ string(APPEND SAP_BOARD "4")
+ endif()
+
+ set(LIBRARY_OUTPUT_PATH ${BIN_DIR}/${CHIP}/libs/audio/${SAP_BOARD}_${APPLICATION}/${OS})
+ foreach(COMPONENT ${COMPONENT_LIST})
+ set(COMPONENT_NAME ${COMPONENT})
+ if (NOT ${COMPONENT_NAME} IN_LIST TARGET_COMPONENT)
+ continue()
+ endif()
+ find_library(LIBS${COMPONENT_NAME} "lib${COMPONENT_NAME}.a" ${LIBRARY_OUTPUT_PATH})
+ set(AUDIO_LIB_LIST ${AUDIO_LIB_LIST} ${LIBS${COMPONENT_NAME}})
+ build_component()
+ endforeach()
+
+ target_link_libraries(${TARGET_NAME} PRIVATE -Wl,--whole-archive ${AUDIO_LIB_LIST} -Wl,--no-whole-archive )
endif()
*/
td_s32 uapi_audio_set_dsp_log_level(td_u32 log_level);
+/**
+ * @if Eng
+ * @brief Set DSP binary file path.
+ * @retval SUCCESS Success.
+ * @retval FAILURE Failure.
+ * @else
+ * @brief 设置DSP二进制文件路径
+ * @retval SUCCESS 成功
+ * @retval FAILURE 失败
+ * @endif
+ */
+td_s32 uapi_audio_set_dsp_file_path(const td_char *file_path, td_u32 len);
+
/**
* @}
*/
UAPI_SND_AEF_PROFILE_MUSIC,
UAPI_SND_AEF_PROFILE_VOIP,
UAPI_SND_AEF_PROFILE_RINGTONE,
+ UAPI_SND_AEF_PROFILE_EXT0,
+ UAPI_SND_AEF_PROFILE_EXT1,
+ UAPI_SND_AEF_PROFILE_EXT2,
UAPI_SND_AEF_PROFILE_VOIP_CAT1,
UAPI_SND_AEF_PROFILE_MAX,
} uapi_snd_aef_profile;
td_s32 mpi_audio_set_dsp_log_level(td_u32 log_level);
+td_s32 mpi_audio_set_dsp_file_path(const td_char *file_path, td_u32 len);
+
#ifdef __cplusplus
#if __cplusplus
}
#define mpi_sys_check_inited() \
do { \
if (g_mpi_sys_init_cnt == 0) { \
- return ERR_ADEC_NOT_INIT; \
+ return ERR_SYS_NOT_INIT; \
} \
} while (0)
return AUDIO_SUCCESS;
}
+td_s32 mpi_audio_set_dsp_file_path(const td_char *file_path, td_u32 len)
+{
+ td_s32 ret;
+ sap_drv_str drv_str;
+
+ mpi_sys_check_inited();
+ mpi_sys_lock();
+
+ audio_api_time_consum_stat();
+
+ drv_str.str = file_path;
+ drv_str.len = len;
+ ret = audio_ioctl(g_mpi_sys_fd, CMD_IOCTL_SYS_SET_DSP_FILE_PATH, (td_void *)&drv_str);
+ if (ret != AUDIO_SUCCESS) {
+ mpi_sys_unlock();
+ return ret;
+ }
+
+ mpi_sys_unlock();
+ return AUDIO_SUCCESS;
+}
+
#ifdef __cplusplus
#if __cplusplus
}
return mpi_audio_set_dsp_log_level(log_level);
}
+td_s32 uapi_audio_set_dsp_file_path(const td_char *file_path, td_u32 len)
+{
+ return mpi_audio_set_dsp_file_path(file_path, len);
+}
+
#ifdef __cplusplus
#if __cplusplus
}
CFG_SAP_SEA_SEE_1MIC_SUPPORT=y
CFG_SAP_SEA_SEE_1MIC_WNR_SUPPORT=y
CFG_SAP_SEA_SEE_1MIC_NNSPK_SUPPORT=y
+CFG_SAP_SEA_SEE_1MIC_EQ_SUPPORT=y
# CFG_SAP_SEA_SEE_1MIC_PROTECT_SUPPORT is not set
# CFG_SAP_SEA_SEE_2MIC_SUPPORT is not set
# CFG_SAP_SEA_VQE_DEF_SUPPORT is not set
CFG_SAP_SEA_SEE_1MIC_SUPPORT=y
CFG_SAP_SEA_SEE_1MIC_WNR_SUPPORT=y
CFG_SAP_SEA_SEE_1MIC_NNSPK_SUPPORT=y
+CFG_SAP_SEA_SEE_1MIC_EQ_SUPPORT=y
# CFG_SAP_SEA_SEE_1MIC_PROTECT_SUPPORT is not set
# CFG_SAP_SEA_SEE_2MIC_SUPPORT is not set
# CFG_SAP_SEA_VQE_DEF_SUPPORT is not set
CFG_SAP_SEA_SEE_1MIC_SUPPORT=y
# CFG_SAP_SEA_SEE_1MIC_WNR_SUPPORT is not set
# CFG_SAP_SEA_SEE_1MIC_NNSPK_SUPPORT is not set
+# CFG_SAP_SEA_SEE_1MIC_EQ_SUPPORT is not set
# CFG_SAP_SEA_SEE_1MIC_PROTECT_SUPPORT is not set
# CFG_SAP_SEA_SEE_2MIC_SUPPORT is not set
# CFG_SAP_SEA_VQE_DEF_SUPPORT is not set
CFG_SAP_SEA_SEE_1MIC_SUPPORT=y
CFG_SAP_SEA_SEE_1MIC_WNR_SUPPORT=y
CFG_SAP_SEA_SEE_1MIC_NNSPK_SUPPORT=y
+CFG_SAP_SEA_SEE_1MIC_EQ_SUPPORT=y
# CFG_SAP_SEA_SEE_1MIC_PROTECT_SUPPORT is not set
# CFG_SAP_SEA_SEE_2MIC_SUPPORT is not set
# CFG_SAP_SEA_VQE_DEF_SUPPORT is not set
CFG_SAP_SEA_SEE_1MIC_SUPPORT=y
CFG_SAP_SEA_SEE_1MIC_WNR_SUPPORT=y
CFG_SAP_SEA_SEE_1MIC_NNSPK_SUPPORT=y
+CFG_SAP_SEA_SEE_1MIC_EQ_SUPPORT=y
# CFG_SAP_SEA_SEE_1MIC_PROTECT_SUPPORT is not set
# CFG_SAP_SEA_SEE_2MIC_SUPPORT is not set
# CFG_SAP_SEA_VQE_DEF_SUPPORT is not set
)\r
endif()\r
\r
-if("${CHIP}" STREQUAL "brandy")\r
-install_sdk(${CMAKE_CURRENT_SOURCE_DIR}/dpm "*")\r
-endif()\r
-\r
-if("${CFG_SAP_DRV_OVERLAY_LOAD_FROM}" STREQUAL "flash")\r
+if("CFG_LOAD_FROM_FS" IN_LIST DEFINES)\r
+set(COMPONENT_SRC ${COMPONENT_SRC}\r
+ ${CMAKE_CURRENT_SOURCE_DIR}/common/drv_overlay_load_from_file.c\r
+)\r
+else()\r
set(COMPONENT_SRC ${COMPONENT_SRC}\r
${CMAKE_CURRENT_SOURCE_DIR}/common/drv_overlay_load_from_flash.c\r
)\r
endif()\r
\r
-if("${CFG_SAP_DRV_OVERLAY_LOAD_FROM}" STREQUAL "file")\r
-set(COMPONENT_SRC ${COMPONENT_SRC}\r
- ${CMAKE_CURRENT_SOURCE_DIR}/common/drv_overlay_load_from_file.c\r
-)\r
+if("${CHIP}" STREQUAL "brandy")\r
+install_sdk(${CMAKE_CURRENT_SOURCE_DIR}/dpm "*")\r
+install_sdk(${CMAKE_CURRENT_SOURCE_DIR}/common "drv_overlay_load_from_file.c")\r
+install_sdk(${CMAKE_CURRENT_SOURCE_DIR}/common "drv_overlay_load_from_flash.c")\r
endif()\r
#===================================================================================\r
set(COMPONENT_INC\r
{AO_AEF_PROFILE_MUSIC, "aef_music.bin"},
{AO_AEF_PROFILE_VOIP, "aef_voip.bin"},
{AO_AEF_PROFILE_RINGTONE, "aef_ringtone.bin"},
+ {AO_AEF_PROFILE_EXT0, "aef_ext0.bin"},
+ {AO_AEF_PROFILE_EXT1, "aef_ext1.bin"},
+ {AO_AEF_PROFILE_EXT2, "aef_ext2.bin"},
};
const td_u32 item_cnt = (td_u32)(sizeof(aef_profile_bin_name) / sizeof(aef_profile_bin_name[0]));
{AO_AEF_PROFILE_NONE, "none"},
{AO_AEF_PROFILE_MUSIC, "music"},
{AO_AEF_PROFILE_VOIP, "voip"},
- {AO_AEF_PROFILE_RINGTONE, "RINGTONE"},
+ {AO_AEF_PROFILE_RINGTONE, "ringtone"},
+ {AO_AEF_PROFILE_EXT0, "ext0"},
+ {AO_AEF_PROFILE_EXT1, "ext1"},
+ {AO_AEF_PROFILE_EXT2, "ext2"},
};
static const td_char *drv_ao_proc_aef_profile_name(ao_aef_profile profile)
[CMD_SYS_SET_TWS_MODE] = {CMD_IOCTL_SYS_SET_TWS_MODE, sap_ioctl_sys_set_tws_mode},
[CMD_SYS_SET_TWS_ROLE] = {CMD_IOCTL_SYS_SET_TWS_ROLE, sap_ioctl_sys_set_tws_role},
[CMD_SYS_SET_DSP_LOG_LEVEL] = {CMD_IOCTL_SYS_SET_DSP_LOG_LEVEL, sap_ioctl_sys_set_dsp_log_level},
+ [CMD_SYS_SET_DSP_FILE_PATH] = {CMD_IOCTL_SYS_SET_DSP_FILE_PATH, sap_ioctl_sys_set_dsp_file_path},
};
static drv_audio_osal_fileops g_sap_sys_fops = {
td_u32 value;
} sap_drv_u32;
+typedef struct {
+ td_char *str;
+ td_u32 len;
+} sap_drv_str;
+
typedef struct {
td_handle track;
td_s64 pts; /* us */
#define CMD_IOCTL_SYS_SET_TWS_MODE _IOW(DEV_ID_SAP_SYS, CMD_SYS_SET_TWS_MODE, td_u8)
#define CMD_IOCTL_SYS_SET_TWS_ROLE _IOW(DEV_ID_SAP_SYS, CMD_SYS_SET_TWS_ROLE, td_u8)
#define CMD_IOCTL_SYS_SET_DSP_LOG_LEVEL _IOW(DEV_ID_SAP_SYS, CMD_SYS_SET_DSP_LOG_LEVEL, td_u32)
+#define CMD_IOCTL_SYS_SET_DSP_FILE_PATH _IOW(DEV_ID_SAP_SYS, CMD_SYS_SET_DSP_FILE_PATH, sap_drv_str)
#define CMD_IOCTL_ADP_INIT _IOWR(DEV_ID_SAP_ADP, CMD_ADP_INIT, sap_adp_init)
#define CMD_IOCTL_ADP_DEINIT _IO(DEV_ID_SAP_ADP, CMD_ADP_DEINIT)
CMD_SYS_SET_TWS_MODE,
CMD_SYS_SET_TWS_ROLE,
CMD_SYS_SET_DSP_LOG_LEVEL,
+ CMD_SYS_SET_DSP_FILE_PATH,
CMD_SYS_ID_MAX,
};
--- /dev/null
+/*
+ * Copyright (c) CompanyNameMagicTag 2020-2020. All rights reserved.
+ * Description: header file for audio input
+ * Author: audio
+ */
+
+#include "securec.h"
+#include "mem_addr.h"
+#include "audio_osal.h"
+#include "audio_debug.h"
+#include "drv_audio_osal.h"
+#include "drv_overlay_load.h"
+#include "core_overlay_info.h"
+
+#ifdef __cplusplus
+#if __cplusplus
+extern "C" {
+#endif
+#endif
+
+#define MAX_PATH_LENGTH 64
+
+static const td_char *g_dsp_main_file = "dsp_main.bin";
+static const td_char *g_dsp_lib_file = "dsp_overlay.bin";
+static td_char g_dsp_file_path[MAX_PATH_LENGTH] = {0};
+
+td_s32 overlay_set_dsp_file_path(const char *file_path, td_u32 len)
+{
+ td_s32 ret;
+ td_u32 dsp_main_file_length = strlen(g_dsp_main_file);
+ td_u32 dsp_lib_file_length = strlen(g_dsp_lib_file);
+ td_u32 max_file_length = (dsp_main_file_length > dsp_lib_file_length) ? dsp_main_file_length : dsp_lib_file_length;
+
+ if (len + max_file_length >= MAX_PATH_LENGTH) {
+ sap_err_log_u32(len);
+ sap_err_log_info("file path is too long");
+ return ERR_SYS_MEM_OVERLOAD;
+ }
+
+ ret = memcpy_s(g_dsp_file_path, MAX_PATH_LENGTH - 1, file_path, len);
+ if (ret != EOK) {
+ sap_err_log_fun(memcpy_s, ret);
+ return ERR_SYS_MEM_COPY;
+ }
+
+ return AUDIO_SUCCESS;
+}
+
+static td_s32 overlay_load_elf(audio_core_id core_id, td_void *flip)
+{
+ td_u32 i, sec_cnt;
+ td_bool tcm_flag;
+ td_u32 phys_addr;
+ td_u32 *virt_addr = TD_NULL;
+ td_char *sec_buf = TD_NULL;
+ struct {
+ td_u32 addr;
+ td_u32 size;
+ } sec_hdr;
+
+ if (drv_audio_osal_klib_fread((td_char *)&sec_cnt, sizeof(sec_cnt), flip) != sizeof(sec_cnt)) {
+ return ERR_SYS_NOT_AVAILABLE;
+ }
+
+ for (i = 0; i < sec_cnt; i++) {
+ if (drv_audio_osal_klib_fread((td_char *)&sec_hdr, sizeof(sec_hdr), flip) != sizeof(sec_hdr)) {
+ return ERR_SYS_NOT_AVAILABLE;
+ }
+
+ if (is_4byte_aligned(sec_hdr.addr) != TD_TRUE || is_4byte_aligned(sec_hdr.size) != TD_TRUE) {
+ audio_log_err("addr=%#x/size=%#x, not aligned to 4 bytes", sec_hdr.addr, sec_hdr.size);
+ return ERR_SYS_VERIFY_FAIL;
+ }
+
+ phys_addr = drv_overlay_map_addr(core_id, sec_hdr.addr, &tcm_flag);
+ virt_addr = audio_osal_address_map((td_ulong)phys_addr, sec_hdr.size);
+ if (virt_addr == TD_NULL) {
+ return ERR_SYS_MEM_EXCEPTION;
+ }
+
+ if (tcm_flag) {
+ /* Load IRAM/DRAM with 32bit operation */
+ sec_buf = audio_osal_malloc_aligned(sec_hdr.size, sizeof(td_u32));
+ if (sec_buf == TD_NULL) {
+ audio_osal_address_unmap((td_ulong)phys_addr, virt_addr);
+ return ERR_SYS_MEM_ALLOC;
+ }
+ if (drv_audio_osal_klib_fread((td_char *)sec_buf, sec_hdr.size, flip) != sec_hdr.size) {
+ audio_osal_free_aligned(sec_buf);
+ audio_osal_address_unmap((td_ulong)phys_addr, virt_addr);
+ return ERR_SYS_NOT_AVAILABLE;
+ }
+ drv_overlay_copy_section(virt_addr, (const td_u32 *)sec_buf, sec_hdr.size);
+ audio_osal_free_aligned(sec_buf);
+ } else {
+ if (drv_audio_osal_klib_fread((td_char *)virt_addr, sec_hdr.size, flip) != sec_hdr.size) {
+ audio_osal_address_unmap((td_ulong)phys_addr, virt_addr);
+ return ERR_SYS_NOT_AVAILABLE;
+ }
+ }
+
+ audio_osal_dcache_region_wb((td_ulong)phys_addr, virt_addr, sec_hdr.size);
+ audio_osal_address_unmap((td_ulong)phys_addr, virt_addr);
+ }
+
+ return AUDIO_SUCCESS;
+}
+
+static td_s32 overlay_get_file_from_flash(const char *file, td_u32 flash_addr, td_u32 flash_len)
+{
+#ifdef SAP_FLASH_FIRMWARE_SUPPORT
+ td_void *flip = TD_NULL;
+
+ audio_log_warn("save %#x %#x to %s\n", flash_addr, flash_len, file);
+ flip = drv_audio_osal_klib_fopen(file, DRV_AUDIO_OSAL_O_RDWR | DRV_AUDIO_OSAL_O_CREAT, 0777); /* 0777: priv mode */
+ if (flip == TD_NULL) {
+ audio_log_err("open %s failed\n", file);
+ return ERR_SYS_OPEN_FAILED;
+ }
+
+ if (drv_audio_osal_klib_fwrite((td_char *)flash_addr, flash_len, flip) != flash_len) {
+ audio_log_err("Write %s failed\n", file);
+ return ERR_SYS_MEM_COPY;
+ }
+
+ audio_log_warn("Save %s Success.\n", file);
+ drv_audio_osal_klib_fclose(flip);
+#endif
+ audio_unused(file);
+ audio_unused(flash_addr);
+ audio_unused(flash_len);
+ return AUDIO_SUCCESS;
+}
+
+static td_void *overlay_open_file(const char *file, td_u32 flash_addr, td_u32 flash_len)
+{
+ td_s32 ret;
+ td_void *flip = TD_NULL;
+ td_char full_path[MAX_PATH_LENGTH] = {0};
+
+ ret = snprintf_s(full_path, MAX_PATH_LENGTH - 1, MAX_PATH_LENGTH - 1, "%s%s", g_dsp_file_path, file);
+ if (ret < 0) {
+ sap_err_log_s32(ret);
+ return ERR_SYS_MEM_COPY;
+ }
+
+ flip = drv_audio_osal_klib_fopen(full_path, DRV_AUDIO_OSAL_O_RDONLY, 0);
+ if (flip == TD_NULL) {
+ ret = overlay_get_file_from_flash(full_path, flash_addr, flash_len);
+ if (ret != AUDIO_SUCCESS) {
+ sap_err_log_fun(overlay_get_file_from_flash, ret);
+ return TD_NULL;
+ }
+
+ flip = drv_audio_osal_klib_fopen(full_path, DRV_AUDIO_OSAL_O_RDONLY, 0);
+ if (flip == TD_NULL) {
+ sap_err_log_fun(drv_audio_osal_klib_fopen, ERR_SYS_OPEN_FAILED);
+ return TD_NULL;
+ }
+ }
+
+ return flip;
+}
+
+static td_s32 overlay_update_section_list(audio_core_id core_id, td_void *flip)
+{
+ td_u32 i;
+ td_u32 sec_cnt;
+ td_bool tcm_flag;
+ struct {
+ td_u32 addr;
+ td_u32 size;
+ } sec_hdr;
+
+ drv_overlay_clear_section_list();
+
+ drv_audio_osal_klib_fseek(0, SEEK_SET, flip);
+ if (drv_audio_osal_klib_fread((td_char *)&sec_cnt, sizeof(sec_cnt), flip) != sizeof(sec_cnt)) {
+ return ERR_SYS_NOT_AVAILABLE;
+ }
+
+ for (i = 0; i < sec_cnt; i++) {
+ if (drv_audio_osal_klib_fread((td_char *)&sec_hdr, sizeof(sec_hdr), flip) != sizeof(sec_hdr)) {
+ return ERR_SYS_NOT_AVAILABLE;
+ }
+
+ (td_void)drv_overlay_map_addr(core_id, sec_hdr.addr, &tcm_flag);
+ drv_overlay_add_section_item(core_id, sec_hdr.addr, sec_hdr.size);
+
+ drv_audio_osal_klib_fseek(sec_hdr.size, SEEK_CUR, flip);
+ }
+
+ return AUDIO_SUCCESS;
+}
+
+static td_s32 overlay_unpack_lib(const td_char *lib_name, td_void *flip, td_u32 *lib_size)
+{
+ td_u32 i, sec_cnt = 0;
+ struct {
+ td_char name[OVERLAY_NAME_LEN];
+ td_u32 size;
+ } sec_hdr;
+
+ if (drv_audio_osal_klib_fread((td_char *)&sec_cnt, sizeof(td_u32), flip) != sizeof(td_u32)) {
+ sap_err_log_fun(drv_audio_osal_klib_fread, AUDIO_FAILURE);
+ return ERR_SYS_NOT_AVAILABLE;
+ }
+
+ for (i = 0; i < sec_cnt; i++) {
+ if (drv_audio_osal_klib_fread((td_char *)&sec_hdr, sizeof(sec_hdr), flip) != sizeof(sec_hdr)) {
+ sap_err_log_fun(drv_audio_osal_klib_fread, AUDIO_FAILURE);
+ return ERR_SYS_NOT_AVAILABLE;
+ }
+
+ sap_trace_log_str(sec_hdr.name);
+ if (audio_osal_strncmp(sec_hdr.name, sizeof(sec_hdr.name), lib_name, sizeof(sec_hdr.name)) == 0) {
+ sap_warn_log_str(sec_hdr.name);
+ if (lib_size == TD_NULL) {
+ return ERR_SYS_NULL_PTR;
+ }
+ *lib_size = sec_hdr.size;
+ return AUDIO_SUCCESS;
+ }
+
+ if (drv_audio_osal_klib_fseek(sec_hdr.size, OSAL_SEEK_CUR, flip) < 0) {
+ sap_err_log_fun(drv_audio_osal_klib_fseek, AUDIO_FAILURE);
+ return ERR_SYS_NOT_AVAILABLE;
+ }
+ }
+
+ return ERR_SYS_NOT_SUPPORTED;
+}
+
+td_s32 drv_overlay_get_lib(const td_char *lib_name, td_u8 *lib_buf, td_u32 *lib_buf_size)
+{
+ td_s32 ret;
+ td_u32 lib_size;
+ td_u8 *lib = TD_NULL;
+ td_void *flip = TD_NULL;
+
+ sys_check_null_ptr_return(lib_name);
+ sys_check_null_ptr_return(lib_buf);
+ sys_check_null_ptr_return(lib_buf_size);
+
+ flip = overlay_open_file(g_dsp_lib_file, FLASH_DSP_OVERLAY_ADDR, FLASH_DSP_OVERLAY_SIZE);
+ if (flip == TD_NULL) {
+ sap_err_log_fun(overlay_open_file, flip);
+ return ERR_SYS_OPEN_FAILED;
+ }
+
+ ret = overlay_unpack_lib(lib_name, flip, &lib_size);
+ if (ret != AUDIO_SUCCESS) {
+ sap_err_log_fun(overlay_unpack_lib, ret);
+ goto out0;
+ }
+
+ if (lib_size > *lib_buf_size) { /* input buf size check */
+ sap_err_log_str(lib_size);
+ ret = ERR_SYS_BUF_OVERFLOW;
+ goto out0;
+ }
+
+ if (drv_audio_osal_klib_fread((td_char *)lib_buf, lib_size, flip) != lib_size) {
+ ret = ERR_SYS_NOT_AVAILABLE;
+ goto out0;
+ }
+
+ *lib_buf_size = lib_size; /* output buf actual data size */
+
+out0:
+ drv_audio_osal_klib_fclose(flip);
+ return ret;
+}
+
+td_s32 drv_overlay_load_main_program(audio_core_id core_id)
+{
+ td_s32 ret;
+ td_void *flip = TD_NULL;
+
+ flip = overlay_open_file(g_dsp_main_file, FLASH_DSP_MAIN_ADDR, FLASH_DSP_MAIN_SIZE);
+ if (flip == TD_NULL) {
+ return ERR_SYS_OPEN_FAILED;
+ }
+
+ ret = overlay_load_elf(core_id, flip);
+ if (ret != AUDIO_SUCCESS) {
+ sap_err_log_fun(overlay_load_elf, ret);
+ drv_audio_osal_klib_fclose(flip);
+ return ret;
+ }
+
+ overlay_update_section_list(core_id, flip);
+ drv_audio_osal_klib_fclose(flip);
+
+ return AUDIO_SUCCESS;
+}
+
+td_s32 drv_overlay_load_lib_program(audio_core_id core_id, audio_lib_id type, td_u32 index)
+{
+ td_s32 ret;
+ td_u32 lib_size;
+ const td_char *lib_name = TD_NULL;
+ td_void *flip = TD_NULL;
+
+ if (type >= AUDIO_LIB_MAX) {
+ sap_err_log_s32(type);
+ return ERR_SYS_INVALID_PARAM;
+ }
+
+ lib_name = drv_overlay_find_and_reset_lib(core_id, type, index);
+ if (lib_name == TD_NULL) {
+ sap_err_log_fun(drv_overlay_find_and_reset_lib, lib_name);
+ return ERR_SYS_NOT_SUPPORTED;
+ }
+
+ flip = overlay_open_file(g_dsp_lib_file, FLASH_DSP_OVERLAY_ADDR, FLASH_DSP_OVERLAY_SIZE);
+ if (flip == TD_NULL) {
+ sap_err_log_fun(overlay_open_file, flip);
+ return ERR_SYS_OPEN_FAILED;
+ }
+
+ ret = overlay_unpack_lib(lib_name, flip, &lib_size);
+ if (ret != AUDIO_SUCCESS) {
+ sap_err_log_fun(overlay_unpack_lib, ret);
+ drv_audio_osal_klib_fclose(flip);
+ return ret;
+ }
+
+ ret = overlay_load_elf(core_id, flip);
+ if (ret != AUDIO_SUCCESS) {
+ sap_err_log_fun(overlay_load_elf, ret);
+ drv_audio_osal_klib_fclose(flip);
+ return ret;
+ }
+
+ drv_audio_osal_klib_fclose(flip);
+ audio_unused(core_id);
+ return AUDIO_SUCCESS;
+}
+
+#ifdef __cplusplus
+#if __cplusplus
+}
+#endif
+#endif
#endif
#endif
+td_s32 overlay_set_dsp_file_path(const char *file_path, td_u32 len)
+{
+ audio_unused(file_path);
+ audio_unused(len);
+ return AUDIO_SUCCESS;
+}
+
static td_s32 overlay_load_elf(audio_core_id core_id, const td_u8 *lib, td_u32 size)
{
td_u32 i, sec_cnt;
}
}
+td_s32 overlay_set_dsp_file_path(const char *file_path, td_u32 len);
+
td_u32 drv_overlay_map_addr(audio_core_id core_id, td_u32 addr, td_bool *tcm_flag);
td_s32 drv_overlay_add_section_item(audio_core_id core_id, td_u32 addr, td_u32 size);
\r
td_s32 sap_ioctl_sys_set_dsp_log_level(td_u32 cmd, td_void *arg, td_void *file);\r
\r
+td_s32 sap_ioctl_sys_set_dsp_file_path(td_u32 cmd, td_void *arg, td_void *file);\r
+\r
td_s32 drv_msg_sys_module_init(audio_core_id core_id);\r
\r
td_s32 sys_read_proc(td_void *file, td_void *private);\r
return ret;
}
-#if (SAP_CHIP_TYPE != socmn1)
- hal_dsp_set_power_on(core_cid, TD_TRUE);
-
- ret = drv_sys_load_image(core_cid);
- if (ret != AUDIO_SUCCESS) {
- sap_err_log_fun(drv_sys_load_image, ret);
- drv_sap_msg_stop(core_cid);
- hal_dsp_reset(core_cid);
- hal_dsp_deinit(core_cid);
- drv_ipc_deinit(drv_cid, core_cid);
- return ret;
- }
-
- drv_overlay_backup_tcm(core_cid);
-
- hal_dsp_set_power_on(core_cid, TD_FALSE);
-#endif
-
audio_func_exit();
return AUDIO_SUCCESS;
}
return AUDIO_SUCCESS;
}
+static td_s32 drv_sys_set_dsp_file_path(const td_char *file_path, td_u32 len)
+{
+ return overlay_set_dsp_file_path(file_path, len);
+}
+
td_s32 sap_ioctl_sys_init(td_u32 cmd, td_void *arg, td_void *file)
{
td_s32 ret;
return drv_msg_sys_set_dsp_log_level(log_level);
}
+td_s32 sap_ioctl_sys_set_dsp_file_path(td_u32 cmd, td_void *arg, td_void *file)
+{
+ sap_drv_str *drv_str = (sap_drv_str *)arg;
+ audio_unused(cmd);
+ audio_unused(file);
+
+ return drv_sys_set_dsp_file_path(drv_str->str, drv_str->len);
+}
+
static td_s32 drv_msg_sys_active(audio_core_id to)
{
return drv_sys_set_state(to, AUDIO_SYS_ACTIVE);
AO_AEF_PROFILE_MUSIC,
AO_AEF_PROFILE_VOIP,
AO_AEF_PROFILE_RINGTONE,
+ AO_AEF_PROFILE_EXT0,
+ AO_AEF_PROFILE_EXT1,
+ AO_AEF_PROFILE_EXT2,
AO_AEF_PROFILE_MAX,
} ao_aef_profile;
#define AUDIO_BIN_LEN 320 // half of fft length
#define AUDIO_INPUT_FS 16000 // input samplerate
#define AUDIO_PROCESS_FS 16000 // process samplerate
+#define AUDIO_EQ_BAND_NUM 20
#define AUDIO_VQE_VERSION_LEN 64 // 版本号字符串长度
#define AUDIO_VQE_48K_SAMPLERATE 48000 // 48000采样率定义
// AGC使能开关; 范围:{0,1}; 默认值:1; 错误码:-58;
td_u8 agc_enable;
td_u8 fmp_enable;
+ td_u8 eq_enable;
// 保留位
- td_u8 reserve4[AUDIO_VQE_COM_PAD_2];
+ td_u8 reserve4;
// ####### AEC参数
// 非线性开关; 范围:{0,1}; 默认值:1; 错误码:-231;
td_s8 comfort_intensity; /* noise compensation level, 1-10, default:3 */
td_s8 mode2; /* no-echo_area, 0->headset, 1->handsfree, 2->headphone */
td_s8 fmp_reserved[5]; /* reserved */
+
+ /* eq */
+ td_s8 eq_band_gain[AUDIO_EQ_BAND_NUM];
} audio_vqe_param_struct;
bool g_gpio_timer_is_running = false;
msg_send_callback_t g_msg_send_cb = NULL;
pin_t g_gpio_key_record = 0;
-uint8_t g_buttom_vetoed = 0;
static const char* g_state_str[PRESSED_MAX] = {
"BUTTON_PRESSED",
button_api->button_clear_interrupt(pin);
button_press_state_t press_state = button_get_press_state(pin);
button_send_msg(BUTTON_PWREN_ID, press_state);
- if (g_buttom_vetoed == 0) {
- button_api->button_add_veto();
- g_buttom_vetoed = 1;
- }
+ button_api->button_add_veto();
button_timer_start_check_released();
}
button_press_state_t press_state;
press_state = button_get_press_state(PIN_NONE);
if (press_state == 1) {
- if (g_buttom_vetoed == 1) {
- button_api->button_remove_veto();
- g_buttom_vetoed = 0;
- }
+ button_api->button_remove_veto();
button_send_msg(1, RELEASED);
} else {
button_timer_start_check_released();
#include "systick_porting.h"
#include "watchdog_porting.h"
#include "watchdog.h"
+#include "preserve.h"
#if !defined(BUILD_APPLICATION_SSB) && !defined(UNIT_TEST)
#include "cpu_trace.h"
#ifdef BUILD_APPLICATION_STANDARD
if (dst == CORES_BT_CORE) {
g_ipc_to_bcore_continuous_fail_nums++;
if (g_ipc_to_bcore_continuous_fail_nums > IPC_CONTINUOUS_FAIL_MAX) {
+#if defined SAVE_EXC_INFO
+ save_btram_file_to_fs();
+ save_btrace_file_to_fs();
+#endif
panic(PANIC_BT_STS_ABNORMAL, __LINE__);
}
}
#include "soc_mipi_tx.h"\r
#include "debug_print.h"\r
\r
+#ifdef BUILD_RECOVERY_IMAGE\r
+#define lcd_err(x, ...)\r
+#define lcd_print(fmt, ...)\r
+#else\r
#define lcd_err(x, ...) \\r
do { \\r
PRINT("%s(%d): "x, __FUNCTION__, __LINE__, ##__VA_ARGS__); \\r
do { \\r
PRINT(fmt, ##__VA_ARGS__); \\r
} while (0)\r
-\r
+#endif\r
#define DEFAULT_BRIGHTNESS 255\r
\r
typedef enum {\r
PRINT(fmt, ##__VA_ARGS__); \
} while (0)
+#ifdef BUILD_RECOVERY_IMAGE
+#define mipi_tx_err(x, ...)
+#else
#define mipi_tx_err(x, ...) \
do { \
PRINT(x, ##__VA_ARGS__); \
} while (0)
+#endif
#define mipi_tx_check_null_ptr_return(ptr) \
do { \
#include "mmc_private.h"
#include "mmcreg.h"
#include "pm_veto.h"
+#include "clocks_config.h"
+#include "clocks_core.h"
static uint32_t part_node_cnt = 0;
#ifdef CONFIG_DRIVERS_MMC_RW_IN_EXC
#define BLOCK_MSLEEP10 10
struct mmcsd_part *g_local_part[MAX_PART_COUNT];
-static void mmc_init_before_handler(void)
+static void mmc_clk_set_before_handler(void)
{
- if (!mmc_get_sleep_init_flag() && mmc_get_first_init_flag()) {
- emmc_recovery_init();
- mmc_set_sleep_init_flag(true);
+ system_freq_t sys_freq = get_system_freq();
+ system_mcu_core_clk_cfg_t mcu_freq = clocks_system_mcu_freq_get(sys_freq.system_mcu_freq);
+ /* 当mcu处于高频模式下,尝试emmc使用前切到高频模式。是否真正切换,还依赖emmc卡的能力能支持高频模式 */
+ if (mcu_freq.mcu_clk.clk_src == CLOCKS_CLK_SRC_PLL) {
+ mmc_set_internal_clk(CLOCKS_SDIO_FREQ_H);
}
}
+static void mmc_clk_set_after_handler(void)
+{
+ mmc_set_internal_clk(CLOCKS_SDIO_FREQ_50M);
+}
+
static inline void set_local_part_node(struct mmcsd_part *part, int index)
{
g_local_part[index] = part;
mmc_err("failed to find mmc device!\n");
return (-EINVAL);
}
- mmc_init_before_handler();
+ mmc_clk_set_before_handler();
uapi_pm_add_sleep_veto(PM_ID_STORAGE);
dpal_atomic_inc(&part->atom_reqs);
if (part->part_status != PART_NORMAL) {
out:
dpal_atomic_dec(&part->atom_reqs);
uapi_pm_remove_sleep_veto(PM_ID_STORAGE);
+ mmc_clk_set_after_handler();
return ((ret == 0) ? -EAGAIN : (ssize_t)ret);
}
mmc_err("failed to find mmc device!\n");
return (-EINVAL);
}
- mmc_init_before_handler();
+ mmc_clk_set_before_handler();
uapi_pm_add_sleep_veto(PM_ID_STORAGE);
dpal_atomic_inc(&part->atom_reqs);
if (part->part_status != PART_NORMAL) {
out:
dpal_atomic_dec(&part->atom_reqs);
uapi_pm_remove_sleep_veto(PM_ID_STORAGE);
+ mmc_clk_set_after_handler();
return ((ret == 0) ? -EAGAIN : (ssize_t)ret);
}
}
sc = part->sc;
dev = sc->dev;
- mmc_init_before_handler();
+ mmc_clk_set_before_handler();
uapi_pm_add_sleep_veto(PM_ID_STORAGE);
dpal_atomic_inc(&part->atom_reqs);
if (part->part_status != PART_NORMAL) {
geometry->geo_sectorsize = (size_t)mmc_get_sector_size(dev);
dpal_atomic_dec(&part->atom_reqs);
uapi_pm_remove_sleep_veto(PM_ID_STORAGE);
+ mmc_clk_set_after_handler();
return (ENOERR);
}
struct mmc_ivars *ivar = device_get_ivars(dev);
uint32_t au_reg_value;
- mmc_init_before_handler();
+ mmc_clk_set_before_handler();
uapi_pm_add_sleep_veto(PM_ID_STORAGE);
dpal_atomic_inc(&part->atom_reqs);
if (part->part_status != PART_NORMAL) {
}
dpal_atomic_dec(&part->atom_reqs);
uapi_pm_remove_sleep_veto(PM_ID_STORAGE);
+ mmc_clk_set_after_handler();
return (ENOERR);
}
uint32_t sector_now = nsectors;
uint32_t sector_count;
ssize_t ret;
- mmc_init_before_handler();
+ mmc_clk_set_before_handler();
uapi_pm_add_sleep_veto(PM_ID_STORAGE);
do {
sector_count = (sector_now >= MMC_RAW_WRITE_MAX_SECTOR) ? MMC_RAW_WRITE_MAX_SECTOR : sector_now;
buffer += sector_count << 9; /* every sector size is 512 (1 << 9) */
} while (sector_now != 0);
uapi_pm_remove_sleep_veto(PM_ID_STORAGE);
+ mmc_clk_set_after_handler();
return ((ssize_t)nsectors);
}
#include "sdhci_private.h"
#include "hci_helper.h"
#include "mmc_adapt.h"
+#include "mmcvar.h"
+#include "mmc_private.h"
+#include "sdio.h"
#include "chip_core_definition.h"
#include "common_def.h"
#include "clocks_switch.h"
#define EMMC_SAVE_BUS_TIMING_MMC_DDR52 4
#define EMMC_SAVE_BUS_TIMING_MMC_HS400 7
#define EMMC_CMD0_RESET_WAIT_TIME 900
-#define PM_EMMC_CCLK_DIV_REG 0x52000100
-#define PM_SD_HOST_CCLK_DIV_REG 0x52000110
+
#define RC_CLK_VALUE 49152000
#define XO_CLK_VALUE 32000000
#define XO_DLL2_CLK_VALUE 64000000
#define PLL_CLK_VALUE 884736000
-#define PM_SDIOM_CLK_REG 0x55000628
-#define PM_EMMC_DIV_REG 0x52000120
+
+#ifndef SDHCI_ERR_INT_STAT_EN
+#define SDHCI_ERR_INT_STAT_EN 0x36
+#endif
+
+#ifndef SDHCI_ERR_INT_SIGNAL_EN
+#define SDHCI_ERR_INT_SIGNAL_EN 0x3A
+#endif
+#ifndef SDHCI_MBIU_CTRL
+#define SDHCI_MBIU_CTRL 0x510
+#endif
typedef struct {
uint16_t sdiom_clk_reg;
- uint16_t emmc_cclk_reg;
- uint16_t emmc_div_reg;
+ uint16_t clk_div1_reg; // EMMC_CCLK_DIV or SD_HOST_CCLK_DIV
+ uint16_t clk_div2_reg; // EMMC_DIV or SDIO_HOST_CKDIV
uint16_t sd_bus_reg;
uint16_t mbiu_ctrl;
uint32_t timing;
uint32_t bus_width;
uint32_t at_ctrl;
uint32_t at_stat;
+ uint16_t clk_ctrl;
+ uint16_t power_ctrl;
uint16_t host_ctrl1;
uint16_t host_ctrl2;
+ uint32_t int_en; // int & err_int
+ uint32_t int_sig_en; // int_sig & err_int_sig
} mmc_save_info_t;
-static mmc_save_info_t g_mmc_cur_info = { 0 };
+typedef enum {
+ SDIOM_SEL_LP_MODE, // 功耗优先, 两路mmc需求不一致选低的
+ SDIOM_SEL_PERF_MODE, // 性能优先,两路mmc需求不一致选高的
+ SDIOM_SEL_MODE_MAX,
+} sdiom_select_mode_t;
+uint8_t g_sdiom_sel_mode = SDIOM_SEL_LP_MODE;
+
+uint32_t g_sdiom_cfg_clk[MAX_MMC_NUM] = {0, 0};
+system_sdio_freq_t g_sdiom_mmc_sel[MAX_MMC_NUM] = {CLOCKS_SDIO_FREQ_MAX, CLOCKS_SDIO_FREQ_MAX};
+system_sdio_freq_t g_sdiom_cur_sel = CLOCKS_SDIO_FREQ_MAX;
+
+
+static mmc_save_info_t g_mmc_cur_info[MAX_MMC_NUM] = { {0}, {0} };
bool g_mmc_sleep_inited = false;
bool g_mmc_inited = false;
-static enum mmc_bus_timing g_max_timing = bus_timing_normal;
+static enum mmc_bus_timing g_max_timing[MAX_MMC_NUM] = {bus_timing_normal, bus_timing_normal};
+
+uint32_t g_clk_div1_reg[MAX_MMC_NUM] = {EMMC_CCLK_DIV_REG, SD_HOST_CCLK_DIV_REG};
+uint32_t g_clk_div2_reg[MAX_MMC_NUM] = {EMMC_DIV_REG, SDIO_HOST_CCLK_DIV_REG};
+uint32_t g_tunning_coarse_mode[MAX_MMC_NUM] = {EMMC_TUNING_COARSE_MODE, SDIO_TUNING_COARSE_MODE};
+uint32_t g_tunning_bm0_reg[MAX_MMC_NUM] = {EMMC_TUNING_BM0_REG, SD_HOST_TUNING_BM0_REG};
+uint32_t g_tunning_bm0_value[MAX_MMC_NUM] = {EMMC_TUNING_BM0_VAL, SDIO_TUNING_BM0_VAL};
+uint32_t g_tunning_bm1_reg[MAX_MMC_NUM] = {EMMC_TUNING_BM1_REG, SD_HOST_TUNING_BM1_REG};
+uint32_t g_tunning_bm1_value[MAX_MMC_NUM] = {EMMC_TUNING_BM1_VAL, SDIO_TUNING_BM1_VAL};
+
+uint32_t mmc_get_clock_value(uint32_t id);
void mmc_set_first_init_flag(bool flag)
{
return g_mmc_sleep_inited;
}
-mmc_save_info_t* sdhci_get_save_info(void)
+/*
+ * 函 数 名 : mmc_sdhci_suspend
+ * 功能描述 : 低功耗suspend接口, 保存所有mmc slot工作必须的寄存器
+ */
+void mmc_sdhci_suspend(void)
{
- return &g_mmc_cur_info;
+ int32_t i;
+ struct hci_softc *sc = NULL;
+
+ for (i = 0; i < MAX_MMC_NUM; i++) {
+ sc = get_mmc_resource(i);
+ if (sc == NULL || sc->slot == NULL || ((struct sdhci_slot*)sc->slot)->dev == NULL) {
+ continue;
+ }
+
+ reg16_setbit(g_clk_div1_reg[i], 0); // clk en
+ g_mmc_cur_info[i].timing = regw_getbits(sc->base, SDHCI_HOST_CONTROL2, 0x0, LEN_3BIT); // for speed mode
+ g_mmc_cur_info[i].at_ctrl = hci_readl(sc, SDHCI_AUTO_TUNING_CTRL);
+ g_mmc_cur_info[i].at_stat = regw_getbits(sc->base, SDHCI_AUTO_TUNING_STATUS, 0x0, LEN_8BIT); // for phase
+ if (reg8_getbit(sc->base + SDHCI_HOST_CONTROL, EXT_DAT_XFER_BIT) == 1) {
+ g_mmc_cur_info[i].bus_width = EMMC_SAVE_BUS_WIDTH_8BIT;
+ } else {
+ if (reg8_getbit(sc->base + SDHCI_HOST_CONTROL, 0x1) == 1) {
+ g_mmc_cur_info[i].bus_width = EMMC_SAVE_BUS_WIDTH_4BIT;
+ } else {
+ g_mmc_cur_info[i].bus_width = EMMC_SAVE_BUS_WIDTH_1BIT;
+ }
+ }
+ g_mmc_cur_info[i].sdiom_clk_reg = readw(SDIOM_CR_REG);
+ g_mmc_cur_info[i].clk_div1_reg = readw(g_clk_div1_reg[i]);
+ g_mmc_cur_info[i].clk_div2_reg = readw(g_clk_div2_reg[i]);
+ g_mmc_cur_info[i].sd_bus_reg = readw(SDIO_BUS_CGDIV_REG);
+ g_mmc_cur_info[i].mbiu_ctrl = hci_readw(sc, SDHCI_MBIU_CTRL);
+ g_mmc_cur_info[i].clk_ctrl = hci_readw(sc, SDHCI_CLOCK_CONTROL);
+ g_mmc_cur_info[i].power_ctrl = hci_readb(sc, SDHCI_POWER_CONTROL);
+ g_mmc_cur_info[i].host_ctrl1 = hci_readb(sc, SDHCI_HOST_CONTROL);
+ g_mmc_cur_info[i].host_ctrl2 = hci_readw(sc, SDHCI_HOST_CONTROL2);
+ g_mmc_cur_info[i].int_en = hci_readl(sc, SDHCI_INT_ENABLE);
+ g_mmc_cur_info[i].int_sig_en = hci_readl(sc, SDHCI_SIGNAL_ENABLE);
+#if MMC_BOARD_DEBUG_ON
+ PRINT("mmc%d save sdiom=0x%x, clk_div1=0x%x, clk_div2=0x%x, timing=%d, phase=%d, bus_width=%d\r\n",
+ i, g_mmc_cur_info[i].sdiom_clk_reg, g_mmc_cur_info[i].clk_div1_reg, g_mmc_cur_info[i].clk_div2_reg,
+ g_mmc_cur_info[i].timing, g_mmc_cur_info[i].at_stat, g_mmc_cur_info[i].bus_width);
+ PRINT("mmc%d save clk_ctrl=0x%x, power_ctrl=0x%x, host_ctrl1=0x%x, host_ctrl2=0x%x\r\n",
+ i, g_mmc_cur_info[i].clk_ctrl, g_mmc_cur_info[i].power_ctrl, g_mmc_cur_info[i].host_ctrl1,
+ g_mmc_cur_info[i].host_ctrl2);
+ PRINT("mmc%d save int_en=0x%x, sig_en=0x%x\r\n", i, g_mmc_cur_info[i].int_en, g_mmc_cur_info[i].int_sig_en);
+#endif
+ reg16_clrbit(g_clk_div1_reg[i], 0); // clk disable
+ }
+ mmc_set_sleep_init_flag(false);
}
-void emmc_save_info(void)
+/*
+ * 函 数 名 : mmc_sdhci_resume
+ * 功能描述 : 低功耗resume接口, 恢复所有mmc slot工作必须的寄存器
+ */
+void mmc_sdhci_resume(void)
{
- uint32_t tmp_div;
- if (!mmc_get_sleep_init_flag()) {
- return;
- }
- reg16_setbit(PM_EMMC_CCLK_DIV_REG, 0);
- g_mmc_cur_info.timing = regw_getbits(HOST_CTRL2, 0, 0x0, LEN_3BIT); // for speed mode
- g_mmc_cur_info.at_ctrl = readl(AT_CTRL);
- g_mmc_cur_info.at_stat = regw_getbits(AT_STAT, 0, 0x0, LEN_8BIT); // for phase
- if (reg8_getbit(HOST_CTRL1, EXT_DAT_XFER_BIT) == 1) {
- g_mmc_cur_info.bus_width = EMMC_SAVE_BUS_WIDTH_8BIT;
- } else {
- if (reg8_getbit(HOST_CTRL1, 0x1) == 1) {
- g_mmc_cur_info.bus_width = EMMC_SAVE_BUS_WIDTH_4BIT;
- } else {
- g_mmc_cur_info.bus_width = EMMC_SAVE_BUS_WIDTH_1BIT;
+ int32_t i;
+ struct hci_softc *sc;
+
+ for (i = 0; i < MAX_MMC_NUM; i++) {
+ sc = get_mmc_resource(i);
+ if (sc == NULL || sc->slot == NULL || ((struct sdhci_slot*)sc->slot)->dev == NULL) {
+ continue;
+ }
+#if MMC_BOARD_DEBUG_ON
+ PRINT("mmc%d resume all saved reg\r\n", i);
+#endif
+ writew(SDIOM_CR_REG, g_mmc_cur_info[i].sdiom_clk_reg);
+ writew(g_clk_div1_reg[i], g_mmc_cur_info[i].clk_div1_reg);
+ writew(g_clk_div2_reg[i], g_mmc_cur_info[i].clk_div2_reg);
+ writew(SDIO_BUS_CGDIV_REG, g_mmc_cur_info[i].sd_bus_reg);
+ reg16_setbit(sc->base + SDHCI_CLOCK_CONTROL, 0x0); // offset:2c bit0 internal clk en
+ reg16_setbit(sc->base + SDHCI_CLOCK_CONTROL, 0x3); // offset:2c bit3 pll enable
+ reg16_setbit(sc->base + SDHCI_CLOCK_CONTROL, 0x2); // offset:2c bit2 sd clk enable
+ while (reg16_getbit(sc->base + SDHCI_CLOCK_CONTROL, 0x1) != 1) { ; } // wait clock is stability
+
+ hci_writeb(sc, SDHCI_TIMEOUT_CONTROL, 0xe);
+ hci_writew(sc, SDHCI_CLOCK_CONTROL, g_mmc_cur_info[i].clk_ctrl);
+ hci_writeb(sc, SDHCI_POWER_CONTROL, g_mmc_cur_info[i].power_ctrl);
+ hci_writeb(sc, SDHCI_HOST_CONTROL, g_mmc_cur_info[i].host_ctrl1);
+ hci_writew(sc, SDHCI_HOST_CONTROL2, g_mmc_cur_info[i].host_ctrl2);
+ hci_writel(sc, SDHCI_INT_ENABLE, g_mmc_cur_info[i].int_en);
+ hci_writel(sc, SDHCI_SIGNAL_ENABLE, g_mmc_cur_info[i].int_sig_en);
+
+ hci_writew(sc, SDHCI_MBIU_CTRL, g_mmc_cur_info[i].mbiu_ctrl);
+ writew(g_tunning_bm0_reg[i], g_tunning_bm0_value[i]);
+ writew(g_tunning_bm1_reg[i], g_tunning_bm1_value[i]);
+ hci_writel(sc, SDHCI_AUTO_TUNING_CTRL, g_mmc_cur_info[i].at_ctrl);
+ reg16_setbits(sc->base + SDHCI_AUTO_TUNING_STATUS, 0, LEN_8BIT, g_mmc_cur_info[i].at_stat);
+ // The fixed clock is less than or equal to 52 MHz, and the tuning clock is not used.
+ if (mmc_get_clock_value(i) <= SDIOM_SRC_CLK_FREQ_LVL_50M_VAL) {
+ reg16_clrbit(sc->base + SDHCI_HOST_CONTROL2, SAMPLE_CLK_SEL_BIT);
}
}
- g_mmc_cur_info.sdiom_clk_reg = readw(SDIOM_CR_REG);
- g_mmc_cur_info.emmc_cclk_reg = readw(EMMC_CCLK_DIV_REG);
- g_mmc_cur_info.emmc_div_reg = readw(EMMC_DIV_REG);
- g_mmc_cur_info.sd_bus_reg = readw(SDIO_BUS_CGDIV_REG);
- g_mmc_cur_info.mbiu_ctrl = readw(MBIIU_CTRL);
- g_mmc_cur_info.host_ctrl1 = readb(HOST_CTRL1);
- g_mmc_cur_info.host_ctrl2 = readw(HOST_CTRL2);
-
-#if EMMC_BOARD_DEBUG_ON
- PRINT("emmc save sdiom_reg=%x, emmc_cclk_reg=%x, emmc_div_reg=%x, timing=%d, phase=%d, bus_width=%d\r\n",
- g_mmc_cur_info.sdiom_clk_reg, g_mmc_cur_info.emmc_cclk_reg, g_mmc_cur_info.emmc_div_reg,
- g_mmc_cur_info.timing, g_mmc_cur_info.at_stat, g_mmc_cur_info.bus_width);
+ mmc_set_sleep_init_flag(true);
+}
+
+#ifdef CFG_DRIVERS_SDIO
+/*
+ * 函 数 名 : mmc_sdhci_sdio_reset
+ * 功能描述 : sdio slave设备上下电重启后,调用本接口恢复连接
+ * 参数 :func:slave设备驱动中保存的sdio_func指针
+ */
+void mmc_sdhci_sdio_reset(struct sdio_func* func)
+{
+ struct mmc_softc *mmc_sc = device_get_parent(func->sc->dev);
+#ifdef DPALCFG_DRIVERS_SDIO
+ sdio_reset_comm(func);
#endif
- reg16_clrbit(PM_EMMC_CCLK_DIV_REG, 0);
- mmc_set_sleep_init_flag(false);
+ sdio_en_func(func);
+ mmc_sc->card_init_status = MMC_CARD_INIT;
+}
+
+struct sdio_func* mmc_get_sdio_func(int fn)
+{
+ struct hci_softc *sc = NULL;
+ struct mmc_softc *mmc_sc;
+
+ sc = get_mmc_resource(1);
+ if (sc == NULL || sc->slot == NULL || ((struct sdhci_slot*)sc->slot)->dev == NULL) {
+ return NULL;
+ }
+ mmc_sc = device_get_softc(((struct sdhci_slot*)sc->slot)->dev);
+ if (mmc_sc == NULL || mmc_sc->child_list[0] == NULL) {
+ return NULL;
+ }
+ device_t child = mmc_sc->child_list[0];
+ uint16_t manf_id = (uint16_t)mmc_get_cis_manid(child);
+ uint16_t device_id = (uint16_t)mmc_get_cis_proid(child);
+
+ dprintf("%s manf_id: 0x%x, device_id: 0x%x\r\n", __FUNCTION__, manf_id, device_id);
+ return sdio_get_func(fn, manf_id, device_id);
}
+int mmc_test_sdio_read_byte(void)
+{
+ uint32_t addr = 0x0;
+ int err;
+ uint8_t byte;
+
+ struct sdio_func* func = mmc_get_sdio_func(1);
+ if (func == NULL) {
+ return -ENODEV;
+ }
+ // 读CCCR寄存器
+ for (addr = 0; addr < 0x10; addr++) {
+ byte = sdio_func0_read_byte(func, addr, &err);
+ dprintf("%s func0 address: 0x%x, result: 0x%x, err = %d\r\n", __FUNCTION__, addr, byte, err);
+ }
+ // 读func1地址
+ for (addr = 0; addr < 0x10; addr++) {
+ byte = sdio_read_byte(func, addr, &err);
+ dprintf("%s func1 address: 0x%x, result: 0x%x, err = %d\r\n", __FUNCTION__, addr, byte, err);
+ }
+
+ return err;
+}
+
+void mmc_test_sdio_reset(void)
+{
+ struct sdio_func* func = mmc_get_sdio_func(1);
+ if (func == NULL) {
+ return;
+ }
+ mmc_sdhci_sdio_reset(func);
+}
+#endif
+
void emmc_send_cmd1(uint32_t args, uint16_t cmd, uint32_t *resp)
{
uint16_t rd_data = 0;
if (cnt == RETRY_CNT2) { PRINT("cmd=%x ERR INT=%x\r\n", cmd, readw(ERROR_INT_STAT)); }
reg16_setbit(NORMAL_INT_STAT, 0x0);
*resp = readl(RESP01);
-#if EMMC_BOARD_DEBUG_ON
+#if MMC_BOARD_DEBUG_ON
PRINT("CMD=%x, arg=%x, resp=%x\r\n", cmd, args, *resp);
#endif
}
resp[1] = readl(RESP23); // 1 for responese 71-40 bits of the Response Field
resp[2] = readl(RESP45); // 2 for responese 103-72 bits of the Response Field
resp[3] = readl(RESP67); // 3 for responese 135-104 bits of the Response Field
-#if EMMC_BOARD_DEBUG_ON
+#if MMC_BOARD_DEBUG_ON
PRINT("CMD-r2=%x, arg=%x, resp:%x %x %x %x\r\n", cmd, args, resp[0], resp[1], resp[2], resp[3]); // 2,3 fro resp
#endif
}
if (width_flag == 1) { emmc_send_cmd6(width_args, CMD6_INDEX, &resp); }
if (timing_flag == 1) { emmc_send_cmd6(timing_args, CMD6_INDEX, &resp); }
-#if EMMC_BOARD_DEBUG_ON
- PRINT("timing=%x width_args=%x tuning=%x \r\n", timing, width_args, g_mmc_cur_info.at_stat);
+#if MMC_BOARD_DEBUG_ON
+ PRINT("timing=%x width_args=%x tuning=%x \r\n", timing, width_args, g_mmc_cur_info[0].at_stat);
#endif
}
-static void emmc_reg_init(void)
-{
- writew(PERI_EMMC_CRG_RST_CTL, 0);
- writew(PERI_EMMC_CRG_RST_CTL, SOFT_RST_GLB_SDIO_DERESET);
- init_emmc_pinmux();
-
- // set emmc clk 400k
- writew(SDIOM_CR_REG, 0x3);
- writew(EMMC_CCLK_DIV_REG, 0x5507);
- writew(EMMC_DIV_REG, 0x13);
- reg16_setbit(CLK_CTRL, 0x0); // offset:2c bit0 internal clk en
- reg16_setbit(CLK_CTRL, 0x3); // offset:2c bit3 pll enable
- reg16_setbit(CLK_CTRL, 0x2); // offset:2c bit2 sd clk enable
- while (reg16_getbit(CLK_CTRL, 0x1) != 1) { ; } // wait clock is stability
- writeb(TOUT_CTRL, 0xe);
-
- writeb(PWR_CTRL, POWR_ON_1_8V); // pwr ctrl, 1.8v
- writew(NORMAL_INT_STAT_EN, NORMAL_ERR_INT_EN); // normal int enable
- writew(ERROR_INT_STAT_EN, NORMAL_ERR_INT_EN); // normal signal enable
- writew(NORMAL_INT_SIGNAL_EN, ALL_NORMAL_ERR_INT); // error int enable
- writew(ERROR_INT_SIGNAL_EN, ALL_NORMAL_ERR_INT); // error signal enable
- reg16_setbit(EMMC_CTRL, 0x0); // set emmc
-}
-
-uint32_t emmc_get_clock_value(void)
+uint32_t mmc_get_clock_value(uint32_t id)
{
- uint8_t clk_flag = (readw(PM_SDIOM_CLK_REG) & 0xE) >> 0x1;
+ uint8_t clk_flag = (readw(SDIOM_CR_REG) & 0xE) >> 0x1;
uint32_t source_clk_val = XO_CLK_VALUE;
uint16_t div1 = 1;
uint16_t div2 = 1;
uint16_t div3 = 1;
+
if (clk_flag == 0x1) {
source_clk_val = XO_CLK_VALUE;
} else if (clk_flag == 0x2) {
} else { // rc or no defined
source_clk_val = RC_CLK_VALUE;
}
- if (reg16_getbit(PM_SDIOM_CLK_REG, 0x4) == 1) {
- div1 = regw_getbits(PM_SDIOM_CLK_REG, 0, 0x5, 0x4);
+ if (reg16_getbit(SDIOM_CR_REG, 0x4) == 1) {
+ div1 = regw_getbits(SDIOM_CR_REG, 0, 0x5, 0x4);
}
- if (reg16_getbit(PM_EMMC_CCLK_DIV_REG, 0x1) == 1) {
- div2 = regw_getbits(PM_EMMC_CCLK_DIV_REG, 0, 0x4, 0x8);
+ if (reg16_getbit(g_clk_div1_reg[id], 0x1) == 1) {
+ div2 = regw_getbits(g_clk_div1_reg[id], 0, 0x4, 0x8);
}
- if (reg16_getbit(PM_EMMC_DIV_REG, 0x0) == 1) {
- div3 = regw_getbits(PM_EMMC_DIV_REG, 0, 0x4, 0x3);
+ if (reg16_getbit(g_clk_div2_reg[id], 0x0) == 1) {
+ div3 = regw_getbits(g_clk_div2_reg[id], 0, 0x4, 0x3);
}
-#if EMMC_BOARD_DEBUG_ON
- PRINT(" value =%lu, div1=%d div2=%d, div3=%d\r\n", source_clk_val, div1, div2, div3);
+#if MMC_BOARD_DEBUG_ON
+ PRINT("clk_flag=%d, value=%lu, div1=%d div2=%d, div3=%d\r\n", clk_flag, source_clk_val, div1, div2, div3);
#endif
return (source_clk_val / div1 / div2 / div3);
}
-static void emmc_recovery_register(void)
-{
- // set emmc clk 400k
- writew(SDIOM_CR_REG, 0x3);
- writew(EMMC_CCLK_DIV_REG, 0x5507);
- writew(EMMC_DIV_REG, 0x13);
- reg16_setbit(CLK_CTRL, 0x0); // offset:2c bit0 internal clk en
- reg16_setbit(CLK_CTRL, 0x3); // offset:2c bit3 pll enable
- reg16_setbit(CLK_CTRL, 0x2); // offset:2c bit2 sd clk enable
- while (reg16_getbit(CLK_CTRL, 0x1) != 1) { ; } // wait clock is stability
- writeb(TOUT_CTRL, 0xe);
-
- writeb(PWR_CTRL, POWR_ON_1_8V); // pwr ctrl, 1.8v
- writew(NORMAL_INT_STAT_EN, NORMAL_ERR_INT_EN); // normal int enable
- writew(ERROR_INT_STAT_EN, NORMAL_ERR_INT_EN); // normal signal enable
- writew(NORMAL_INT_SIGNAL_EN, ALL_NORMAL_ERR_INT); // error int enable
- writew(ERROR_INT_SIGNAL_EN, ALL_NORMAL_ERR_INT); // error signal enable
- reg16_setbit(EMMC_CTRL, 0x0); // set emmc
- writeb(HOST_CTRL1, g_mmc_cur_info.host_ctrl1);
- writew(HOST_CTRL2, g_mmc_cur_info.host_ctrl2);
- writew(SDIOM_CR_REG, g_mmc_cur_info.sdiom_clk_reg);
- writew(EMMC_CCLK_DIV_REG, g_mmc_cur_info.emmc_cclk_reg);
- writew(EMMC_DIV_REG, g_mmc_cur_info.emmc_div_reg);
- writew(SDIO_BUS_CGDIV_REG, g_mmc_cur_info.sd_bus_reg);
- writew(MBIIU_CTRL, g_mmc_cur_info.mbiu_ctrl);
- writew(EMMC_TUNING_BM0_REG, EMMC_TUNING_BM0_VAL);
- writew(EMMC_TUNING_BM1_REG, EMMC_TUNING_BM1_VAL);
- writel(AT_CTRL, g_mmc_cur_info.at_ctrl);
- reg16_setbits(AT_STAT, 0, LEN_8BIT, g_mmc_cur_info.at_stat);
- // The fixed clock is less than or equal to 52 MHz, and the tuning clock is not used.
- if (emmc_get_clock_value() <= SDIOM_SRC_CLK_FREQ_LVL_50M_VAL) {
- reg16_clrbit(HOST_CTRL2, SAMPLE_CLK_SEL_BIT);
- }
-}
-void emmc_recovery_init(void)
-{
- uint32_t irq_sts = osal_irq_lock();
- uint64_t time1 = uapi_tcxo_get_us();
- uint64_t time9 = 0;
-#ifdef EMMC_RECOVERY_WITH_REENUME
- uint32_t args = 0;
- uint32_t resp = 0;
- uint32_t resp_r2[4] = { 0 };
- uint32_t flag = 1;
- mmc_save_info_t* ptr_mmc = sdhci_get_save_info();
- uint32_t timing = ptr_mmc->timing;
- uint32_t bus_width = ptr_mmc->bus_width;
-
- emmc_reg_init();
- tcxo_port_delay_us(1200); // wait 1200 cnt (1ms)
- emmc_send_cmd(0x0, CMD0_INDEX, 0, &resp); // cmd0
- tcxo_port_delay_us(1000); // wait 1000 cnt (900us) ok
- resp = 0;
- emmc_send_cmd1(CMD1_ARGS, CMD1_INDEX, &resp);
- emmc_send_cmd_r2(0x0, CMD2_INDEX, resp_r2); // cmd2
- emmc_send_cmd(CMD3_ARGS, CMD3_INDEX, 1, &resp); // cmd3
- emmc_send_cmd_r2(CMD9_ARGS, CMD9_INDEX, resp_r2); // cmd9
- emmc_send_cmd(CMD7_ARGS, CMD7_INDEX, 1, &resp); // cmd7
- emmc_set_timing_and_buswidth(bus_width, timing);
- // recovery for clock and phase
- writeb(HOST_CTRL1, g_mmc_cur_info.host_ctrl1);
- writew(HOST_CTRL2, g_mmc_cur_info.host_ctrl2);
- writew(SDIOM_CR_REG, g_mmc_cur_info.sdiom_clk_reg);
- writew(EMMC_CCLK_DIV_REG, g_mmc_cur_info.emmc_cclk_reg);
- writew(EMMC_DIV_REG, g_mmc_cur_info.emmc_div_reg);
- writew(SDIO_BUS_CGDIV_REG, g_mmc_cur_info.sd_bus_reg);
- writew(MBIIU_CTRL, g_mmc_cur_info.mbiu_ctrl);
- writew(EMMC_TUNING_BM0_REG, EMMC_TUNING_BM0_VAL);
- writew(EMMC_TUNING_BM1_REG, EMMC_TUNING_BM1_VAL);
- writel(AT_CTRL, g_mmc_cur_info.at_ctrl);
- reg16_setbits(AT_STAT, 0, LEN_8BIT, g_mmc_cur_info.at_stat);
- // The fixed clock is less than or equal to 52 MHz, and the tuning clock is not used.
- if (emmc_get_clock_value() <= SDIOM_SRC_CLK_FREQ_LVL_50M_VAL) {
- reg16_clrbit(HOST_CTRL2, SAMPLE_CLK_SEL_BIT);
- }
-#else
- emmc_recovery_register();
-#endif
- time9 = uapi_tcxo_get_us();
- osal_irq_restore(irq_sts);
-#if EMMC_BOARD_DEBUG_ON
- PRINT("OK~ time1=%llu tim9=%llu, time=%llu\r\n", time1, time9, time9-time1);
-#endif
- reg16_clrbit(PM_EMMC_CCLK_DIV_REG, 0);
-}
static void hal_mmc_set_preset_val(struct hci_softc *sc, bool en)
{
break;
}
-#if (EMMC_BOARD_DEBUG_ON)
+#if (MMC_BOARD_DEBUG_ON)
device_printf(sc->dev, "vccq:[%u], pwr:[%u].\n", vccq, pwr);
#endif
DPAL_WRITE_UINT16(value, div_reg);
}
-static void mmc_set_sdiom_src_clk(uint32_t cfg_clock, uint32_t *freq_div, uint32_t *second_freq_div)
+static void mmc_calc_sdiom_clk_div(system_sdio_freq_t freq_level, uint32_t cfg_clock,
+ uint32_t *freq_div, uint32_t *second_freq_div)
{
- system_sdio_freq_t sdiom_freq_level;
+ uint32_t sdiom_freq_val[CLOCKS_SDIO_FREQ_MAX] = {
+ SDIOM_SRC_CLK_LOW_FREQ_VAL, SDIOM_SRC_CLK_FREQ_LVL_50M_VAL,
+ SDIOM_SRC_CLK_FREQ_LVL_64M_VAL, SDIOM_SRC_CLK_HIGH_FREQ_LVL_VAL
+ };
*second_freq_div = 1;
+ if (cfg_clock <= sdiom_freq_val[freq_level]) {
+ *freq_div = sdiom_freq_val[freq_level] / cfg_clock;
+ if (freq_level == CLOCKS_SDIO_FREQ_32M || freq_level == CLOCKS_SDIO_FREQ_H) {
+ if (sdiom_freq_val[freq_level] % cfg_clock != 0) { *freq_div += 1; }
+ }
+ } else {
+ *freq_div = 1;
+ }
+
+ if (*freq_div > 0xFF) {
+ dprintf("%s, div:[%u] error\r\n", __FUNCTION__, *freq_div);
+ freq_level = CLOCKS_SDIO_FREQ_32M;
+ *freq_div = 1;
+ }
+#if (MMC_BOARD_DEBUG_ON)
+ dprintf("clk_level[%u], freq_div[%u], second_freq_div[%u], sdiom_freq_val[%u], cfg_clock[%u]!\n",
+ freq_level, *freq_div, *second_freq_div, sdiom_freq_val[freq_level], cfg_clock);
+#endif
+}
+static system_sdio_freq_t mmc_select_sdiom_src_clk(struct hci_softc *sc, uint32_t cfg_clock)
+{
+ uint32_t co_num = (sc->num == 0) ? 1 : 0; // 同时钟源共存的另外一个mmc
+ system_sdio_freq_t freq_level;
+
+ g_sdiom_cfg_clk[sc->num] = cfg_clock;
if (cfg_clock <= SDIOM_SRC_CLK_LOW_FREQ_VAL) {
- sdiom_freq_level = CLOCKS_SDIO_FREQ_32M;
- *freq_div = SDIOM_SRC_CLK_LOW_FREQ_VAL / cfg_clock;
- if (SDIOM_SRC_CLK_LOW_FREQ_VAL % cfg_clock != 0) { *freq_div += 1; }
+ freq_level = CLOCKS_SDIO_FREQ_32M;
+#ifndef CFG_DRIVERS_NANDFLASH
} else if (cfg_clock <= SDIOM_SRC_CLK_FREQ_LVL_50M_VAL) {
- sdiom_freq_level = CLOCKS_SDIO_FREQ_50M;
- *freq_div = 1;
+ freq_level = CLOCKS_SDIO_FREQ_50M;
} else if (cfg_clock == SDIOM_SRC_CLK_FREQ_LVL_64M_VAL) {
- sdiom_freq_level = CLOCKS_SDIO_FREQ_64M;
- *freq_div = 1;
+ freq_level = CLOCKS_SDIO_FREQ_64M;
} else if (cfg_clock <= SDIOM_SRC_CLK_HIGH_FREQ_LVL_VAL) {
- sdiom_freq_level = CLOCKS_SDIO_FREQ_H;
- *freq_div = SDIOM_SRC_CLK_HIGH_FREQ_LVL_VAL / cfg_clock;
- if (SDIOM_SRC_CLK_HIGH_FREQ_LVL_VAL % cfg_clock != 0) { *freq_div += 1; }
+ freq_level = CLOCKS_SDIO_FREQ_H;
} else {
- sdiom_freq_level = CLOCKS_SDIO_FREQ_32M;
- *freq_div = 1;
+ freq_level = CLOCKS_SDIO_FREQ_H;
}
- if (!clocks_set_sdio_freq(sdiom_freq_level)) {
-#if (EMMC_BOARD_DEBUG_ON)
- dprintf("%s, sdiom_freq_level:[%u] error\r\n", __FUNCTION__, sdiom_freq_level);
-#endif
+#else // NANDFLASH + SDIO共存场景, 固定选高频
+ } else {
+ freq_level = CLOCKS_SDIO_FREQ_H;
}
+#endif
+ /* 记录下原始的选择 */
+ g_sdiom_mmc_sel[sc->num] = freq_level;
-#if (EMMC_BOARD_DEBUG_ON)
- if (*freq_div > 0xFF) {
- dprintf("%s, div:[%u] error\r\n", __FUNCTION__, *freq_div);
+ /* 根据同router的另外一个mmc确定最终的选择 */
+ if (g_sdiom_mmc_sel[co_num] != CLOCKS_SDIO_FREQ_MAX) {
+ if (g_sdiom_sel_mode == SDIOM_SEL_LP_MODE) {
+ freq_level = (g_sdiom_mmc_sel[co_num] > freq_level) ? freq_level : g_sdiom_mmc_sel[co_num];
+ } else {
+ freq_level = (g_sdiom_mmc_sel[co_num] > freq_level) ? g_sdiom_mmc_sel[co_num] : freq_level;
+ }
}
- dprintf("clk_level:[%u], freq_div:[%u], second_freq_div:[%u], cfg_clock: [%u]!\n",
- sdiom_freq_level, *freq_div, *second_freq_div, cfg_clock);
-#endif
+
+ return freq_level;
}
-static void mmc_set_first_level_clk_div(uint32_t div_reg, uint32_t freq_div)
+static void emmc_host_set_first_level_clk_div(uint32_t div_reg, uint32_t freq_div)
{
uint16_t value;
value &= ~SDIO_EMMC_DIV_NUM_MASK;
value |= (uint16_t)(freq_div << SDIO_EMMC_DIV_NUM_POST_SHIFT);
value |= EMMC_CARD_CLK_INV_SET;
-#if (EMMC_BOARD_DEBUG_ON)
+#if (MMC_BOARD_DEBUG_ON)
dprintf("%s, freq_div:[%u] value:[%x]!\n", __FUNCTION__, freq_div, value);
#endif
// 当0x52000100的bit13设置emmc cclk tuning coarse mode后,soc要求其分频系数必须大于等于2
DPAL_WRITE_UINT16(value, div_reg);
value |= EMMC_EMMC_CCLK_EN;
DPAL_WRITE_UINT16(value, div_reg);
+
+ tcxo_port_delay_us(60); // wait 60us
}
-static void mmc_set_second_level_clk_div(uint32_t div_reg, uint32_t freq_div)
+static void emmc_host_set_second_level_clk_div(uint32_t div_reg, uint32_t freq_div)
{
uint16_t value;
DPAL_WRITE_UINT16(value, div_reg);
}
-static void mmc_host_set_first_level_clk_div(uint32_t div_reg, uint32_t freq_div)
+static void emmc_host_set_clk_div(system_sdio_freq_t sdiom_freq_level, uint32_t real_clock)
+{
+ uint32_t freq_div = 1;
+ uint32_t sec_freq_div = 1;
+
+ if (real_clock == 0) {
+ return;
+ }
+ /* 根据所选的sdiom时钟源和目标时钟频率,计算分频比 */
+ mmc_calc_sdiom_clk_div(sdiom_freq_level, real_clock, &freq_div, &sec_freq_div);
+ if (real_clock <= SDIOM_SRC_CLK_FREQ_LVL_50M_VAL) {
+ reg16_clrbit(EMMC_CCLK_DIV_REG, EMMC_TUNING_COARSE_MODE_BIT);
+ } else {
+ reg16_setbit(EMMC_CCLK_DIV_REG, EMMC_TUNING_COARSE_MODE_BIT);
+ }
+ emmc_host_set_first_level_clk_div(EMMC_CCLK_DIV_REG, freq_div);
+ emmc_host_set_second_level_clk_div(EMMC_DIV_REG, sec_freq_div);
+}
+
+static void sdio_host_set_first_level_clk_div(uint32_t div_reg, uint32_t freq_div)
{
uint16_t value;
value = DPAL_GET_UINT16(div_reg);
DPAL_WRITE_UINT16(value, div_reg);
value &= ~SDIO_EMMC_DIV_NUM_MASK;
value |= (uint16_t)(freq_div << SDIO_EMMC_DIV_NUM_POST_SHIFT);
+ value |= SDIO_HOST_CARD_CLK_INV_SET;
DPAL_WRITE_UINT16(value, div_reg);
value |= SDIO_CCLK_ORI_DIV_EN;
DPAL_WRITE_UINT16(value, div_reg);
DPAL_WRITE_UINT16(value, div_reg);
value = DPAL_GET_UINT16(div_reg);
+#if (MMC_BOARD_DEBUG_ON)
+ dprintf("%s, freq_div:[%u],value:[%x]!\n", __FUNCTION__, freq_div, value);
+#endif
+ tcxo_port_delay_us(60); // wait 60us
}
-static void mmc_host_set_second_level_clk_div(uint32_t div_reg, uint32_t freq_div)
+static void sdio_host_set_second_level_clk_div(uint32_t div_reg, uint32_t freq_div)
{
uint16_t value;
DPAL_WRITE_UINT16(value, div_reg);
}
-unsigned int mmc_set_clock_with_way2(struct hci_softc *sc, unsigned int cfg_clock)
+static void sdio_host_set_clk_div(system_sdio_freq_t sdiom_freq_level, uint32_t real_clock)
{
- uint32_t first_freq_div = 0;
- uint32_t freq_div = 0;
- uint32_t second_freq_div = 0;
+ uint32_t freq_div = 1;
uint32_t sec_freq_div = 1;
+
+ if (real_clock == 0) {
+ return;
+ }
+ /* 根据所选的sdiom时钟源和目标时钟频率,计算分频比 */
+ mmc_calc_sdiom_clk_div(sdiom_freq_level, real_clock, &freq_div, &sec_freq_div);
+ if (real_clock <= SDIOM_SRC_CLK_FREQ_LVL_50M_VAL) {
+ reg16_clrbit(SD_HOST_CCLK_DIV_REG, SDIO_TUNING_COARSE_MODE_BIT);
+ } else {
+ reg16_setbit(SD_HOST_CCLK_DIV_REG, SDIO_TUNING_COARSE_MODE_BIT);
+ }
+ sdio_host_set_first_level_clk_div(SD_HOST_CCLK_DIV_REG, freq_div);
+ sdio_host_set_second_level_clk_div(SDIO_HOST_CCLK_DIV_REG, sec_freq_div);
+}
+
+unsigned int mmc_set_clock_with_way2(struct hci_softc *sc, unsigned int cfg_clock)
+{
+ system_sdio_freq_t sdiom_freq_level;
uint32_t real_clock = cfg_clock;
+ uint32_t change = true;
if (cfg_clock > sc->caps.max_clk) {
-#if EMMC_BOARD_DEBUG_ON
- dprintf("%s, clock:[%u] is greater than the max_clk:[%u]!\n", __FUNCTION__, cfg_clock, sc->caps.max_clk);
-#endif
real_clock = sc->caps.max_clk;
}
- mmc_set_sdiom_src_clk(real_clock, &freq_div, &sec_freq_div);
+#if MMC_BOARD_DEBUG_ON
+ dprintf("mmc%d cfg_clock[%u],max_clk:[%u],real_clock:[%u]\n", sc->num, cfg_clock, sc->caps.max_clk, real_clock);
+#endif
+ sdiom_freq_level = mmc_select_sdiom_src_clk(sc, real_clock);
+ if (!clocks_set_sdio_freq(sdiom_freq_level)) {
+ return 0;
+ }
+ change = (sdiom_freq_level != g_sdiom_cur_sel) ? true : false;
if (sc->num == 0) {
- first_freq_div = EMMC_CCLK_DIV_REG;
- second_freq_div = EMMC_DIV_REG;
- mmc_set_first_level_clk_div(first_freq_div, freq_div);
- mmc_set_second_level_clk_div(second_freq_div, sec_freq_div);
+ emmc_host_set_clk_div(sdiom_freq_level, real_clock);
+ if (change == true) {
+#if (MMC_BOARD_DEBUG_ON)
+ dprintf("%s, sdiom change, update mmc1, cfg_clk[%d]\r\n", __FUNCTION__, g_sdiom_cfg_clk[1]);
+#endif
+ sdio_host_set_clk_div(sdiom_freq_level, g_sdiom_cfg_clk[1]); // 源时钟有切换,另一路mmc要重配
+ }
#ifdef DPALCFG_DRIVERS_SDIO
} else if (sc->num == 1) {
- first_freq_div = SD_HOST_CCLK_DIV_REG;
- second_freq_div = SDIO_HOST_CCLK_DIV_REG;
- mmc_host_set_first_level_clk_div(first_freq_div, freq_div);
- mmc_host_set_second_level_clk_div(second_freq_div, sec_freq_div);
+ sdio_host_set_clk_div(sdiom_freq_level, real_clock);
+ if (change == true) {
+#if (MMC_BOARD_DEBUG_ON)
+ dprintf("%s, sdiom change, update mmc0, cfg_clk[%d]\r\n", __FUNCTION__, g_sdiom_cfg_clk[0]);
+#endif
+ emmc_host_set_clk_div(sdiom_freq_level, g_sdiom_cfg_clk[0]); // 源时钟有切换,另一路mmc要重配
+ }
#endif
}
-
+ g_sdiom_cur_sel = sdiom_freq_level;
mmc_set_sd_bus_clk_div(SDIO_BUS_CGDIV_REG, 1);
return 0;
{
uint32_t actual_clock = clock;
if (clock > sc->caps.max_clk) {
-#if EMMC_BOARD_DEBUG_ON
+#if MMC_BOARD_DEBUG_ON
dprintf("%s, clock:[%u] is greater than the max_clk:[%u]!\n", __FUNCTION__, clock, sc->caps.max_clk);
#endif
actual_clock = sc->caps.max_clk;
}
- switch (g_max_timing) {
+ switch (g_max_timing[sc->num]) {
case bus_timing_mmc_hs:
case bus_timing_uhs_sdr50:
case bus_timing_uhs_ddr50:
case bus_timing_mmc_ddr52:
case bus_timing_sd_hs:
- if (actual_clock >= SDIOM_SRC_CLK_FREQ_LVL_50M_VAL) {
+ if (actual_clock >= SDIOM_SRC_CLK_FREQ_LVL_49M_VAL) {
actual_clock = SDIOM_SRC_CLK_FREQ_LVL_49M_VAL;
}
break;
return actual_clock;
}
-uint32_t sdhci_set_clock(struct hci_softc *sc, uint32_t clock)
+uint32_t mmc_sdhci_set_clock(struct hci_softc *sc, uint32_t clock)
{
unsigned int ret;
static uint8_t inited = false;
return clock;
}
actual_clk = sdhci_get_config_clock(sc, clock);
-#if EMMC_BOARD_DEBUG_ON
- dprintf("%s, clk:%u,a_clk:%u,resource:[0x%x]!\n", __FUNCTION__, clock, actual_clk, DPAL_GET_UINT16(SDIOM_CR_REG));
+#if MMC_BOARD_DEBUG_ON
+ dprintf("mmc%d clk:%u,a_clk:%u,max_timing[%d],resource:[0x%x]!\n", sc->num,
+ clock, actual_clk, g_max_timing[sc->num], DPAL_GET_UINT16(SDIOM_CR_REG));
#endif
- if (actual_clk <= SDIOM_SRC_CLK_FREQ_LVL_50M_VAL) {
- reg16_clrbit(BRANDY_EXTERNAL_EMMC_CCLK_DIV, EMMC_TUNING_COARSE_MODE_BIT);
- } else {
- reg16_setbit(BRANDY_EXTERNAL_EMMC_CCLK_DIV, EMMC_TUNING_COARSE_MODE_BIT);
- }
+
ret = hal_mmc_set_soc_clock(sc, actual_clk);
if (ret != 0) {
device_printf(sc->dev, "set clock fail!\n");
hci_writeb(sc, SDHCI_AXI_MBIIU_CTRL, val);
inited = true;
}
-#ifdef CFG_SDIO_EMMC_COEXIST
- if (sc->num == 0) {
-#endif
+
// After the tuning phase value is configured, the tuning clk function is automatically enabled.
if (actual_clk > SDIOM_SRC_CLK_FREQ_LVL_50M_VAL) {
- reg16_clrbit(HOST_CTRL2, SAMPLE_CLK_SEL_BIT);
- reg16_clrbit(AT_CTRL, 0x4); // 0x4 means SW_TUNE_EN
- dpal_writel(sc->tuning_phase, AT_STAT);
- reg16_setbit(HOST_CTRL2, SAMPLE_CLK_SEL_BIT);
+ reg16_clrbit(sc->base + SDHCI_HOST_CONTROL2, SAMPLE_CLK_SEL_BIT);
+ hci_clearl(sc, SDHCI_AUTO_TUNING_CTRL, SDHCI_SW_TUNING_EN); // bit4
+ hci_writel(sc, SDHCI_AUTO_TUNING_STATUS, sc->tuning_phase);
+ reg16_setbit(sc->base + SDHCI_HOST_CONTROL2, SAMPLE_CLK_SEL_BIT);
// The fixed clock is less than or equal to 52 MHz, and the tuning clock is not used.
} else {
- reg16_clrbit(HOST_CTRL2, SAMPLE_CLK_SEL_BIT);
- }
-#ifdef CFG_SDIO_EMMC_COEXIST
+ reg16_clrbit(sc->base + SDHCI_HOST_CONTROL2, SAMPLE_CLK_SEL_BIT);
}
+
+#if MMC_BOARD_DEBUG_ON
+ dprintf("%s,clk_src=0x%X, at_ctrl=0x%X, at_stat=0x%X, host2_ctrl=0x%X, tuning_phase=0x%X\r\n",
+ __FUNCTION__, readw(SDIOM_CR_REG), hci_readl(sc, SDHCI_AUTO_TUNING_CTRL),
+ hci_readl(sc, SDHCI_AUTO_TUNING_STATUS), hci_readw(sc, SDHCI_HOST_CONTROL2), sc->tuning_phase);
#endif
-#if EMMC_BOARD_DEBUG_ON
- dprintf("%s,clk_src=0x%X, at_ctrl=0x%X, at_stat=0x%X, host2_ctrl=0x%X, tuning_phase=0x%X\r\n", __FUNCTION__,
- readw(SDIOM_CR_REG), readw(AT_CTRL), readw(AT_STAT), readw(HOST_CTRL2), sc->tuning_phase);
-#endif
+ tcxo_port_delay_us(60); // wait 60us
return actual_clk;
}
+uint8_t is_sdio_working(void)
+{
+ struct hci_softc *sc = get_mmc_resource(1);
+
+ if (sc == NULL || sc->slot == NULL) {
+ return false;
+ }
+ struct mmc_softc *mmc_sc = device_get_softc(((struct sdhci_slot*)sc->slot)->dev);
+ if (mmc_sc == NULL || mmc_sc->child_count == 0) {
+ return false;
+ }
+
+ return (mmc_sc->card_init_status == MMC_CARD_INIT) ? true : false;
+}
void mmc_set_internal_clk(uint16_t clk_level)
{
+ /* sdio和emmc共存情况下, 外部不能更改emmc的时钟源 */
+ if (is_sdio_working() == true) {
+ return;
+ }
+
struct hci_softc *sc = get_mmc_resource(0);
uint32_t g_sdiom_val[CLOCKS_SDIO_FREQ_MAX] = {
CLOCKS_SDIO_FREQ_32M_VAL, CLOCKS_SDIO_FREQ_50M_VAL, CLOCKS_SDIO_FREQ_64M_VAL, CLOCKS_SDIO_FREQ_H_VAL };
- clocks_clk_cfg_t sdio_freq = clocks_system_sdio_freq_get(clk_level);
- sdhci_set_clock(sc, g_sdiom_val[clk_level]);
+
+ static uint16_t cur_level = CLOCKS_SDIO_FREQ_MAX;
+ if (clk_level == cur_level) {
+ return;
+ }
+ cur_level = clk_level;
+#if MMC_BOARD_DEBUG_ON
+ dprintf("%s, clk_level %d\r\n", __FUNCTION__, clk_level);
+#endif
+ mmc_sdhci_set_clock(sc, g_sdiom_val[clk_level]);
}
static void sdhci_set_drv_phase(uint32_t host_id, uint32_t phase)
device_printf(sc->dev, "LOSCFG_DRIVERS_EMMC selected\n");
cfg_info->caps |= HCI_SLOTTYPE_EMBEDDED;
cfg_info->caps |= HCI_CAN_DO_8BITBUS;
- cfg_info->quirks |= SDHCI_QUIRK_SIG_1V8_ONLY; /* signal 1.2V unsupported */
+ cfg_info->quirks |= SDHCI_QUIRK_SIG_1V8_ONLY;
#ifdef DPALCFG_DRIVERS_SDIO
} else if (sc->num == 1) { /* SDIO device */
- // brandyæ\9c\80é«\98é¢\91ç\8e\87æ\9c\89é\99\90å\88¶
- cfg_info->max_clk = SDIOM_SRC_CLK_FREQ_LVL_49M_VAL;
+ // brandyæ\9c\80é«\98é¢\91ç\8e\87æ\8c\89æ\9c\80é«\98è\83½å\8a\9bé\85\8dç½®
+ cfg_info->max_clk = SDIOM_SRC_CLK_FREQ_LVL_98M_VAL;
cfg_info->min_clk = CONFIG_MMC1_CCLK_MIN;
cfg_info->caps |= HCI_SLOTTYPE_SDIO;
- cfg_info->quirks |= SDHCI_QUIRK_SIG_3V3_ONLY; /* signal 1.2V 1.8V unsupported */
+ cfg_info->quirks |= SDHCI_QUIRK_SIG_1V8_ONLY;
cfg_info->quirks |= SDHCI_QUIRK_BROKEN_TIMEOUT_VAL;
cfg_info->caps &= ~HCI_CAN_VDD_180;
cfg_info->caps &= ~HCI_CAN_DO_8BITBUS;
cfg_info->caps2 &= ~HCI_CAN_MMC_HS400ES;
sdhci_subplatform_init(sc, cfg_info);
+#if MMC_BOARD_DEBUG_ON
+ dprintf("%s, hci_caps:caps[0x%x],caps2[0x%x],quirks[0x%x],max_clk[0x%x],min_clk[0x%x]\r\n", __FUNCTION__,
+ cfg_info->caps, cfg_info->caps2, cfg_info->quirks, cfg_info->min_clk);
+#endif
}
{
uint16_t val = 0;
-#if EMMC_BOARD_DEBUG_ON
+#if MMC_BOARD_DEBUG_ON
dprintf("%s, en:[%u]\r\n", __FUNCTION__, en);
#endif
-
+ if (sc->num >= MAX_MMC_NUM) {
+ dprintf("%s, sc->num:[%u]\r\n", __FUNCTION__, sc->num);
+ return;
+ }
if (en != 0) {
hci_setl(sc, SDHCI_AUTO_TUNING_CTRL, SDHCI_SW_TUNING_EN);
- val = DPAL_GET_UINT16(EMMC_CCLK_DIV_REG);
- val |= EMMC_TUNING_COARSE_MODE;
- DPAL_WRITE_UINT16(val, EMMC_CCLK_DIV_REG);
+ val = DPAL_GET_UINT16(g_clk_div1_reg[sc->num]);
+ val |= g_tunning_coarse_mode[sc->num];
+ DPAL_WRITE_UINT16(val, g_clk_div1_reg[sc->num]);
- DPAL_WRITE_UINT16(EMMC_TUNING_BM0_VAL, EMMC_TUNING_BM0_REG);
- DPAL_WRITE_UINT16(EMMC_TUNING_BM1_VAL, EMMC_TUNING_BM1_REG);
+ DPAL_WRITE_UINT16(g_tunning_bm0_value[sc->num], g_tunning_bm0_reg[sc->num]);
+ DPAL_WRITE_UINT16(g_tunning_bm1_value[sc->num], g_tunning_bm1_reg[sc->num]);
} else {
hci_clearl(sc, SDHCI_AUTO_TUNING_CTRL, SDHCI_SW_TUNING_EN);
}
unused(timing);
}
-static bool sdhci_judge_dll_sample(uint32_t timing)
+static bool sdhci_judge_dll_sample(struct hci_softc *sc, uint32_t timing)
{
- if (g_max_timing < timing) { g_max_timing = timing; }
+ if (g_max_timing[sc->num] < timing) { g_max_timing[sc->num] = timing; }
if (timing == bus_timing_mmc_hs || timing == bus_timing_sd_hs || timing == bus_timing_normal ||
timing == bus_timing_uhs_sdr25) {
return false;
phase = 0;
}
}
- en_flag = sdhci_judge_dll_sample(timing);
-#if EMMC_BOARD_DEBUG_ON
- device_printf(sc->dev, "timing:%u, g_max_timing =%u, phase:0x%x, drv_phase:0x%x, en_flag:%d \n", timing,
- g_max_timing, phase, drv_phase, en_flag);
+ en_flag = sdhci_judge_dll_sample(sc, timing);
+#if MMC_BOARD_DEBUG_ON
+ device_printf(sc->dev, "%s timing:%u, g_max_timing =%u, phase:0x%x, drv_phase:0x%x, en_flag:%d \n", __FUNCTION__,
+ timing, g_max_timing[sc->num], phase, drv_phase, en_flag);
#endif
sdhci_set_drv_phase(sc->num, drv_phase);
sdhci_en_drv_dll_sample(sc, en_flag);
void mmc_ext_clk_switch(struct hci_softc *sc, bool enable)
{
- unused(sc);
- if (enable) {
- reg16_setbit(BRANDY_EXTERNAL_EMMC_CCLK_DIV, 0);
- } else {
- reg16_clrbit(BRANDY_EXTERNAL_EMMC_CCLK_DIV, 0);
+ /* sdio slave主动发消息可能需要时钟, master不关时钟 */
+ if (sc->num == 0) {
+ if (enable) {
+ reg16_setbit(g_clk_div1_reg[sc->num], 0);
+ } else {
+ reg16_clrbit(g_clk_div1_reg[sc->num], 0);
+ }
}
}
slot_ops->pre_clock = sdhci_pre_set_clock;
slot_ops->post_clock = sdhci_post_clock;
- slot_ops->set_clock = sdhci_set_clock;
+ slot_ops->set_clock = mmc_sdhci_set_clock;
slot_ops->extra_init = sdhci_extra_init;
slot_ops->slot_init = sdhci_slot_init;
slot_ops->set_phase = sdhci_set_phase;
#endif /* __cplusplus */
#endif /* __cplusplus */
-#define EMMC_BOARD_DEBUG_ON 0
+#ifndef MMC_BOARD_DEBUG_ON
+#define MMC_BOARD_DEBUG_ON 0
+#endif
#define GLB_CTL_M_RB_BASE 0x57000000
#define M_CTL_RB_BASE 0x52000000
#define BRANDY_EMMC_REG_END 0x52063FFF
// emmc external clk EMMC_CCLK_DIV
#define BRANDY_EXTERNAL_EMMC_CCLK_DIV 0x52000100
-#define EMMC_TUNING_COARSE_MODE_BIT 0xD
#define PERI_EMMC_CRG_RST_CTL (GLB_CTL_M_RB_BASE + 0xc8)
#define SOFT_RST_GLB_SDIO_CRG_N BIT(0)
#define CMD6_INDEX 0x61b
#define EMMC_CCLK_DIV_REG (M_CTL_RB_BASE + 0x0100)
-#define EMMC_CCLK_ORI_DIV_NUM_MASK 0x0FF0
-#define EMMC_CCLK_ORI_DIV_NUM_2 0x20
+#define EMMC_TUNING_COARSE_MODE_BIT (13)
+#define EMMC_TUNING_COARSE_MODE BIT(13)
+
+#define EMMC_CCLK_ORI_DIV_NUM_MASK 0x0FF0
+#define EMMC_CCLK_ORI_DIV_NUM_2 0x20
#define EMMC_TUNING_BM0_REG (M_CTL_RB_BASE + 0x104)
#define EMMC_TUNING_BM1_REG (M_CTL_RB_BASE + 0x108)
-#define SD_HOST_CCLK_DIV_REG (M_CTL_RB_BASE + 0x0110)
-#define SDIO_HOST_CCLK_DIV_REG (M_CTL_RB_BASE + 0x014C)
+#define EMMC_TUNING_BM0_VAL (0x4244)
+#define EMMC_TUNING_BM1_VAL (0x777)
-#define SDIO_HOST_CLKEN BIT(0)
-#define SDIO_CCLK_ORI_DIV_EN BIT(1)
-#define SDIO_CCLK_ORI_LOAD_DIV_EN BIT(2)
-#define SDIO_HOST_DIV_EN BIT(0)
-#define SDIO_HOST_DIV_SHFIT 1
-#define SDIO_HOST_DIV_MASK 0xE
+#define SD_HOST_CCLK_DIV_REG (M_CTL_RB_BASE + 0x0110)
+#define SDIO_HOST_CLKEN BIT(0)
+#define SDIO_CCLK_ORI_DIV_EN BIT(1)
+#define SDIO_CCLK_ORI_LOAD_DIV_EN BIT(2)
+#define SDIO_TUNING_COARSE_MODE_BIT (3)
+#define SDIO_TUNING_COARSE_MODE BIT(SDIO_TUNING_COARSE_MODE_BIT)
+#define SDIO_HOST_CARD_CLK_INV_SET BIT(13)
+
+#define SD_HOST_TUNING_BM0_REG (M_CTL_RB_BASE + 0x114)
+#define SD_HOST_TUNING_BM1_REG (M_CTL_RB_BASE + 0x118)
+#define SDIO_TUNING_BM0_VAL (0x4244)
+#define SDIO_TUNING_BM1_VAL (0x777)
#define EMMC_DIV_REG (M_CTL_RB_BASE + 0x0120)
#define SDIO_BUS_CGDIV_REG (M_CTL_RB_BASE + 0x0124)
-#define SD_BUS_CLKEN BIT(0)
-#define SD_BUS_DIV_EN BIT(1)
-#define SD_BUS_LOAD_DIV_EN BIT(8)
-#define SD_BUS_DIV_NUM_MASK 0xF8 // bit3---bit7
-#define SD_BUS_DIV_NUM_POST_SHIFT 3
+#define SD_BUS_CLKEN BIT(0)
+#define SD_BUS_DIV_EN BIT(1)
+#define SD_BUS_LOAD_DIV_EN BIT(8)
+#define SD_BUS_DIV_NUM_MASK 0xF8 // bit3---bit7
+#define SD_BUS_DIV_NUM_POST_SHIFT 3
-#define EMMC_TUNING_BM0_VAL (0x4244)
-#define EMMC_TUNING_BM1_VAL (0x777)
-#define EMMC_TUNING_COARSE_MODE BIT(13)
+#define SDIO_HOST_CCLK_DIV_REG (M_CTL_RB_BASE + 0x014C)
+#define SDIO_HOST_DIV_EN BIT(0)
+#define SDIO_HOST_DIV_SHFIT 1
+#define SDIO_HOST_DIV_MASK 0xE
#define DWC_MSHC_PTR_VENDOR1 0x500
#define SDHCI_MSHC_CTRL (DWC_MSHC_PTR_VENDOR1 + 0x08)
void sdio_drv_context_init(void);
void init_sdio_pinmux(void);
+uint8_t is_sdio_working(void);
void mmc_set_internal_clk(uint16_t clk_level);
void mmc_set_first_init_flag(bool flag);
bool mmc_get_first_init_flag(void);
void mmc_set_sleep_init_flag(bool flag);
bool mmc_get_sleep_init_flag(void);
+
#ifdef __cplusplus
#if __cplusplus
}
*/
typedef struct {
uint32_t min_interval; /*!< @if Eng Min interval[N * 0.625ms]
- @else 最小的广播间隔[N * 0.625ms] @endif */
+ The value range: 0x0020 to 0x4000
+ @else 最小的广播间隔[N * 0.625ms]
+ 可取值范围: 0x0020 to 0x4000 @endif */
uint32_t max_interval; /*!< @if Eng Max interval[N * 0.625ms]
- @else 最大的广播间隔[N * 0.625ms] @endif */
+ The value range: 0x0020 to 0x4000
+ @else 最大的广播间隔[N * 0.625ms]
+ 可取值范围: 0x0020 to 0x4000 @endif */
uint8_t adv_type; /*!< @if Eng Advertising type { @ref gap_ble_adv_type_t }
@else 广播类型 { @ref gap_ble_adv_type_t } @endif */
bd_addr_t own_addr; /*!< @if Eng own address
*/
typedef void (*gap_is_accept_conn_on_safe_mode_callback)(const bd_addr_t *bd_addr, bool *res);
+/**
+ * @if Eng
+ * @brief Callback function for a new connection is rejected.
+ * @par When registered, this callback notifys application a connect request is rejected.
+ * @attention NULL
+ * @param [in] bd_addr #const bd_addr_t *, the address of the remote device.
+ * @retval #void no return value.
+ * @par Dependency:
+ * @li bts_gap.h
+ * @see gap_call_backs_t
+ * @else
+ * @brief 通知上层应用有个新的连接请求被拒绝了。
+ * @par 注册该回调函数之后,bluetooth调用该回调函数通知上层应用有个新的连接请求被拒绝了。
+ * @attention 无
+ * @param [in] 远端设备地址。
+ * @retval #void 无返回值。
+ * @par 依赖:
+ * @li bts_gap.h
+ * @see gap_call_backs_t
+ * @endif
+ */
+typedef void (*gap_connect_rejection_report_callback)(const bd_addr_t *bd_addr);
+
/**
* @if Eng
* @brief Struct of GAP callback functions.
*/
errcode_t gap_bt_set_flow_limit(uint16_t flow_limit);
+/**
+ * @if Eng
+ * @brief Register callback function for connection rejected event notification.
+ * @par Register callback function for connection rejected event notification.
+ * @attention NULL
+ * @param [in] func #gap_connect_rejection_report_callback, a pointer to the callback func.
+ * @retval #void no return value.
+ * @par Dependency:
+ * @li bts_br_gap.h
+ * @else
+ * @brief 注册拒绝新手机连接事件上报回调函数。
+ * @par 注册拒绝新手机连接事件上报回调函数。
+ * @attention 无
+ * @param [in] 指向回调函数的指针。
+ * @retval #void 无
+ * @par 依赖:
+ * @li bts_br_gap.h
+ * @endif
+ */
+void gap_register_br_connect_rejection_report_callback(gap_connect_rejection_report_callback func);
/**
* @}
*/
<MSG STRUCTURE="diag_log_msg0" NAME="malloc or read fail! @DialBinParser.cpp(882),ERROR" ID="0xb8d01b92" />
<MSG STRUCTURE="diag_log_msg0" NAME="Parser dial option image fail, file is nullptr! @DialBinParser.cpp(906),ERROR" ID="0xb8d01c52" />
<MSG STRUCTURE="diag_log_msg0" NAME="malloc or read fail! @DialBinParser.cpp(919),ERROR" ID="0xb8d01cba" />
- <MSG STRUCTURE="diag_log_msg2" NAME="load img fail! file: %s resId: %x @DialBinParser.cpp(929),ERROR" ID="0xb8d01d0a" />
+ <MSG STRUCTURE="diag_log_msg2" NAME="load img fail! file: %s resId: %x @DialBinParser.cpp(935),ERROR" ID="0xb8d01d3a" />
</MSG_LOG>
\ No newline at end of file
-<MSG_LOG><MSG STRUCTURE="diag_log_msg0" NAME="osal_mutex_init in g_connect_list_lock failed @connection_manager.c(126),ERROR" ID="0xd80603f2" />
- <MSG STRUCTURE="diag_log_msg0" NAME="osal_mutex_init in g_ble_conn_list_lock failed @connection_manager.c(131),ERROR" ID="0xd806041a" />
- <MSG STRUCTURE="diag_log_msg1" NAME="create timer error! ret: %x @connection_manager.c(206),ERROR" ID="0xd8060672" />
- <MSG STRUCTURE="diag_log_msg1" NAME="start timer error! ret: %x @connection_manager.c(214),ERROR" ID="0xd80606b2" />
- <MSG STRUCTURE="diag_log_msg0" NAME="start timer success! @connection_manager.c(219),INFO" ID="0xd80606dd" />
- <MSG STRUCTURE="diag_log_msg0" NAME="already in discovery @connection_manager.c(238),WARNING" ID="0xd8060773" />
- <MSG STRUCTURE="diag_log_msg0" NAME="already in discovery @connection_manager.c(250),WARNING" ID="0xd80607d3" />
- <MSG STRUCTURE="diag_log_msg1" NAME="start discovery fail ret: %x @connection_manager.c(264),ERROR" ID="0xd8060842" />
- <MSG STRUCTURE="diag_log_msg0" NAME="discovery started @connection_manager.c(272),INFO" ID="0xd8060885" />
- <MSG STRUCTURE="diag_log_msg2" NAME="reconnect phone con_hdl:0x%x, result: %08x @connection_manager.c(405),INFO" ID="0xd8060cad" />
- <MSG STRUCTURE="diag_log_msg0" NAME="exist connect phone reject! @connection_manager.c(433),INFO" ID="0xd8060d8d" />
+<MSG_LOG><MSG STRUCTURE="diag_log_msg0" NAME="osal_mutex_init in g_connect_list_lock failed @connection_manager.c(127),ERROR" ID="0xd80603fa" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="osal_mutex_init in g_ble_conn_list_lock failed @connection_manager.c(132),ERROR" ID="0xd8060422" />
+ <MSG STRUCTURE="diag_log_msg1" NAME="create timer error! ret: %x @connection_manager.c(207),ERROR" ID="0xd806067a" />
+ <MSG STRUCTURE="diag_log_msg1" NAME="start timer error! ret: %x @connection_manager.c(215),ERROR" ID="0xd80606ba" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="start timer success! @connection_manager.c(220),INFO" ID="0xd80606e5" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="already in discovery @connection_manager.c(239),WARNING" ID="0xd806077b" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="already in discovery @connection_manager.c(251),WARNING" ID="0xd80607db" />
+ <MSG STRUCTURE="diag_log_msg1" NAME="start discovery fail ret: %x @connection_manager.c(265),ERROR" ID="0xd806084a" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="discovery started @connection_manager.c(273),INFO" ID="0xd806088d" />
+ <MSG STRUCTURE="diag_log_msg2" NAME="reconnect phone con_hdl:0x%x, result: %08x @connection_manager.c(406),INFO" ID="0xd8060cb5" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="exist connect phone reject! @connection_manager.c(434),INFO" ID="0xd8060d95" />
<MSG STRUCTURE="diag_log_msg0" NAME="malloc fail @connection_manager.c(454),ERROR" ID="0xd8060e32" />
<MSG STRUCTURE="diag_log_msg0" NAME="memcpy fail @connection_manager.c(458),ERROR" ID="0xd8060e52" />
<MSG STRUCTURE="diag_log_msg1" NAME="send msg fail. %x @connection_manager.c(464),ERROR" ID="0xd8060e82" />
<MSG STRUCTURE="diag_log_msg1" NAME="create acl cfm ret = %08x @connection_manager.c(472),INFO" ID="0xd8060ec5" />
<MSG STRUCTURE="diag_log_msg3" NAME="dev_hdl: 0x%08x cod: 0x%x link_type: 0x%x @connection_manager.c(501),INFO" ID="0xd8060fad" />
- <MSG STRUCTURE="diag_log_msg0" NAME="already exist conn_node @connection_manager.c(511),INFO" ID="0xd8060ffd" />
- <MSG STRUCTURE="diag_log_msg0" NAME="accept not paired earbuds. @connection_manager.c(520),INFO" ID="0xd8061045" />
- <MSG STRUCTURE="diag_log_msg0" NAME="exist same type conn node. @connection_manager.c(524),INFO" ID="0xd8061065" />
- <MSG STRUCTURE="diag_log_msg0" NAME="add conn info error! @connection_manager.c(531),ERROR" ID="0xd806109a" />
- <MSG STRUCTURE="diag_log_msg1" NAME="btsdk_disconnect_acl_by_handle ret: %x @connection_manager.c(538),INFO" ID="0xd80610d5" />
- <MSG STRUCTURE="diag_log_msg0" NAME="malloc fail @connection_manager.c(546),ERROR" ID="0xd8061112" />
- <MSG STRUCTURE="diag_log_msg0" NAME="get addr fail @connection_manager.c(553),ERROR" ID="0xd806114a" />
- <MSG STRUCTURE="diag_log_msg0" NAME="memcpy fail @connection_manager.c(558),ERROR" ID="0xd8061172" />
- <MSG STRUCTURE="diag_log_msg1" NAME="send msg fail. %x @connection_manager.c(564),ERROR" ID="0xd80611a2" />
- <MSG STRUCTURE="diag_log_msg0" NAME="connect exist conn_node @connection_manager.c(580),INFO" ID="0xd8061225" />
- <MSG STRUCTURE="diag_log_msg0" NAME="exist same type conn_node, disconnect. @connection_manager.c(585),INFO" ID="0xd806124d" />
- <MSG STRUCTURE="diag_log_msg0" NAME="find remote node fail @connection_manager.c(593),WARNING" ID="0xd806128b" />
- <MSG STRUCTURE="diag_log_msg0" NAME="add conn info error! @connection_manager.c(600),ERROR" ID="0xd80612c2" />
- <MSG STRUCTURE="diag_log_msg1" NAME="create acl ret = %08x @connection_manager.c(612),WARNING" ID="0xd8061323" />
- <MSG STRUCTURE="diag_log_msg0" NAME="acl is connected @connection_manager.c(620),INFO" ID="0xd8061365" />
- <MSG STRUCTURE="diag_log_msg1" NAME="dev_hdl: %08x @connection_manager.c(629),INFO" ID="0xd80613ad" />
- <MSG STRUCTURE="diag_log_msg0" NAME="not exist conn node. @connection_manager.c(632),INFO" ID="0xd80613c5" />
- <MSG STRUCTURE="diag_log_msg1" NAME="is phone=0x%x @connection_manager.c(635),INFO" ID="0xd80613dd" />
- <MSG STRUCTURE="diag_log_msg2" NAME="status error dev_hdl: %x status: %d @connection_manager.c(638),WARNING" ID="0xd80613f3" />
- <MSG STRUCTURE="diag_log_msg1" NAME="btsdk_disconnect_acl_by_handle ret: %x @connection_manager.c(678),INFO" ID="0xd8061535" />
- <MSG STRUCTURE="diag_log_msg0" NAME="send msg connecting @connection_manager.c(710),INFO" ID="0xd8061635" />
- <MSG STRUCTURE="diag_log_msg0" NAME="malloc fail @connection_manager.c(714),ERROR" ID="0xd8061652" />
- <MSG STRUCTURE="diag_log_msg0" NAME="memcpy fail @connection_manager.c(718),ERROR" ID="0xd8061672" />
- <MSG STRUCTURE="diag_log_msg1" NAME="send msg fail. %x @connection_manager.c(724),ERROR" ID="0xd80616a2" />
- <MSG STRUCTURE="diag_log_msg0" NAME="send msg connecting success! @connection_manager.c(727),INFO" ID="0xd80616bd" />
- <MSG STRUCTURE="diag_log_msg0" NAME="stop timer @connection_manager.c(732),INFO" ID="0xd80616e5" />
- <MSG STRUCTURE="diag_log_msg0" NAME="stop timer success! @connection_manager.c(740),INFO" ID="0xd8061725" />
- <MSG STRUCTURE="diag_log_msg0" NAME="start timer @connection_manager.c(745),INFO" ID="0xd806174d" />
- <MSG STRUCTURE="diag_log_msg0" NAME="memcpy fail @connection_manager.c(755),ERROR" ID="0xd806179a" />
- <MSG STRUCTURE="diag_log_msg1" NAME="create timer error! ret: %x @connection_manager.c(760),ERROR" ID="0xd80617c2" />
- <MSG STRUCTURE="diag_log_msg1" NAME="start timer error! ret: %x @connection_manager.c(766),ERROR" ID="0xd80617f2" />
- <MSG STRUCTURE="diag_log_msg2" NAME="start timer success! try to reconnect %d times interval %dms @connection_manager.c(771),INFO" ID="0xd806181d" />
- <MSG STRUCTURE="diag_log_msg2" NAME="dev_hdl: %08x reason: %08x @connection_manager.c(803),INFO" ID="0xd806191d" />
- <MSG STRUCTURE="diag_log_msg1" NAME="no conn record dev_hdl: %08x @connection_manager.c(812),WARNING" ID="0xd8061963" />
- <MSG STRUCTURE="diag_log_msg2" NAME="rmt device class=0x%x is phone: 0x%x @connection_manager.c(822),INFO" ID="0xd80619b5" />
- <MSG STRUCTURE="diag_log_msg0" NAME="get addr fail @connection_manager.c(835),WARNING" ID="0xd8061a1b" />
- <MSG STRUCTURE="diag_log_msg1" NAME="get remote dev addr failed. dev_hdl: %x @connection_manager.c(849),WARNING" ID="0xd8061a8b" />
- <MSG STRUCTURE="diag_log_msg6" NAME="addr: ****%02x%02x%02x%02x dev_hdl: %08x gap_remove_pair ret(bool): %d @connection_manager.c(858),INFO" ID="0xd8061ad5" />
- <MSG STRUCTURE="diag_log_msg3" NAME="error dev_hdl: %x pair_ret: %x disconn_ret: %x @connection_manager.c(867),WARNING" ID="0xd8061b1b" />
- <MSG STRUCTURE="diag_log_msg1" NAME="dev_hdl: %08x @connection_manager.c(874),INFO" ID="0xd8061b55" />
- <MSG STRUCTURE="diag_log_msg1" NAME="conn node is null dev_hdl: %x @connection_manager.c(878),INFO" ID="0xd8061b75" />
- <MSG STRUCTURE="diag_log_msg2" NAME="status error dev_hdl: %x status: %d @connection_manager.c(884),INFO" ID="0xd8061ba5" />
- <MSG STRUCTURE="diag_log_msg1" NAME="dev_hdl: %08x @connection_manager.c(898),INFO" ID="0xd8061c15" />
- <MSG STRUCTURE="diag_log_msg0" NAME="get addr fail @connection_manager.c(906),WARNING" ID="0xd8061c53" />
- <MSG STRUCTURE="diag_log_msg0" NAME="rmt device is phone @connection_manager.c(913),INFO" ID="0xd8061c8d" />
- <MSG STRUCTURE="diag_log_msg0" NAME="rmt device is not phone @connection_manager.c(916),INFO" ID="0xd8061ca5" />
- <MSG STRUCTURE="diag_log_msg0" NAME="node not exist @connection_manager.c(927),INFO" ID="0xd8061cfd" />
- <MSG STRUCTURE="diag_log_msg0" NAME="success @connection_manager.c(935),INFO" ID="0xd8061d3d" />
- <MSG STRUCTURE="diag_log_msg0" NAME="add remote list error! @connection_manager.c(989),WARNING" ID="0xd8061eeb" />
- <MSG STRUCTURE="diag_log_msg0" NAME="descovery result @connection_manager.c(1015),INFO" ID="0xd8061fbd" />
- <MSG STRUCTURE="diag_log_msg5" NAME="found device addr: ****%02x%02x%02x%02x name: %s @connection_manager.c(1024),INFO" ID="0xd8062005" />
- <MSG STRUCTURE="diag_log_msg0" NAME="gap_get_device_name failed @connection_manager.c(1026),INFO" ID="0xd8062015" />
- <MSG STRUCTURE="diag_log_msg0" NAME="get device name fail @connection_manager.c(1051),WARNING" ID="0xd80620db" />
- <MSG STRUCTURE="diag_log_msg1" NAME="unhandled msg id: %d @connection_manager.c(1120),WARNING" ID="0xd8062303" />
- <MSG STRUCTURE="diag_log_msg0" NAME="set discovery status to stop @connection_manager.c(1138),INFO" ID="0xd8062395" />
- <MSG STRUCTURE="diag_log_msg1" NAME="unhandled msg id: %d @connection_manager.c(1209),WARNING" ID="0xd80625cb" />
- <MSG STRUCTURE="diag_log_msg0" NAME="show conn list: @connection_manager.c(1230),INFO" ID="0xd8062675" />
- <MSG STRUCTURE="diag_log_msg7" NAME="| %-4s | %-32s | %-12s | %-16s | %-16s | %-8s | %-8s | @connection_manager.c(1232),INFO" ID="0xd8062685" />
- <MSG STRUCTURE="diag_log_msg0" NAME="remote is null @connection_manager.c(1240),ERROR" ID="0xd80626c2" />
- <MSG STRUCTURE="diag_log_msg0" NAME="addr memcpy_s fail @connection_manager.c(1243),ERROR" ID="0xd80626da" />
- <MSG STRUCTURE="diag_log_msg0" NAME="name memcpy_s fail @connection_manager.c(1246),ERROR" ID="0xd80626f2" />
- <MSG STRUCTURE="diag_log_msg10" NAME="| %-4d | %-32s | ****%02x%02x%02x%02x | %-16d | %-16d | %-8d | %-8d | @connection_manager.c(1251),INFO" ID="0xd806271d" />
- <MSG STRUCTURE="diag_log_msg0" NAME="show conn list end! @connection_manager.c(1256),INFO" ID="0xd8062745" />
- <MSG STRUCTURE="diag_log_msg0" NAME="show ble conn list: @connection_manager.c(1264),INFO" ID="0xd8062785" />
- <MSG STRUCTURE="diag_log_msg9" NAME="| %-4s | %-12s | %-10s | %-8s | %-12s | %-12s | %-12s | %-12s | %-48s | @connection_manager.c(1269),INFO" ID="0xd80627ad" />
- <MSG STRUCTURE="diag_log_msg11" NAME="| %-4d | %02x******%02x%02x | %-10d | %-8d | %-12d | %-12d | %-12d | %-12d | %-48s | @connection_manager.c(1282),INFO" ID="0xd8062815" />
- <MSG STRUCTURE="diag_log_msg8" NAME="| %-4s | %-12s | %-10s | %-8s | %-12s | %-12s | %-12s | %-12s | @connection_manager.c(1289),INFO" ID="0xd806284d" />
- <MSG STRUCTURE="diag_log_msg10" NAME="| %-4d | %02x******%02x%02x | %-10d | %-8d | %-12d | %-12d | %-12d | %-12d | @connection_manager.c(1295),INFO" ID="0xd806287d" />
- <MSG STRUCTURE="diag_log_msg0" NAME="show ble conn list end! @connection_manager.c(1303),INFO" ID="0xd80628bd" />
- <MSG STRUCTURE="diag_log_msg0" NAME="show link mode: @connection_manager.c(1315),INFO" ID="0xd806291d" />
- <MSG STRUCTURE="diag_log_msg4" NAME="| %-4s | %-32s | %-12s | %-16s | @connection_manager.c(1317),INFO" ID="0xd806292d" />
- <MSG STRUCTURE="diag_log_msg0" NAME="remote is null @connection_manager.c(1326),ERROR" ID="0xd8062972" />
- <MSG STRUCTURE="diag_log_msg0" NAME="addr memcpy_s fail @connection_manager.c(1329),ERROR" ID="0xd806298a" />
- <MSG STRUCTURE="diag_log_msg0" NAME="name memcpy_s fail @connection_manager.c(1332),ERROR" ID="0xd80629a2" />
- <MSG STRUCTURE="diag_log_msg7" NAME="| %-4d | %-32s | ****%02x%02x%02x%02x | %-16s | @connection_manager.c(1340),INFO" ID="0xd80629e5" />
- <MSG STRUCTURE="diag_log_msg0" NAME="show link mode end! @connection_manager.c(1345),INFO" ID="0xd8062a0d" />
- <MSG STRUCTURE="diag_log_msg2" NAME="set scan mode old=%d new=%d @connection_manager.c(1407),INFO" ID="0xd8062bfd" />
- <MSG STRUCTURE="diag_log_msg1" NAME="btsdk_set_discovery_mode ret: %x @connection_manager.c(1418),INFO" ID="0xd8062c55" />
- <MSG STRUCTURE="diag_log_msg2" NAME="btsdk_set_discovery_mode mode: %x ret: %x @connection_manager.c(1429),INFO" ID="0xd8062cad" />
- <MSG STRUCTURE="diag_log_msg0" NAME="already in discovery @connection_manager.c(1451),INFO" ID="0xd8062d5d" />
- <MSG STRUCTURE="diag_log_msg0" NAME="bt is not enabled @connection_manager.c(1464),WARNING" ID="0xd8062dc3" />
- <MSG STRUCTURE="diag_log_msg0" NAME="discovery already stopped @connection_manager.c(1469),WARNING" ID="0xd8062deb" />
- <MSG STRUCTURE="diag_log_msg1" NAME="btsdk_stop_device_discovery ret=0x%x @connection_manager.c(1474),INFO" ID="0xd8062e15" />
- <MSG STRUCTURE="diag_log_msg0" NAME="discovery stopped @connection_manager.c(1477),INFO" ID="0xd8062e2d" />
- <MSG STRUCTURE="diag_log_msg0" NAME="not start bt @connection_manager.c(1503),INFO" ID="0xd8062efd" />
- <MSG STRUCTURE="diag_log_msg0" NAME="param id null @connection_manager.c(1507),INFO" ID="0xd8062f1d" />
- <MSG STRUCTURE="diag_log_msg0" NAME="exist connect audio device @connection_manager.c(1513),INFO" ID="0xd8062f4d" />
- <MSG STRUCTURE="diag_log_msg0" NAME="gap_br_cancel_discovery fail @connection_manager.c(1518),INFO" ID="0xd8062f75" />
- <MSG STRUCTURE="diag_log_msg1" NAME="btsdk_disconnect_acl_by_handle ret: %x @connection_manager.c(1554),INFO" ID="0xd8063095" />
- <MSG STRUCTURE="diag_log_msg0" NAME="[btsrv][ERROR] gatt client add conn node memcpy fail. @connection_manager.c(1621),ERROR" ID="0xd80632aa" />
- <MSG STRUCTURE="diag_log_msg0" NAME="btsrv connect state change cbk arg NULL! @connection_manager.c(1635),ERROR" ID="0xd806331a" />
- <MSG STRUCTURE="diag_log_msg0" NAME="connect state update memcpy fail. @connection_manager.c(1640),ERROR" ID="0xd8063342" />
- <MSG STRUCTURE="diag_log_msg0" NAME="connect node is null. @connection_manager.c(1656),ERROR" ID="0xd80633c2" />
- <MSG STRUCTURE="diag_log_msg0" NAME="ble smp paired keys cbk param error @connection_manager.c(1675),ERROR" ID="0xd806345a" />
- <MSG STRUCTURE="diag_log_msg0" NAME="paired keys malloc fail. @connection_manager.c(1681),ERROR" ID="0xd806348a" />
- <MSG STRUCTURE="diag_log_msg0" NAME="paired keys malloc fail. @connection_manager.c(1686),ERROR" ID="0xd80634b2" />
- <MSG STRUCTURE="diag_log_msg0" NAME="pair keys notify, keys addr memcpy fail. @connection_manager.c(1691),ERROR" ID="0xd80634da" />
- <MSG STRUCTURE="diag_log_msg0" NAME="pair keys notify, keys memcpy fail. @connection_manager.c(1698),ERROR" ID="0xd8063512" />
- <MSG STRUCTURE="diag_log_msg0" NAME="ble smp paired complete cbk param error @connection_manager.c(1715),ERROR" ID="0xd806359a" />
- <MSG STRUCTURE="diag_log_msg0" NAME="connect param update incomes arg is NULL! @connection_manager.c(1726),ERROR" ID="0xd80635f2" />
- <MSG STRUCTURE="diag_log_msg0" NAME="connect param update, conn_node not found. @connection_manager.c(1733),ERROR" ID="0xd806362a" />
- <MSG STRUCTURE="diag_log_msg0" NAME="connect param update,connect_params NULL. @connection_manager.c(1739),ERROR" ID="0xd806365a" />
- <MSG STRUCTURE="diag_log_msg0" NAME="connect param update, addr memcpy fail. @connection_manager.c(1745),ERROR" ID="0xd806368a" />
- <MSG STRUCTURE="diag_log_msg1" NAME="connect param update done ret:%d. @connection_manager.c(1754),INFO" ID="0xd80636d5" />
- <MSG STRUCTURE="diag_log_msg0" NAME="gap_ble_connect_remote_device not start bt @connection_manager.c(1763),INFO" ID="0xd806371d" />
- <MSG STRUCTURE="diag_log_msg0" NAME="gap_ble_connect_remote_device param id null @connection_manager.c(1767),INFO" ID="0xd806373d" />
- <MSG STRUCTURE="diag_log_msg0" NAME="[btsrv][INFO] addr memcpy to param fail. @connection_manager.c(1773),INFO" ID="0xd806376d" />
- <MSG STRUCTURE="diag_log_msg0" NAME="[btsrv]addr memcpy fail. @connection_manager.c(1791),INFO" ID="0xd80637fd" />
- <MSG STRUCTURE="diag_log_msg0" NAME="addr memcpy_s fail @connection_manager.c(1809),ERROR" ID="0xd806388a" />
- <MSG STRUCTURE="diag_log_msg0" NAME="read remote device rssi, conn_node not found. @connection_manager.c(1830),ERROR" ID="0xd8063932" />
- <MSG STRUCTURE="diag_log_msg0" NAME="read remote device rssi fail @connection_manager.c(1835),ERROR" ID="0xd806395a" />
- <MSG STRUCTURE="diag_log_msg0" NAME="conn_node not found. @connection_manager.c(1850),ERROR" ID="0xd80639d2" />
- <MSG STRUCTURE="diag_log_msg0" NAME="auto reconnect is enabled, close it first. @connection_manager.c(1874),ERROR" ID="0xd8063a92" />
- <MSG STRUCTURE="diag_log_msg0" NAME="malloc fail @connection_manager.c(1879),ERROR" ID="0xd8063aba" />
- <MSG STRUCTURE="diag_log_msg0" NAME="memcpy fail @connection_manager.c(1883),ERROR" ID="0xd8063ada" />
- <MSG STRUCTURE="diag_log_msg1" NAME="send msg fail. %x @connection_manager.c(1890),ERROR" ID="0xd8063b12" />
- <MSG STRUCTURE="diag_log_msg0" NAME="send msg connecting success! @connection_manager.c(1894),INFO" ID="0xd8063b35" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="already exist conn_node @connection_manager.c(512),INFO" ID="0xd8061005" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="accept not paired earbuds. @connection_manager.c(521),INFO" ID="0xd806104d" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="exist same type conn node. @connection_manager.c(525),INFO" ID="0xd806106d" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="add conn info error! @connection_manager.c(532),ERROR" ID="0xd80610a2" />
+ <MSG STRUCTURE="diag_log_msg1" NAME="btsdk_disconnect_acl_by_handle ret: %x @connection_manager.c(539),INFO" ID="0xd80610dd" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="memcpy fail @connection_manager.c(546),ERROR" ID="0xd8061112" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="malloc fail @connection_manager.c(559),ERROR" ID="0xd806117a" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="get addr fail @connection_manager.c(566),ERROR" ID="0xd80611b2" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="memcpy fail @connection_manager.c(571),ERROR" ID="0xd80611da" />
+ <MSG STRUCTURE="diag_log_msg1" NAME="send msg fail. %x @connection_manager.c(577),ERROR" ID="0xd806120a" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="connect exist conn_node @connection_manager.c(593),INFO" ID="0xd806128d" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="exist same type conn_node, disconnect. @connection_manager.c(598),INFO" ID="0xd80612b5" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="find remote node fail @connection_manager.c(606),WARNING" ID="0xd80612f3" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="add conn info error! @connection_manager.c(613),ERROR" ID="0xd806132a" />
+ <MSG STRUCTURE="diag_log_msg1" NAME="create acl ret = %08x @connection_manager.c(625),WARNING" ID="0xd806138b" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="acl is connected @connection_manager.c(633),INFO" ID="0xd80613cd" />
+ <MSG STRUCTURE="diag_log_msg1" NAME="dev_hdl: %08x @connection_manager.c(642),INFO" ID="0xd8061415" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="not exist conn node. @connection_manager.c(645),INFO" ID="0xd806142d" />
+ <MSG STRUCTURE="diag_log_msg1" NAME="is phone=0x%x @connection_manager.c(648),INFO" ID="0xd8061445" />
+ <MSG STRUCTURE="diag_log_msg2" NAME="status error dev_hdl: %x status: %d @connection_manager.c(651),WARNING" ID="0xd806145b" />
+ <MSG STRUCTURE="diag_log_msg1" NAME="btsdk_disconnect_acl_by_handle ret: %x @connection_manager.c(691),INFO" ID="0xd806159d" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="send msg connecting @connection_manager.c(723),INFO" ID="0xd806169d" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="malloc fail @connection_manager.c(727),ERROR" ID="0xd80616ba" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="memcpy fail @connection_manager.c(731),ERROR" ID="0xd80616da" />
+ <MSG STRUCTURE="diag_log_msg1" NAME="send msg fail. %x @connection_manager.c(737),ERROR" ID="0xd806170a" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="send msg connecting success! @connection_manager.c(740),INFO" ID="0xd8061725" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="stop timer @connection_manager.c(745),INFO" ID="0xd806174d" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="stop timer success! @connection_manager.c(753),INFO" ID="0xd806178d" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="start timer @connection_manager.c(758),INFO" ID="0xd80617b5" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="memcpy fail @connection_manager.c(768),ERROR" ID="0xd8061802" />
+ <MSG STRUCTURE="diag_log_msg1" NAME="create timer error! ret: %x @connection_manager.c(773),ERROR" ID="0xd806182a" />
+ <MSG STRUCTURE="diag_log_msg1" NAME="start timer error! ret: %x @connection_manager.c(779),ERROR" ID="0xd806185a" />
+ <MSG STRUCTURE="diag_log_msg2" NAME="start timer success! try to reconnect %d times interval %dms @connection_manager.c(784),INFO" ID="0xd8061885" />
+ <MSG STRUCTURE="diag_log_msg2" NAME="dev_hdl: %08x reason: %08x @connection_manager.c(816),INFO" ID="0xd8061985" />
+ <MSG STRUCTURE="diag_log_msg1" NAME="no conn record dev_hdl: %08x @connection_manager.c(825),WARNING" ID="0xd80619cb" />
+ <MSG STRUCTURE="diag_log_msg2" NAME="rmt device class=0x%x is phone: 0x%x @connection_manager.c(835),INFO" ID="0xd8061a1d" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="get addr fail @connection_manager.c(848),WARNING" ID="0xd8061a83" />
+ <MSG STRUCTURE="diag_log_msg1" NAME="get remote dev addr failed. dev_hdl: %x @connection_manager.c(862),WARNING" ID="0xd8061af3" />
+ <MSG STRUCTURE="diag_log_msg6" NAME="addr: ****%02x%02x%02x%02x dev_hdl: %08x gap_remove_pair ret(bool): %d @connection_manager.c(871),INFO" ID="0xd8061b3d" />
+ <MSG STRUCTURE="diag_log_msg3" NAME="error dev_hdl: %x pair_ret: %x disconn_ret: %x @connection_manager.c(880),WARNING" ID="0xd8061b83" />
+ <MSG STRUCTURE="diag_log_msg1" NAME="dev_hdl: %08x @connection_manager.c(887),INFO" ID="0xd8061bbd" />
+ <MSG STRUCTURE="diag_log_msg1" NAME="conn node is null dev_hdl: %x @connection_manager.c(891),INFO" ID="0xd8061bdd" />
+ <MSG STRUCTURE="diag_log_msg2" NAME="status error dev_hdl: %x status: %d @connection_manager.c(897),INFO" ID="0xd8061c0d" />
+ <MSG STRUCTURE="diag_log_msg1" NAME="dev_hdl: %08x @connection_manager.c(911),INFO" ID="0xd8061c7d" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="get addr fail @connection_manager.c(919),WARNING" ID="0xd8061cbb" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="rmt device is phone @connection_manager.c(926),INFO" ID="0xd8061cf5" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="rmt device is not phone @connection_manager.c(929),INFO" ID="0xd8061d0d" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="node not exist @connection_manager.c(940),INFO" ID="0xd8061d65" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="success @connection_manager.c(948),INFO" ID="0xd8061da5" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="add remote list error! @connection_manager.c(1002),WARNING" ID="0xd8061f53" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="descovery result @connection_manager.c(1028),INFO" ID="0xd8062025" />
+ <MSG STRUCTURE="diag_log_msg5" NAME="found device addr: ****%02x%02x%02x%02x name: %s @connection_manager.c(1037),INFO" ID="0xd806206d" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="gap_get_device_name failed @connection_manager.c(1039),INFO" ID="0xd806207d" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="get device name fail @connection_manager.c(1064),WARNING" ID="0xd8062143" />
+ <MSG STRUCTURE="diag_log_msg1" NAME="unhandled msg id: %d @connection_manager.c(1139),WARNING" ID="0xd806239b" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="set discovery status to stop @connection_manager.c(1157),INFO" ID="0xd806242d" />
+ <MSG STRUCTURE="diag_log_msg1" NAME="unhandled msg id: %d @connection_manager.c(1228),WARNING" ID="0xd8062663" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="show conn list: @connection_manager.c(1249),INFO" ID="0xd806270d" />
+ <MSG STRUCTURE="diag_log_msg7" NAME="| %-4s | %-32s | %-12s | %-16s | %-16s | %-8s | %-8s | @connection_manager.c(1251),INFO" ID="0xd806271d" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="remote is null @connection_manager.c(1259),ERROR" ID="0xd806275a" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="addr memcpy_s fail @connection_manager.c(1262),ERROR" ID="0xd8062772" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="name memcpy_s fail @connection_manager.c(1265),ERROR" ID="0xd806278a" />
+ <MSG STRUCTURE="diag_log_msg10" NAME="| %-4d | %-32s | ****%02x%02x%02x%02x | %-16d | %-16d | %-8d | %-8d | @connection_manager.c(1270),INFO" ID="0xd80627b5" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="show conn list end! @connection_manager.c(1275),INFO" ID="0xd80627dd" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="show ble conn list: @connection_manager.c(1283),INFO" ID="0xd806281d" />
+ <MSG STRUCTURE="diag_log_msg9" NAME="| %-4s | %-12s | %-10s | %-8s | %-12s | %-12s | %-12s | %-12s | %-48s | @connection_manager.c(1288),INFO" ID="0xd8062845" />
+ <MSG STRUCTURE="diag_log_msg11" NAME="| %-4d | %02x******%02x%02x | %-10d | %-8d | %-12d | %-12d | %-12d | %-12d | %-48s | @connection_manager.c(1301),INFO" ID="0xd80628ad" />
+ <MSG STRUCTURE="diag_log_msg8" NAME="| %-4s | %-12s | %-10s | %-8s | %-12s | %-12s | %-12s | %-12s | @connection_manager.c(1308),INFO" ID="0xd80628e5" />
+ <MSG STRUCTURE="diag_log_msg10" NAME="| %-4d | %02x******%02x%02x | %-10d | %-8d | %-12d | %-12d | %-12d | %-12d | @connection_manager.c(1314),INFO" ID="0xd8062915" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="show ble conn list end! @connection_manager.c(1322),INFO" ID="0xd8062955" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="show link mode: @connection_manager.c(1334),INFO" ID="0xd80629b5" />
+ <MSG STRUCTURE="diag_log_msg4" NAME="| %-4s | %-32s | %-12s | %-16s | @connection_manager.c(1336),INFO" ID="0xd80629c5" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="remote is null @connection_manager.c(1345),ERROR" ID="0xd8062a0a" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="addr memcpy_s fail @connection_manager.c(1348),ERROR" ID="0xd8062a22" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="name memcpy_s fail @connection_manager.c(1351),ERROR" ID="0xd8062a3a" />
+ <MSG STRUCTURE="diag_log_msg7" NAME="| %-4d | %-32s | ****%02x%02x%02x%02x | %-16s | @connection_manager.c(1359),INFO" ID="0xd8062a7d" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="show link mode end! @connection_manager.c(1364),INFO" ID="0xd8062aa5" />
+ <MSG STRUCTURE="diag_log_msg2" NAME="set scan mode old=%d new=%d @connection_manager.c(1426),INFO" ID="0xd8062c95" />
+ <MSG STRUCTURE="diag_log_msg1" NAME="btsdk_set_discovery_mode ret: %x @connection_manager.c(1437),INFO" ID="0xd8062ced" />
+ <MSG STRUCTURE="diag_log_msg2" NAME="btsdk_set_discovery_mode mode: %x ret: %x @connection_manager.c(1448),INFO" ID="0xd8062d45" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="already in discovery @connection_manager.c(1470),INFO" ID="0xd8062df5" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="bt is not enabled @connection_manager.c(1483),WARNING" ID="0xd8062e5b" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="discovery already stopped @connection_manager.c(1488),WARNING" ID="0xd8062e83" />
+ <MSG STRUCTURE="diag_log_msg1" NAME="btsdk_stop_device_discovery ret=0x%x @connection_manager.c(1493),INFO" ID="0xd8062ead" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="discovery stopped @connection_manager.c(1496),INFO" ID="0xd8062ec5" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="not start bt @connection_manager.c(1522),INFO" ID="0xd8062f95" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="param id null @connection_manager.c(1526),INFO" ID="0xd8062fb5" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="exist connect audio device @connection_manager.c(1532),INFO" ID="0xd8062fe5" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="gap_br_cancel_discovery fail @connection_manager.c(1537),INFO" ID="0xd806300d" />
+ <MSG STRUCTURE="diag_log_msg1" NAME="btsdk_disconnect_acl_by_handle ret: %x @connection_manager.c(1573),INFO" ID="0xd806312d" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="[btsrv][ERROR] gatt client add conn node memcpy fail. @connection_manager.c(1640),ERROR" ID="0xd8063342" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="btsrv connect state change cbk arg NULL! @connection_manager.c(1654),ERROR" ID="0xd80633b2" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="connect state update memcpy fail. @connection_manager.c(1659),ERROR" ID="0xd80633da" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="connect node is null. @connection_manager.c(1675),ERROR" ID="0xd806345a" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="ble smp paired keys cbk param error @connection_manager.c(1694),ERROR" ID="0xd80634f2" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="paired keys malloc fail. @connection_manager.c(1700),ERROR" ID="0xd8063522" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="paired keys malloc fail. @connection_manager.c(1705),ERROR" ID="0xd806354a" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="pair keys notify, keys addr memcpy fail. @connection_manager.c(1710),ERROR" ID="0xd8063572" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="pair keys notify, keys memcpy fail. @connection_manager.c(1717),ERROR" ID="0xd80635aa" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="ble smp paired complete cbk param error @connection_manager.c(1734),ERROR" ID="0xd8063632" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="connect param update incomes arg is NULL! @connection_manager.c(1745),ERROR" ID="0xd806368a" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="connect param update, conn_node not found. @connection_manager.c(1752),ERROR" ID="0xd80636c2" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="connect param update,connect_params NULL. @connection_manager.c(1758),ERROR" ID="0xd80636f2" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="connect param update, addr memcpy fail. @connection_manager.c(1764),ERROR" ID="0xd8063722" />
+ <MSG STRUCTURE="diag_log_msg1" NAME="connect param update done ret:%d. @connection_manager.c(1773),INFO" ID="0xd806376d" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="gap_ble_connect_remote_device not start bt @connection_manager.c(1782),INFO" ID="0xd80637b5" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="gap_ble_connect_remote_device param id null @connection_manager.c(1786),INFO" ID="0xd80637d5" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="[btsrv][INFO] addr memcpy to param fail. @connection_manager.c(1792),INFO" ID="0xd8063805" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="[btsrv]addr memcpy fail. @connection_manager.c(1810),INFO" ID="0xd8063895" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="addr memcpy_s fail @connection_manager.c(1828),ERROR" ID="0xd8063922" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="read remote device rssi, conn_node not found. @connection_manager.c(1849),ERROR" ID="0xd80639ca" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="read remote device rssi fail @connection_manager.c(1854),ERROR" ID="0xd80639f2" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="conn_node not found. @connection_manager.c(1869),ERROR" ID="0xd8063a6a" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="auto reconnect is enabled, close it first. @connection_manager.c(1893),ERROR" ID="0xd8063b2a" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="malloc fail @connection_manager.c(1898),ERROR" ID="0xd8063b52" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="memcpy fail @connection_manager.c(1902),ERROR" ID="0xd8063b72" />
+ <MSG STRUCTURE="diag_log_msg1" NAME="send msg fail. %x @connection_manager.c(1909),ERROR" ID="0xd8063baa" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="send msg connecting success! @connection_manager.c(1913),INFO" ID="0xd8063bcd" />
</MSG_LOG>
\ No newline at end of file
<MSG STRUCTURE="diag_log_msg0" NAME="unsupported color format @display_vau.c(138),ERROR" ID="0xcb200452" />
<MSG STRUCTURE="diag_log_msg1" NAME="blend type %d is not supported yet, use BLEND_SRCOVER instead @display_vau.c(169),WARNING" ID="0xcb20054b" />
<MSG STRUCTURE="diag_log_msg0" NAME="AllocMem failed. @display_vau.c(182),ERROR" ID="0xcb2005b2" />
- <MSG STRUCTURE="diag_log_msg0" NAME="DispMalloc failed due to handle limit. @display_vau.c(191),ERROR" ID="0xcb2005fa" />
- <MSG STRUCTURE="diag_log_msg0" NAME="uapi_vau_wait_for_done failed. @display_vau.c(256),ERROR" ID="0xcb200802" />
- <MSG STRUCTURE="diag_log_msg0" NAME="Convert2VauSurface failed @display_vau.c(299),ERROR" ID="0xcb20095a" />
- <MSG STRUCTURE="diag_log_msg1" NAME="uapi_vau_render failure, ret = 0x%x! @display_vau.c(326),ERROR" ID="0xcb200a32" />
- <MSG STRUCTURE="diag_log_msg0" NAME="uapi_vau_parse_cmp_header failed @display_vau.c(348),ERROR" ID="0xcb200ae2" />
- <MSG STRUCTURE="diag_log_msg0" NAME="unsupported color format @display_vau.c(366),ERROR" ID="0xcb200b72" />
- <MSG STRUCTURE="diag_log_msg0" NAME="Blend type of each image must be same when blitting them together. @display_vau.c(423),ERROR" ID="0xcb200d3a" />
- <MSG STRUCTURE="diag_log_msg0" NAME="ConvertVGUImg2VauSurface failed @display_vau.c(427),ERROR" ID="0xcb200d5a" />
- <MSG STRUCTURE="diag_log_msg1" NAME="uapi_vau_compose failure, ret = 0x%x! @display_vau.c(473),ERROR" ID="0xcb200eca" />
- <MSG STRUCTURE="diag_log_msg14" NAME="src[%d] w:%u h:%u str:%u fmt:%d cmp:%d rect:[%d,%d,%u,%u] outRect:[%d,%d,%u,%u] @display_vau.c(480),ERROR" ID="0xcb200f02" />
- <MSG STRUCTURE="diag_log_msg0" NAME="DispMalloc for dstSurface failed! @display_vau.c(537),ERROR" ID="0xcb2010ca" />
- <MSG STRUCTURE="diag_log_msg0" NAME="1st render error!!!! @display_vau.c(552),ERROR" ID="0xcb201142" />
- <MSG STRUCTURE="diag_log_msg0" NAME="2nd render error!!!! @display_vau.c(576),ERROR" ID="0xcb201202" />
- <MSG STRUCTURE="diag_log_msg0" NAME="invalid cmd num: 0. @display_vau.c(592),ERROR" ID="0xcb201282" />
- <MSG STRUCTURE="diag_log_msg0" NAME="VGUPathAppendData with invalid path. @display_vau.c(597),ERROR" ID="0xcb2012aa" />
- <MSG STRUCTURE="diag_log_msg0" NAME="invalid cmd num: 0. @display_vau.c(613),ERROR" ID="0xcb20132a" />
- <MSG STRUCTURE="diag_log_msg0" NAME="VGUPathAppendData with invalid path. @display_vau.c(618),ERROR" ID="0xcb201352" />
- <MSG STRUCTURE="diag_log_msg2" NAME="%s: %d memcpy_s failed @display_vau.c(627),ERROR" ID="0xcb20139a" />
- <MSG STRUCTURE="diag_log_msg2" NAME="%s: %d memcpy_s for cmd failed. @display_vau.c(637),ERROR" ID="0xcb2013ea" />
- <MSG STRUCTURE="diag_log_msg2" NAME="%s: %d memcpy_s failed @display_vau.c(647),ERROR" ID="0xcb20143a" />
- <MSG STRUCTURE="diag_log_msg1" NAME="Invalid gradient type: %d @display_vau.c(716),ERROR" ID="0xcb201662" />
- <MSG STRUCTURE="diag_log_msg0" NAME="Invalid VGUFillRule. @display_vau.c(734),ERROR" ID="0xcb2016f2" />
- <MSG STRUCTURE="diag_log_msg0" NAME="HandlePaintStyle failed. @display_vau.c(739),ERROR" ID="0xcb20171a" />
- <MSG STRUCTURE="diag_log_msg0" NAME="Invalid Cap Style! @display_vau.c(759),ERROR" ID="0xcb2017ba" />
- <MSG STRUCTURE="diag_log_msg0" NAME="Invalid Join Style! @display_vau.c(780),ERROR" ID="0xcb201862" />
- <MSG STRUCTURE="diag_log_msg0" NAME="HandlePaintStyle failed. @display_vau.c(794),ERROR" ID="0xcb2018d2" />
- <MSG STRUCTURE="diag_log_msg1" NAME="uapi_vau_render failure, ret = 0x%x! @display_vau.c(977),ERROR" ID="0xcb201e8a" />
- <MSG STRUCTURE="diag_log_msg1" NAME="uapi_vau_render failure, ret = 0x%x! @display_vau.c(1044),ERROR" ID="0xcb2020a2" />
- <MSG STRUCTURE="diag_log_msg0" NAME="RenderPath with invalid path. @display_vau.c(1176),ERROR" ID="0xcb2024c2" />
- <MSG STRUCTURE="diag_log_msg0" NAME="One of fill and stroke in path attr should be set! @display_vau.c(1181),ERROR" ID="0xcb2024ea" />
- <MSG STRUCTURE="diag_log_msg1" NAME="[%d] DispMalloc for tmpTarget1 failed @display_vau.c(1213),ERROR" ID="0xcb2025ea" />
- <MSG STRUCTURE="diag_log_msg1" NAME="[%d] DispMalloc for tmpTarget2 failed @display_vau.c(1221),ERROR" ID="0xcb20262a" />
- <MSG STRUCTURE="diag_log_msg1" NAME="[%d] RenderPathInternal failed @display_vau.c(1227),ERROR" ID="0xcb20265a" />
- <MSG STRUCTURE="diag_log_msg1" NAME="[%d] RenderPatternInternal failed @display_vau.c(1232),ERROR" ID="0xcb202682" />
- <MSG STRUCTURE="diag_log_msg1" NAME="[%d] BlendToSurface failed @display_vau.c(1237),ERROR" ID="0xcb2026aa" />
- <MSG STRUCTURE="diag_log_msg1" NAME="[%d] BlendToSurface failed @display_vau.c(1242),ERROR" ID="0xcb2026d2" />
- <MSG STRUCTURE="diag_log_msg1" NAME="[%d] RenderPathInternal failed @display_vau.c(1269),ERROR" ID="0xcb2027aa" />
- <MSG STRUCTURE="diag_log_msg1" NAME="[%d] BlendImgToSurface failed @display_vau.c(1273),ERROR" ID="0xcb2027ca" />
- <MSG STRUCTURE="diag_log_msg1" NAME="g_hdlLast %lld has not been destroyed, destroy now. @display_vau.c(1319),ERROR" ID="0xcb20293a" />
- <MSG STRUCTURE="diag_log_msg1" NAME="uapi_vau_submit failure, ret = 0x%x! @display_vau.c(1326),ERROR" ID="0xcb202972" />
- <MSG STRUCTURE="diag_log_msg0" NAME="gFuncs is null @display_vau.c(1338),ERROR" ID="0xcb2029d2" />
- <MSG STRUCTURE="diag_log_msg0" NAME="memset_s gFuncs failed @display_vau.c(1344),ERROR" ID="0xcb202a02" />
- <MSG STRUCTURE="diag_log_msg0" NAME="VGU initializes successfully @display_vau.c(1363),INFO" ID="0xcb202a9d" />
- <MSG STRUCTURE="diag_log_msg0" NAME="VGU uninitializes successfully @display_vau.c(1372),INFO" ID="0xcb202ae5" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="DispMalloc failed due to handle limit. @display_vau.c(190),ERROR" ID="0xcb2005f2" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="uapi_vau_wait_for_done failed. @display_vau.c(255),ERROR" ID="0xcb2007fa" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="Convert2VauSurface failed @display_vau.c(298),ERROR" ID="0xcb200952" />
+ <MSG STRUCTURE="diag_log_msg1" NAME="uapi_vau_render failure, ret = 0x%x! @display_vau.c(325),ERROR" ID="0xcb200a2a" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="uapi_vau_parse_cmp_header failed @display_vau.c(347),ERROR" ID="0xcb200ada" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="unsupported color format @display_vau.c(365),ERROR" ID="0xcb200b6a" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="Blend type of each image must be same when blitting them together. @display_vau.c(422),ERROR" ID="0xcb200d32" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="ConvertVGUImg2VauSurface failed @display_vau.c(426),ERROR" ID="0xcb200d52" />
+ <MSG STRUCTURE="diag_log_msg1" NAME="uapi_vau_compose failure, ret = 0x%x! @display_vau.c(477),ERROR" ID="0xcb200eea" />
+ <MSG STRUCTURE="diag_log_msg14" NAME="src[%d] w:%u h:%u str:%u fmt:%d cmp:%d rect:[%d,%d,%u,%u] outRect:[%d,%d,%u,%u] @display_vau.c(484),ERROR" ID="0xcb200f22" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="DispMalloc for dstSurface failed! @display_vau.c(541),ERROR" ID="0xcb2010ea" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="1st render error!!!! @display_vau.c(556),ERROR" ID="0xcb201162" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="2nd render error!!!! @display_vau.c(580),ERROR" ID="0xcb201222" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="invalid cmd num: 0. @display_vau.c(596),ERROR" ID="0xcb2012a2" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="VGUPathAppendData with invalid path. @display_vau.c(601),ERROR" ID="0xcb2012ca" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="invalid cmd num: 0. @display_vau.c(617),ERROR" ID="0xcb20134a" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="VGUPathAppendData with invalid path. @display_vau.c(622),ERROR" ID="0xcb201372" />
+ <MSG STRUCTURE="diag_log_msg2" NAME="%s: %d memcpy_s failed @display_vau.c(631),ERROR" ID="0xcb2013ba" />
+ <MSG STRUCTURE="diag_log_msg2" NAME="%s: %d memcpy_s for cmd failed. @display_vau.c(641),ERROR" ID="0xcb20140a" />
+ <MSG STRUCTURE="diag_log_msg2" NAME="%s: %d memcpy_s failed @display_vau.c(651),ERROR" ID="0xcb20145a" />
+ <MSG STRUCTURE="diag_log_msg1" NAME="Invalid gradient type: %d @display_vau.c(720),ERROR" ID="0xcb201682" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="Invalid VGUFillRule. @display_vau.c(738),ERROR" ID="0xcb201712" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="HandlePaintStyle failed. @display_vau.c(743),ERROR" ID="0xcb20173a" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="Invalid Cap Style! @display_vau.c(763),ERROR" ID="0xcb2017da" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="Invalid Join Style! @display_vau.c(784),ERROR" ID="0xcb201882" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="HandlePaintStyle failed. @display_vau.c(798),ERROR" ID="0xcb2018f2" />
+ <MSG STRUCTURE="diag_log_msg1" NAME="uapi_vau_render failure, ret = 0x%x! @display_vau.c(981),ERROR" ID="0xcb201eaa" />
+ <MSG STRUCTURE="diag_log_msg1" NAME="uapi_vau_render failure, ret = 0x%x! @display_vau.c(1048),ERROR" ID="0xcb2020c2" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="RenderPath with invalid path. @display_vau.c(1185),ERROR" ID="0xcb20250a" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="One of fill and stroke in path attr should be set! @display_vau.c(1190),ERROR" ID="0xcb202532" />
+ <MSG STRUCTURE="diag_log_msg1" NAME="[%d] DispMalloc for tmpTarget1 failed @display_vau.c(1222),ERROR" ID="0xcb202632" />
+ <MSG STRUCTURE="diag_log_msg1" NAME="[%d] DispMalloc for tmpTarget2 failed @display_vau.c(1230),ERROR" ID="0xcb202672" />
+ <MSG STRUCTURE="diag_log_msg1" NAME="[%d] RenderPathInternal failed @display_vau.c(1237),ERROR" ID="0xcb2026aa" />
+ <MSG STRUCTURE="diag_log_msg1" NAME="[%d] RenderPatternInternal failed @display_vau.c(1242),ERROR" ID="0xcb2026d2" />
+ <MSG STRUCTURE="diag_log_msg1" NAME="[%d] BlendToSurface failed @display_vau.c(1247),ERROR" ID="0xcb2026fa" />
+ <MSG STRUCTURE="diag_log_msg1" NAME="[%d] BlendToSurface failed @display_vau.c(1252),ERROR" ID="0xcb202722" />
+ <MSG STRUCTURE="diag_log_msg1" NAME="[%d] RenderPathInternal failed @display_vau.c(1279),ERROR" ID="0xcb2027fa" />
+ <MSG STRUCTURE="diag_log_msg1" NAME="[%d] BlendImgToSurface failed @display_vau.c(1283),ERROR" ID="0xcb20281a" />
+ <MSG STRUCTURE="diag_log_msg1" NAME="g_hdlLast %lld has not been destroyed, destroy now. @display_vau.c(1329),ERROR" ID="0xcb20298a" />
+ <MSG STRUCTURE="diag_log_msg1" NAME="uapi_vau_submit failure, ret = 0x%x! @display_vau.c(1336),ERROR" ID="0xcb2029c2" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="gFuncs is null @display_vau.c(1348),ERROR" ID="0xcb202a22" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="memset_s gFuncs failed @display_vau.c(1354),ERROR" ID="0xcb202a52" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="VGU initializes successfully @display_vau.c(1373),INFO" ID="0xcb202aed" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="VGU uninitializes successfully @display_vau.c(1382),INFO" ID="0xcb202b35" />
</MSG_LOG>
\ No newline at end of file
<MSG STRUCTURE="diag_log_msg0" NAME="[BMS] InstallAllSystemBundle InitAllAppInfo fail, list is nullptr @gt_bundle_manager_service.cpp(318),ERROR" ID="0xe04409f2" />
<MSG STRUCTURE="diag_log_msg1" NAME="VINCENTSS::GtManagerService::ScanPackages = %s @gt_bundle_manager_service.cpp(376),INFO" ID="0xe0440bc5" />
<MSG STRUCTURE="diag_log_msg0" NAME="[BMS] ScanSystemApp InitAllAppInfo fail, list is nullptr @gt_bundle_manager_service.cpp(419),ERROR" ID="0xe0440d1a" />
- <MSG STRUCTURE="diag_log_msg0" NAME="[BMS] memset fail when initialize bundle name! @gt_bundle_manager_service.cpp(489),ERROR" ID="0xe0440f4a" />
- <MSG STRUCTURE="diag_log_msg0" NAME="[BMS] failed to copy bundle name! @gt_bundle_manager_service.cpp(494),ERROR" ID="0xe0440f72" />
- <MSG STRUCTURE="diag_log_msg0" NAME="[BMS] malloc fail when reload third app! @gt_bundle_manager_service.cpp(504),ERROR" ID="0xe0440fc2" />
- <MSG STRUCTURE="diag_log_msg0" NAME="[BMS] strcat fail when reload third app! @gt_bundle_manager_service.cpp(509),ERROR" ID="0xe0440fea" />
- <MSG STRUCTURE="diag_log_msg0" NAME="[BMS] app path is not dir when reload third app! @gt_bundle_manager_service.cpp(515),ERROR" ID="0xe044101a" />
- <MSG STRUCTURE="diag_log_msg0" NAME="[BMS] app path is not third bundle path! @gt_bundle_manager_service.cpp(521),INFO" ID="0xe044104d" />
- <MSG STRUCTURE="diag_log_msg0" NAME="[BMS] third bundle reload number is to MAX_THIRD_BUNDLE_NUMBER! @gt_bundle_manager_service.cpp(528),INFO" ID="0xe0441085" />
- <MSG STRUCTURE="diag_log_msg0" NAME="[BMS] parse bundle attr fail! @gt_bundle_manager_service.cpp(574),ERROR" ID="0xe04411f2" />
- <MSG STRUCTURE="diag_log_msg1" NAME="[BMS] reload bundle info fail!, isSystemApp is %d @gt_bundle_manager_service.cpp(689),ERROR" ID="0xe044158a" />
- <MSG STRUCTURE="diag_log_msg0" NAME="[BMS] get installRecord fail when restart! @gt_bundle_manager_service.cpp(745),ERROR" ID="0xe044174a" />
- <MSG STRUCTURE="diag_log_msg0" NAME="[BMS] TransformJsToBcWhenRestart jsEngineVer_ is nullptr! @gt_bundle_manager_service.cpp(752),ERROR" ID="0xe0441782" />
- <MSG STRUCTURE="diag_log_msg0" NAME="[BMS] create string object fail when restart! @gt_bundle_manager_service.cpp(760),ERROR" ID="0xe04417c2" />
- <MSG STRUCTURE="diag_log_msg0" NAME="[BMS] add js engine version record fail when restart! @gt_bundle_manager_service.cpp(775),ERROR" ID="0xe044183a" />
- <MSG STRUCTURE="diag_log_msg0" NAME="[BMS] refresh js engine version fail when restart! @gt_bundle_manager_service.cpp(783),ERROR" ID="0xe044187a" />
- <MSG STRUCTURE="diag_log_msg1" NAME="[BMS] transform js to bc, result is %d @gt_bundle_manager_service.cpp(810),INFO" ID="0xe0441955" />
- <MSG STRUCTURE="diag_log_msg1" NAME="[BMS] delete byte code, result is %d @gt_bundle_manager_service.cpp(813),INFO" ID="0xe044196d" />
- <MSG STRUCTURE="diag_log_msg0" NAME="[BMS] add transform result record fail when restart! @gt_bundle_manager_service.cpp(826),ERROR" ID="0xe04419d2" />
- <MSG STRUCTURE="diag_log_msg0" NAME="[BMS] refresh transform result record fail when restart! @gt_bundle_manager_service.cpp(832),ERROR" ID="0xe0441a02" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="[BMS] memset fail when initialize bundle name! @gt_bundle_manager_service.cpp(504),ERROR" ID="0xe0440fc2" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="[BMS] failed to copy bundle name! @gt_bundle_manager_service.cpp(513),ERROR" ID="0xe044100a" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="[BMS] malloc fail when reload third app! @gt_bundle_manager_service.cpp(528),ERROR" ID="0xe0441082" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="[BMS] strcat fail when reload third app! @gt_bundle_manager_service.cpp(537),ERROR" ID="0xe04410ca" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="[BMS] app path is not dir when reload third app! @gt_bundle_manager_service.cpp(547),ERROR" ID="0xe044111a" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="[BMS] app path is not third bundle path! @gt_bundle_manager_service.cpp(553),INFO" ID="0xe044114d" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="[BMS] third bundle reload number is to MAX_THIRD_BUNDLE_NUMBER! @gt_bundle_manager_service.cpp(560),INFO" ID="0xe0441185" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="[BMS] parse bundle attr fail! @gt_bundle_manager_service.cpp(611),ERROR" ID="0xe044131a" />
+ <MSG STRUCTURE="diag_log_msg1" NAME="[BMS] reload bundle info fail!, isSystemApp is %d @gt_bundle_manager_service.cpp(726),ERROR" ID="0xe04416b2" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="[BMS] get installRecord fail when restart! @gt_bundle_manager_service.cpp(782),ERROR" ID="0xe0441872" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="[BMS] TransformJsToBcWhenRestart jsEngineVer_ is nullptr! @gt_bundle_manager_service.cpp(789),ERROR" ID="0xe04418aa" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="[BMS] create string object fail when restart! @gt_bundle_manager_service.cpp(797),ERROR" ID="0xe04418ea" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="[BMS] add js engine version record fail when restart! @gt_bundle_manager_service.cpp(812),ERROR" ID="0xe0441962" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="[BMS] refresh js engine version fail when restart! @gt_bundle_manager_service.cpp(820),ERROR" ID="0xe04419a2" />
+ <MSG STRUCTURE="diag_log_msg1" NAME="[BMS] transform js to bc, result is %d @gt_bundle_manager_service.cpp(847),INFO" ID="0xe0441a7d" />
+ <MSG STRUCTURE="diag_log_msg1" NAME="[BMS] delete byte code, result is %d @gt_bundle_manager_service.cpp(850),INFO" ID="0xe0441a95" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="[BMS] add transform result record fail when restart! @gt_bundle_manager_service.cpp(863),ERROR" ID="0xe0441afa" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="[BMS] refresh transform result record fail when restart! @gt_bundle_manager_service.cpp(869),ERROR" ID="0xe0441b2a" />
</MSG_LOG>
\ No newline at end of file
-<MSG_LOG><MSG STRUCTURE="diag_log_msg0" NAME="replace async failed with null input parameter @js_router.cpp(31),ERROR" ID="0xe11600fa" />
- <MSG STRUCTURE="diag_log_msg0" NAME="router is replacing, can not handle the new request @js_router.cpp(43),ERROR" ID="0xe116015a" />
- <MSG STRUCTURE="diag_log_msg0" NAME="malloc state machine memory heap failed. @js_router.cpp(48),ERROR" ID="0xe1160182" />
- <MSG STRUCTURE="diag_log_msg0" NAME="dispatch replacing request failed @js_router.cpp(64),ERROR" ID="0xe1160202" />
- <MSG STRUCTURE="diag_log_msg0" NAME="replace sync failed, new sm should be prepared @js_router.cpp(78),ERROR" ID="0xe1160272" />
- <MSG STRUCTURE="diag_log_msg0" NAME="the whole application is in background, move to HIDE state directly @js_router.cpp(94),DBG" ID="0xe11602f6" />
- <MSG STRUCTURE="diag_log_msg0" NAME="no SM when performing show @js_router.cpp(110),ERROR" ID="0xe1160372" />
- <MSG STRUCTURE="diag_log_msg0" NAME="no SM when performing background @js_router.cpp(122),ERROR" ID="0xe11603d2" />
+<MSG_LOG><MSG STRUCTURE="diag_log_msg0" NAME="replace async failed with null input parameter @js_router.cpp(32),ERROR" ID="0xe1160102" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="router is replacing, can not handle the new request @js_router.cpp(44),ERROR" ID="0xe1160162" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="malloc state machine memory heap failed. @js_router.cpp(49),ERROR" ID="0xe116018a" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="dispatch replacing request failed @js_router.cpp(65),ERROR" ID="0xe116020a" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="replace sync failed, new sm should be prepared @js_router.cpp(79),ERROR" ID="0xe116027a" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="the whole application is in background, move to HIDE state directly @js_router.cpp(97),DBG" ID="0xe116030e" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="no SM when performing show @js_router.cpp(113),ERROR" ID="0xe116038a" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="no SM when performing background @js_router.cpp(125),ERROR" ID="0xe11603ea" />
</MSG_LOG>
\ No newline at end of file
-<MSG_LOG><MSG STRUCTURE="diag_log_msg0" NAME="Alloc buffer for data failed. @kaleidoscope_utils.cpp(31),ERROR" ID="0xcb4200fa" />
- <MSG STRUCTURE="diag_log_msg0" NAME="kaleidoscopeInfo_ is not nullptr @kaleidoscope_utils.cpp(48),ERROR" ID="0xcb420182" />
- <MSG STRUCTURE="diag_log_msg0" NAME="UIMalloc for kaleidoscopeInfo_ failed! @kaleidoscope_utils.cpp(54),ERROR" ID="0xcb4201b2" />
- <MSG STRUCTURE="diag_log_msg0" NAME="Alloc for data failed. @kaleidoscope_utils.cpp(66),ERROR" ID="0xcb420212" />
- <MSG STRUCTURE="diag_log_msg0" NAME="dst->info.data is nullptr @kaleidoscope_utils.cpp(78),ERROR" ID="0xcb420272" />
- <MSG STRUCTURE="diag_log_msg4" NAME="size does not match: src[%u, %u], dst[%u, %u]. @kaleidoscope_utils.cpp(85),ERROR" ID="0xcb4202aa" />
- <MSG STRUCTURE="diag_log_msg0" NAME="Alloc for sectorPath cmds failed. @kaleidoscope_utils.cpp(101),ERROR" ID="0xcb42032a" />
- <MSG STRUCTURE="diag_log_msg0" NAME="Alloc for sectorPath data failed. @kaleidoscope_utils.cpp(106),ERROR" ID="0xcb420352" />
- <MSG STRUCTURE="diag_log_msg0" NAME="Alloc for imgPath cmds failed. @kaleidoscope_utils.cpp(114),ERROR" ID="0xcb420392" />
- <MSG STRUCTURE="diag_log_msg0" NAME="Alloc for imgPath data failed. @kaleidoscope_utils.cpp(129),ERROR" ID="0xcb42040a" />
- <MSG STRUCTURE="diag_log_msg0" NAME="UIMalloc for partialInfo_ failed. @kaleidoscope_utils.cpp(152),ERROR" ID="0xcb4204c2" />
- <MSG STRUCTURE="diag_log_msg0" NAME="Alloc for partial info data failed. @kaleidoscope_utils.cpp(164),ERROR" ID="0xcb420522" />
- <MSG STRUCTURE="diag_log_msg0" NAME="src or src->data is null. @kaleidoscope_utils.cpp(217),ERROR" ID="0xcb4206ca" />
- <MSG STRUCTURE="diag_log_msg0" NAME="UIMalloc for imgInfo_ failed. @kaleidoscope_utils.cpp(224),ERROR" ID="0xcb420702" />
- <MSG STRUCTURE="diag_log_msg0" NAME="memcpy imgInfo_ failed. @kaleidoscope_utils.cpp(230),ERROR" ID="0xcb420732" />
- <MSG STRUCTURE="diag_log_msg0" NAME="InitKaleidoscopeInfo failed. @kaleidoscope_utils.cpp(236),ERROR" ID="0xcb420762" />
- <MSG STRUCTURE="diag_log_msg0" NAME="InitInnerPath failed. @kaleidoscope_utils.cpp(243),ERROR" ID="0xcb42079a" />
- <MSG STRUCTURE="diag_log_msg0" NAME="InitPartialInfo failed. @kaleidoscope_utils.cpp(251),ERROR" ID="0xcb4207da" />
- <MSG STRUCTURE="diag_log_msg0" NAME="ConstructPartial failed. UpdateImageInfoIfNecessary failed. @kaleidoscope_utils.cpp(325),ERROR" ID="0xcb420a2a" />
- <MSG STRUCTURE="diag_log_msg0" NAME="kaleidoscopeInfo_ or partialInfo_ is nullptr. @kaleidoscope_utils.cpp(426),ERROR" ID="0xcb420d52" />
- <MSG STRUCTURE="diag_log_msg0" NAME="kaleidoscopeInfo_ or kaleidoscopeInfo_->info.data is nullptr. @kaleidoscope_utils.cpp(449),ERROR" ID="0xcb420e0a" />
- <MSG STRUCTURE="diag_log_msg0" NAME="ConstructPartial failed. @kaleidoscope_utils.cpp(456),ERROR" ID="0xcb420e42" />
- <MSG STRUCTURE="diag_log_msg0" NAME="UpdateKaleidoscopeImgInfo failed, because isInternalMem_ is false. @kaleidoscope_utils.cpp(465),ERROR" ID="0xcb420e8a" />
- <MSG STRUCTURE="diag_log_msg0" NAME="UpdateKaleidoscopeImgInfo failed, because addr is nullptr. @kaleidoscope_utils.cpp(470),ERROR" ID="0xcb420eb2" />
- <MSG STRUCTURE="diag_log_msg0" NAME="UpdateKaleidoscopeImgInfo failed, because kaleidoscopeInfo_ is nullptr. @kaleidoscope_utils.cpp(475),ERROR" ID="0xcb420eda" />
+<MSG_LOG><MSG STRUCTURE="diag_log_msg0" NAME="Alloc buffer for data failed. @kaleidoscope_utils.cpp(32),ERROR" ID="0xcb440102" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="kaleidoscopeInfo_ is not nullptr @kaleidoscope_utils.cpp(68),ERROR" ID="0xcb440222" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="UIMalloc for kaleidoscopeInfo_ failed! @kaleidoscope_utils.cpp(74),ERROR" ID="0xcb440252" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="Alloc for data failed. @kaleidoscope_utils.cpp(87),ERROR" ID="0xcb4402ba" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="dst->info.data is nullptr @kaleidoscope_utils.cpp(100),ERROR" ID="0xcb440322" />
+ <MSG STRUCTURE="diag_log_msg4" NAME="size does not match: src[%u, %u], dst[%u, %u]. @kaleidoscope_utils.cpp(107),ERROR" ID="0xcb44035a" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="Alloc for sectorPath cmds failed. @kaleidoscope_utils.cpp(123),ERROR" ID="0xcb4403da" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="Alloc for sectorPath data failed. @kaleidoscope_utils.cpp(128),ERROR" ID="0xcb440402" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="Alloc for imgPath cmds failed. @kaleidoscope_utils.cpp(136),ERROR" ID="0xcb440442" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="Alloc for imgPath data failed. @kaleidoscope_utils.cpp(151),ERROR" ID="0xcb4404ba" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="UIMalloc for partialInfo_ failed. @kaleidoscope_utils.cpp(174),ERROR" ID="0xcb440572" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="Alloc for partial info data failed. @kaleidoscope_utils.cpp(186),ERROR" ID="0xcb4405d2" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="src or src->data is null. @kaleidoscope_utils.cpp(240),ERROR" ID="0xcb440782" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="UIMalloc for imgInfo_ failed. @kaleidoscope_utils.cpp(247),ERROR" ID="0xcb4407ba" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="memcpy imgInfo_ failed. @kaleidoscope_utils.cpp(253),ERROR" ID="0xcb4407ea" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="InitKaleidoscopeInfo failed. @kaleidoscope_utils.cpp(259),ERROR" ID="0xcb44081a" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="InitInnerPath failed. @kaleidoscope_utils.cpp(266),ERROR" ID="0xcb440852" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="InitPartialInfo failed. @kaleidoscope_utils.cpp(274),ERROR" ID="0xcb440892" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="ConstructPartial failed. UpdateImageInfoIfNecessary failed. @kaleidoscope_utils.cpp(352),ERROR" ID="0xcb440b02" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="kaleidoscopeInfo_ or partialInfo_ is nullptr. @kaleidoscope_utils.cpp(452),ERROR" ID="0xcb440e22" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="kaleidoscopeInfo_ or kaleidoscopeInfo_->info.data is nullptr. @kaleidoscope_utils.cpp(475),ERROR" ID="0xcb440eda" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="ConstructPartial failed. @kaleidoscope_utils.cpp(482),ERROR" ID="0xcb440f12" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="UpdateKaleidoscopeImgInfo failed, because isInternalMem_ is false. @kaleidoscope_utils.cpp(491),ERROR" ID="0xcb440f5a" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="UpdateKaleidoscopeImgInfo failed, because addr is nullptr. @kaleidoscope_utils.cpp(496),ERROR" ID="0xcb440f82" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="UpdateKaleidoscopeImgInfo failed, because kaleidoscopeInfo_ is nullptr. @kaleidoscope_utils.cpp(501),ERROR" ID="0xcb440faa" />
</MSG_LOG>
\ No newline at end of file
-<MSG_LOG><MSG STRUCTURE="diag_log_msg1" NAME="unsupported BlendMode: %u. @lite_m_gfx_engine.cpp(75),ERROR" ID="0xcb10025a" />
- <MSG STRUCTURE="diag_log_msg1" NAME="unsupported color format: %d @lite_m_gfx_engine.cpp(119),ERROR" ID="0xcb1003ba" />
- <MSG STRUCTURE="diag_log_msg0" NAME="Convert2VGUCap failed! Invalid Capstyle! @lite_m_gfx_engine.cpp(132),ERROR" ID="0xcb100422" />
- <MSG STRUCTURE="diag_log_msg0" NAME="Convert2VGUBuffer failed. @lite_m_gfx_engine.cpp(163),ERROR" ID="0xcb10051a" />
- <MSG STRUCTURE="diag_log_msg0" NAME="Fill operation failed. @lite_m_gfx_engine.cpp(194),ERROR" ID="0xcb100612" />
- <MSG STRUCTURE="diag_log_msg1" NAME="font weight %u was not support @lite_m_gfx_engine.cpp(306),ERROR" ID="0xcb100992" />
- <MSG STRUCTURE="diag_log_msg0" NAME="VGUPathAppendData failed. @lite_m_gfx_engine.cpp(347),ERROR" ID="0xcb100ada" />
- <MSG STRUCTURE="diag_log_msg0" NAME="VGUPathSetData failed. @lite_m_gfx_engine.cpp(358),ERROR" ID="0xcb100b32" />
- <MSG STRUCTURE="diag_log_msg0" NAME="Convert2VGUBuffer failed. @lite_m_gfx_engine.cpp(385),ERROR" ID="0xcb100c0a" />
- <MSG STRUCTURE="diag_log_msg0" NAME="RenderPath failed. Sync previous task. @lite_m_gfx_engine.cpp(397),ERROR" ID="0xcb100c6a" />
- <MSG STRUCTURE="diag_log_msg0" NAME="Convert2VGUBuffer failed. @lite_m_gfx_engine.cpp(418),ERROR" ID="0xcb100d12" />
- <MSG STRUCTURE="diag_log_msg0" NAME="RenderPath failed. Sync previous task. @lite_m_gfx_engine.cpp(430),ERROR" ID="0xcb100d72" />
- <MSG STRUCTURE="diag_log_msg0" NAME="Convert2VGUBuffer failed. @lite_m_gfx_engine.cpp(446),ERROR" ID="0xcb100df2" />
- <MSG STRUCTURE="diag_log_msg0" NAME="RenderPath failed. Sync previous task. @lite_m_gfx_engine.cpp(473),ERROR" ID="0xcb100eca" />
- <MSG STRUCTURE="diag_log_msg0" NAME="Convert2VGUBuffer failed. @lite_m_gfx_engine.cpp(496),ERROR" ID="0xcb100f82" />
- <MSG STRUCTURE="diag_log_msg0" NAME="RenderPath failed. Sync previous task. @lite_m_gfx_engine.cpp(509),ERROR" ID="0xcb100fea" />
- <MSG STRUCTURE="diag_log_msg0" NAME="Convert2VGUBuffer failed. @lite_m_gfx_engine.cpp(619),ERROR" ID="0xcb10135a" />
- <MSG STRUCTURE="diag_log_msg0" NAME="Convert2VGUBuffer failed. @lite_m_gfx_engine.cpp(646),ERROR" ID="0xcb101432" />
- <MSG STRUCTURE="diag_log_msg0" NAME="RenderBlur failed! @lite_m_gfx_engine.cpp(668),ERROR" ID="0xcb1014e2" />
- <MSG STRUCTURE="diag_log_msg0" NAME="RenderBlit failed! @lite_m_gfx_engine.cpp(735),ERROR" ID="0xcb1016fa" />
- <MSG STRUCTURE="diag_log_msg0" NAME="DrawTransform failed. Software can only process uncompressed data. @lite_m_gfx_engine.cpp(770),ERROR" ID="0xcb101812" />
- <MSG STRUCTURE="diag_log_msg0" NAME="vguFuncs_ is null! @lite_m_gfx_engine.cpp(825),ERROR" ID="0xcb1019ca" />
- <MSG STRUCTURE="diag_log_msg0" NAME="InitVgu or RenderClearRect is null! @lite_m_gfx_engine.cpp(829),ERROR" ID="0xcb1019ea" />
- <MSG STRUCTURE="diag_log_msg0" NAME="VGUPathInit, VGUPathAppendData, VGUPathClear or RenderPath is nullptr! @lite_m_gfx_engine.cpp(836),ERROR" ID="0xcb101a22" />
- <MSG STRUCTURE="diag_log_msg0" NAME="VGUPathInit, VGUPathAppendData, VGUPathClear or RenderPath is nullptr! @lite_m_gfx_engine.cpp(842),ERROR" ID="0xcb101a52" />
- <MSG STRUCTURE="diag_log_msg0" NAME="InitVgu failed! @lite_m_gfx_engine.cpp(847),ERROR" ID="0xcb101a7a" />
- <MSG STRUCTURE="diag_log_msg0" NAME="vguFuncs_ is null! @lite_m_gfx_engine.cpp(858),INFO" ID="0xcb101ad5" />
- <MSG STRUCTURE="diag_log_msg0" NAME="DeinitVgu failed! @lite_m_gfx_engine.cpp(863),ERROR" ID="0xcb101afa" />
- <MSG STRUCTURE="diag_log_msg0" NAME="AllocBuffer failed. @lite_m_gfx_engine.cpp(882),ERROR" ID="0xcb101b92" />
- <MSG STRUCTURE="diag_log_msg1" NAME="unsupported PixelFormat: %d @lite_m_gfx_engine.cpp(909),ERROR" ID="0xcb101c6a" />
- <MSG STRUCTURE="diag_log_msg0" NAME="bufferInfo_ is not inited. @lite_m_gfx_engine.cpp(1014),ERROR" ID="0xcb101fb2" />
- <MSG STRUCTURE="diag_log_msg1" NAME="set value: %d @lite_m_gfx_engine.cpp(1068),DBG" ID="0xcb102166" />
+<MSG_LOG><MSG STRUCTURE="diag_log_msg1" NAME="unsupported BlendMode: %u. @lite_m_gfx_engine.cpp(76),ERROR" ID="0xcb100262" />
+ <MSG STRUCTURE="diag_log_msg1" NAME="unsupported color format: %d @lite_m_gfx_engine.cpp(120),ERROR" ID="0xcb1003c2" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="Convert2VGUCap failed! Invalid Capstyle! @lite_m_gfx_engine.cpp(133),ERROR" ID="0xcb10042a" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="Convert2VGUBuffer failed. @lite_m_gfx_engine.cpp(173),ERROR" ID="0xcb10056a" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="Fill operation failed. @lite_m_gfx_engine.cpp(204),ERROR" ID="0xcb100662" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="open image path failed. @lite_m_gfx_engine.cpp(320),ERROR" ID="0xcb100a02" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="Alloc buffer for cmd failed. @lite_m_gfx_engine.cpp(421),ERROR" ID="0xcb100d2a" />
+ <MSG STRUCTURE="diag_log_msg1" NAME="font weight %u was not support @lite_m_gfx_engine.cpp(477),ERROR" ID="0xcb100eea" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="VGUPathAppendData failed. @lite_m_gfx_engine.cpp(518),ERROR" ID="0xcb101032" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="VGUPathSetData failed. @lite_m_gfx_engine.cpp(529),ERROR" ID="0xcb10108a" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="Convert2VGUBuffer failed. @lite_m_gfx_engine.cpp(549),ERROR" ID="0xcb10112a" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="RenderPath failed. Sync previous task. @lite_m_gfx_engine.cpp(561),ERROR" ID="0xcb10118a" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="Convert2VGUBuffer failed. @lite_m_gfx_engine.cpp(582),ERROR" ID="0xcb101232" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="RenderPath failed. Sync previous task. @lite_m_gfx_engine.cpp(594),ERROR" ID="0xcb101292" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="Convert2VGUBuffer failed. @lite_m_gfx_engine.cpp(610),ERROR" ID="0xcb101312" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="RenderPath failed. Sync previous task. @lite_m_gfx_engine.cpp(637),ERROR" ID="0xcb1013ea" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="Convert2VGUBuffer failed. @lite_m_gfx_engine.cpp(660),ERROR" ID="0xcb1014a2" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="RenderPath failed. Sync previous task. @lite_m_gfx_engine.cpp(673),ERROR" ID="0xcb10150a" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="Convert2VGUBuffer failed. @lite_m_gfx_engine.cpp(787),ERROR" ID="0xcb10189a" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="Convert2VGUBuffer failed. @lite_m_gfx_engine.cpp(814),ERROR" ID="0xcb101972" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="RenderBlur failed! @lite_m_gfx_engine.cpp(836),ERROR" ID="0xcb101a22" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="RenderBlit failed! @lite_m_gfx_engine.cpp(903),ERROR" ID="0xcb101c3a" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="DrawTransform failed. Software can only process uncompressed data. @lite_m_gfx_engine.cpp(938),ERROR" ID="0xcb101d52" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="Alloc buffer for cmd failed. @lite_m_gfx_engine.cpp(1019),ERROR" ID="0xcb101fda" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="vguFuncs_ is null! @lite_m_gfx_engine.cpp(1048),ERROR" ID="0xcb1020c2" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="InitVgu or RenderClearRect is null! @lite_m_gfx_engine.cpp(1052),ERROR" ID="0xcb1020e2" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="VGUPathInit, VGUPathAppendData, VGUPathClear or RenderPath is nullptr! @lite_m_gfx_engine.cpp(1059),ERROR" ID="0xcb10211a" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="VGUPathInit, VGUPathAppendData, VGUPathClear or RenderPath is nullptr! @lite_m_gfx_engine.cpp(1065),ERROR" ID="0xcb10214a" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="InitVgu failed! @lite_m_gfx_engine.cpp(1070),ERROR" ID="0xcb102172" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="vguFuncs_ is null! @lite_m_gfx_engine.cpp(1081),INFO" ID="0xcb1021cd" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="DeinitVgu failed! @lite_m_gfx_engine.cpp(1086),ERROR" ID="0xcb1021f2" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="AllocBuffer failed. @lite_m_gfx_engine.cpp(1105),ERROR" ID="0xcb10228a" />
+ <MSG STRUCTURE="diag_log_msg1" NAME="unsupported PixelFormat: %d @lite_m_gfx_engine.cpp(1132),ERROR" ID="0xcb102362" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="bufferInfo_ is not inited. @lite_m_gfx_engine.cpp(1237),ERROR" ID="0xcb1026aa" />
+ <MSG STRUCTURE="diag_log_msg1" NAME="set value: %d @lite_m_gfx_engine.cpp(1291),DBG" ID="0xcb10285e" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="Alloc buffer for cmd failed. @lite_m_gfx_engine.cpp(1333),ERROR" ID="0xcb1029aa" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="Obtain RoundRect Path failed. @lite_m_gfx_engine.cpp(1383),ERROR" ID="0xcb102b3a" />
</MSG_LOG>
\ No newline at end of file
-<MSG_LOG><MSG STRUCTURE="diag_log_msg0" NAME="list node create fail! @local_device_manager.c(127),ERROR" ID="0xd80803fa" />
- <MSG STRUCTURE="diag_log_msg6" NAME="generate addr: ****%02x%02x%02x%02x name: %s sp-ret: %d @local_device_manager.c(253),INFO" ID="0xd80807ed" />
- <MSG STRUCTURE="diag_log_msg1" NAME="local dev info write error! ret 0x%x @local_device_manager.c(278),ERROR" ID="0xd80808b2" />
- <MSG STRUCTURE="diag_log_msg0" NAME="deinit bt stack @local_device_manager.c(309),INFO" ID="0xd80809ad" />
- <MSG STRUCTURE="diag_log_msg0" NAME="adv id is not active, please set param first. @local_device_manager.c(385),ERROR" ID="0xd8080c0a" />
- <MSG STRUCTURE="diag_log_msg0" NAME="[btsrv][ERROR] ble gap conn state change fail. @local_device_manager.c(412),ERROR" ID="0xd8080ce2" />
- <MSG STRUCTURE="diag_log_msg0" NAME="[btsrv][ERROR] ble gap conn addr memcpy fail. @local_device_manager.c(421),ERROR" ID="0xd8080d2a" />
- <MSG STRUCTURE="diag_log_msg0" NAME="ble smp can not find connect node by handle @local_device_manager.c(450),ERROR" ID="0xd8080e12" />
- <MSG STRUCTURE="diag_log_msg0" NAME="[btsrv][ERROR] ble gap conn addr memcpy fail. @local_device_manager.c(459),ERROR" ID="0xd8080e5a" />
- <MSG STRUCTURE="diag_log_msg0" NAME="adv id is not active, please set param first. @local_device_manager.c(482),ERROR" ID="0xd8080f12" />
- <MSG STRUCTURE="diag_log_msg0" NAME="ble enable err,B core may be not calibration end and not notify A Core @local_device_manager.c(508),ERROR" ID="0xd8080fe2" />
- <MSG STRUCTURE="diag_log_msg1" NAME="bt init err ret = %08x @local_device_manager.c(540),ERROR" ID="0xd80810e2" />
- <MSG STRUCTURE="diag_log_msg1" NAME="unhandled msg id %x @local_device_manager.c(626),WARNING" ID="0xd8081393" />
- <MSG STRUCTURE="diag_log_msg1" NAME="unhandled msg id %x @local_device_manager.c(649),WARNING" ID="0xd808144b" />
- <MSG STRUCTURE="diag_log_msg0" NAME="inquiry complete @local_device_manager.c(657),INFO" ID="0xd808148d" />
- <MSG STRUCTURE="diag_log_msg1" NAME="dev_hdl:0x%08x @local_device_manager.c(664),INFO" ID="0xd80814c5" />
- <MSG STRUCTURE="diag_log_msg1" NAME="dev_hdl:0x%08x @local_device_manager.c(678),INFO" ID="0xd8081535" />
- <MSG STRUCTURE="diag_log_msg0" NAME="btsrv_connection_request_ind_callback: memecpy error @local_device_manager.c(692),ERROR" ID="0xd80815a2" />
- <MSG STRUCTURE="diag_log_msg4" NAME="addr:****%02x%02x%02x%02x @local_device_manager.c(697),INFO" ID="0xd80815cd" />
- <MSG STRUCTURE="diag_log_msg1" NAME="dev_hdl:0x%08x @local_device_manager.c(707),INFO" ID="0xd808161d" />
- <MSG STRUCTURE="diag_log_msg0" NAME="memcpy_s errr @local_device_manager.c(722),ERROR" ID="0xd8081692" />
- <MSG STRUCTURE="diag_log_msg0" NAME="malloc errr @local_device_manager.c(736),ERROR" ID="0xd8081702" />
- <MSG STRUCTURE="diag_log_msg0" NAME="memcpy_s errr @local_device_manager.c(742),ERROR" ID="0xd8081732" />
- <MSG STRUCTURE="diag_log_msg0" NAME="malloc errr @local_device_manager.c(771),ERROR" ID="0xd808181a" />
- <MSG STRUCTURE="diag_log_msg0" NAME="memcpy_s errr @local_device_manager.c(777),ERROR" ID="0xd808184a" />
- <MSG STRUCTURE="diag_log_msg8" NAME="conn_hdl: %08x event: %04x role: %x result: %x dev_hdl: %x svc_hdl: %x svc_class: %x duration: %d @local_device_manager.c(791),INFO" ID="0xd80818bd" />
- <MSG STRUCTURE="diag_log_msg2" NAME="received_bytes: %d sent_bytes: %d @local_device_manager.c(796),INFO" ID="0xd80818e5" />
- <MSG STRUCTURE="diag_log_msg1" NAME="unhandled service class 0x%x @local_device_manager.c(822),WARNING" ID="0xd80819b3" />
- <MSG STRUCTURE="diag_log_msg2" NAME="dev_hdl: %08x num_value: %06d @local_device_manager.c(845),INFO" ID="0xd8081a6d" />
- <MSG STRUCTURE="diag_log_msg1" NAME="dev_hdl: 0x%08x @local_device_manager.c(852),INFO" ID="0xd8081aa5" />
- <MSG STRUCTURE="diag_log_msg1" NAME="dev_hdl: 0x%08x @local_device_manager.c(859),INFO" ID="0xd8081add" />
- <MSG STRUCTURE="diag_log_msg2" NAME="dev_hdl: %08x num_value: %06d @local_device_manager.c(865),INFO" ID="0xd8081b0d" />
- <MSG STRUCTURE="diag_log_msg2" NAME="dev_hdl: %08x reason: %x @local_device_manager.c(879),INFO" ID="0xd8081b7d" />
- <MSG STRUCTURE="diag_log_msg1" NAME="white_list_size:%d @local_device_manager.c(885),INFO" ID="0xd8081bad" />
- <MSG STRUCTURE="diag_log_msg1" NAME="transmit_power_level:%d @local_device_manager.c(890),INFO" ID="0xd8081bd5" />
- <MSG STRUCTURE="diag_log_msg2" NAME="register err id: %x ret: %x @local_device_manager.c(921),ERROR" ID="0xd8081cca" />
- <MSG STRUCTURE="diag_log_msg0" NAME="bt enable err,B core may be not calibration end and not notify A Core @local_device_manager.c(961),ERROR" ID="0xd8081e0a" />
- <MSG STRUCTURE="diag_log_msg1" NAME="bt_init err ret = %08x @local_device_manager.c(988),ERROR" ID="0xd8081ee2" />
- <MSG STRUCTURE="diag_log_msg1" NAME="buff is't long enough, need length:%d. @local_device_manager.c(1095),ERROR" ID="0xd808223a" />
- <MSG STRUCTURE="diag_log_msg0" NAME="get local name memcpy fail. @local_device_manager.c(1099),ERROR" ID="0xd808225a" />
- <MSG STRUCTURE="diag_log_msg2" NAME="name: %s, length: %d @local_device_manager.c(1108),INFO" ID="0xd80822a5" />
- <MSG STRUCTURE="diag_log_msg0" NAME="failed: bt not enabled @local_device_manager.c(1123),INFO" ID="0xd808231d" />
- <MSG STRUCTURE="diag_log_msg1" NAME="local name null or length not match, len: %d @local_device_manager.c(1127),INFO" ID="0xd808233d" />
- <MSG STRUCTURE="diag_log_msg1" NAME="returns error ret: %x @local_device_manager.c(1133),WARNING" ID="0xd808236b" />
- <MSG STRUCTURE="diag_log_msg3" NAME="set result name: "%s" name_len: %d get_re: %x @local_device_manager.c(1139),INFO" ID="0xd808239d" />
- <MSG STRUCTURE="diag_log_msg0" NAME="gap_remove_all_pairs fail @local_device_manager.c(1199),ERROR" ID="0xd808257a" />
- <MSG STRUCTURE="diag_log_msg0" NAME="gap ble remove all pairs fail @local_device_manager.c(1205),ERROR" ID="0xd80825aa" />
- <MSG STRUCTURE="diag_log_msg1" NAME="diable_bt_ret(errcode_t): %x @local_device_manager.c(1212),INFO" ID="0xd80825e5" />
- <MSG STRUCTURE="diag_log_msg1" NAME="disable_ble_ret(errcode_t): %x @local_device_manager.c(1217),INFO" ID="0xd808260d" />
- <MSG STRUCTURE="diag_log_msg0" NAME="set discovery data pointer is null. @local_device_manager.c(1248),ERROR" ID="0xd8082702" />
- <MSG STRUCTURE="diag_log_msg1" NAME="adv_id(%d) advertising, please stop first. @local_device_manager.c(1266),ERROR" ID="0xd8082792" />
- <MSG STRUCTURE="diag_log_msg1" NAME="adv data alloc faild, length:%d @local_device_manager.c(1279),ERROR" ID="0xd80827fa" />
- <MSG STRUCTURE="diag_log_msg0" NAME="[Error] gap_ble_set_adv_data adv data memcpy_s fail @local_device_manager.c(1283),ERROR" ID="0xd808281a" />
- <MSG STRUCTURE="diag_log_msg1" NAME="scan rsp data alloc faild, length:%d @local_device_manager.c(1292),ERROR" ID="0xd8082862" />
- <MSG STRUCTURE="diag_log_msg0" NAME="[Error] gap_ble_set_adv_data scan rsp data memcpy_s fail @local_device_manager.c(1296),ERROR" ID="0xd8082882" />
- <MSG STRUCTURE="diag_log_msg1" NAME="adv_id(%d) advertising, please stop first. @local_device_manager.c(1335),ERROR" ID="0xd80829ba" />
- <MSG STRUCTURE="diag_log_msg0" NAME="[Error] gap ble set adv param memcpy_s fail @local_device_manager.c(1347),ERROR" ID="0xd8082a1a" />
- <MSG STRUCTURE="diag_log_msg0" NAME="[Error] gap ble set adv param memcpy_s fail @local_device_manager.c(1361),ERROR" ID="0xd8082a8a" />
- <MSG STRUCTURE="diag_log_msg0" NAME="ble gap set sec param error param NULL @local_device_manager.c(1383),ERROR" ID="0xd8082b3a" />
- <MSG STRUCTURE="diag_log_msg0" NAME="ble gap set sec param error param NULL @local_device_manager.c(1388),ERROR" ID="0xd8082b62" />
- <MSG STRUCTURE="diag_log_msg0" NAME="bt has page scanning enabled. @local_device_manager.c(1412),ERROR" ID="0xd8082c22" />
- <MSG STRUCTURE="diag_log_msg0" NAME="bt has an ACL connection. @local_device_manager.c(1418),ERROR" ID="0xd8082c52" />
- <MSG STRUCTURE="diag_log_msg1" NAME="[CTKD] please set ble secure connection enable,current_sc=%d. @local_device_manager.c(1435),ERROR" ID="0xd8082cda" />
- <MSG STRUCTURE="diag_log_msg0" NAME="[BT] flow limit range is [3072-10240] bytes. @local_device_manager.c(1453),ERROR" ID="0xd8082d6a" />
- <MSG STRUCTURE="diag_log_msg0" NAME="[Error] gap set adv data memcpy_s fail @local_device_manager.c(1472),ERROR" ID="0xd8082e02" />
- <MSG STRUCTURE="diag_log_msg0" NAME="[Error] gap set scan rsp data memcpy_s fail @local_device_manager.c(1479),ERROR" ID="0xd8082e3a" />
- <MSG STRUCTURE="diag_log_msg0" NAME="[Error] btsrv_gap_set_adv_param memcpy_s fail @local_device_manager.c(1498),ERROR" ID="0xd8082ed2" />
- <MSG STRUCTURE="diag_log_msg0" NAME="[Error] gap set adv param memcpy_s fail @local_device_manager.c(1503),ERROR" ID="0xd8082efa" />
- <MSG STRUCTURE="diag_log_msg0" NAME="ble gap ext adv rpt malloc fail @local_device_manager.c(1541),ERROR" ID="0xd808302a" />
- <MSG STRUCTURE="diag_log_msg0" NAME="ble gap ext adv rpt memcpy fail @local_device_manager.c(1546),ERROR" ID="0xd8083052" />
- <MSG STRUCTURE="diag_log_msg0" NAME="ble gap ext adv rpt memcpy fail @local_device_manager.c(1552),ERROR" ID="0xd8083082" />
- <MSG STRUCTURE="diag_log_msg0" NAME="ble gap ext adv rpt malloc fail @local_device_manager.c(1563),ERROR" ID="0xd80830da" />
- <MSG STRUCTURE="diag_log_msg0" NAME="ble gap ext adv rpt memcpy fail @local_device_manager.c(1568),ERROR" ID="0xd8083102" />
- <MSG STRUCTURE="diag_log_msg0" NAME="ble gap adv set terminated cbk param error @local_device_manager.c(1588),ERROR" ID="0xd80831a2" />
- <MSG STRUCTURE="diag_log_msg0" NAME="ble enable cbk param error @local_device_manager.c(1599),ERROR" ID="0xd80831fa" />
- <MSG STRUCTURE="diag_log_msg0" NAME="ble read remote rssi cbk param error @local_device_manager.c(1610),ERROR" ID="0xd8083252" />
- <MSG STRUCTURE="diag_log_msg0" NAME="ble conn param update cbk param error @local_device_manager.c(1626),ERROR" ID="0xd80832d2" />
- <MSG STRUCTURE="diag_log_msg0" NAME="ble gap conn param malloc fail @local_device_manager.c(1640),ERROR" ID="0xd8083342" />
- <MSG STRUCTURE="diag_log_msg3" NAME="ble conn param update cbk interval:%x, latency:%x, timeout:%x @local_device_manager.c(1647),INFO" ID="0xd808337d" />
- <MSG STRUCTURE="diag_log_msg0" NAME="adv id is not active, please set param first. @local_device_manager.c(1681),ERROR" ID="0xd808348a" />
- <MSG STRUCTURE="diag_log_msg1" NAME="adv id(%d) is discoverying, please stop first. @local_device_manager.c(1685),ERROR" ID="0xd80834aa" />
- <MSG STRUCTURE="diag_log_msg0" NAME="adv param alloc fail @local_device_manager.c(1694),ERROR" ID="0xd80834f2" />
- <MSG STRUCTURE="diag_log_msg0" NAME="adv id is not active, please set param first. @local_device_manager.c(1727),ERROR" ID="0xd80835fa" />
- <MSG STRUCTURE="diag_log_msg2" NAME="no advertising in progress or advertising for adv_id(%d). No advertising for adv_id(%d). @local_device_manager.c(1733),ERROR" ID="0xd808362a" />
- <MSG STRUCTURE="diag_log_msg0" NAME="mc sdk ble stop adv atb failed @local_device_manager.c(1739),ERROR" ID="0xd808365a" />
- <MSG STRUCTURE="diag_log_msg0" NAME="scanning in process, please stop first. @local_device_manager.c(1773),ERROR" ID="0xd808376a" />
- <MSG STRUCTURE="diag_log_msg0" NAME="scanning already stopped. @local_device_manager.c(1806),ERROR" ID="0xd8083872" />
- <MSG STRUCTURE="diag_log_msg1" NAME="ble stop extern scan ret: %#x @local_device_manager.c(1810),INFO" ID="0xd8083895" />
- <MSG STRUCTURE="diag_log_msg0" NAME="ble set phy node == NULL @local_device_manager.c(1833),ERROR" ID="0xd808394a" />
- <MSG STRUCTURE="diag_log_msg0" NAME="ble set phy memcpy fail @local_device_manager.c(1838),ERROR" ID="0xd8083972" />
- <MSG STRUCTURE="diag_log_msg5" NAME="ble general set phy hdl:%x all:%x rx:%x tx:%x op:%x. @local_device_manager.c(1846),INFO" ID="0xd80839b5" />
- <MSG STRUCTURE="diag_log_msg1" NAME="ble set phy ret: %#x @local_device_manager.c(1849),ERROR" ID="0xd80839ca" />
- <MSG STRUCTURE="diag_log_msg0" NAME="ble set data length node == NULL @local_device_manager.c(1870),ERROR" ID="0xd8083a72" />
- <MSG STRUCTURE="diag_log_msg0" NAME="ble set data length memcpy fail @local_device_manager.c(1876),ERROR" ID="0xd8083aa2" />
- <MSG STRUCTURE="diag_log_msg3" NAME="ble general set len hdl:%x maxoct:%x maxtime:%x @local_device_manager.c(1883),INFO" ID="0xd8083add" />
- <MSG STRUCTURE="diag_log_msg1" NAME="ble set len ret: %#x @local_device_manager.c(1886),ERROR" ID="0xd8083af2" />
- <MSG STRUCTURE="diag_log_msg1" NAME="bts sert log type levle:%x @local_device_manager.c(1904),INFO" ID="0xd8083b85" />
- <MSG STRUCTURE="diag_log_msg1" NAME="g_bts_feature_bitmap bt_auto_reconnect_closed:%d. @local_device_manager.c(1925),ERROR" ID="0xd8083c2a" />
+<MSG_LOG><MSG STRUCTURE="diag_log_msg0" NAME="list node create fail! @local_device_manager.c(129),ERROR" ID="0xd808040a" />
+ <MSG STRUCTURE="diag_log_msg6" NAME="generate addr: ****%02x%02x%02x%02x name: %s sp-ret: %d @local_device_manager.c(255),INFO" ID="0xd80807fd" />
+ <MSG STRUCTURE="diag_log_msg1" NAME="local dev info write error! ret 0x%x @local_device_manager.c(280),ERROR" ID="0xd80808c2" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="deinit bt stack @local_device_manager.c(311),INFO" ID="0xd80809bd" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="adv id is not active, please set param first. @local_device_manager.c(387),ERROR" ID="0xd8080c1a" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="[btsrv][ERROR] ble gap conn state change fail. @local_device_manager.c(414),ERROR" ID="0xd8080cf2" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="[btsrv][ERROR] ble gap conn addr memcpy fail. @local_device_manager.c(423),ERROR" ID="0xd8080d3a" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="ble smp can not find connect node by handle @local_device_manager.c(452),ERROR" ID="0xd8080e22" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="[btsrv][ERROR] ble gap conn addr memcpy fail. @local_device_manager.c(461),ERROR" ID="0xd8080e6a" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="adv id is not active, please set param first. @local_device_manager.c(484),ERROR" ID="0xd8080f22" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="ble enable err,B core may be not calibration end and not notify A Core @local_device_manager.c(510),ERROR" ID="0xd8080ff2" />
+ <MSG STRUCTURE="diag_log_msg1" NAME="bt init err ret = %08x @local_device_manager.c(542),ERROR" ID="0xd80810f2" />
+ <MSG STRUCTURE="diag_log_msg1" NAME="unhandled msg id %x @local_device_manager.c(628),WARNING" ID="0xd80813a3" />
+ <MSG STRUCTURE="diag_log_msg1" NAME="unhandled msg id %x @local_device_manager.c(651),WARNING" ID="0xd808145b" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="inquiry complete @local_device_manager.c(659),INFO" ID="0xd808149d" />
+ <MSG STRUCTURE="diag_log_msg1" NAME="dev_hdl:0x%08x @local_device_manager.c(666),INFO" ID="0xd80814d5" />
+ <MSG STRUCTURE="diag_log_msg1" NAME="dev_hdl:0x%08x @local_device_manager.c(680),INFO" ID="0xd8081545" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="btsrv_connection_request_ind_callback: memecpy error @local_device_manager.c(694),ERROR" ID="0xd80815b2" />
+ <MSG STRUCTURE="diag_log_msg4" NAME="addr:****%02x%02x%02x%02x @local_device_manager.c(699),INFO" ID="0xd80815dd" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="btsrv connection reject notify callback: memecpy error @local_device_manager.c(711),ERROR" ID="0xd808163a" />
+ <MSG STRUCTURE="diag_log_msg4" NAME="addr:****%02x%02x%02x%02x @local_device_manager.c(716),INFO" ID="0xd8081665" />
+ <MSG STRUCTURE="diag_log_msg1" NAME="dev_hdl:0x%08x @local_device_manager.c(726),INFO" ID="0xd80816b5" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="memcpy_s errr @local_device_manager.c(741),ERROR" ID="0xd808172a" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="malloc errr @local_device_manager.c(755),ERROR" ID="0xd808179a" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="memcpy_s errr @local_device_manager.c(761),ERROR" ID="0xd80817ca" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="malloc errr @local_device_manager.c(790),ERROR" ID="0xd80818b2" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="memcpy_s errr @local_device_manager.c(796),ERROR" ID="0xd80818e2" />
+ <MSG STRUCTURE="diag_log_msg8" NAME="conn_hdl: %08x event: %04x role: %x result: %x dev_hdl: %x svc_hdl: %x svc_class: %x duration: %d @local_device_manager.c(810),INFO" ID="0xd8081955" />
+ <MSG STRUCTURE="diag_log_msg2" NAME="received_bytes: %d sent_bytes: %d @local_device_manager.c(815),INFO" ID="0xd808197d" />
+ <MSG STRUCTURE="diag_log_msg1" NAME="unhandled service class 0x%x @local_device_manager.c(841),WARNING" ID="0xd8081a4b" />
+ <MSG STRUCTURE="diag_log_msg2" NAME="dev_hdl: %08x num_value: %06d @local_device_manager.c(864),INFO" ID="0xd8081b05" />
+ <MSG STRUCTURE="diag_log_msg1" NAME="dev_hdl: 0x%08x @local_device_manager.c(871),INFO" ID="0xd8081b3d" />
+ <MSG STRUCTURE="diag_log_msg1" NAME="dev_hdl: 0x%08x @local_device_manager.c(878),INFO" ID="0xd8081b75" />
+ <MSG STRUCTURE="diag_log_msg2" NAME="dev_hdl: %08x num_value: %06d @local_device_manager.c(884),INFO" ID="0xd8081ba5" />
+ <MSG STRUCTURE="diag_log_msg2" NAME="dev_hdl: %08x reason: %x @local_device_manager.c(898),INFO" ID="0xd8081c15" />
+ <MSG STRUCTURE="diag_log_msg1" NAME="white_list_size:%d @local_device_manager.c(904),INFO" ID="0xd8081c45" />
+ <MSG STRUCTURE="diag_log_msg1" NAME="transmit_power_level:%d @local_device_manager.c(909),INFO" ID="0xd8081c6d" />
+ <MSG STRUCTURE="diag_log_msg2" NAME="register err id: %x ret: %x @local_device_manager.c(941),ERROR" ID="0xd8081d6a" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="bt enable err,B core may be not calibration end and not notify A Core @local_device_manager.c(981),ERROR" ID="0xd8081eaa" />
+ <MSG STRUCTURE="diag_log_msg1" NAME="bt_init err ret = %08x @local_device_manager.c(1008),ERROR" ID="0xd8081f82" />
+ <MSG STRUCTURE="diag_log_msg1" NAME="buff is't long enough, need length:%d. @local_device_manager.c(1115),ERROR" ID="0xd80822da" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="get local name memcpy fail. @local_device_manager.c(1119),ERROR" ID="0xd80822fa" />
+ <MSG STRUCTURE="diag_log_msg2" NAME="name: %s, length: %d @local_device_manager.c(1128),INFO" ID="0xd8082345" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="failed: bt not enabled @local_device_manager.c(1143),INFO" ID="0xd80823bd" />
+ <MSG STRUCTURE="diag_log_msg1" NAME="local name null or length not match, len: %d @local_device_manager.c(1147),INFO" ID="0xd80823dd" />
+ <MSG STRUCTURE="diag_log_msg1" NAME="returns error ret: %x @local_device_manager.c(1153),WARNING" ID="0xd808240b" />
+ <MSG STRUCTURE="diag_log_msg3" NAME="set result name: "%s" name_len: %d get_re: %x @local_device_manager.c(1159),INFO" ID="0xd808243d" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="gap_remove_all_pairs fail @local_device_manager.c(1219),ERROR" ID="0xd808261a" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="gap ble remove all pairs fail @local_device_manager.c(1225),ERROR" ID="0xd808264a" />
+ <MSG STRUCTURE="diag_log_msg1" NAME="diable_bt_ret(errcode_t): %x @local_device_manager.c(1232),INFO" ID="0xd8082685" />
+ <MSG STRUCTURE="diag_log_msg1" NAME="disable_ble_ret(errcode_t): %x @local_device_manager.c(1237),INFO" ID="0xd80826ad" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="set discovery data pointer is null. @local_device_manager.c(1268),ERROR" ID="0xd80827a2" />
+ <MSG STRUCTURE="diag_log_msg1" NAME="adv_id(%d) advertising, please stop first. @local_device_manager.c(1286),ERROR" ID="0xd8082832" />
+ <MSG STRUCTURE="diag_log_msg1" NAME="adv data alloc faild, length:%d @local_device_manager.c(1299),ERROR" ID="0xd808289a" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="[Error] gap_ble_set_adv_data adv data memcpy_s fail @local_device_manager.c(1303),ERROR" ID="0xd80828ba" />
+ <MSG STRUCTURE="diag_log_msg1" NAME="scan rsp data alloc faild, length:%d @local_device_manager.c(1312),ERROR" ID="0xd8082902" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="[Error] gap_ble_set_adv_data scan rsp data memcpy_s fail @local_device_manager.c(1316),ERROR" ID="0xd8082922" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="[Error] invalid interval param. @local_device_manager.c(1349),ERROR" ID="0xd8082a2a" />
+ <MSG STRUCTURE="diag_log_msg1" NAME="adv_id(%d) advertising, please stop first. @local_device_manager.c(1361),ERROR" ID="0xd8082a8a" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="[Error] gap ble set adv param memcpy_s fail @local_device_manager.c(1373),ERROR" ID="0xd8082aea" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="[Error] gap ble set adv param memcpy_s fail @local_device_manager.c(1387),ERROR" ID="0xd8082b5a" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="ble gap set sec param error param NULL @local_device_manager.c(1409),ERROR" ID="0xd8082c0a" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="ble gap set sec param error param NULL @local_device_manager.c(1414),ERROR" ID="0xd8082c32" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="bt has page scanning enabled. @local_device_manager.c(1438),ERROR" ID="0xd8082cf2" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="bt has an ACL connection. @local_device_manager.c(1444),ERROR" ID="0xd8082d22" />
+ <MSG STRUCTURE="diag_log_msg1" NAME="[CTKD] please set ble secure connection enable,current_sc=%d. @local_device_manager.c(1461),ERROR" ID="0xd8082daa" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="[BT] flow limit range is [3072-51200] bytes. @local_device_manager.c(1479),ERROR" ID="0xd8082e3a" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="[Error] gap set adv data memcpy_s fail @local_device_manager.c(1498),ERROR" ID="0xd8082ed2" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="[Error] gap set scan rsp data memcpy_s fail @local_device_manager.c(1505),ERROR" ID="0xd8082f0a" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="[Error] btsrv_gap_set_adv_param memcpy_s fail @local_device_manager.c(1524),ERROR" ID="0xd8082fa2" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="[Error] gap set adv param memcpy_s fail @local_device_manager.c(1529),ERROR" ID="0xd8082fca" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="ble gap ext adv rpt malloc fail @local_device_manager.c(1567),ERROR" ID="0xd80830fa" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="ble gap ext adv rpt memcpy fail @local_device_manager.c(1572),ERROR" ID="0xd8083122" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="ble gap ext adv rpt memcpy fail @local_device_manager.c(1578),ERROR" ID="0xd8083152" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="ble gap ext adv rpt malloc fail @local_device_manager.c(1589),ERROR" ID="0xd80831aa" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="ble gap ext adv rpt memcpy fail @local_device_manager.c(1594),ERROR" ID="0xd80831d2" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="ble gap adv set terminated cbk param error @local_device_manager.c(1614),ERROR" ID="0xd8083272" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="ble enable cbk param error @local_device_manager.c(1625),ERROR" ID="0xd80832ca" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="ble read remote rssi cbk param error @local_device_manager.c(1636),ERROR" ID="0xd8083322" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="ble conn param update cbk param error @local_device_manager.c(1652),ERROR" ID="0xd80833a2" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="ble gap conn param malloc fail @local_device_manager.c(1666),ERROR" ID="0xd8083412" />
+ <MSG STRUCTURE="diag_log_msg3" NAME="ble conn param update cbk interval:%x, latency:%x, timeout:%x @local_device_manager.c(1673),INFO" ID="0xd808344d" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="adv id is not active, please set param first. @local_device_manager.c(1707),ERROR" ID="0xd808355a" />
+ <MSG STRUCTURE="diag_log_msg1" NAME="adv id(%d) is discoverying, please stop first. @local_device_manager.c(1711),ERROR" ID="0xd808357a" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="adv param alloc fail @local_device_manager.c(1720),ERROR" ID="0xd80835c2" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="adv id is not active, please set param first. @local_device_manager.c(1753),ERROR" ID="0xd80836ca" />
+ <MSG STRUCTURE="diag_log_msg2" NAME="no advertising in progress or advertising for adv_id(%d). No advertising for adv_id(%d). @local_device_manager.c(1759),ERROR" ID="0xd80836fa" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="mc sdk ble stop adv atb failed @local_device_manager.c(1765),ERROR" ID="0xd808372a" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="scanning in process, please stop first. @local_device_manager.c(1799),ERROR" ID="0xd808383a" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="scanning already stopped. @local_device_manager.c(1832),ERROR" ID="0xd8083942" />
+ <MSG STRUCTURE="diag_log_msg1" NAME="ble stop extern scan ret: %#x @local_device_manager.c(1836),INFO" ID="0xd8083965" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="ble set phy node == NULL @local_device_manager.c(1859),ERROR" ID="0xd8083a1a" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="ble set phy memcpy fail @local_device_manager.c(1864),ERROR" ID="0xd8083a42" />
+ <MSG STRUCTURE="diag_log_msg5" NAME="ble general set phy hdl:%x all:%x rx:%x tx:%x op:%x. @local_device_manager.c(1872),INFO" ID="0xd8083a85" />
+ <MSG STRUCTURE="diag_log_msg1" NAME="ble set phy ret: %#x @local_device_manager.c(1875),ERROR" ID="0xd8083a9a" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="ble set data length node == NULL @local_device_manager.c(1896),ERROR" ID="0xd8083b42" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="ble set data length memcpy fail @local_device_manager.c(1902),ERROR" ID="0xd8083b72" />
+ <MSG STRUCTURE="diag_log_msg3" NAME="ble general set len hdl:%x maxoct:%x maxtime:%x @local_device_manager.c(1909),INFO" ID="0xd8083bad" />
+ <MSG STRUCTURE="diag_log_msg1" NAME="ble set len ret: %#x @local_device_manager.c(1912),ERROR" ID="0xd8083bc2" />
+ <MSG STRUCTURE="diag_log_msg1" NAME="bts sert log type levle:%x @local_device_manager.c(1930),INFO" ID="0xd8083c55" />
+ <MSG STRUCTURE="diag_log_msg1" NAME="g_bts_feature_bitmap bt_auto_reconnect_closed:%d. @local_device_manager.c(1951),ERROR" ID="0xd8083cfa" />
</MSG_LOG>
\ No newline at end of file
-<MSG_LOG><MSG STRUCTURE="diag_log_msg0" NAME="set svg faild, path len is 0 @map_svg_parser.cpp(54),ERROR" ID="0xcb5001b2" />
- <MSG STRUCTURE="diag_log_msg0" NAME="Invalid file path. @map_svg_parser.cpp(67),ERROR" ID="0xcb50021a" />
- <MSG STRUCTURE="diag_log_msg2" NAME="File(%s) can not open. errno: %d @map_svg_parser.cpp(73),ERROR" ID="0xcb50024a" />
- <MSG STRUCTURE="diag_log_msg0" NAME="read map header faild @map_svg_parser.cpp(78),ERROR" ID="0xcb500272" />
- <MSG STRUCTURE="diag_log_msg0" NAME="parser map success @map_svg_parser.cpp(97),DBG" ID="0xcb50030e" />
- <MSG STRUCTURE="diag_log_msg0" NAME="parser map failed @map_svg_parser.cpp(104),DBG" ID="0xcb500346" />
- <MSG STRUCTURE="diag_log_msg0" NAME="memcpy_s map header faild @map_svg_parser.cpp(113),ERROR" ID="0xcb50038a" />
- <MSG STRUCTURE="diag_log_msg0" NAME="The remaining data is insufficient. The read ends. @map_svg_parser.cpp(118),WARNING" ID="0xcb5003b3" />
- <MSG STRUCTURE="diag_log_msg0" NAME="parser map success @map_svg_parser.cpp(153),DBG" ID="0xcb5004ce" />
- <MSG STRUCTURE="diag_log_msg1" NAME="[%s] param error! @map_svg_parser.cpp(160),ERROR" ID="0xcb500502" />
- <MSG STRUCTURE="diag_log_msg0" NAME="malloc map node array faild! @map_svg_parser.cpp(167),ERROR" ID="0xcb50053a" />
- <MSG STRUCTURE="diag_log_msg2" NAME="read map node array faild, readLen:%d, realReadLen:%d @map_svg_parser.cpp(174),ERROR" ID="0xcb500572" />
- <MSG STRUCTURE="diag_log_msg1" NAME="[%s] param error! @map_svg_parser.cpp(187),ERROR" ID="0xcb5005da" />
- <MSG STRUCTURE="diag_log_msg0" NAME="read map node faild.The data length is less than the read length! @map_svg_parser.cpp(193),ERROR" ID="0xcb50060a" />
- <MSG STRUCTURE="diag_log_msg0" NAME="malloc map node array faild! @map_svg_parser.cpp(198),ERROR" ID="0xcb500632" />
- <MSG STRUCTURE="diag_log_msg1" NAME="memcpy_s map node array faild, nodeLen: 0x%x @map_svg_parser.cpp(205),ERROR" ID="0xcb50066a" />
- <MSG STRUCTURE="diag_log_msg1" NAME="[%s] param error! @map_svg_parser.cpp(215),ERROR" ID="0xcb5006ba" />
- <MSG STRUCTURE="diag_log_msg0" NAME="malloc path style array faild! @map_svg_parser.cpp(222),ERROR" ID="0xcb5006f2" />
- <MSG STRUCTURE="diag_log_msg0" NAME="memcpy_s path style array faild @map_svg_parser.cpp(229),ERROR" ID="0xcb50072a" />
- <MSG STRUCTURE="diag_log_msg1" NAME="[%s] param error! @map_svg_parser.cpp(242),ERROR" ID="0xcb500792" />
- <MSG STRUCTURE="diag_log_msg0" NAME="read path style faild.The data length is less than the read length! @map_svg_parser.cpp(248),ERROR" ID="0xcb5007c2" />
- <MSG STRUCTURE="diag_log_msg0" NAME="malloc path style array faild! @map_svg_parser.cpp(254),ERROR" ID="0xcb5007f2" />
- <MSG STRUCTURE="diag_log_msg0" NAME="memcpy_s path style array faild @map_svg_parser.cpp(261),ERROR" ID="0xcb50082a" />
- <MSG STRUCTURE="diag_log_msg0" NAME="Alloc buffer for buffer failed. @map_svg_parser.cpp(275),ERROR" ID="0xcb50089a" />
- <MSG STRUCTURE="diag_log_msg0" NAME="Alloc buffer for buffer failed. @map_svg_parser.cpp(284),ERROR" ID="0xcb5008e2" />
- <MSG STRUCTURE="diag_log_msg1" NAME="[%s] param error! @map_svg_parser.cpp(295),ERROR" ID="0xcb50093a" />
- <MSG STRUCTURE="diag_log_msg0" NAME="malloc map path array faild! @map_svg_parser.cpp(302),ERROR" ID="0xcb500972" />
- <MSG STRUCTURE="diag_log_msg0" NAME="read map path array faild @map_svg_parser.cpp(312),ERROR" ID="0xcb5009c2" />
- <MSG STRUCTURE="diag_log_msg0" NAME="alloc path faild @map_svg_parser.cpp(319),ERROR" ID="0xcb5009fa" />
- <MSG STRUCTURE="diag_log_msg0" NAME="read path cmd faild @map_svg_parser.cpp(325),ERROR" ID="0xcb500a2a" />
- <MSG STRUCTURE="diag_log_msg0" NAME="read path data faild @map_svg_parser.cpp(331),ERROR" ID="0xcb500a5a" />
- <MSG STRUCTURE="diag_log_msg1" NAME="[%s] param error! @map_svg_parser.cpp(342),ERROR" ID="0xcb500ab2" />
- <MSG STRUCTURE="diag_log_msg0" NAME="malloc map path array faild! @map_svg_parser.cpp(349),ERROR" ID="0xcb500aea" />
- <MSG STRUCTURE="diag_log_msg0" NAME="memcpy_s map path array faild @map_svg_parser.cpp(358),ERROR" ID="0xcb500b32" />
- <MSG STRUCTURE="diag_log_msg0" NAME="alloc path faild @map_svg_parser.cpp(368),ERROR" ID="0xcb500b82" />
- <MSG STRUCTURE="diag_log_msg0" NAME="memcpy_s path cmd faild @map_svg_parser.cpp(373),ERROR" ID="0xcb500baa" />
- <MSG STRUCTURE="diag_log_msg0" NAME="memcpy_s path data faild @map_svg_parser.cpp(380),ERROR" ID="0xcb500be2" />
- <MSG STRUCTURE="diag_log_msg1" NAME="[%s] param error! @map_svg_parser.cpp(415),ERROR" ID="0xcb500cfa" />
- <MSG STRUCTURE="diag_log_msg0" NAME="malloc map path array faild! @map_svg_parser.cpp(422),ERROR" ID="0xcb500d32" />
- <MSG STRUCTURE="diag_log_msg0" NAME="read map text array faild @map_svg_parser.cpp(432),ERROR" ID="0xcb500d82" />
- <MSG STRUCTURE="diag_log_msg0" NAME="malloc map path cmd faild @map_svg_parser.cpp(439),ERROR" ID="0xcb500dba" />
- <MSG STRUCTURE="diag_log_msg0" NAME="read text faild @map_svg_parser.cpp(445),ERROR" ID="0xcb500dea" />
- <MSG STRUCTURE="diag_log_msg0" NAME="malloc text offset faild @map_svg_parser.cpp(453),ERROR" ID="0xcb500e2a" />
- <MSG STRUCTURE="diag_log_msg0" NAME="read text offset faild @map_svg_parser.cpp(459),ERROR" ID="0xcb500e5a" />
- <MSG STRUCTURE="diag_log_msg1" NAME="[%s] param error! @map_svg_parser.cpp(470),ERROR" ID="0xcb500eb2" />
- <MSG STRUCTURE="diag_log_msg0" NAME="malloc map path array faild! @map_svg_parser.cpp(477),ERROR" ID="0xcb500eea" />
- <MSG STRUCTURE="diag_log_msg0" NAME="memcpy_s map text array faild @map_svg_parser.cpp(486),ERROR" ID="0xcb500f32" />
- <MSG STRUCTURE="diag_log_msg0" NAME="malloc map path cmd faild @map_svg_parser.cpp(495),ERROR" ID="0xcb500f7a" />
- <MSG STRUCTURE="diag_log_msg0" NAME="memcpy_s text faild @map_svg_parser.cpp(499),ERROR" ID="0xcb500f9a" />
- <MSG STRUCTURE="diag_log_msg0" NAME="malloc text offset faild @map_svg_parser.cpp(509),ERROR" ID="0xcb500fea" />
- <MSG STRUCTURE="diag_log_msg0" NAME="memcpy_s text offset faild @map_svg_parser.cpp(514),ERROR" ID="0xcb501012" />
- <MSG STRUCTURE="diag_log_msg1" NAME="[%s] param error! @map_svg_parser.cpp(548),ERROR" ID="0xcb501122" />
- <MSG STRUCTURE="diag_log_msg0" NAME="malloc map path array faild! @map_svg_parser.cpp(555),ERROR" ID="0xcb50115a" />
- <MSG STRUCTURE="diag_log_msg0" NAME="read map image array faild @map_svg_parser.cpp(560),ERROR" ID="0xcb501182" />
- <MSG STRUCTURE="diag_log_msg0" NAME="malloc map path array faild! @map_svg_parser.cpp(568),ERROR" ID="0xcb5011c2" />
- <MSG STRUCTURE="diag_log_msg1" NAME="[%s] param error! @map_svg_parser.cpp(597),ERROR" ID="0xcb5012aa" />
- <MSG STRUCTURE="diag_log_msg0" NAME="malloc map path array faild! @map_svg_parser.cpp(604),ERROR" ID="0xcb5012e2" />
- <MSG STRUCTURE="diag_log_msg0" NAME="memcpy_s map text array faild @map_svg_parser.cpp(609),ERROR" ID="0xcb50130a" />
- <MSG STRUCTURE="diag_log_msg0" NAME="malloc map path array faild! @map_svg_parser.cpp(617),ERROR" ID="0xcb50134a" />
- <MSG STRUCTURE="diag_log_msg1" NAME="[%s] param error! @map_svg_parser.cpp(649),ERROR" ID="0xcb50144a" />
- <MSG STRUCTURE="diag_log_msg0" NAME="malloc map path array faild! @map_svg_parser.cpp(656),ERROR" ID="0xcb501482" />
- <MSG STRUCTURE="diag_log_msg0" NAME="read map road array faild @map_svg_parser.cpp(661),ERROR" ID="0xcb5014aa" />
- <MSG STRUCTURE="diag_log_msg1" NAME="[%s] param error! @map_svg_parser.cpp(671),ERROR" ID="0xcb5014fa" />
- <MSG STRUCTURE="diag_log_msg0" NAME="malloc map path array faild! @map_svg_parser.cpp(678),ERROR" ID="0xcb501532" />
- <MSG STRUCTURE="diag_log_msg0" NAME="memcpy_s map text array faild @map_svg_parser.cpp(683),ERROR" ID="0xcb50155a" />
- <MSG STRUCTURE="diag_log_msg1" NAME="[%s] param error! @map_svg_parser.cpp(702),ERROR" ID="0xcb5015f2" />
- <MSG STRUCTURE="diag_log_msg0" NAME="malloc map path array faild! @map_svg_parser.cpp(709),ERROR" ID="0xcb50162a" />
- <MSG STRUCTURE="diag_log_msg0" NAME="read map poi array faild @map_svg_parser.cpp(714),ERROR" ID="0xcb501652" />
- <MSG STRUCTURE="diag_log_msg1" NAME="[%s] param error! @map_svg_parser.cpp(724),ERROR" ID="0xcb5016a2" />
- <MSG STRUCTURE="diag_log_msg0" NAME="malloc map path array faild! @map_svg_parser.cpp(731),ERROR" ID="0xcb5016da" />
- <MSG STRUCTURE="diag_log_msg0" NAME="memcpy_s map text array faild @map_svg_parser.cpp(736),ERROR" ID="0xcb501702" />
+<MSG_LOG><MSG STRUCTURE="diag_log_msg0" NAME="set svg faild, path len is 0 @map_svg_parser.cpp(54),ERROR" ID="0xcb5401b2" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="Invalid file path. @map_svg_parser.cpp(67),ERROR" ID="0xcb54021a" />
+ <MSG STRUCTURE="diag_log_msg2" NAME="File(%s) can not open. errno: %d @map_svg_parser.cpp(73),ERROR" ID="0xcb54024a" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="read map header faild @map_svg_parser.cpp(78),ERROR" ID="0xcb540272" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="parser map success @map_svg_parser.cpp(97),DBG" ID="0xcb54030e" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="parser map failed @map_svg_parser.cpp(104),DBG" ID="0xcb540346" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="memcpy_s map header faild @map_svg_parser.cpp(113),ERROR" ID="0xcb54038a" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="The remaining data is insufficient. The read ends. @map_svg_parser.cpp(118),WARNING" ID="0xcb5403b3" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="parser map success @map_svg_parser.cpp(153),DBG" ID="0xcb5404ce" />
+ <MSG STRUCTURE="diag_log_msg1" NAME="[%s] param error! @map_svg_parser.cpp(160),ERROR" ID="0xcb540502" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="malloc map node array faild! @map_svg_parser.cpp(167),ERROR" ID="0xcb54053a" />
+ <MSG STRUCTURE="diag_log_msg2" NAME="read map node array faild, readLen:%d, realReadLen:%d @map_svg_parser.cpp(174),ERROR" ID="0xcb540572" />
+ <MSG STRUCTURE="diag_log_msg1" NAME="[%s] param error! @map_svg_parser.cpp(187),ERROR" ID="0xcb5405da" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="read map node faild.The data length is less than the read length! @map_svg_parser.cpp(193),ERROR" ID="0xcb54060a" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="malloc map node array faild! @map_svg_parser.cpp(198),ERROR" ID="0xcb540632" />
+ <MSG STRUCTURE="diag_log_msg1" NAME="memcpy_s map node array faild, nodeLen: 0x%x @map_svg_parser.cpp(205),ERROR" ID="0xcb54066a" />
+ <MSG STRUCTURE="diag_log_msg1" NAME="[%s] param error! @map_svg_parser.cpp(215),ERROR" ID="0xcb5406ba" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="malloc path style array faild! @map_svg_parser.cpp(222),ERROR" ID="0xcb5406f2" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="memcpy_s path style array faild @map_svg_parser.cpp(229),ERROR" ID="0xcb54072a" />
+ <MSG STRUCTURE="diag_log_msg1" NAME="[%s] param error! @map_svg_parser.cpp(242),ERROR" ID="0xcb540792" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="read path style faild.The data length is less than the read length! @map_svg_parser.cpp(248),ERROR" ID="0xcb5407c2" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="malloc path style array faild! @map_svg_parser.cpp(254),ERROR" ID="0xcb5407f2" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="memcpy_s path style array faild @map_svg_parser.cpp(261),ERROR" ID="0xcb54082a" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="Alloc buffer for buffer failed. @map_svg_parser.cpp(275),ERROR" ID="0xcb54089a" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="Alloc buffer for buffer failed. @map_svg_parser.cpp(284),ERROR" ID="0xcb5408e2" />
+ <MSG STRUCTURE="diag_log_msg1" NAME="[%s] param error! @map_svg_parser.cpp(295),ERROR" ID="0xcb54093a" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="malloc map path array faild! @map_svg_parser.cpp(302),ERROR" ID="0xcb540972" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="read map path array faild @map_svg_parser.cpp(312),ERROR" ID="0xcb5409c2" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="alloc path faild @map_svg_parser.cpp(319),ERROR" ID="0xcb5409fa" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="read path cmd faild @map_svg_parser.cpp(325),ERROR" ID="0xcb540a2a" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="read path data faild @map_svg_parser.cpp(331),ERROR" ID="0xcb540a5a" />
+ <MSG STRUCTURE="diag_log_msg1" NAME="[%s] param error! @map_svg_parser.cpp(342),ERROR" ID="0xcb540ab2" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="malloc map path array faild! @map_svg_parser.cpp(349),ERROR" ID="0xcb540aea" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="memcpy_s map path array faild @map_svg_parser.cpp(358),ERROR" ID="0xcb540b32" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="alloc path faild @map_svg_parser.cpp(368),ERROR" ID="0xcb540b82" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="memcpy_s path cmd faild @map_svg_parser.cpp(373),ERROR" ID="0xcb540baa" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="memcpy_s path data faild @map_svg_parser.cpp(380),ERROR" ID="0xcb540be2" />
+ <MSG STRUCTURE="diag_log_msg1" NAME="[%s] param error! @map_svg_parser.cpp(415),ERROR" ID="0xcb540cfa" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="malloc map path array faild! @map_svg_parser.cpp(422),ERROR" ID="0xcb540d32" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="read map text array faild @map_svg_parser.cpp(432),ERROR" ID="0xcb540d82" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="malloc map path cmd faild @map_svg_parser.cpp(439),ERROR" ID="0xcb540dba" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="read text faild @map_svg_parser.cpp(445),ERROR" ID="0xcb540dea" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="malloc text offset faild @map_svg_parser.cpp(453),ERROR" ID="0xcb540e2a" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="read text offset faild @map_svg_parser.cpp(459),ERROR" ID="0xcb540e5a" />
+ <MSG STRUCTURE="diag_log_msg1" NAME="[%s] param error! @map_svg_parser.cpp(470),ERROR" ID="0xcb540eb2" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="malloc map path array faild! @map_svg_parser.cpp(477),ERROR" ID="0xcb540eea" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="memcpy_s map text array faild @map_svg_parser.cpp(486),ERROR" ID="0xcb540f32" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="malloc map path cmd faild @map_svg_parser.cpp(495),ERROR" ID="0xcb540f7a" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="memcpy_s text faild @map_svg_parser.cpp(499),ERROR" ID="0xcb540f9a" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="malloc text offset faild @map_svg_parser.cpp(509),ERROR" ID="0xcb540fea" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="memcpy_s text offset faild @map_svg_parser.cpp(514),ERROR" ID="0xcb541012" />
+ <MSG STRUCTURE="diag_log_msg1" NAME="[%s] param error! @map_svg_parser.cpp(548),ERROR" ID="0xcb541122" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="malloc map path array faild! @map_svg_parser.cpp(555),ERROR" ID="0xcb54115a" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="read map image array faild @map_svg_parser.cpp(560),ERROR" ID="0xcb541182" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="malloc map path array faild! @map_svg_parser.cpp(568),ERROR" ID="0xcb5411c2" />
+ <MSG STRUCTURE="diag_log_msg1" NAME="[%s] param error! @map_svg_parser.cpp(597),ERROR" ID="0xcb5412aa" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="malloc map path array faild! @map_svg_parser.cpp(604),ERROR" ID="0xcb5412e2" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="memcpy_s map text array faild @map_svg_parser.cpp(609),ERROR" ID="0xcb54130a" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="malloc map path array faild! @map_svg_parser.cpp(617),ERROR" ID="0xcb54134a" />
+ <MSG STRUCTURE="diag_log_msg1" NAME="[%s] param error! @map_svg_parser.cpp(649),ERROR" ID="0xcb54144a" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="malloc map path array faild! @map_svg_parser.cpp(656),ERROR" ID="0xcb541482" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="read map road array faild @map_svg_parser.cpp(661),ERROR" ID="0xcb5414aa" />
+ <MSG STRUCTURE="diag_log_msg1" NAME="[%s] param error! @map_svg_parser.cpp(671),ERROR" ID="0xcb5414fa" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="malloc map path array faild! @map_svg_parser.cpp(678),ERROR" ID="0xcb541532" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="memcpy_s map text array faild @map_svg_parser.cpp(683),ERROR" ID="0xcb54155a" />
+ <MSG STRUCTURE="diag_log_msg1" NAME="[%s] param error! @map_svg_parser.cpp(702),ERROR" ID="0xcb5415f2" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="malloc map path array faild! @map_svg_parser.cpp(709),ERROR" ID="0xcb54162a" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="read map poi array faild @map_svg_parser.cpp(714),ERROR" ID="0xcb541652" />
+ <MSG STRUCTURE="diag_log_msg1" NAME="[%s] param error! @map_svg_parser.cpp(724),ERROR" ID="0xcb5416a2" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="malloc map path array faild! @map_svg_parser.cpp(731),ERROR" ID="0xcb5416da" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="memcpy_s map text array faild @map_svg_parser.cpp(736),ERROR" ID="0xcb541702" />
</MSG_LOG>
\ No newline at end of file
-<MSG_LOG><MSG STRUCTURE="diag_log_msg0" NAME="src is nullptr! @particle_cell.cpp(44),ERROR" ID="0xcb780162" />
- <MSG STRUCTURE="diag_log_msg0" NAME="memcpy imageInfo_ failed. @particle_cell.cpp(49),ERROR" ID="0xcb78018a" />
- <MSG STRUCTURE="diag_log_msg0" NAME="ABS(range) is out of range @particle_cell.cpp(116),INFO" ID="0xcb7803a5" />
- <MSG STRUCTURE="diag_log_msg0" NAME="Particle cell's parent should be UIParticleView! @particle_cell.cpp(257),ERROR" ID="0xcb78080a" />
+<MSG_LOG><MSG STRUCTURE="diag_log_msg0" NAME="src is nullptr! @particle_cell.cpp(44),ERROR" ID="0xcb7c0162" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="memcpy imageInfo_ failed. @particle_cell.cpp(49),ERROR" ID="0xcb7c018a" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="ABS(range) is out of range @particle_cell.cpp(116),INFO" ID="0xcb7c03a5" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="Particle cell's parent should be UIParticleView! @particle_cell.cpp(257),ERROR" ID="0xcb7c080a" />
</MSG_LOG>
\ No newline at end of file
<MSG STRUCTURE="diag_log_msg0" NAME="memcpy for data failed. @ui_canvas_ext.cpp(131),ERROR" ID="0xcaec041a" />
<MSG STRUCTURE="diag_log_msg0" NAME="can only set matrix after beginning any path. @ui_canvas_ext.cpp(145),ERROR" ID="0xcaec048a" />
<MSG STRUCTURE="diag_log_msg0" NAME="Index out of range. @ui_canvas_ext.cpp(153),ERROR" ID="0xcaec04ca" />
- <MSG STRUCTURE="diag_log_msg0" NAME="HandleStyleAndPattern failed. UpdateImageInfoIfNecessary failed. @ui_canvas_ext.cpp(274),ERROR" ID="0xcaec0892" />
- <MSG STRUCTURE="diag_log_msg0" NAME="Image is invalid! @ui_canvas_ext.cpp(340),ERROR" ID="0xcaec0aa2" />
- <MSG STRUCTURE="diag_log_msg0" NAME="path or paint or matrix is nullptr. @ui_canvas_ext.cpp(390),ERROR" ID="0xcaec0c32" />
- <MSG STRUCTURE="diag_log_msg0" NAME="Alloc buffer for cmd failed. @ui_canvas_ext.cpp(455),ERROR" ID="0xcaec0e3a" />
- <MSG STRUCTURE="diag_log_msg0" NAME="Alloc buffer for cmd failed. @ui_canvas_ext.cpp(492),ERROR" ID="0xcaec0f62" />
- <MSG STRUCTURE="diag_log_msg0" NAME="Alloc buffer for cmd failed. @ui_canvas_ext.cpp(526),ERROR" ID="0xcaec1072" />
- <MSG STRUCTURE="diag_log_msg0" NAME="Sector is not supported currently @ui_canvas_ext.cpp(542),WARNING" ID="0xcaec10f3" />
- <MSG STRUCTURE="diag_log_msg0" NAME="startAngle and endAngle can not be smaller than 0. @ui_canvas_ext.cpp(550),ERROR" ID="0xcaec1132" />
- <MSG STRUCTURE="diag_log_msg0" NAME="endAngle should not be equal to startAngle @ui_canvas_ext.cpp(554),ERROR" ID="0xcaec1152" />
- <MSG STRUCTURE="diag_log_msg1" NAME="realpath fail: %s @ui_canvas_ext.cpp(595),ERROR" ID="0xcaec129a" />
- <MSG STRUCTURE="diag_log_msg0" NAME="new svgdata obj failed @ui_canvas_ext.cpp(607),ERROR" ID="0xcaec12fa" />
- <MSG STRUCTURE="diag_log_msg0" NAME="OverlayOpacity Failed!!! @ui_canvas_ext.cpp(632),ERROR" ID="0xcaec13c2" />
- <MSG STRUCTURE="diag_log_msg0" NAME="can only set matrix after beginning any path. @ui_canvas_ext.cpp(719),ERROR" ID="0xcaec167a" />
- <MSG STRUCTURE="diag_log_msg0" NAME="index error @ui_canvas_ext.cpp(723),ERROR" ID="0xcaec169a" />
- <MSG STRUCTURE="diag_log_msg0" NAME="read data fail. @ui_canvas_ext.cpp(786),ERROR" ID="0xcaec1892" />
- <MSG STRUCTURE="diag_log_msg0" NAME="UIMalloc path fail. @ui_canvas_ext.cpp(804),ERROR" ID="0xcaec1922" />
- <MSG STRUCTURE="diag_log_msg0" NAME="UIMalloc path fail. @ui_canvas_ext.cpp(809),ERROR" ID="0xcaec194a" />
- <MSG STRUCTURE="diag_log_msg1" NAME="open %s fail @ui_canvas_ext.cpp(825),ERROR" ID="0xcaec19ca" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="HandleStyleAndPattern failed. UpdateImageInfoIfNecessary failed. @ui_canvas_ext.cpp(280),ERROR" ID="0xcaec08c2" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="Image is invalid! @ui_canvas_ext.cpp(346),ERROR" ID="0xcaec0ad2" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="path or paint or matrix is nullptr. @ui_canvas_ext.cpp(396),ERROR" ID="0xcaec0c62" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="Alloc buffer for cmd failed. @ui_canvas_ext.cpp(461),ERROR" ID="0xcaec0e6a" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="Alloc buffer for cmd failed. @ui_canvas_ext.cpp(498),ERROR" ID="0xcaec0f92" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="Alloc buffer for cmd failed. @ui_canvas_ext.cpp(532),ERROR" ID="0xcaec10a2" />
+ <MSG STRUCTURE="diag_log_msg1" NAME="realpath fail: %s @ui_canvas_ext.cpp(607),ERROR" ID="0xcaec12fa" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="new svgdata obj failed @ui_canvas_ext.cpp(619),ERROR" ID="0xcaec135a" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="OverlayOpacity Failed!!! @ui_canvas_ext.cpp(644),ERROR" ID="0xcaec1422" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="can only set matrix after beginning any path. @ui_canvas_ext.cpp(731),ERROR" ID="0xcaec16da" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="index error @ui_canvas_ext.cpp(735),ERROR" ID="0xcaec16fa" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="read data fail. @ui_canvas_ext.cpp(798),ERROR" ID="0xcaec18f2" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="UIMalloc path fail. @ui_canvas_ext.cpp(816),ERROR" ID="0xcaec1982" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="UIMalloc path fail. @ui_canvas_ext.cpp(821),ERROR" ID="0xcaec19aa" />
+ <MSG STRUCTURE="diag_log_msg1" NAME="open %s fail @ui_canvas_ext.cpp(837),ERROR" ID="0xcaec1a2a" />
</MSG_LOG>
\ No newline at end of file
-<MSG_LOG><MSG STRUCTURE="diag_log_msg0" NAME="add faild, Input parameter error. @ui_coverflow_view.cpp(97),ERROR" ID="0xcb44030a" />
- <MSG STRUCTURE="diag_log_msg0" NAME="remove faild, Input parameter error. @ui_coverflow_view.cpp(138),ERROR" ID="0xcb440452" />
- <MSG STRUCTURE="diag_log_msg0" NAME="UICoverflowView calls TYPE_THREE vibrator @ui_coverflow_view.cpp(339),INFO" ID="0xcb440a9d" />
- <MSG STRUCTURE="diag_log_msg0" NAME="UICoverflowView calls TYPE_ONE vibrator @ui_coverflow_view.cpp(342),INFO" ID="0xcb440ab5" />
+<MSG_LOG><MSG STRUCTURE="diag_log_msg0" NAME="add faild, Input parameter error. @ui_coverflow_view.cpp(96),ERROR" ID="0xcb460302" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="remove faild, Input parameter error. @ui_coverflow_view.cpp(137),ERROR" ID="0xcb46044a" />
</MSG_LOG>
\ No newline at end of file
-<MSG_LOG><MSG STRUCTURE="diag_log_msg0" NAME="add failed, view is nullptr @ui_coverflow_view2.cpp(53),ERROR" ID="0xcb4601aa" />
- <MSG STRUCTURE="diag_log_msg0" NAME="add failed, the view type is not support, only suppot UITransformGroup. @ui_coverflow_view2.cpp(58),ERROR" ID="0xcb4601d2" />
- <MSG STRUCTURE="diag_log_msg0" NAME="insert failed, view is nullptr @ui_coverflow_view2.cpp(76),ERROR" ID="0xcb460262" />
- <MSG STRUCTURE="diag_log_msg0" NAME="add failed, the view type is not support, only suppot UITransformGroup. @ui_coverflow_view2.cpp(81),ERROR" ID="0xcb46028a" />
- <MSG STRUCTURE="diag_log_msg0" NAME="remove failed, view is nullptr @ui_coverflow_view2.cpp(104),ERROR" ID="0xcb460342" />
- <MSG STRUCTURE="diag_log_msg0" NAME="remove failed, the view type is not support, only suppot UITransformGroup. @ui_coverflow_view2.cpp(109),ERROR" ID="0xcb46036a" />
- <MSG STRUCTURE="diag_log_msg0" NAME="remove failed, view parent is nullptr @ui_coverflow_view2.cpp(115),ERROR" ID="0xcb46039a" />
+<MSG_LOG><MSG STRUCTURE="diag_log_msg0" NAME="add failed, view is nullptr @ui_coverflow_view2.cpp(53),ERROR" ID="0xcb4801aa" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="add failed, the view type is not support, only suppot UITransformGroup. @ui_coverflow_view2.cpp(58),ERROR" ID="0xcb4801d2" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="insert failed, view is nullptr @ui_coverflow_view2.cpp(76),ERROR" ID="0xcb480262" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="add failed, the view type is not support, only suppot UITransformGroup. @ui_coverflow_view2.cpp(81),ERROR" ID="0xcb48028a" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="remove failed, view is nullptr @ui_coverflow_view2.cpp(104),ERROR" ID="0xcb480342" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="remove failed, the view type is not support, only suppot UITransformGroup. @ui_coverflow_view2.cpp(109),ERROR" ID="0xcb48036a" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="remove failed, view parent is nullptr @ui_coverflow_view2.cpp(115),ERROR" ID="0xcb48039a" />
</MSG_LOG>
\ No newline at end of file
--- /dev/null
+<MSG_LOG><MSG STRUCTURE="diag_log_msg0" NAME="Vertical current view is nullptr! @ui_cross_view.cpp(115),DBG" ID="0xcb4e039e" />
+ <MSG STRUCTURE="diag_log_msg1" NAME="vBlankIndex_ is invalid: %d, or vBlankView is nullptr @ui_cross_view.cpp(119),DBG" ID="0xcb4e03be" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="Horizontal current view is nullptr! @ui_cross_view.cpp(150),DBG" ID="0xcb4e04b6" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="horizontal current container is nullptr. @ui_cross_view.cpp(538),ERROR" ID="0xcb4e10d2" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="horizontal current page is nullptr or it is not coverable. @ui_cross_view.cpp(543),ERROR" ID="0xcb4e10fa" />
+ </MSG_LOG>
\ No newline at end of file
-<MSG_LOG><MSG STRUCTURE="diag_log_msg0" NAME="Can not add view other than UIImageView or UITransfromGroup. @ui_hexagons_list.cpp(73),ERROR" ID="0xcb36024a" />
- <MSG STRUCTURE="diag_log_msg0" NAME="insertView is nullptr! @ui_hexagons_list.cpp(92),ERROR" ID="0xcb3602e2" />
- <MSG STRUCTURE="diag_log_msg0" NAME="Can not insert view other than UIImageView or UITransfromGroup. @ui_hexagons_list.cpp(105),ERROR" ID="0xcb36034a" />
- <MSG STRUCTURE="diag_log_msg0" NAME="don't support scale when rebound mode is normal @ui_hexagons_list.cpp(230),ERROR" ID="0xcb360732" />
- <MSG STRUCTURE="diag_log_msg1" NAME="scale value %f is invalid @ui_hexagons_list.cpp(235),ERROR" ID="0xcb36075a" />
- <MSG STRUCTURE="diag_log_msg0" NAME="Scale coefficient is same, don't scale and invalidate item. @ui_hexagons_list.cpp(495),DBG" ID="0xcb360f7e" />
- <MSG STRUCTURE="diag_log_msg2" NAME="parameter is not valid, distance_:%u size:%d @ui_hexagons_list.cpp(638),ERROR" ID="0xcb3613f2" />
+<MSG_LOG><MSG STRUCTURE="diag_log_msg0" NAME="Can not add view other than UIImageView or UITransfromGroup. @ui_hexagons_list.cpp(73),ERROR" ID="0xcb38024a" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="insertView is nullptr! @ui_hexagons_list.cpp(92),ERROR" ID="0xcb3802e2" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="Can not insert view other than UIImageView or UITransfromGroup. @ui_hexagons_list.cpp(105),ERROR" ID="0xcb38034a" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="don't support scale when rebound mode is normal @ui_hexagons_list.cpp(230),ERROR" ID="0xcb380732" />
+ <MSG STRUCTURE="diag_log_msg1" NAME="scale value %f is invalid @ui_hexagons_list.cpp(235),ERROR" ID="0xcb38075a" />
+ <MSG STRUCTURE="diag_log_msg2" NAME="parameter is not valid, distance_: %u, size: %d @ui_hexagons_list.cpp(639),ERROR" ID="0xcb3813fa" />
</MSG_LOG>
\ No newline at end of file
-<MSG_LOG><MSG STRUCTURE="diag_log_msg0" NAME="A maximum of 20 records can be added. @ui_icosahedron_view.cpp(108),ERROR" ID="0xcb4c0362" />
+<MSG_LOG><MSG STRUCTURE="diag_log_msg0" NAME="A maximum of 20 records can be added. @ui_icosahedron_view.cpp(108),ERROR" ID="0xcb500362" />
</MSG_LOG>
\ No newline at end of file
-<MSG_LOG><MSG STRUCTURE="diag_log_msg0" NAME="buffer is nil @ui_kaleidoscope_view.cpp(46),ERROR" ID="0xcb400172" />
- <MSG STRUCTURE="diag_log_msg1" NAME="Fmt not support: %d @ui_kaleidoscope_view.cpp(55),ERROR" ID="0xcb4001ba" />
- <MSG STRUCTURE="diag_log_msg0" NAME="Init KaleidoscopeUtils failed. @ui_kaleidoscope_view.cpp(62),ERROR" ID="0xcb4001f2" />
+<MSG_LOG><MSG STRUCTURE="diag_log_msg0" NAME="buffer is nil @ui_kaleidoscope_view.cpp(46),ERROR" ID="0xcb420172" />
+ <MSG STRUCTURE="diag_log_msg1" NAME="Fmt not support: %d @ui_kaleidoscope_view.cpp(55),ERROR" ID="0xcb4201ba" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="Init KaleidoscopeUtils failed. @ui_kaleidoscope_view.cpp(62),ERROR" ID="0xcb4201f2" />
</MSG_LOG>
\ No newline at end of file
-<MSG_LOG><MSG STRUCTURE="diag_log_msg0" NAME="new TextExt failed @ui_label_button_ext.cpp(40),ERROR" ID="0xcaf20142" />
+<MSG_LOG><MSG STRUCTURE="diag_log_msg0" NAME="new TextExt failed @ui_label_button_ext.cpp(41),ERROR" ID="0xcaf2014a" />
</MSG_LOG>
\ No newline at end of file
-<MSG_LOG><MSG STRUCTURE="diag_log_msg0" NAME="pois_ malloc fail @ui_map_view.cpp(79),ERROR" ID="0xcb4e027a" />
- <MSG STRUCTURE="diag_log_msg0" NAME="roads_ malloc fail @ui_map_view.cpp(130),ERROR" ID="0xcb4e0412" />
+<MSG_LOG><MSG STRUCTURE="diag_log_msg0" NAME="pois_ malloc fail @ui_map_view.cpp(79),ERROR" ID="0xcb52027a" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="roads_ malloc fail @ui_map_view.cpp(130),ERROR" ID="0xcb520412" />
</MSG_LOG>
\ No newline at end of file
-<MSG_LOG><MSG STRUCTURE="diag_log_msg0" NAME="new ParticleCell failed. Return nullptr! @ui_particle_view.cpp(176),ERROR" ID="0xcb760582" />
+<MSG_LOG><MSG STRUCTURE="diag_log_msg0" NAME="new ParticleCell failed. Return nullptr! @ui_particle_view.cpp(176),ERROR" ID="0xcb7a0582" />
</MSG_LOG>
\ No newline at end of file
-<MSG_LOG><MSG STRUCTURE="diag_log_msg0" NAME="width and height can not set 0 @ui_roller_view.cpp(146),ERROR" ID="0xcb4a0492" />
- <MSG STRUCTURE="diag_log_msg0" NAME="RollerItemInfo is nullptr! @ui_roller_view.cpp(193),ERROR" ID="0xcb4a060a" />
- <MSG STRUCTURE="diag_log_msg0" NAME="Already add an item with the same name. Remove it before adding this. @ui_roller_view.cpp(237),ERROR" ID="0xcb4a076a" />
- <MSG STRUCTURE="diag_log_msg0" NAME="name is empty! @ui_roller_view.cpp(280),ERROR" ID="0xcb4a08c2" />
- <MSG STRUCTURE="diag_log_msg0" NAME="Should remove an item in DISPLAY mode @ui_roller_view.cpp(285),ERROR" ID="0xcb4a08ea" />
- <MSG STRUCTURE="diag_log_msg0" NAME="RollerItemInfo is null! @ui_roller_view.cpp(466),ERROR" ID="0xcb4a0e92" />
- <MSG STRUCTURE="diag_log_msg0" NAME="Cannot set align item when mode is about to change. @ui_roller_view.cpp(535),ERROR" ID="0xcb4a10ba" />
- <MSG STRUCTURE="diag_log_msg0" NAME="Should SetCurrentItem in DISPLAY mode. @ui_roller_view.cpp(539),ERROR" ID="0xcb4a10da" />
- <MSG STRUCTURE="diag_log_msg1" NAME="Cannot find an item with name: %s @ui_roller_view.cpp(554),ERROR" ID="0xcb4a1152" />
- <MSG STRUCTURE="diag_log_msg0" NAME="Cannot set mode when AlignAnim is running @ui_roller_view.cpp(649),ERROR" ID="0xcb4a144a" />
- <MSG STRUCTURE="diag_log_msg0" NAME="mode is already set. @ui_roller_view.cpp(654),ERROR" ID="0xcb4a1472" />
- <MSG STRUCTURE="diag_log_msg0" NAME="Cannot Set mode during transition or cannot set TRANSITION mode. @ui_roller_view.cpp(659),ERROR" ID="0xcb4a149a" />
+<MSG_LOG><MSG STRUCTURE="diag_log_msg0" NAME="width and height can not set 0 @ui_roller_view.cpp(147),ERROR" ID="0xcb4c049a" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="RollerItemInfo is nullptr! @ui_roller_view.cpp(194),ERROR" ID="0xcb4c0612" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="Already add an item with the same name. Remove it before adding this. @ui_roller_view.cpp(238),ERROR" ID="0xcb4c0772" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="name is empty! @ui_roller_view.cpp(281),ERROR" ID="0xcb4c08ca" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="Should remove an item in DISPLAY mode @ui_roller_view.cpp(286),ERROR" ID="0xcb4c08f2" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="RollerItemInfo is null! @ui_roller_view.cpp(467),ERROR" ID="0xcb4c0e9a" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="Cannot set align item when mode is about to change. @ui_roller_view.cpp(556),ERROR" ID="0xcb4c1162" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="Should SetCurrentItem in DISPLAY mode. @ui_roller_view.cpp(560),ERROR" ID="0xcb4c1182" />
+ <MSG STRUCTURE="diag_log_msg1" NAME="Cannot find an item with name: %s @ui_roller_view.cpp(575),ERROR" ID="0xcb4c11fa" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="Cannot set mode when AlignAnim is running @ui_roller_view.cpp(673),ERROR" ID="0xcb4c150a" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="mode is already set. @ui_roller_view.cpp(678),ERROR" ID="0xcb4c1532" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="Cannot Set mode during transition or cannot set TRANSITION mode. @ui_roller_view.cpp(683),ERROR" ID="0xcb4c155a" />
</MSG_LOG>
\ No newline at end of file
-<MSG_LOG><MSG STRUCTURE="diag_log_msg0" NAME="add failed, view is nullptr @ui_slipflow_view.cpp(60),ERROR" ID="0xcb4801e2" />
- <MSG STRUCTURE="diag_log_msg0" NAME="remove faild, Input parameter error. @ui_slipflow_view.cpp(135),ERROR" ID="0xcb48043a" />
+<MSG_LOG><MSG STRUCTURE="diag_log_msg0" NAME="add failed, view is nullptr @ui_slipflow_view.cpp(60),ERROR" ID="0xcb4a01e2" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="remove faild, Input parameter error. @ui_slipflow_view.cpp(135),ERROR" ID="0xcb4a043a" />
</MSG_LOG>
\ No newline at end of file
-<MSG_LOG><MSG STRUCTURE="diag_log_msg1" NAME="Failed to create the child control. The control of this [%d] cannot be copied. @ui_transform_group.cpp(35),WARNING" ID="0xcb64011b" />
- <MSG STRUCTURE="diag_log_msg1" NAME="add failed, the view type %d is not support @ui_transform_group.cpp(49),ERROR" ID="0xcb64018a" />
- <MSG STRUCTURE="diag_log_msg1" NAME="add failed, the view type %d is not support @ui_transform_group.cpp(63),ERROR" ID="0xcb6401fa" />
- <MSG STRUCTURE="diag_log_msg0" NAME="Cannot find target child! @ui_transform_group.cpp(103),ERROR" ID="0xcb64033a" />
+<MSG_LOG><MSG STRUCTURE="diag_log_msg1" NAME="Failed to create the child control. The control of this [%d] cannot be copied. @ui_transform_group.cpp(35),WARNING" ID="0xcb68011b" />
+ <MSG STRUCTURE="diag_log_msg1" NAME="add failed, the view type %d is not support @ui_transform_group.cpp(49),ERROR" ID="0xcb68018a" />
+ <MSG STRUCTURE="diag_log_msg1" NAME="add failed, the view type %d is not support @ui_transform_group.cpp(63),ERROR" ID="0xcb6801fa" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="Cannot find target child! @ui_transform_group.cpp(103),ERROR" ID="0xcb68033a" />
</MSG_LOG>
\ No newline at end of file
-<MSG_LOG><MSG STRUCTURE="diag_log_msg0" NAME="Can not add view other than UIImageView or UITransfromGroup. @ui_waterfall_list.cpp(55),ERROR" ID="0xcb3c01ba" />
- <MSG STRUCTURE="diag_log_msg0" NAME="insertView is nullptr! @ui_waterfall_list.cpp(74),ERROR" ID="0xcb3c0252" />
- <MSG STRUCTURE="diag_log_msg0" NAME="Can not insert view other than UIImageView or UITransfromGroup. @ui_waterfall_list.cpp(87),ERROR" ID="0xcb3c02ba" />
- <MSG STRUCTURE="diag_log_msg1" NAME="scale value %f is invalid @ui_waterfall_list.cpp(271),ERROR" ID="0xcb3c087a" />
- <MSG STRUCTURE="diag_log_msg2" NAME="parameter is not valid, distance_:%u size:%d @ui_waterfall_list.cpp(430),ERROR" ID="0xcb3c0d72" />
+<MSG_LOG><MSG STRUCTURE="diag_log_msg0" NAME="Can not add view other than UIImageView or UITransfromGroup. @ui_waterfall_list.cpp(54),ERROR" ID="0xcb3e01b2" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="insertView is nullptr! @ui_waterfall_list.cpp(73),ERROR" ID="0xcb3e024a" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="Can not insert view other than UIImageView or UITransfromGroup. @ui_waterfall_list.cpp(86),ERROR" ID="0xcb3e02b2" />
+ <MSG STRUCTURE="diag_log_msg1" NAME="scale value %f is invalid @ui_waterfall_list.cpp(281),ERROR" ID="0xcb3e08ca" />
+ <MSG STRUCTURE="diag_log_msg2" NAME="parameter is not valid, distance_: %u, size: %d @ui_waterfall_list.cpp(445),ERROR" ID="0xcb3e0dea" />
</MSG_LOG>
\ No newline at end of file
<MSG STRUCTURE="diag_log_msg1" NAME="[hifi]Call core_aenc_stop Failed, Error Code: [0x%08X] @core_msg_aenc.c(83),ERROR" ID="0x985c029a" />
<MSG STRUCTURE="diag_log_msg1" NAME="[hifi]Call core_aenc_get_attr Failed, Error Code: [0x%08X] @core_msg_aenc.c(100),ERROR" ID="0x985c0322" />
<MSG STRUCTURE="diag_log_msg1" NAME="[hifi]Error Code: [0x%08X] @core_msg_aenc.c(109),ERROR" ID="0x985c036a" />
- <MSG STRUCTURE="diag_log_msg1" NAME="[hifi]Call core_aenc_set_attr Failed, Error Code: [0x%08X] @core_msg_aenc.c(136),ERROR" ID="0x985c0442" />
- <MSG STRUCTURE="diag_log_msg1" NAME="[hifi]Call core_aenc_set_bypass Failed, Error Code: [0x%08X] @core_msg_aenc.c(158),ERROR" ID="0x985c04f2" />
- <MSG STRUCTURE="diag_log_msg1" NAME="[hifi]Call connector_open Failed, Error Code: [0x%08X] @core_msg_aenc.c(175),ERROR" ID="0x985c057a" />
- <MSG STRUCTURE="diag_log_msg1" NAME="[hifi]Call core_aenc_get_proc_info Failed, Error Code: [0x%08X] @core_msg_aenc.c(200),ERROR" ID="0x985c0642" />
- <MSG STRUCTURE="diag_log_msg1" NAME="[hifi]Call core_aenc_get_lib_type Failed, Error Code: [0x%08X] @core_msg_aenc.c(217),ERROR" ID="0x985c06ca" />
- <MSG STRUCTURE="diag_log_msg1" NAME="[hifi]Call core_aenc_set_param Failed, Error Code: [0x%08X] @core_msg_aenc.c(234),ERROR" ID="0x985c0752" />
- <MSG STRUCTURE="diag_log_msg1" NAME="[hifi]msg_data->cmd = %u @core_msg_aenc.c(261),ERROR" ID="0x985c082a" />
+ <MSG STRUCTURE="diag_log_msg1" NAME="[hifi]Call core_aenc_set_attr Failed, Error Code: [0x%08X] @core_msg_aenc.c(141),ERROR" ID="0x985c046a" />
+ <MSG STRUCTURE="diag_log_msg1" NAME="[hifi]Call core_aenc_set_bypass Failed, Error Code: [0x%08X] @core_msg_aenc.c(163),ERROR" ID="0x985c051a" />
+ <MSG STRUCTURE="diag_log_msg1" NAME="[hifi]Call connector_open Failed, Error Code: [0x%08X] @core_msg_aenc.c(180),ERROR" ID="0x985c05a2" />
+ <MSG STRUCTURE="diag_log_msg1" NAME="[hifi]Call core_aenc_get_proc_info Failed, Error Code: [0x%08X] @core_msg_aenc.c(205),ERROR" ID="0x985c066a" />
+ <MSG STRUCTURE="diag_log_msg1" NAME="[hifi]Call core_aenc_get_lib_type Failed, Error Code: [0x%08X] @core_msg_aenc.c(222),ERROR" ID="0x985c06f2" />
+ <MSG STRUCTURE="diag_log_msg1" NAME="[hifi]Call core_aenc_set_param Failed, Error Code: [0x%08X] @core_msg_aenc.c(239),ERROR" ID="0x985c077a" />
+ <MSG STRUCTURE="diag_log_msg1" NAME="[hifi]msg_data->cmd = %u @core_msg_aenc.c(266),ERROR" ID="0x985c0852" />
</MSG_LOG>
\ No newline at end of file
<MSG STRUCTURE="diag_log_msg4" NAME="[INFO][LLD]lld_rpa_init:init_filt_policy=0x%x,own_addr_type=0x%x,ral_ptr=0x%x, ral_en=0x%x @lld_rpa_ram.c(77),INFO" ID="0x8a4e026d" />
<MSG STRUCTURE="diag_log_msg0" NAME="DSP0 power off @pm_control.c(168),INFO" ID="0xa0560545" />
<MSG STRUCTURE="diag_log_msg2" NAME="[HFP][GetServiceInfo] connection_number=0x%x, status=0x%x @hfp_fsm_ram.c(292),INFO" ID="0x8be20925" />
- <MSG STRUCTURE="diag_log_msg2" NAME="[T%x][TIMEOUT]SLC NOT ESTABLISHED, TIMER=0x%x @hfp_fsm_ram.c(572),WARNING" ID="0x8be211e3" />
- <MSG STRUCTURE="diag_log_msg2" NAME="[T%x][TIMEOUT]RING OR DIAL, TIMER=0x%x @hfp_fsm_ram.c(578),WARNING" ID="0x8be21213" />
- <MSG STRUCTURE="diag_log_msg3" NAME="[T%x][TIMEOUT]AT CMD, LAST_CMD=0x%x, TIMER=0x%x @hfp_fsm_ram.c(583),WARNING" ID="0x8be2123b" />
+ <MSG STRUCTURE="diag_log_msg2" NAME="[T%x][TIMEOUT]SLC NOT ESTABLISHED, TIMER=0x%x @hfp_fsm_ram.c(573),WARNING" ID="0x8be211eb" />
+ <MSG STRUCTURE="diag_log_msg2" NAME="[T%x][TIMEOUT]RING OR DIAL, TIMER=0x%x @hfp_fsm_ram.c(579),WARNING" ID="0x8be2121b" />
+ <MSG STRUCTURE="diag_log_msg3" NAME="[T%x][TIMEOUT]AT CMD, LAST_CMD=0x%x, TIMER=0x%x @hfp_fsm_ram.c(584),WARNING" ID="0x8be21243" />
<MSG STRUCTURE="diag_log_msg0" NAME="[WARNING][LLM]llm_per_adv_create_sync is pending or starting @llm_per.c(93),WARNING" ID="0x898602eb" />
<MSG STRUCTURE="diag_log_msg4" NAME="[LLD][INFO]lld_a2dp_sco_20dbm_check:conhdl=0x%x, txpwrlev=0x%x, ackrate=%d, last_rssi_delta=%d @lld_pwr_ctrl.c(285),INFO" ID="0x89ee08ed" />
<MSG STRUCTURE="diag_log_msg2" NAME="[LLD][INFO]lld_a2dp_sco_20dbm_check:reason_20dbm=0x%x, locper=%d @lld_pwr_ctrl.c(288),INFO" ID="0x89ee0905" />
<MSG STRUCTURE="diag_log_msg2" NAME="[INFO][LLC]llc_channel_map_instant_exec:dummy=%d,opcode=%d @llc_llcp.c(3663),INFO" ID="0x8838727d" />
<MSG STRUCTURE="diag_log_msg0" NAME="[WARNING][LLC]llcp_channel_map_req_handler:llc_env_ptr is null @llc_llcp.c(3693),WARNING" ID="0x8838736b" />
<MSG STRUCTURE="diag_log_msg0" NAME="smp_pair_new_patch @patch_bth.c(52),INFO" ID="0x8d5401a5" />
- <MSG STRUCTURE="diag_log_msg0" NAME="[AVDTP][GET_SEP_FAIL] Can not get sep info @patch_bth.c(156),WARNING" ID="0x8d5404e3" />
- <MSG STRUCTURE="diag_log_msg0" NAME="[STACK][RECV_RING_STOP] @patch_bth.c(244),INFO" ID="0x8d5407a5" />
- <MSG STRUCTURE="diag_log_msg3" NAME="[ATT_GATT] att error rsp opcode:0x%x handle:%d error:0x%x @patch_bth.c(277),ERROR" ID="0x8d5408aa" />
- <MSG STRUCTURE="diag_log_msg0" NAME="[SMP]PAIRING_REQ_RECV @patch_bth.c(506),ERROR" ID="0x8d540fd2" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="[AVDTP][GET_SEP_FAIL] Can not get sep info @patch_bth.c(157),WARNING" ID="0x8d5404eb" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="[STACK][RECV_RING_STOP] @patch_bth.c(245),INFO" ID="0x8d5407ad" />
+ <MSG STRUCTURE="diag_log_msg3" NAME="[ATT_GATT] att error rsp opcode:0x%x handle:%d error:0x%x @patch_bth.c(278),ERROR" ID="0x8d5408b2" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="[SMP]PAIRING_REQ_RECV @patch_bth.c(507),ERROR" ID="0x8d540fda" />
<MSG STRUCTURE="diag_log_msg1" NAME="ble add ble white list fail: %d @bt_mpc_adpt_gap.c(53),ERROR" ID="0x8dd401aa" />
<MSG STRUCTURE="diag_log_msg1" NAME="ble add ble white list params err! len = %d @bt_mpc_adpt_gap.c(57),ERROR" ID="0x8dd401ca" />
<MSG STRUCTURE="diag_log_msg1" NAME="ble remove all ble white list fail: %d @bt_mpc_adpt_gap.c(72),ERROR" ID="0x8dd40242" />
<MSG STRUCTURE="diag_log_msg1" NAME="bt mpc read remote rssi: %d @bt_mpc_adpt_gap.c(524),ERROR" ID="0x8dd41062" />
<MSG STRUCTURE="diag_log_msg1" NAME="bt mpc read remote rssi err! len = %d @bt_mpc_adpt_gap.c(527),ERROR" ID="0x8dd4107a" />
<MSG STRUCTURE="diag_log_msg0" NAME="[ECC]release semaphore fail @ecc_p256.c(1857),INFO" ID="0x89463a0d" />
- <MSG STRUCTURE="diag_log_msg4" NAME="[HCI] remove remote exceed upper limit %d addr:%02x:%02x:xx:xx:xx:%02x! @hci_hlp_ram.c(524),ERROR" ID="0x8ba81062" />
- <MSG STRUCTURE="diag_log_msg0" NAME="[HCI]memcpy_s error @hci_hlp_ram.c(544),ERROR" ID="0x8ba81102" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="[HCI] hci_merged_remote_node! @hci_hlp_ram.c(392),ERROR" ID="0x8ba80c42" />
+ <MSG STRUCTURE="diag_log_msg4" NAME="[HCI] remove remote exceed upper limit %d addr:%02x:%02x:xx:xx:xx:%02x! @hci_hlp_ram.c(555),ERROR" ID="0x8ba8115a" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="[HCI]memcpy_s error @hci_hlp_ram.c(575),ERROR" ID="0x8ba811fa" />
<MSG STRUCTURE="diag_log_msg1" NAME="rx_phy is %d @patch_llc.c(19),INFO" ID="0x8a5e009d" />
<MSG STRUCTURE="diag_log_msg0" NAME="[ATT]memcpy_s error @att_reserve.c(141),ERROR" ID="0x8dee046a" />
<MSG STRUCTURE="diag_log_msg1" NAME="[productline cali]productline_cali_start_tx, freq=%d, @bt_productline.c(41),INFO" ID="0x88fc014d" />
<MSG STRUCTURE="diag_log_msg0" NAME="[ERROR][CTE]llcp_cte_req_handler: LLCP_CTE_REQ Received! But current version software DO NOT support this feature. @llc_llcp_ram.c(636),ERROR" ID="0x896613e2" />
<MSG STRUCTURE="diag_log_msg0" NAME="[ERROR][CTE]llcp_cte_rsp_handler: LLCP_SUPP_RSP Received! But current version software DO NOT support this feature. @llc_llcp_ram.c(700),ERROR" ID="0x896615e2" />
<MSG STRUCTURE="diag_log_msg0" NAME="[GAP][to_expire] wait_handle2 to_expire @hdlmgnt.c(428),INFO" ID="0x8ac80d65" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="[HFP]hfp_ag_bcs: HFP_AG_WAIT4_BCSCMD not set, ignore this command. @hfp_ag_ram.c(1154),ERROR" ID="0x8d7a2412" />
<MSG STRUCTURE="diag_log_msg1" NAME="[HCI]CURRENT_LINK_MODE=0x%x, ACL Data Will be pend! @hci_link_br.c(220),INFO" ID="0x8bdc06e5" />
<MSG STRUCTURE="diag_log_msg3" NAME="[HCI] create connection addr:%02x******%02x%02x @hci_link_br.c(260),ERROR" ID="0x8bdc0822" />
<MSG STRUCTURE="diag_log_msg3" NAME="[HCI][CONN_COMPLETE] LINK_STATUS=0x%x, EVENT_STATUS=0x%x, CONN_HDL=0x%x @hci_link_br.c(497),ERROR" ID="0x8bdc0f8a" />
<MSG STRUCTURE="diag_log_msg2" NAME="[BTH][QOS]release ipc:%u fsm_tx:%u. @sdk_hlp.c(129),ERROR" ID="0x8b7a040a" />
<MSG STRUCTURE="diag_log_msg2" NAME="[BTH][QOS]release hci_rx:%u hci_qos:%u. @sdk_hlp.c(130),ERROR" ID="0x8b7a0412" />
<MSG STRUCTURE="diag_log_msg3" NAME="[SDK][GAP] CTKD BR link key report, addr=0x%02x:**:**:**:0x%02x:0x%02x @sdk_hlp.c(906),WARNING" ID="0x8b7a1c53" />
- <MSG STRUCTURE="diag_log_msg1" NAME="[SDK][GAP] paired phone exist, dev_handle=0x%x @sdk_hlp.c(912),WARNING" ID="0x8b7a1c83" />
- <MSG STRUCTURE="diag_log_msg1" NAME="hlp_link_key_req_cbk no source addr:0x%x @sdk_hlp.c(1007),INFO" ID="0x8b7a1f7d" />
- <MSG STRUCTURE="diag_log_msg2" NAME="hlp_connection_ev_cbk_dis_conn hdl:0x%x status:%d @sdk_hlp.c(2162),INFO" ID="0x8b7a4395" />
- <MSG STRUCTURE="diag_log_msg3" NAME="[SDK] connect event cbk connected: %d, reason: %d link_type:%d! @sdk_hlp.c(2184),ERROR" ID="0x8b7a4442" />
- <MSG STRUCTURE="diag_log_msg4" NAME="[SDK] connect event cbk cap:%d addr:%02x******%02x%02x @sdk_hlp.c(2199),ERROR" ID="0x8b7a44ba" />
- <MSG STRUCTURE="diag_log_msg2" NAME="[SDK] connect event cbk status:%d dev_hdl:0x%x @sdk_hlp.c(2202),ERROR" ID="0x8b7a44d2" />
+ <MSG STRUCTURE="diag_log_msg1" NAME="[SDK][GAP] paired phone exist, dev_handle=0x%x @sdk_hlp.c(913),WARNING" ID="0x8b7a1c8b" />
+ <MSG STRUCTURE="diag_log_msg1" NAME="hlp_link_key_req_cbk no source addr:0x%x @sdk_hlp.c(1012),INFO" ID="0x8b7a1fa5" />
+ <MSG STRUCTURE="diag_log_msg2" NAME="hlp_connection_ev_cbk_dis_conn hdl:0x%x status:%d @sdk_hlp.c(2167),INFO" ID="0x8b7a43bd" />
+ <MSG STRUCTURE="diag_log_msg3" NAME="[SDK] connect event cbk connected: %d, reason: %d link_type:%d! @sdk_hlp.c(2189),ERROR" ID="0x8b7a446a" />
+ <MSG STRUCTURE="diag_log_msg4" NAME="[SDK] connect event cbk cap:%d addr:%02x******%02x%02x @sdk_hlp.c(2204),ERROR" ID="0x8b7a44e2" />
+ <MSG STRUCTURE="diag_log_msg2" NAME="[SDK] connect event cbk status:%d dev_hdl:0x%x @sdk_hlp.c(2207),ERROR" ID="0x8b7a44fa" />
<MSG STRUCTURE="diag_log_msg0" NAME="gdk message post, failed retry later. @gdk_msg.c(46),ERROR" ID="0x8cb40172" />
<MSG STRUCTURE="diag_log_msg0" NAME="gdk message timer cback @gdk_msg.c(74),DBG" ID="0x8cb40256" />
<MSG STRUCTURE="diag_log_msg2" NAME="gdk message add itor_msgid:0x%x, itor_ts:0x%lld @gdk_msg.c(107),DBG" ID="0x8cb4035e" />
<MSG STRUCTURE="diag_log_msg0" NAME="[WARNING][LLD]lld_ext_create_con_req_opt:2m fail @lld_con.c(1218),WARNING" ID="0x89702613" />
<MSG STRUCTURE="diag_log_msg0" NAME="[WARNING][LLD]lld_ext_create_con_req_opt:coded fail @lld_con.c(1232),WARNING" ID="0x89702683" />
<MSG STRUCTURE="diag_log_msg3" NAME="[INFO][LLD]lld_ext_con_start_by_phy_opt:elt_scan=0x%x, elt_connect=0x%x, aux_init_elt=0x%x @lld_con.c(1323),INFO" ID="0x8970295d" />
- <MSG STRUCTURE="diag_log_msg1" NAME="btsdk get remote device address failed! dev_hdl = 0x%x @bt_ahi_common.c(97),ERROR" ID="0x8c9e030a" />
- <MSG STRUCTURE="diag_log_msg1" NAME="btsrv passkey req ind callback dev_hdl = 0x%x @bt_ahi_common.c(162),INFO" ID="0x8c9e0515" />
+ <MSG STRUCTURE="diag_log_msg1" NAME="get remote device address failed! dev_hdl = 0x%x @bt_ahi_common.c(92),ERROR" ID="0x8c9e02e2" />
+ <MSG STRUCTURE="diag_log_msg1" NAME="btsdk get remote device address failed! dev_hdl = 0x%x @bt_ahi_common.c(109),ERROR" ID="0x8c9e036a" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="remote device address copy failed! @bt_ahi_common.c(122),ERROR" ID="0x8c9e03d2" />
+ <MSG STRUCTURE="diag_log_msg1" NAME="btsrv passkey req ind callback dev_hdl = 0x%x @bt_ahi_common.c(185),INFO" ID="0x8c9e05cd" />
<MSG STRUCTURE="diag_log_msg4" NAME="[INFO][LLD]lld_bis_elt_ready:elt=0x%x,elt_ts=0x%x,intv=%d,duration_min=%d @patch_lld_bis.c(46),INFO" ID="0x8a5a0175" />
<MSG STRUCTURE="diag_log_msg2" NAME="[INFO]hci_dbg_meta_evt_pkupk:in=%d,*in=%d @hci_msg.c(1958),INFO" ID="0x88d03d35" />
<MSG STRUCTURE="diag_log_msg3" NAME="[LOW_POWER]des is error ,des:0x%x,%s,%d @hal_cpu_hifi.c(69),INFO" ID="0xa028022d" />
-<MSG_LOG><MSG STRUCTURE="diag_log_msg1" NAME="btsdk get remote device address failed! dev_hdl = 0x%x @bt_ahi_common.c(97),ERROR" ID="0x8c9e030a" />
- <MSG STRUCTURE="diag_log_msg1" NAME="btsrv passkey req ind callback dev_hdl = 0x%x @bt_ahi_common.c(162),INFO" ID="0x8c9e0515" />
+<MSG_LOG><MSG STRUCTURE="diag_log_msg1" NAME="get remote device address failed! dev_hdl = 0x%x @bt_ahi_common.c(92),ERROR" ID="0x8c9e02e2" />
+ <MSG STRUCTURE="diag_log_msg1" NAME="btsdk get remote device address failed! dev_hdl = 0x%x @bt_ahi_common.c(109),ERROR" ID="0x8c9e036a" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="remote device address copy failed! @bt_ahi_common.c(122),ERROR" ID="0x8c9e03d2" />
+ <MSG STRUCTURE="diag_log_msg1" NAME="btsrv passkey req ind callback dev_hdl = 0x%x @bt_ahi_common.c(185),INFO" ID="0x8c9e05cd" />
</MSG_LOG>
\ No newline at end of file
-<MSG_LOG><MSG STRUCTURE="diag_log_msg4" NAME="[HCI] remove remote exceed upper limit %d addr:%02x:%02x:xx:xx:xx:%02x! @hci_hlp_ram.c(524),ERROR" ID="0x8ba81062" />
- <MSG STRUCTURE="diag_log_msg0" NAME="[HCI]memcpy_s error @hci_hlp_ram.c(544),ERROR" ID="0x8ba81102" />
+<MSG_LOG><MSG STRUCTURE="diag_log_msg0" NAME="[HCI] hci_merged_remote_node! @hci_hlp_ram.c(392),ERROR" ID="0x8ba80c42" />
+ <MSG STRUCTURE="diag_log_msg4" NAME="[HCI] remove remote exceed upper limit %d addr:%02x:%02x:xx:xx:xx:%02x! @hci_hlp_ram.c(555),ERROR" ID="0x8ba8115a" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="[HCI]memcpy_s error @hci_hlp_ram.c(575),ERROR" ID="0x8ba811fa" />
</MSG_LOG>
\ No newline at end of file
--- /dev/null
+<MSG_LOG><MSG STRUCTURE="diag_log_msg0" NAME="[HFP]hfp_ag_bcs: HFP_AG_WAIT4_BCSCMD not set, ignore this command. @hfp_ag_ram.c(1154),ERROR" ID="0x8d7a2412" />
+ </MSG_LOG>
\ No newline at end of file
<MSG_LOG><MSG STRUCTURE="diag_log_msg2" NAME="[HFP][GetServiceInfo] connection_number=0x%x, status=0x%x @hfp_fsm_ram.c(292),INFO" ID="0x8be20925" />
- <MSG STRUCTURE="diag_log_msg2" NAME="[T%x][TIMEOUT]SLC NOT ESTABLISHED, TIMER=0x%x @hfp_fsm_ram.c(572),WARNING" ID="0x8be211e3" />
- <MSG STRUCTURE="diag_log_msg2" NAME="[T%x][TIMEOUT]RING OR DIAL, TIMER=0x%x @hfp_fsm_ram.c(578),WARNING" ID="0x8be21213" />
- <MSG STRUCTURE="diag_log_msg3" NAME="[T%x][TIMEOUT]AT CMD, LAST_CMD=0x%x, TIMER=0x%x @hfp_fsm_ram.c(583),WARNING" ID="0x8be2123b" />
+ <MSG STRUCTURE="diag_log_msg2" NAME="[T%x][TIMEOUT]SLC NOT ESTABLISHED, TIMER=0x%x @hfp_fsm_ram.c(573),WARNING" ID="0x8be211eb" />
+ <MSG STRUCTURE="diag_log_msg2" NAME="[T%x][TIMEOUT]RING OR DIAL, TIMER=0x%x @hfp_fsm_ram.c(579),WARNING" ID="0x8be2121b" />
+ <MSG STRUCTURE="diag_log_msg3" NAME="[T%x][TIMEOUT]AT CMD, LAST_CMD=0x%x, TIMER=0x%x @hfp_fsm_ram.c(584),WARNING" ID="0x8be21243" />
</MSG_LOG>
\ No newline at end of file
<MSG_LOG><MSG STRUCTURE="diag_log_msg0" NAME="smp_pair_new_patch @patch_bth.c(52),INFO" ID="0x8d5401a5" />
- <MSG STRUCTURE="diag_log_msg0" NAME="[AVDTP][GET_SEP_FAIL] Can not get sep info @patch_bth.c(156),WARNING" ID="0x8d5404e3" />
- <MSG STRUCTURE="diag_log_msg0" NAME="[STACK][RECV_RING_STOP] @patch_bth.c(244),INFO" ID="0x8d5407a5" />
- <MSG STRUCTURE="diag_log_msg3" NAME="[ATT_GATT] att error rsp opcode:0x%x handle:%d error:0x%x @patch_bth.c(277),ERROR" ID="0x8d5408aa" />
- <MSG STRUCTURE="diag_log_msg0" NAME="[SMP]PAIRING_REQ_RECV @patch_bth.c(506),ERROR" ID="0x8d540fd2" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="[AVDTP][GET_SEP_FAIL] Can not get sep info @patch_bth.c(157),WARNING" ID="0x8d5404eb" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="[STACK][RECV_RING_STOP] @patch_bth.c(245),INFO" ID="0x8d5407ad" />
+ <MSG STRUCTURE="diag_log_msg3" NAME="[ATT_GATT] att error rsp opcode:0x%x handle:%d error:0x%x @patch_bth.c(278),ERROR" ID="0x8d5408b2" />
+ <MSG STRUCTURE="diag_log_msg0" NAME="[SMP]PAIRING_REQ_RECV @patch_bth.c(507),ERROR" ID="0x8d540fda" />
</MSG_LOG>
\ No newline at end of file
<MSG STRUCTURE="diag_log_msg2" NAME="[BTH][QOS]release ipc:%u fsm_tx:%u. @sdk_hlp.c(129),ERROR" ID="0x8b7a040a" />
<MSG STRUCTURE="diag_log_msg2" NAME="[BTH][QOS]release hci_rx:%u hci_qos:%u. @sdk_hlp.c(130),ERROR" ID="0x8b7a0412" />
<MSG STRUCTURE="diag_log_msg3" NAME="[SDK][GAP] CTKD BR link key report, addr=0x%02x:**:**:**:0x%02x:0x%02x @sdk_hlp.c(906),WARNING" ID="0x8b7a1c53" />
- <MSG STRUCTURE="diag_log_msg1" NAME="[SDK][GAP] paired phone exist, dev_handle=0x%x @sdk_hlp.c(912),WARNING" ID="0x8b7a1c83" />
- <MSG STRUCTURE="diag_log_msg1" NAME="hlp_link_key_req_cbk no source addr:0x%x @sdk_hlp.c(1007),INFO" ID="0x8b7a1f7d" />
- <MSG STRUCTURE="diag_log_msg2" NAME="hlp_connection_ev_cbk_dis_conn hdl:0x%x status:%d @sdk_hlp.c(2162),INFO" ID="0x8b7a4395" />
- <MSG STRUCTURE="diag_log_msg3" NAME="[SDK] connect event cbk connected: %d, reason: %d link_type:%d! @sdk_hlp.c(2184),ERROR" ID="0x8b7a4442" />
- <MSG STRUCTURE="diag_log_msg4" NAME="[SDK] connect event cbk cap:%d addr:%02x******%02x%02x @sdk_hlp.c(2199),ERROR" ID="0x8b7a44ba" />
- <MSG STRUCTURE="diag_log_msg2" NAME="[SDK] connect event cbk status:%d dev_hdl:0x%x @sdk_hlp.c(2202),ERROR" ID="0x8b7a44d2" />
+ <MSG STRUCTURE="diag_log_msg1" NAME="[SDK][GAP] paired phone exist, dev_handle=0x%x @sdk_hlp.c(913),WARNING" ID="0x8b7a1c8b" />
+ <MSG STRUCTURE="diag_log_msg1" NAME="hlp_link_key_req_cbk no source addr:0x%x @sdk_hlp.c(1012),INFO" ID="0x8b7a1fa5" />
+ <MSG STRUCTURE="diag_log_msg2" NAME="hlp_connection_ev_cbk_dis_conn hdl:0x%x status:%d @sdk_hlp.c(2167),INFO" ID="0x8b7a43bd" />
+ <MSG STRUCTURE="diag_log_msg3" NAME="[SDK] connect event cbk connected: %d, reason: %d link_type:%d! @sdk_hlp.c(2189),ERROR" ID="0x8b7a446a" />
+ <MSG STRUCTURE="diag_log_msg4" NAME="[SDK] connect event cbk cap:%d addr:%02x******%02x%02x @sdk_hlp.c(2204),ERROR" ID="0x8b7a44e2" />
+ <MSG STRUCTURE="diag_log_msg2" NAME="[SDK] connect event cbk status:%d dev_hdl:0x%x @sdk_hlp.c(2207),ERROR" ID="0x8b7a44fa" />
</MSG_LOG>
\ No newline at end of file
#endif /* __cplusplus */
#endif /* __cplusplus */
+#ifndef EMMC_BOARD_DEBUG_ON
#define EMMC_BOARD_DEBUG_ON 0
+#endif
#define MAX_MMC_NUM 2
${CMAKE_CURRENT_SOURCE_DIR}/src/${src_sub}/osal_device.c
${CMAKE_CURRENT_SOURCE_DIR}/src/${src_sub}/osal_drvbox.c
${CMAKE_CURRENT_SOURCE_DIR}/src/${src_sub}/osal_event.c
- # ${CMAKE_CURRENT_SOURCE_DIR}/src/${src_sub}/osal_fileops.c
+ ${CMAKE_CURRENT_SOURCE_DIR}/src/${src_sub}/osal_fileops.c
${CMAKE_CURRENT_SOURCE_DIR}/src/${src_sub}/osal_interrupt.c
# ${CMAKE_CURRENT_SOURCE_DIR}/src/${src_sub}/osal_math.c
${CMAKE_CURRENT_SOURCE_DIR}/src/${src_sub}/osal_msgqueue.c
--- /dev/null
+/*
+ * Copyright (c) CompanyNameMagicTag 2021-2022. All rights reserved.
+ */
+
+#include <FreeRTOS.h>
+#include <fcntl.h>
+#include <fs/fs.h>
+#include <fs/file.h>
+#include <unistd.h>
+#include <portable.h>
+
+#include "soc_osal.h"
+#include "osal_inner.h"
+
+void *osal_klib_fopen(const char *filename, int flags, int mode)
+{
+ int *filp = NULL;
+ int fd = open(filename, flags, mode);
+ if (fd < 0) {
+ osal_log("open failed! fd = %d, errno = %d\n", fd, get_errno());
+ return NULL;
+ } else {
+ filp = (int *)pvPortMalloc(sizeof(int));
+ if (filp == NULL) {
+ osal_log("pvPortMalloc failed!\n");
+ close(fd);
+ return NULL;
+ }
+ *filp = fd;
+ }
+ return (void *)filp;
+}
+
+void osal_klib_fclose(void *filp)
+{
+ if (filp == NULL) {
+ osal_log("parameter invalid!\n");
+ return;
+ }
+ close(*(int *)filp);
+ vPortFree(filp);
+}
+
+int osal_klib_fwrite(const char *buf, unsigned long size, void *filp)
+{
+ if (filp == NULL) {
+ osal_log("parameter invalid!\n");
+ return OSAL_FAILURE;
+ }
+ return write(*(int *)filp, buf, size);
+}
+
+int osal_klib_fread(char *buf, unsigned long size, void *filp)
+{
+ if (filp == NULL) {
+ osal_log("parameter invalid!\n");
+ return OSAL_FAILURE;
+ }
+ return read(*(int *)filp, buf, size);
+}
+
+int osal_klib_fseek(long long offset, int whence, void *filp)
+{
+ int ret;
+ off_t res;
+ if (filp == NULL || offset > INT32_MAX) {
+ osal_log("parameter invalid!\n");
+ return OSAL_FAILURE;
+ }
+ res = lseek(*(int *)filp, (off_t)offset, whence);
+ ret = (int)res;
+ if (res != (off_t)ret) {
+ ret = OSAL_EOVERFLOW;
+ }
+ return ret;
+}
\ No newline at end of file
#include "errcode.h"\r
#include "diag.h"\r
\r
-#define NV_AUDIO_VQE_PARAM_SIZE 48\r
+#define NV_AUDIO_VQE_PARAM_SIZE 53\r
\r
typedef struct {\r
uint32_t size;\r
IMAGE_CACHE_MANAGER_CPP,
DISPLAY_VAU_C,
DISPLAY_GRALLOC_C,
+ DISPLAY_GMMU_C,
MEM_POOL_LOS_C,
DISPLAY_LAYER_C,
CUBE_ROTATE_VIEW_CPP,
UI_COVERFLOW_VIEW2_CPP,
UI_SLIPFLOW_VIEW_CPP,
UI_ROLLER_VIEW_CPP,
+ UI_CROSS_VIEW_CPP,
UI_ICOSAHEDRON_VIEW_CPP,
UI_MAP_VIEW_CPP,
MAP_SVG_PARSER_CPP,
UI_LIST_NESTED_CPP,
UI_PARTICLE_VIEW_CPP,
PARTICLE_CELL_CPP,
+ VIDEOCARD_CPP,
+ DIALBINPARSERV3_CPP,
+ DIALTIMEPUBLISHER_CPP,
+ DIALSEQUENCECONTAINER_CPP,
+ WATCHINTERFACE_CPP,
FILE_ID_MAX = 1024,
} log_file_list_enum_gui_t;
#endif
/* gpu cmd [0xa0, 0xaf] */\r
#define DIAG_CMD_GPU_VAU_PROC diag_cmd_id_comb(0xa0)\r
#define DIAG_CMD_GPU_DPU_PROC diag_cmd_id_comb(0xa1)\r
-#define DIAG_CMD_GPU_GMMU_PROC diag_cmd_id_comb(0xa2)\r
#define DIAG_CMD_GPU_JPEG_PROC diag_cmd_id_comb(0xa3)\r
#define DIAG_CMD_GPU_DPU_PRINT diag_cmd_id_comb(0xa4)\r
\r
#include "sys/stat.h"
#include "fcntl.h"
#include "unistd.h"
+#include "stdio.h"
+#if defined(BUILD_APPLICATION_STANDARD) && !defined(BUILD_RECOVERY_IMAGE)
+#include "diag_filter.h"
+#endif
#define STATUS_ADDRESS 0x5702C1E8
#define VBUS_INSERT_POS 4
#define PWREN_PRESS_POS 3
+#define B_IS_WAKE_UP_REG 0x57000500
+#define B_MAINTENANCE_1 0x59008500
+#define B_MAINTENANCE_2 0x570007a4
+#define B_MAINTENANCE_3 0x570007a0
+#define B_MAINTENANCE_PC_L 0x570007a8
+#define B_MAINTENANCE_PC_H 0x570007ac
bool is_first_power_on(void)
{
return -1;
}
return len;
+}
+
+void config_maintenance_b_function(void)
+{
+#if defined(BUILD_APPLICATION_STANDARD) && !defined(BUILD_RECOVERY_IMAGE)
+ diag_highest_level_proc(2);
+ while(readw(B_IS_WAKE_UP_REG) != 0) {
+ diag_highest_level_proc(2);
+ }
+ writew(B_MAINTENANCE_1,1);
+ uint8_t before = readb(B_MAINTENANCE_2);
+ before = before | 0x1;
+ writeb(B_MAINTENANCE_2, before);
+ printf("0x59008500 %x \r\n", readw(B_MAINTENANCE_1));
+ printf("0x570007a4 %x \r\n", readw(B_MAINTENANCE_2));
+ printf("0x570007a0 %x \r\n", readw(B_MAINTENANCE_3));
+ printf("0x570007a8 =%x,0x570007ac =%x \r\n", readw(0x570007a8), readw(0x570007ac));
+#endif
}
\ No newline at end of file
* @return write length
*/
int32_t write_fileinfo(const char *path, uint32_t offset, const uint8_t *buf, uint32_t size);
+
+/**
+ * @brief Configure B-core maintenance function
+ * @return null
+ */
+void config_maintenance_b_function(void);
#endif
#include "chip_system_time.h"
-#define SECONDS_PER_MINUTE 60 /* second per minute */
-#define MINUTES_PER_HOUR 60 /* second per minute */
-#define MSEC_PER_SEC 1000
-#define USEC_PER_MSEC 1000
-#define TZ_ADDRESS 0x5702C014
-#define MAX_TIMEZONE_HOURS 24
-#define TIME_MAX 64
+#define SECONDS_PER_MINUTE 60 /* second per minute */
+#define MINUTES_PER_HOUR 60 /* second per minute */
+#define MSEC_PER_SEC 1000
+#define USEC_PER_MSEC 1000
+#define TZ_ADDRESS 0x5702C014
+#define MAX_TIMEZONE_HOURS 24
+#define TIME_MAX 64
+#define ONE_DAY_MIN 1440
+#define BEIJING_TIMEZONE 480
+#define MIN_INTERVAL 15
+#define CUSTOM_PER_HOUR (60 / MIN_INTERVAL)
void print_time(calendar_t *date)
{
printf("CALLENDAR:year = %d, month = %d, day = %d, hour = %d, minute = %d, second = %d \r\n",
- date->year,
- date->mon,
- date->day,
- date->hour,
- date->min,
- date->sec);
+ date->year,
+ date->mon,
+ date->day,
+ date->hour,
+ date->min,
+ date->sec);
}
void print_time_2(struct tm *date)
{
printf("TM:year = %d, month = %d, day = %d, hour = %d, minute = %d, second = %d \r\n",
- date->tm_year + 1900,
- date->tm_mon,
- date->tm_mday,
- date->tm_hour,
- date->tm_min,
- date->tm_sec);
+ date->tm_year,
+ date->tm_mon,
+ date->tm_mday,
+ date->tm_hour,
+ date->tm_min,
+ date->tm_sec);
}
static uint16_t get_timezone(void)
writew(TZ_ADDRESS, tz_zone);
}
+int get_timezone_min(void)
+{
+ uint16_t sdk_zone = get_timezone();
+ if (sdk_zone > (CUSTOM_PER_HOUR * MAX_TIMEZONE_HOURS))
+ return BEIJING_TIMEZONE;
+ int zone = 0;
+ // 东边 1-12H, 西边 13-24H
+ if (sdk_zone > (12 * CUSTOM_PER_HOUR)) // 西边
+ {
+ zone = (sdk_zone - (12 * CUSTOM_PER_HOUR)) * MIN_INTERVAL * (-1);
+ }
+ else // 东边
+ {
+ zone = sdk_zone * MIN_INTERVAL;
+ }
+ return zone;
+}
+
void save_time(void)
{
uint64_t time_sec = get_local_timestamp();
uapi_calendar_set_timestamp(time_sec);
}
-uint32_t get_current_timestamp(void)
+uint32_t get_current_timestamp(void) // 0时区timestamp
{
uint32_t timestamp = 0;
struct timeval current_time = {0};
return timestamp;
}
-uint32_t get_local_timestamp(void)
+uint32_t get_local_timestamp(void) // 本地时区timestamp
{
- uint32_t timestamp = get_current_timestamp() + get_timezone() * MINUTES_PER_HOUR * SECONDS_PER_MINUTE;
+ uint32_t timestamp = get_current_timestamp() + get_timezone_min() * SECONDS_PER_MINUTE;
return timestamp;
}
-void get_current_time(struct timeval *tv, struct tm *tm)
+void get_local_time(struct tm *tm)
{
- char timebuf[TIME_MAX] = {0};
- if (gettimeofday(tv, NULL)) {
- return;
- }
- localtime_r(&tv->tv_sec, tm);
+ uint32_t timestamp = get_current_timestamp();
+ localtime_r(×tamp, tm);
+ tm->tm_year = tm->tm_year + 1900,
+ tm->tm_mon = tm->tm_mon + 1;
+}
+
+void get_current_time(struct tm *tm)
+{
+ uint32_t timestamp = get_current_timestamp() - (get_timezone_min() * 60);
+ localtime_r(×tamp, tm);
+ tm->tm_year = tm->tm_year + 1900,
tm->tm_mon = tm->tm_mon + 1;
- printf("get_current_time tv_tv_sec = %d \r\n", tv->tv_sec);
- print_time_2(tm);
}
void restore_time(void)
uapi_calendar_get_timestamp(&sec);
printf("callendar timestamp = %lld \r\n", sec);
sec = sec / MSEC_PER_SEC;
- sync_time(sec, get_timezone());
+ // 东边 1-12H, 西边 13-24H, 需在这里转换成 -1到-12
+ uint16_t timezone = get_timezone();
+ int timezone_trans = timezone > (12 * CUSTOM_PER_HOUR) ? ((timezone - (12 * CUSTOM_PER_HOUR)) * (-1)) : timezone;
+ timezone_trans *= MIN_INTERVAL;
+ sync_time(sec, timezone_trans);
}
-uint32_t sync_time(uint32_t timestamp, uint32_t timezone)
+uint32_t sync_time(uint32_t timestamp, int timezone)
{
printf("sync time timestamp %d, timezone %d \r\n", timestamp, timezone);
uint32_t seconds;
- if (timezone > MAX_TIMEZONE_HOURS) {
+ if (timezone > ONE_DAY_MIN) {
return ERRCODE_FAIL;
}
if (timestamp == 0) {
return ERRCODE_FAIL;
- } else if (timestamp <= (timezone * MINUTES_PER_HOUR * SECONDS_PER_MINUTE)) {
- seconds = 0;
} else {
- seconds = timestamp - (timezone * MINUTES_PER_HOUR * SECONDS_PER_MINUTE);
+ seconds = timestamp - (timezone * SECONDS_PER_MINUTE);
}
- set_timezone(timezone);
+
+ // 东边1-12H, 西边13-24H
+ uint32_t timezone_trans = (timezone / MIN_INTERVAL) < 0 ? abs(timezone / MIN_INTERVAL) + (12 * CUSTOM_PER_HOUR) : (timezone / MIN_INTERVAL);
+ set_timezone(timezone_trans);
struct timeval tv = {0};
struct timezone tzone = {0};
tv.tv_sec = seconds;
tv.tv_usec = 0;
tzone.tz_dsttime = 0;
- tzone.tz_minuteswest = timezone * MINUTES_PER_HOUR;
+ tzone.tz_minuteswest = timezone;
return settimeofday(&tv, &tzone);
}
void test_bandy_time(void)
{
struct tm tm;
- struct timeval tv;
- uint32_t time = 1716044461; // 2024-5-18 15:1:1
+ uint32_t time = 1716044461; // 2024-5-18 15:1:1
printf("--------SYNC TIME----------\r\n");
get_current_timestamp();
- get_current_time(&tv, &tm);
- sync_time(time, 8);
+ get_current_time(&tm);
+ sync_time(time, 480);
get_current_timestamp();
- get_current_time(&tv, &tm);
+ get_current_time(&tm);
printf("--------SAVE TIME----------\r\n");
get_current_timestamp();
- get_current_time(&tv, &tm);
+ get_current_time(&tm);
save_time();
get_current_timestamp();
- get_current_time(&tv, &tm);
+ get_current_time(&tm);
printf("--------RESTORE TIME----------\r\n");
get_current_timestamp();
- get_current_time(&tv, &tm);
+ get_current_time(&tm);
restore_time();
get_current_timestamp();
- get_current_time(&tv, &tm);
+ get_current_time(&tm);
}
-#endif
\ No newline at end of file
+#endif
#ifndef CHIP_SYSTEM_TIME_H
#define CHIP_SYSTEM_TIME_H
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
#ifndef BUILD_APPLICATION_SSB
#include <stdio.h>
#include <stdint.h>
* @brief Get the current system time as a timeval struct and a tm
* @return void.
*/
-void get_current_time(struct timeval *tv, struct tm *tm);
+void get_current_time(struct tm *tm);
+
+void get_local_time(struct tm *tm);
/**
* @brief Restore the system time from the saved non-volatile
*/
void restore_time(void);
+/**
+ * @brief get timezone minute
+ * @return timezone minute.
+ */
+int get_timezone_min(void);
+
/**
* @brief Synchronize the system time with the given timestamp and timezone
* @return void.
*/
-uint32_t sync_time(uint32_t timestamp, uint32_t timezone);
+uint32_t sync_time(uint32_t timestamp, int timezone);
/**
* @brief use for test
* @return void.
*/
-void test_time(void);
+void test_bandy_time(void);
/**
* @brief Get the current system time as a local timestamp with timezone offset
*/
uint32_t get_local_timestamp(void);
#endif
-#endif
\ No newline at end of file
+
+#ifdef __cplusplus
+}
+#endif
+#endif
"key_status": "alive",
"structure_type": "audio_vqe_param_t",
"attributions": 1,
- "value": [48, [0, 0, 0, 0, 16843009, 33620225, 16000, 16000,
- 1024, 100, 0, 0, 16842753, 257, 257, 256,
+ "value": [53, [0, 0, 0, 0, 16843009, 33620225, 16000, 16000,
+ 1024, 100, 0, 0, 16842753, 65793, 257, 256,
16778116, 16844032, 4, 0, 458824, 11796580, 327946, 1310720005,
65576964, 1000, 21499085, 67108874, 327680, 655367, 2126009683, 654734439,
1, 0, 0, 0, 0, 0, 5308380, 655336,
- 4286447619, 64536, 500, 16384, 3277, 0, 66049, 0]]
+ 4286447619, 64536, 500, 16384, 3277, 0, 66049, 0,
+ 16711166, 2, 34145024, 33751810, 0]]
},
"audio_vqe_kws_param":{
"key_id": "0x320D",
"key_status": "alive",
"structure_type": "audio_vqe_param_t",
"attributions": 1,
- "value": [48, [0, 0, 0, 0, 16843009, 33554689, 16000, 16000,
- 1024, 100, 1985229328, 1985229328, 16843009, 257, 257, 256,
+ "value": [53, [0, 0, 0, 0, 16843009, 33554689, 16000, 16000,
+ 1024, 100, 1985229328, 1985229328, 16843009, 65793, 257, 256,
16778116, 1280, 4, 0, 458824, 11796580, 327690, 13107205,
65576964, 1000, 679102459, 67108874, 327680, 655367, 2126009683,
654734439, 1, 0, 0, 0, 0, 0, 10551272, 655336, 4286447619, 64536,
- 500, 16384, 3277, 0, 66049, 0]]
+ 500, 16384, 3277, 0, 66049, 0,
+ 16711166, 2, 34145024, 33751810, 0]]
}
}
}
"key_status": "alive",
"structure_type": "audio_vqe_param_t",
"attributions": 1,
- "value": [48, [0, 0, 0, 0, 16843009, 33620225, 16000, 16000,
- 1024, 100, 0, 0, 16842753, 257, 257, 256,
+ "value": [53, [0, 0, 0, 0, 16843009, 33620225, 16000, 16000,
+ 1024, 100, 0, 0, 16842753, 65793, 257, 256,
16778116, 16844032, 4, 0, 458824, 11796580, 327946, 1310720005,
65576964, 1000, 21499085, 67108874, 327680, 655367, 2126009683, 654734439,
1, 0, 0, 0, 0, 0, 5308380, 655336,
- 4286447619, 64536, 500, 16384, 3277, 0, 66049, 0]]
+ 4286447619, 64536, 500, 16384, 3277, 0, 66049, 0,
+ 16711166, 2, 34145024, 33751810, 0]]
},
"audio_vqe_kws_param":{
"key_id": "0x320D",
"key_status": "alive",
"structure_type": "audio_vqe_param_t",
"attributions": 1,
- "value": [48, [0, 0, 0, 0, 16843009, 33554689, 16000, 16000,
- 1024, 100, 1985229328, 1985229328, 16843009, 257, 257, 256,
+ "value": [53, [0, 0, 0, 0, 16843009, 33554689, 16000, 16000,
+ 1024, 100, 1985229328, 1985229328, 16843009, 65793, 257, 256,
16778116, 1280, 4, 0, 458824, 11796580, 327690, 13107205,
65576964, 1000, 679102459, 67108874, 327680, 655367, 2126009683,
654734439, 1, 0, 0, 0, 0, 0, 10551272, 655336, 4286447619, 64536,
- 500, 16384, 3277, 0, 66049, 0]]
+ 500, 16384, 3277, 0, 66049, 0,
+ 16711166, 2, 34145024, 33751810, 0]]
}
}
}
} bth_product_data_config_t;\r
\r
/* 3A prams */\r
-#define NV_AUDIO_VQE_PARAM_SIZE 48\r
+#define NV_AUDIO_VQE_PARAM_SIZE 53\r
typedef struct {\r
uint32_t size;\r
uint32_t data[NV_AUDIO_VQE_PARAM_SIZE];\r
#include "watchdog_porting.h"
#include "securec.h"
#include "pmu_interrupt.h"
+#include "calendar_porting.h"
typedef struct {
uint32_t slp_ms;
void uapi_sys_shipmode(uint32_t arg)
{
+ uapi_calendar_calibration_enable();
UNUSED(arg);
uint32_t irq = osal_irq_lock();
uapi_pm_control(PM_BT_POWER_OFF);
uapi_dma_close();
uapi_dma_deinit();
display_suspend();
+
+#if defined(CFG_DRIVERS_MMC) || defined(CFG_DRIVERS_SDIO)
+ mmc_sdhci_suspend();
+#endif
storage_device_suspend();
opi_psram_suspend();
qspi0_suspend();
uart_h1_suspend();
uapi_dma_close();
uapi_dma_deinit();
-
+#if defined(CFG_DRIVERS_MMC) || defined(CFG_DRIVERS_SDIO)
+ mmc_sdhci_suspend();
+#endif
storage_device_suspend();
opi_psram_suspend();
qspi0_suspend();
clocks_system_resume_clock();
uapi_dma_init();
uapi_dma_open();
+#if defined(CFG_DRIVERS_MMC) || defined(CFG_DRIVERS_SDIO)
+ mmc_sdhci_resume();
+#endif
storage_device_resume();
reg16_setbit(0x520003e4, 0x0); // set mcpu_clken_slp in MSUB_SLP_CFG
uapi_dma_init();
uapi_dma_open();
cpu_trace_enable_mcpu_repeat();
+#if defined(CFG_DRIVERS_MMC) || defined(CFG_DRIVERS_SDIO)
+ mmc_sdhci_resume();
+#endif
storage_device_resume();
display_resume();
if (non_os_get_nmi_raw_status() == 0x2) {
#include "i2c_porting.h"
#include "spi_porting.h"
#include "uart_porting.h"
-#ifdef CFG_DRIVERS_MMC
#include "soc_mmc.h"
-#endif
#include "chip_io.h"
#define UART_SUSPEND_REGS_NUM 8
#ifdef CFG_DRIVERS_NANDFLASH
reg16_setbit(QSPI1_NANDFLASH_CS0_PAD, PAD_PS_BIT);
reg16_setbit(QSPI1_NANDFLASH_CS0_PAD, PAD_PE_BIT); // make CS1 to high in deepsleep.
-#elif defined (CFG_DRIVERS_MMC)
- emmc_save_info();
#endif
}
#ifndef QSPI_DISPLAY
ret = drv_dpu_suspend(NULL);
if (ret != 0) { PRINT("drv dpu suspend ret =%d\n", ret); }
-#endif
-#ifdef SUPPORT_GPU_GMMU
- ret = drv_gmmu_suspend(NULL);
- if (ret != 0) { PRINT("drv_gmmu_suspend ret =%d\n", ret); }
#endif
lcd_bus_api *bus_api = lcd_get_bus_api();
ret = bus_api->bus_suspend();
(void)drv_jpeg_resume(NULL);
#endif
(void)drv_vau_resume(NULL);
-#ifdef SUPPORT_GPU_GMMU
- (void)drv_gmmu_resume(NULL);
-#endif
if (g_resume_touch_flag != 0) { touch_resume_for_i2c(); }
}
#endif
writel(M_AXI_BRG_LP_CFG0, M_AXI_BRG_LP_DEFAULT_VAL); // M_axi
writel(EFUSE_CTL_CFG, EFUSE_ALL_ENABLE); // enable efuse
#ifdef CFG_DRIVERS_NANDFLASH
- reg16_clrbit(PM_SD_HOST_CCLK_DIV_REG, 0); // close sd host clock enable.
- reg16_clrbit(PM_EMMC_CCLK_DIV_REG, 0); // close sd mmc clock enable.
+ reg16_clrbit(EMMC_CCLK_DIV_REG, 0); // close sd mmc clock enable.
#endif
-#ifdef CFG_DRIVERS_MMC
- reg16_clrbit(PM_SD_HOST_CCLK_DIV_REG, 0); // close sd host clock enable.
+
+#ifndef CFG_DRIVERS_SDIO
+ reg16_clrbit(SD_HOST_CCLK_DIV_REG, 0); // close sdio host clock enable.
#endif
hal_pmu_set_cmu_xo_trim(HAL_PMU_XO_CORE_DS_1_025X);
}
add_subdirectory(vau)
add_subdirectory(rm)
-if("SUPPORT_GPU_GMMU" IN_LIST DEFINES)
- add_subdirectory(gmmu)
-endif()
if("SUPPORT_GPU_OPENVG" IN_LIST DEFINES)
add_subdirectory(openvg)
endif()
set(COMPONENT_NAME "gfx_rm")\r
\r
set(SOURCES\r
- ${CMAKE_CURRENT_SOURCE_DIR}/src/vau_stroke_dash.c\r
- ${CMAKE_CURRENT_SOURCE_DIR}/src/vau_arc.c\r
- ${CMAKE_CURRENT_SOURCE_DIR}/src/vau_stroke_path.c\r
- ${CMAKE_CURRENT_SOURCE_DIR}/src/vau_math.c\r
+ ${CMAKE_CURRENT_SOURCE_DIR}/rm/src/vau_stroke_dash.c\r
+ ${CMAKE_CURRENT_SOURCE_DIR}/rm/src/vau_arc.c\r
+ ${CMAKE_CURRENT_SOURCE_DIR}/rm/src/vau_stroke_path.c\r
+ ${CMAKE_CURRENT_SOURCE_DIR}/rm/src/vau_math.c\r
+\r
+ ${CMAKE_CURRENT_SOURCE_DIR}/gmmu/drv/clock/gmmu_clock.c\r
+ ${CMAKE_CURRENT_SOURCE_DIR}/gmmu/drv/context/gmmu_context.c\r
+ ${CMAKE_CURRENT_SOURCE_DIR}/gmmu/drv/dev/gmmu_dev.c\r
+ ${CMAKE_CURRENT_SOURCE_DIR}/gmmu/drv/dfx/gmmu_dfx.c\r
+ ${CMAKE_CURRENT_SOURCE_DIR}/gmmu/drv/hal/gmmu_hal.c\r
+ ${CMAKE_CURRENT_SOURCE_DIR}/gmmu/drv/intf/drv_gmmu_intf.c\r
+ ${CMAKE_CURRENT_SOURCE_DIR}/gmmu/drv/ioctl/gmmu_ioctl.c\r
+ ${CMAKE_CURRENT_SOURCE_DIR}/gmmu/drv/isr/gmmu_isr.c\r
+ ${CMAKE_CURRENT_SOURCE_DIR}/gmmu/drv/mem/gmmu_mem.c\r
+ ${CMAKE_CURRENT_SOURCE_DIR}/gmmu/drv/base/gmmu_comm.c\r
+\r
+ ${CMAKE_CURRENT_SOURCE_DIR}/gmmu/api/src/soc_gmmu_api.c\r
)\r
\r
set(PUBLIC_HEADER\r
${ROOT_DIR}/middleware/utils/common_headers/drivers/gpu\r
${ROOT_DIR}/middleware/services/gpu/api/vau/debug\r
${ROOT_DIR}/middleware/services/gpu/drv/vau/mem\r
- ${CMAKE_CURRENT_SOURCE_DIR}/inc\r
+ ${ROOT_DIR}/middleware/services/gpu/drv/comm\r
+ ${ROOT_DIR}/middleware/services/gpu/drv/include/\r
+ ${CMAKE_CURRENT_SOURCE_DIR}/rm/inc\r
+\r
+ ${CMAKE_CURRENT_SOURCE_DIR}/gmmu/drv/base\r
+ ${CMAKE_CURRENT_SOURCE_DIR}/gmmu/drv/clock\r
+ ${CMAKE_CURRENT_SOURCE_DIR}/gmmu/drv/context\r
+ ${CMAKE_CURRENT_SOURCE_DIR}/gmmu/drv/dev\r
+ ${CMAKE_CURRENT_SOURCE_DIR}/gmmu/drv/dfx\r
+ ${CMAKE_CURRENT_SOURCE_DIR}/gmmu/drv/hal\r
+ ${CMAKE_CURRENT_SOURCE_DIR}/gmmu/drv/include\r
+ ${CMAKE_CURRENT_SOURCE_DIR}/gmmu/drv/intf\r
+ ${CMAKE_CURRENT_SOURCE_DIR}/gmmu/drv/ioctl\r
+ ${CMAKE_CURRENT_SOURCE_DIR}/gmmu/drv/isr\r
+ ${CMAKE_CURRENT_SOURCE_DIR}/gmmu/drv/mem\r
+\r
+ ${CMAKE_CURRENT_SOURCE_DIR}/gmmu/api/inc\r
)\r
\r
set(PUBLIC_DEFINES\r
--- /dev/null
+/*
+ * Copyright (c) CompanyNameMagicTag 2021-2023. All rights reserved.
+ * Description: gmmu api interface
+ * Author:
+ * Create: 2021-10-15
+ */
+
+#ifndef SOC_GMMU_API_H
+#define SOC_GMMU_API_H
+
+#include "td_type.h"
+
+#ifdef __cplusplus
+#if __cplusplus
+extern "C" {
+#endif
+#endif
+
+/**
+ * @defgroup gmmu_type gmmu_type
+ * @ingroup gpu_api
+ * @{
+ */
+
+/*-------------------------------- macro define -------------------------------------------*/
+
+#define GMMU_BUF_CNT 2
+
+/*-------------------------------- struct define ------------------------------------------*/
+
+/**
+ * @if Eng
+ * @brief Gmmu memory attributes.
+ * @else
+ * @brief gmmu内存属性
+ * @endif
+ */
+typedef struct gmmu_attr_struct {
+ td_u8 bpp; /*!< @if Eng Pixel Depth.
+ @else 像素深度 @endif */
+ td_u32 width; /*!< @if Eng Memory Width.
+ @else 内存宽度 @endif */
+ td_u32 height; /*!< @if Eng Memory height.
+ @else 内存高度 @endif */
+ td_u8 offset; /*!< @if Eng Pixel offset for fine tuning lut contours.
+ @else 像素偏移,用于微调lut轮廓 @endif */
+} *gmmu_attr_ptr;
+
+/**
+ * @if Eng
+ * @brief gmmu buffer attribute.
+ * @else
+ * @brief gmmu buffer属性
+ * @endif
+ */
+typedef struct gmmu_buf_struct {
+ td_u32 stride; /*!< @if Eng Gmmu buffer line spacing.
+ @else gmmu buffer行间距 @endif */
+ td_u32 size; /*!< @if Eng Pixel Depth.
+ @else gmmu buffer 大小@endif */
+ td_u32 buffer[GMMU_BUF_CNT]; /*!< @if Eng Pixel Depth.
+ @else gmmu buffer地址 @endif */
+} *gmmu_buf_ptr;
+
+/**
+ * @}
+ */
+
+/**
+ * @defgroup gmmu_api gmmu_api
+ * @ingroup gpu_api
+ * @{
+ */
+
+/*-------------------------------- func declares ------------------------------------------*/
+
+/**
+ * @if Eng
+ * @brief Initializing the Gmmu Memory.
+ * @param [in] Width, height, and pixel depth required for memory initialization.
+ * @retval EXT_SUCCESS Success.
+ * @retval Other Failure.
+ * @else
+ * @brief Gmmu 内存初始化
+ * @param [in] gmmu_attr 内存初始化需要的宽高,像素深度信息
+ * @retval EXT_SUCCESS 成功
+ * @retval Other 失败
+ * @endif
+ */
+td_s32 uapi_gmmu_init(const gmmu_attr_ptr gmmu_attr);
+
+/**
+ * @if Eng
+ * @brief Gmmu Memory Deinitialization.
+ * @else
+ * @brief Gmmu 内存去初始化
+ * @endif
+ */
+td_void uapi_gmmu_deinit(td_void);
+
+/**
+ * @if Eng
+ * @brief Gmmu buffer application.
+ * @param [in] gmmu_buf Memory information about the gmmu buffer
+ * @else
+ * @brief Gmmu 内存申请
+ * @param [in] gmmu_buf gmmu buffer的内存信息
+ * @endif
+ */
+td_void uapi_gmmu_alloc(gmmu_buf_ptr gmmu_buf);
+
+/**
+ * @if Eng
+ * @brief Gmmu buffer free.
+ * @param [in] gmmu_buf Memory information about the gmmu buffer
+ * @else
+ * @brief Gmmu 内存释放
+ * @param [in] gmmu_buf gmmu buffer的内存信息
+ * @endif
+ */
+td_void uapi_gmmu_free(gmmu_buf_ptr gmmu_buf);
+
+/**
+ * @}
+ */
+
+#ifdef __cplusplus
+#if __cplusplus
+}
+#endif
+#endif
+
+#endif /* SOC_GMMU_API_H */
--- /dev/null
+/*
+ * Copyright (c) @CompanyNameMagicTag 2021-2021. All rights reserved.
+ * Description: drv gmmu intf
+ */
+
+#ifndef DRV_GRAPHICS_DRV_GMMU_INTF_H
+#define DRV_GRAPHICS_DRV_GMMU_INTF_H
+
+#include "td_type.h"
+
+#ifdef __cplusplus
+#if __cplusplus
+extern "C" {
+#endif
+#endif
+
+/*-------------------------------- macro define -------------------------------------------*/
+
+typedef td_s32 (*pfn_gmmu_suspend)(td_void);
+typedef td_s32 (*pfn_gmmu_resume)(td_void);
+
+/*-------------------------------- struct define ------------------------------------------*/
+
+typedef struct {
+ pfn_gmmu_suspend suspend;
+ pfn_gmmu_resume resume;
+} drv_gmmu_export_func;
+
+/*-------------------------------- func declares ------------------------------------------*/
+
+td_s32 drv_gmmu_module_init(td_void);
+td_void drv_gmmu_module_exit(td_void);
+
+td_s32 drv_gmmu_suspend(td_void *private_data);
+td_s32 drv_gmmu_resume(td_void *private_data);
+
+#ifdef __cplusplus
+#if __cplusplus
+}
+#endif
+#endif
+
+#endif /* DRV_GRAPHICS_DRV_GMMU_INTF_H */
--- /dev/null
+/*
+ * Copyright (c) @CompanyNameMagicTag 2021-2021. All rights reserved.
+ * Description: drv gmmu ioctl
+ */
+
+#ifndef DRV_GRAPHICS_DRV_GMMU_IOCTL_H
+#define DRV_GRAPHICS_DRV_GMMU_IOCTL_H
+
+#include <stdio.h>
+#include "td_base.h"
+#include "drv_gmmu_struct.h"
+
+#ifdef __cplusplus
+#if __cplusplus
+extern "C" {
+#endif
+#endif
+
+/*-------------------------------- macro define -------------------------------------------*/
+
+#define GMMU_DEV_NAME "/dev/gmmu"
+
+#define DRV_GMMU_CMD_CONFIG 0
+
+td_s32 gmmu_open(const td_char *path_name, td_s32 flags, td_s32 mode);
+td_s32 gmmu_ioctl(td_s32 module_idx, td_ulong ioctl_cmd, td_void *para);
+td_s32 gmmu_close(td_s32 module_idx);
+
+#ifdef __cplusplus
+#if __cplusplus
+}
+#endif
+#endif
+
+#endif /* DRV_GRAPHICS_DRV_GMMU_IOCTL_H */
--- /dev/null
+/*
+ * Copyright (c) @CompanyNameMagicTag 2021-2021. All rights reserved.
+ * Description: drv gmmu struct
+ */
+
+#ifndef DRV_GRAPHICS_DRV_GMMU_STRUCT_H
+#define DRV_GRAPHICS_DRV_GMMU_STRUCT_H
+
+#include "td_type.h"
+
+#ifdef __cplusplus
+#if __cplusplus
+extern "C" {
+#endif
+#endif
+
+/*-------------------------------- macro define -------------------------------------------*/
+
+#define DRV_GMMU_MASK 0x0123456789ABCDEF
+
+/*-------------------------------- struct define ------------------------------------------*/
+
+typedef struct {
+ td_u64 mask;
+ td_u8 input_bpp;
+ td_u32 input_width;
+ td_u32 input_height;
+ td_u8 offset;
+ td_u32 output_size;
+ td_u32 output_stride;
+ td_u32 output_addr0;
+ td_u32 output_addr1;
+} drv_gmmu_mgr;
+
+/*-------------------------------- func declares ------------------------------------------*/
+
+#ifdef __cplusplus
+#if __cplusplus
+}
+#endif
+#endif
+
+#endif /* DRV_GRAPHICS_DRV_GMMU_STRUCT_H */
--- /dev/null
+/*
+ * Copyright (c) @CompanyNameMagicTag 2021-2021. All rights reserved.
+ * Description: vau_arc
+ */
+
+#ifndef RM_BASIC_ARC_H
+#define RM_BASIC_ARC_H
+
+#include "soc_vau_type.h"
+
+#ifdef __cplusplus
+#if __cplusplus
+extern "C" {
+#endif
+#endif
+
+#ifndef CIRCLE_TO_BEZIER_H_90_DEG
+#define CIRCLE_TO_BEZIER_H_90_DEG 0.551915024494f
+#endif
+
+typedef struct {
+ float x;
+ float y;
+} float_point;
+
+typedef struct {
+ float rx;
+ float ry;
+ td_float cos_phi;
+ td_float sin_phi;
+ td_float xhalf;
+ td_float yhalf;
+ td_float x1p;
+ td_float y1p;
+ float_point r2;
+ td_float x12p;
+ td_float y12p;
+ td_float cr;
+ td_float dq;
+ td_float pq;
+ td_float sc;
+ td_float cxp;
+ td_float cyp;
+ td_float cx;
+ td_float cy;
+ td_float theta;
+ td_float delta;
+} local_arc_params;
+
+typedef struct {
+ float_point en1;
+ float_point en2;
+ float_point edn1;
+ float_point edn2;
+ td_u8 split_len;
+ td_u8 t_len;
+ td_float alpha;
+ td_float step;
+ td_float alpha_t;
+ td_float theta;
+ td_float delta;
+ float_point r;
+ float_point c;
+ float_point angles;
+ td_float cos_phi;
+ td_float sin_phi;
+ td_float interval;
+} local_bezier_points;
+
+float_point *create_arc_utility(const float_point *center, float r, float start_angle, float angle_extend, int *num);
+float_point *create_arc_cmd(const float_point *start, const float_point *end, unsigned char cmd, float r, int *num);
+void destroy_arc_path(float_point *cubic);
+td_s32 vau_draw_create_arc_fit_path(const ext_vau_path *org, ext_vau_path *fit);
+td_void vau_draw_destroy_arc_fit_path(ext_vau_path *path);
+float_point *create_elliptical_arc_utility(float_point p[2], unsigned char cmd, float_point r, float phi, int *num);
+
+#ifdef __cplusplus
+#if __cplusplus
+}
+#endif
+#endif
+
+#endif /* RM_BASIC_ARC_H */
--- /dev/null
+/*
+ * Copyright (c) @CompanyNameMagicTag 2022-2022. All rights reserved.
+ * Description : vau math file
+ */
+
+#ifndef API_RM_VAU_MATH_H
+#define API_RM_VAU_MATH_H
+
+#include <math.h>
+#include "td_base.h"
+#include "soc_vau_type.h"
+
+#ifdef __cplusplus
+#if __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+#endif /* __cplusplus */
+
+#define VAU_TRIGO_SHIFT 15
+#ifndef CIRCLE_TO_BEZIER_H_90_DEG
+#define CIRCLE_TO_BEZIER_H_90_DEG 0.551915024494f
+#endif
+
+#define HALF_M_PI (M_PI / 2)
+
+#define deg_to_rad(a) ((a) * M_PI / 180.0f)
+#define rad_to_deg(a) ((a) * 180.0f / M_PI)
+
+#define vau_matrix_x(m, x, y) ((x) * (m)[0][0] + (y) * (m)[0][1] + (m)[0][2])
+#define vau_matrix_y(m, x, y) ((x) * (m)[1][0] + (y) * (m)[1][1] + (m)[1][2])
+
+static inline td_bool double_is_equal(double a, double b)
+{
+ return fabs(a - b) <= 1e-6;
+}
+
+typedef struct {
+ float x;
+ float y;
+} vau_point_float, vau_vector;
+
+td_float vau_math_fabs(td_float x);
+td_float vau_math_fsqrt(td_float x);
+td_float vau_math_inv_fsqrt(td_float x);
+td_s32 vau_math_min(td_s32 a, td_s32 b);
+td_float vau_math_min_f(td_float a, td_float b);
+td_s32 vau_math_max(td_s32 a, td_s32 b);
+td_float vau_math_max_f(td_float a, td_float b);
+td_float vau_math_clamp(td_float value, td_float min_value, td_float max_value);
+td_bool vau_math_float_is_equal(td_float a, td_float b);
+td_bool vau_math_float_is_zero(td_float x);
+td_void vau_matrix_identity(ext_vau_matrix *m);
+td_void vau_matrix_mult(ext_vau_matrix *m, const ext_vau_matrix *m2);
+td_void vau_matrix_trans(ext_vau_matrix *m, float tx, float ty);
+td_void vau_matrix_scale(ext_vau_matrix *m, float sx, float sy);
+td_void vau_matrix_shear(ext_vau_matrix *m, float shx, float shy);
+td_void vau_matrix_rotate(ext_vau_matrix *m, float angle);
+td_void vau_matrix_reflect_x(ext_vau_matrix *m);
+td_void vau_matrix_reflect_y(ext_vau_matrix *m);
+td_void vau_matrix_reflect_o(ext_vau_matrix *m);
+td_s32 vector_dot_product_sign(const vau_vector *v1, const vau_vector *v2);
+td_float fast_inv_sqrt(td_float x);
+bool float_is_nan(float a);
+float vau_circle_to_bezier_h(float rad);
+
+#ifdef __cplusplus
+#if __cplusplus
+}
+#endif /* __cplusplus */
+#endif /* __cplusplus */
+#endif /* API_RM_VAU_MATH_H */
--- /dev/null
+/*
+ * Copyright (c) @CompanyNameMagicTag 2021-2021. All rights reserved.
+ * Description: render path basic
+ */
+
+#ifndef VAU_SPLIT_BEZIER_H
+#define VAU_SPLIT_BEZIER_H
+
+#include "vau_stroke_dash.h"
+
+#ifdef __cplusplus
+#if __cplusplus
+extern "C" {
+#endif
+#endif
+
+td_u32 cubic_split_agg(const vau_point_float *cubic, vau_point_float *line_points, td_u32 point_num);
+
+#ifdef __cplusplus
+#if __cplusplus
+}
+#endif
+#endif
+
+#endif /* VAU_SPLIT_BEZIER_H */
--- /dev/null
+/*
+ * Copyright (c) @CompanyNameMagicTag 2021-2021. All rights reserved.
+ * Description: render path basic
+ */
+
+#ifndef VAU_STROKE_DASH_H
+#define VAU_STROKE_DASH_H
+
+#include "soc_vau_type.h"
+#include "vau_math.h"
+
+#ifdef __cplusplus
+#if __cplusplus
+extern "C" {
+#endif
+#endif
+
+#define VAU_CUBIC_BEZIER_POINT_NUM 4
+
+typedef struct {
+ float x;
+ float y;
+} vau_path_line_to;
+
+typedef struct {
+ float x0; /* ctrl point */
+ float y0; /* ctrl point */
+ float x1; /* end point */
+ float y1; /* end point */
+} vau_path_quad_to;
+
+typedef struct {
+ float x0; /* ctrl point */
+ float y0; /* ctrl point */
+ float x1; /* ctrl point */
+ float y1; /* ctrl point */
+ float x2; /* end point */
+ float y2; /* end point */
+} vau_path_cubic_to;
+
+typedef struct {
+ vau_point_float s;
+ vau_point_float p;
+ vau_point_float o;
+ td_uchar cmd;
+ td_u32 offset;
+ td_u32 data_num;
+ vau_path_line_to line_to;
+ vau_path_quad_to quad_to;
+ vau_path_cubic_to cubic_to;
+ vau_point_float cubic[VAU_CUBIC_BEZIER_POINT_NUM];
+ td_bool rel;
+} local_stroke_dash_path;
+
+td_s32 vau_create_stroke_dash_path(const ext_vau_path *path, const ext_vau_stroke_attr *stroke,
+ ext_vau_path *dash_path);
+td_void vau_destroy_stroke_dash_path(ext_vau_path *dash_path);
+
+#ifdef __cplusplus
+#if __cplusplus
+}
+#endif
+#endif
+
+#endif /* VAU_STROKE_DASH_H */
--- /dev/null
+/*
+ * Copyright (c) @CompanyNameMagicTag 2021-2021. All rights reserved.
+ * Description: stroke path
+ */
+
+#ifndef STROKE_INC_VAU_STROKE_PATH_H
+#define STROKE_INC_VAU_STROKE_PATH_H
+
+#include "soc_vau_type.h"
+#include "vau_stroke_dash.h"
+
+#ifdef __cplusplus
+#if __cplusplus
+extern "C" {
+#endif
+#endif
+
+typedef enum {
+ EXT_BEZIER_MODE_LINE_AVG,
+ EXT_BEZIER_MODE_BEZIER_4,
+ EXT_BEZIER_MODE_BEZIER_CLOSE,
+ EXT_BEZIER_MODE_BEZIER_MONO,
+ EXT_BEZIER_MODE_BEZIER_ELIA,
+ EXT_BEZIER_MODE_BEZIER_ELIA_4,
+ EXT_BEZIER_MODE_BEZIER_ELIA_CLOSE,
+ EXT_BEZIER_MODE_LINE_FREETYPE,
+ EXT_BEZIER_MODE_LINE_AGG,
+ EXT_BEZIER_MODE_MAX
+} ext_vau_bezier_stroke_split_mode;
+
+typedef struct {
+ vau_vector v;
+ vau_point_float c1;
+ vau_point_float c2;
+ vau_point_float p4;
+ float h;
+ float p1p3;
+ float p1p4;
+ float p3p4;
+ float sin;
+ float cos;
+} local_stroke_add_round;
+
+typedef struct {
+ td_s32 x1;
+ td_s32 y1;
+ td_s32 x2;
+ td_s32 y2;
+} ext_vau_line_fixed;
+
+typedef struct {
+ td_u32 i;
+ float sx;
+ float sy;
+ float px;
+ float py;
+ float ox;
+ float oy;
+ td_uchar cmd;
+ td_u32 offset;
+ td_u32 data_num;
+ vau_path_line_to line_to;
+ vau_path_quad_to quad_to;
+ vau_path_cubic_to cubic_to;
+ ext_vau_line_fixed line_inner;
+ ext_vau_line_fixed line_outer;
+ td_u32 cubic_split_count;
+ vau_point_float p0;
+ vau_point_float p1;
+ vau_point_float left;
+ vau_point_float right;
+ td_bool rel;
+ float width;
+ float half_width;
+ td_bool has_close;
+ td_u32 sub_index;
+ int l_count;
+ int c_count;
+ td_bool add_join;
+ td_bool add_cap;
+ td_s32 ret;
+ float rx;
+ float ry;
+ td_u32 point_num;
+ td_u32 cubic_split_count_out;
+} local_parse_stroke_path;
+
+typedef struct {
+ float miter_limit;
+ float half_width;
+} vau_line_cap_param;
+
+typedef struct {
+ td_bool add_join;
+ td_bool add_cap;
+} vau_join_cap_flag;
+
+td_s32 vau_create_stroke_to_fill_path(const ext_vau_path *path, const ext_vau_stroke_attr *stroke_attr,
+ ext_vau_path *fill_path, ext_vau_fill_attr *fill_attr, ext_vau_bezier_stroke_split_mode mode);
+td_void vau_destroy_stroke_to_fill_path(ext_vau_path *fill_path);
+td_u32 cubic_bezier_subdivision(const vau_point_float *points, vau_point_float *points_subdivision);
+td_void split_cubic_to_line_average(const vau_point_float *cubic, vau_point_float *line_points, td_u32 point_num);
+#ifdef __cplusplus
+#if __cplusplus
+}
+#endif
+#endif
+
+#endif /* STROKE_INC_VAU_STROKE_PATH_H */
set(
vau_api_header_list
- ${ROOT_DIR}/middleware/services/gpu/api/rm/inc
+ ${ROOT_DIR}/middleware/services/gpu/api/rm/rm/inc/
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/draw
${CMAKE_CURRENT_SOURCE_DIR}/matrix
]]
add_subdirectory(dpu)
add_subdirectory(vau)
-if("SUPPORT_GPU_GMMU" IN_LIST DEFINES)
- add_subdirectory(gmmu)
-endif()
if("SUPPORT_GPU_JPEG" IN_LIST DEFINES)
add_subdirectory(jpeg)
endif()
${CMAKE_CURRENT_SOURCE_DIR}/list
${CMAKE_CURRENT_SOURCE_DIR}/mem
${CMAKE_CURRENT_SOURCE_DIR}/node
+ ${ROOT_DIR}/middleware/services/gpu/api/rm/gmmu/drv/include
)
set(GPU_INC_LIST "${GPU_INC_LIST}" "${vau_drv_header_list}" CACHE INTERNAL "platform src obj list" FORCE)
\ No newline at end of file
#include "vau_pre_process.h"\r
#include "vau_handle.h"\r
#include "drv_vau_struct.h"\r
+#include "drv_gmmu_intf.h"\r
\r
#define DRV_VAU_IOCTL_CMD_NUM 20\r
\r
drv_vau_set_suspend_flag(TD_TRUE);\r
vau_dbg("vau suspend ok");\r
\r
+#ifdef SUPPORT_GPU_GMMU\r
+ (td_void)drv_gmmu_suspend(NULL);\r
+#endif\r
+\r
return ret;\r
}\r
\r
drv_vau_set_suspend_flag(TD_FALSE);\r
vau_dbg("vau resume ok");\r
\r
+#ifdef SUPPORT_GPU_GMMU\r
+ (void)drv_gmmu_resume(NULL);\r
+#endif\r
+\r
return EXT_SUCCESS;\r
}\r
\r
td_s32 uapi_vau_module_init(void)\r
{\r
td_s32 ret;\r
-\r
+#ifdef SUPPORT_GPU_GMMU\r
+ ret = drv_gmmu_module_init();\r
+ if (ret != EXT_SUCCESS) {\r
+ vau_err("drv_gmmu_module_init failed, ret=%#x!", ret);\r
+ return ret;\r
+ }\r
+#endif\r
vau_ip_dcmp_tmp();\r
\r
ret = vau_mem_init();\r
osal_spin_lock_irqsave(&(g_mem_info[mem_type].mem_lock), &lockflags);
if (osal_list_empty(&g_mem_free_list_head[mem_type]) != 0) {
+ osal_spin_unlock_irqrestore(&(g_mem_info[mem_type].mem_lock), &lockflags);
vau_err("mem_free_list[%d] is empty!", mem_type);
return TD_NULL;
}
* @brief Enable JPEG preview which includes decoding jpeg file and cacheing decoded data.
*/
#ifdef SUPPORT_GPU_JPEG
+#ifdef XTS_SUPPORT
+#define CAPABILITY_HW_JPEG_DECODE 0
+#else
#define CAPABILITY_HW_JPEG_DECODE 1
+#endif
#else
#define CAPABILITY_HW_JPEG_DECODE 0
#endif
* @brief Hardware acceleration for drawing cubic bezier curve. Prerequirement is ENABLE_VGU_ENGINE is 1.
*/
#define CAPABILITY_HWDRAW_CURVE 0
-
+/**
+ * @brief Hardware acceleration for drawing rect. Prerequirement is ENABLE_VGU_ENGINE is 1.
+ */
+#define CAPABILITY_HWDRAW_RECT 0
+/**
+ * @brief Hardware acceleration for filling small size. Prerequirement is ENABLE_VGU_ENGINE is 1.
+ */
+#define CAPABILITY_HWDRAW_SMALL_SIZE 0
/**
* @brief Whether open offline dial.
*/
/**
* @brief Use double buffer for rendering process.
*/
-
+
#ifndef DOUBLE_BUFFER
#define DOUBLE_BUFFER 1
#endif
set(SOURCES
${CMAKE_CURRENT_SOURCE_DIR}/src/display_vau.c
${CMAKE_CURRENT_SOURCE_DIR}/src/yuv_to_rgb.c
+ ${CMAKE_CURRENT_SOURCE_DIR}/src/display_gmmu.c
${PROJECT_ROOT_DIR}/hal/common/src/barcode128.c
)
${CMAKE_CURRENT_SOURCE_DIR}/include
${ROOTDIR}/open_source/openharmony/drivers/peripheral/display/interfaces/include
${UIKIT_ROOT_DIR}/proprietary/src/utils/innerkits
+ ${ROOTDIR}/middleware/services/gpu/api/rm/gmmu/api/inc
)
set(PRIVATE_DEFINES
${CMAKE_CURRENT_SOURCE_DIR}/mempool/include
${ROOTDIR}/open_source/openharmony/drivers/peripheral/display/interfaces/include
${UIKIT_ROOT_DIR}/proprietary/src/utils/innerkits
+ ${ROOTDIR}/middleware/services/gpu/api/rm/gmmu/api/inc
)
set(PRIVATE_DEFINES
set(PRIVATE_HEADER
${ROOTDIR}/open_source/openharmony/drivers/peripheral/display/interfaces/include
${UIKIT_ROOT_DIR}/proprietary/src/utils/innerkits
+ ${ROOTDIR}/middleware/services/gpu/api/rm/gmmu/api/inc
)
set(PRIVATE_DEFINES
--- /dev/null
+/*
+Copyright (c) HiSilicon (Shanghai) Technologies Co., Ltd. 2025. All rights reserved.
+*/
+
+#ifndef DISPLAY_GMMU_INTERNAL_H
+#define DISPLAY_GMMU_INTERNAL_H
+#include "display_type.h"
+
+#define INTERNAL_GMMU_BUF_CNT 2
+
+typedef struct {
+ td_u32 stride; /* Gmmu buffer line spacing. */
+ td_u32 size; /* Gmmu buffer Size. */
+ td_u32 buffer[INTERNAL_GMMU_BUF_CNT]; /* Gmmu buffer Addr. */
+} GmmuBuf;
+
+typedef struct {
+ td_u8 bpp; /* Pixel Depth. */
+ td_u32 width; /* Memory Width. */
+ td_u32 height; /* height. */
+ td_u8 offset; /* Pixel offset for fine tuning lut contours. */
+} GmmuAttr;
+
+td_s32 GmmuInit(const GmmuAttr *gmmu_attr);
+td_void GmmuAlloc(GmmuBuf *gmmu_buf);
+td_void GmmuFree(GmmuBuf *gmmu_buf);
+td_void GmmuDeinit(td_void);
+
+#endif /* DISPLAY_GMMU_INTERNAL_H */
#endif
#include "mem_pool_los.h"
#include "mem_pool_types.h"
-#include "soc_gmmu_api.h"
#include "graphic_hardware_config.h"
+#if ENABLE_GMMU
+#include "display_gmmu_internal.h"
+#endif
#define MAX_MALLOC_SIZE 0x10000000L
#define FB_COUNT 2
#if ENABLE_GMMU
static bool g_gmmuAllocated[FB_COUNT] = {false, false};
-struct gmmu_buf_struct g_gmmuMem = { 0 };
+GmmuBuf g_gmmuMem = { 0 };
#else
static AddrInfo FBInfo[FB_COUNT] = {
{false, MEM_POOL_UI_FB, MEM_POOL_UI_FB_SIZE / 2},
*funcs = gFuncs;
#if ENABLE_GMMU
- struct gmmu_attr_struct gmmuAtr = {LAYER_BPP, RESOLUTION_WIDTH, RESOLUTION_HEIGHT};
- if (uapi_gmmu_init(&gmmuAtr) != DISPLAY_SUCCESS) {
+ GmmuAttr gmmuAtr = {LAYER_BPP, RESOLUTION_WIDTH, RESOLUTION_HEIGHT};
+ if (GmmuInit(&gmmuAtr) != DISPLAY_SUCCESS) {
return DISPLAY_FAILURE;
}
- uapi_gmmu_alloc(&g_gmmuMem);
+ GmmuAlloc(&g_gmmuMem);
#endif
DISP_LOGI("gralloc initialize success\n");
return DISPLAY_SUCCESS;
DISP_LOGI("gralloc uninitialize success\n");
#if ENABLE_GMMU
- uapi_gmmu_free(&g_gmmuMem);
- uapi_gmmu_deinit();
+ GmmuFree(&g_gmmuMem);
+ GmmuDeinit();
#endif
return DISPLAY_SUCCESS;
}
/**
* @brief Sweep gradient params.
+ * @param centerX Indicates the x coordinate of the circle center.
+ * @param centerY Indicates the y coordinate of the circle center.
+ * @param startAngle Indicates the start angle of the sector. Value <b>0</b> indicates the 12-o'clock direction,
+ * and <b>90</b> indicates the 3-o'clock direction.
*/
struct SweepGradient {
int16_t centerX;
Path imgPath_ = {0};
float thetaVal_ = 0.0f;
float radius_ = 0.0f;
- Point point_ = {0, 0};
+ float x_ = 0.0f;
+ float y_ = 0.0f;
Point startPoint_ = {0, 0};
bool isInternalMem_ = false;
* @return Returns index value that relates to a path object. Returns -1 when any error occurs.
*/
int16_t DrawSector(const Point& center, uint16_t radius,
- int16_t startAngle, int16_t endAngle, const PaintExt& paint);
+ float startAngle, float endAngle, const PaintExt& paint);
/**
* @brief Draws an arc.
~UICardPage() override {}
/* *
- * @brief This function is invoked when the function SetHorCurrentPage() is called.
+ * @brief This function is invoked when the function SetHorCurrentPage() or Presenter:OnResume() is called.
* @since 1.0
* @version 1.0
*/
*/
virtual void CoverEnd(bool isCovered) {}
+ /* *
+ * @brief This function is invoked when SetVerCurrentPage is called and horizontal page is covered.
+ * @since 1.0
+ * @version 1.0
+ */
+ virtual void OnCovered(void) {}
+
+ /* *
+ * @brief This function is invoked when SetVerCurrentPage is called and horizontal page is not covered.
+ * @since 1.0
+ * @version 1.0
+ */
+ virtual void OnUncovered(void) {}
+
+ /* *
+ * @brief This function is invoked when Presenter::OnPause is called.
+ * @since 1.0
+ * @version 1.0
+ */
+ virtual void OnPause(void) {}
+
/* *
* @brief Set coverable state.
* @since 1.0
*/
void SetHorCurrentPage(uint16_t index, bool loadAdjacent = true);
+ /* *
+ * @brief Set the current page index of vertical direction.
+ * @since 1.0
+ * @version 1.0
+ */
+ void SetVerCurrentPage(uint16_t index);
+
/* *
* @brief Get the current page index of target direction.
* @since 1.0
}
/**
- * @brief Set background blur radius. Default value is 10.
+ * @brief Set background blur radius. Default value is 10.0f, The effective range is [0.0f ~ 32.0f].
* @since 1.0
* @version 1.0
*/
- void SetBlurRadius(uint16_t radius) {
+ void SetBlurRadius(float radius)
+ {
blurRadius_ = radius;
}
private:
using UIViewGroup::Remove;
- uint16_t blurRadius_ = 10;
+ float blurRadius_ = 10.0f;
void UpdateCardPageIndex();
static constexpr uint16_t INVALID_VIEW_INDEX = 0xff;
bool loop_ = false;
*/
void ClearParticles();
+ UIViewType GetViewType() const override
+ {
+ return UI_PARTICLE_VIEW;
+ }
+
private:
void ProcessParticleCells();
return onScrollListener_;
}
+ class OnChildStateListener : public HeapBase {
+ public:
+ /**
+ * @brief Callback function when the status of a child control changes.
+ *
+ * @param view Object of the child control whose state changes.
+ * This object is a control of the UIViewGroup type.
+ * If roller is in mirror mode, the object will contain two subcomponents.
+ * The head is normal image,tail is mirror image.
+ * If there is no mirroring mode,only have normal images.
+ * @param angle Rotation angle of the child control in the current.range: 0-360
+ */
+ virtual bool StateChange(UIView* view, float angle) = 0;
+ virtual ~OnChildStateListener() {}
+ };
+
+ /**
+ * @brief Listens for the change of the angle status of the child control.
+ *
+ * @param Object of class OnChildStateListener.
+ * @since 1.0
+ * @version 1.0
+ */
+ void SetChildStateListener(OnChildStateListener* listener)
+ {
+ onChildStateListener_ = listener;
+ }
+
/**
* @brief Get current mode.
*/
*/
void SetCamY(int16_t y);
+ /**
+ * @brief Obtains the view name.
+ * @param view Specifies the view to be obtained.
+ */
+ static std::string GetRollerItemName(UIView* view);
+
+ bool IsShowMirrorMode()
+ {
+ return isShowMirrorImg_;
+ }
+
UIViewType GetViewType() const override
{
return UI_ROLLER_VIEW;
bool OnDragEvent(const DragEvent& event) override;
bool OnDragEndEvent(const DragEvent& event) override;
#if ENABLE_ROTATE_INPUT
+ bool OnRotateStartEvent(const RotateEvent& event) override;
bool OnRotateEvent(const RotateEvent& event) override;
bool OnRotateEndEvent(const RotateEvent& event) override;
#endif
static constexpr float TRANSITION_COEFFICIENT = 0.2;
OnModeChangeListener* onModeChangeListener_ = nullptr;
OnScrollListener* onScrollListener_ = nullptr;
+ OnChildStateListener* onChildStateListener_ = nullptr;
float ConvertDistanceToAngle(int16_t distance);
bool IsInCurrentItemRange(float angle);
void InitImg(UIView* img);
uint16_t itemPadding_ = 0;
bool needLayout_ = false;
UIViewGroup* currentItem_ = nullptr;
+#if ENABLE_VIBRATOR
+ UIViewGroup* lastItem_ = nullptr;
+ bool needVibration_ = false;
+#endif
UIViewGroup* alignItem_ = nullptr;
bool isShowMirrorImg_;
float alignAngle_ = 0.0f;
HW_DRAW_FLUSH,
HW_DRAW_WAIT,
HW_DRAW_ARC_RECT,
+ HW_DRAW_LINE,
+ HW_DRAW_ARC,
+ HW_DRAW_CUBICBEZIER,
DRAW_MAX
};
class FontGlobalManager : public HeapBase {
public:
+ class LangChangeListener {
+ public:
+ virtual void OnLangChange(uint8_t langId) = 0;
+ virtual ~LangChangeListener() {}
+ };
char* GetText(uint16_t textId);
bool RegisterLanguageInfo(const char** resFile, uint8_t totalLangId, uint8_t defaultLangId);
void UnRegisterLanguageInfo();
void SetCurrentLangId(uint8_t langId);
+ uint8_t GetCurrentLangId() const
+ {
+ return currentLangId_;
+ }
FontParam GetFontParam(uint16_t textId);
uint8_t GetTotalLangId();
static FontGlobalManager* GetInstance();
static constexpr uint16_t INVALID_TEXT_ID = 0xFFFF;
- static constexpr uint8_t INVALIDE_LANG_ID = 0xFF;
+ static constexpr uint8_t INVALID_LANG_ID = 0xFF;
private:
void RefreshViews(UIView* rootView);
LangBinInfo* GetLangBinInfo();
bool ReallocStringInfos(uint8_t totalLangId);
StringsInfo* stringsInfos_ = nullptr;
- uint8_t currentLangId_ = INVALIDE_LANG_ID; // 0xFF: the max lang id
+ uint8_t currentLangId_ = INVALID_LANG_ID; // 0xFF: the max lang id
uint8_t totalLangId_ = 0;
};
} // namespace OHOS
\r
void GraphicEventHandler::PostGraphicEvent(const GraphicEvent& event, bool exitLowPower)\r
{\r
+ queueMutex_.Lock();\r
if (exitLowPower) {\r
LowPowerManager::GetInstance()->ExitLowPower();\r
}\r
- queueMutex_.Lock();\r
eventQueue_.push(event);\r
pthreadCond_.Signal();\r
queueMutex_.Unlock();\r
bool UIListNested::OnDragStartEvent(const DragEvent& event)
{
- if (reboundSize_ != 0) {
- for (uint8_t i = 0; i < sizeof(isIntercepts_) / sizeof(bool); ++i) {
- isIntercepts_[i] = true;
- }
+ if (reboundSizeTop_ != 0) {
+ isIntercepts_[DragEvent::DIRECTION_TOP_TO_BOTTOM] = true;
+ }
+ if (reboundSizeBottom_ != 0) {
+ isIntercepts_[DragEvent::DIRECTION_BOTTOM_TO_TOP] = true;
+ }
+ if (reboundSizeLeft_ != 0) {
+ isIntercepts_[DragEvent::DIRECTION_LEFT_TO_RIGHT] = true;
+ }
+ if (reboundSizeRight_ != 0) {
+ isIntercepts_[DragEvent::DIRECTION_RIGHT_TO_LEFT] = true;
}
+
uint8_t dragDirection;
if (MATH_ABS(event.GetDeltaX()) >= MATH_ABS(event.GetDeltaY())) {
dragDirection = HORIZONTAL;
if (direction_ == VERTICAL) {
outOfBounds[DragEvent::DIRECTION_TOP_TO_BOTTOM] =
- childrenHead_->GetY() >= scrollBlankSize_ + childrenHead_->GetStyle(STYLE_MARGIN_TOP);
+ childrenHead_->GetY() >= scrollBlankSizeTop_ + childrenHead_->GetStyle(STYLE_MARGIN_TOP);
outOfBounds[DragEvent::DIRECTION_BOTTOM_TO_TOP] = childrenTail_->GetRelativeRect().GetBottom() <=
- listHeight - scrollBlankSize_ - childrenTail_->GetStyle(STYLE_MARGIN_BOTTOM);
+ listHeight - scrollBlankSizeBottom_ - childrenTail_->GetStyle(STYLE_MARGIN_BOTTOM);
} else {
outOfBounds[DragEvent::DIRECTION_LEFT_TO_RIGHT] =
- childrenHead_->GetX() >= scrollBlankSize_ + childrenHead_->GetStyle(STYLE_MARGIN_LEFT);
+ childrenHead_->GetX() >= scrollBlankSizeLeft_ + childrenHead_->GetStyle(STYLE_MARGIN_LEFT);
outOfBounds[DragEvent::DIRECTION_RIGHT_TO_LEFT] = childrenTail_->GetRelativeRect().GetRight() <=
- listWidth - scrollBlankSize_ - childrenTail_->GetStyle(STYLE_MARGIN_RIGHT);
+ listWidth - scrollBlankSizeRight_ - childrenTail_->GetStyle(STYLE_MARGIN_RIGHT);
}
bool transfer = false;
void UIListNested::SetBoundaryIntercept(uint8_t direction, bool isIntercept)
{
- if (direction > DragEvent::DIRECTION_BOTTOM_TO_TOP) {
- return;
- }
- if (reboundSize_ != 0) {
- GRAPHIC_LOGE("rebound size is not zero!");
- return;
+ switch (direction) {
+ case DragEvent::DIRECTION_LEFT_TO_RIGHT:
+ if (reboundSizeLeft_ != 0) {
+ GRAPHIC_LOGE("reboundSizeLeft_ is not zero!");
+ return;
+ }
+ break;
+ case DragEvent::DIRECTION_RIGHT_TO_LEFT:
+ if (reboundSizeRight_ != 0) {
+ GRAPHIC_LOGE("reboundSizeRight_ is not zero!");
+ return;
+ }
+ break;
+ case DragEvent::DIRECTION_TOP_TO_BOTTOM:
+ if (reboundSizeTop_ != 0) {
+ GRAPHIC_LOGE("reboundSizeTop_ is not zero!");
+ return;
+ }
+ break;
+ case DragEvent::DIRECTION_BOTTOM_TO_TOP:
+ if (reboundSizeBottom_ != 0) {
+ GRAPHIC_LOGE("reboundSizeBottom_ is not zero!");
+ return;
+ }
+ break;
+ default:
+ return;
}
+
uint8_t dragDirection = (direction == DragEvent::DIRECTION_LEFT_TO_RIGHT ||
direction == DragEvent::DIRECTION_RIGHT_TO_LEFT) ? HORIZONTAL : VERTICAL;
if (dragDirection != direction_) {
bool UIScrollViewNested::OnDragStartEvent(const DragEvent& event)
{
+ if (reboundSizeTop_ != 0) {
+ isIntercepts_[DragEvent::DIRECTION_TOP_TO_BOTTOM] = true;
+ }
+ if (reboundSizeBottom_ != 0) {
+ isIntercepts_[DragEvent::DIRECTION_BOTTOM_TO_TOP] = true;
+ }
+ if (reboundSizeLeft_ != 0) {
+ isIntercepts_[DragEvent::DIRECTION_LEFT_TO_RIGHT] = true;
+ }
+ if (reboundSizeRight_ != 0) {
+ isIntercepts_[DragEvent::DIRECTION_RIGHT_TO_LEFT] = true;
+ }
+
uint8_t dragDirection;
if (MATH_ABS(event.GetDeltaX()) >= MATH_ABS(event.GetDeltaY())) {
dragDirection = HORIZONTAL;
int16_t scrollHeight = GetHeight();
bool outOfBounds[4] = {false, false, false, false}; // 4: the number of direction
if (direction_ == VERTICAL) {
- outOfBounds[DragEvent::DIRECTION_TOP_TO_BOTTOM] = childRect.GetTop() >= scrollBlankSize_;
- outOfBounds[DragEvent::DIRECTION_BOTTOM_TO_TOP] = childRect.GetBottom() <= scrollHeight - scrollBlankSize_;
+ outOfBounds[DragEvent::DIRECTION_TOP_TO_BOTTOM] = childRect.GetTop() >= scrollBlankSizeTop_;
+ outOfBounds[DragEvent::DIRECTION_BOTTOM_TO_TOP] =
+ childRect.GetBottom() <= scrollHeight - scrollBlankSizeBottom_;
} else {
- outOfBounds[DragEvent::DIRECTION_LEFT_TO_RIGHT] = childRect.GetLeft() >= scrollBlankSize_;
- outOfBounds[DragEvent::DIRECTION_RIGHT_TO_LEFT] = childRect.GetRight() <= scrollWidth - scrollBlankSize_;
+ outOfBounds[DragEvent::DIRECTION_LEFT_TO_RIGHT] = childRect.GetLeft() >= scrollBlankSizeLeft_;
+ outOfBounds[DragEvent::DIRECTION_RIGHT_TO_LEFT] = childRect.GetRight() <= scrollWidth - scrollBlankSizeRight_;
}
bool transfer = false;
void UIScrollViewNested::SetBoundaryIntercept(uint8_t direction, bool isIntercept)
{
- if (direction > DragEvent::DIRECTION_BOTTOM_TO_TOP) {
- return;
+ switch (direction) {
+ case DragEvent::DIRECTION_LEFT_TO_RIGHT:
+ if (reboundSizeLeft_ != 0) {
+ GRAPHIC_LOGE("reboundSizeLeft_ is not zero!");
+ return;
+ }
+ break;
+ case DragEvent::DIRECTION_RIGHT_TO_LEFT:
+ if (reboundSizeRight_ != 0) {
+ GRAPHIC_LOGE("reboundSizeRight_ is not zero!");
+ return;
+ }
+ break;
+ case DragEvent::DIRECTION_TOP_TO_BOTTOM:
+ if (reboundSizeTop_ != 0) {
+ GRAPHIC_LOGE("reboundSizeTop_ is not zero!");
+ return;
+ }
+ break;
+ case DragEvent::DIRECTION_BOTTOM_TO_TOP:
+ if (reboundSizeBottom_ != 0) {
+ GRAPHIC_LOGE("reboundSizeBottom_ is not zero!");
+ return;
+ }
+ break;
+ default:
+ return;
}
+
uint8_t dragDirection = (direction == DragEvent::DIRECTION_LEFT_TO_RIGHT ||
direction == DragEvent::DIRECTION_RIGHT_TO_LEFT) ? HORIZONTAL : VERTICAL;
if (dragDirection != direction_) {
#include "dfx/dfx_frame_trace.h"
#include "common/low_power_manager.h"
#include "common/image_cache_manager.h"
-
+#include "common/input_device_manager.h"
+#include "common/task_manager.h"
+#include "graphic_service_wrapper.h"
+#include "graphic_event_handler.h"
+#include "animator/animator_manager.h"
#if ENABLE_DEBUG
#include "common/key_code.h"
#include "dfx/event_injector.h"
printf(" NativeRunninng: %d\n", GraphicService::GetInstance()->IsNativeRunning());
printf(" IsScreenOn: %d\n", GraphicService::GetInstance()->IsScreenOn());
printf(" GraphicTaskTriggeredCount: %d\n", GraphicService::GetInstance()->GetGraphicTaskTriggeredCount());
+ printf(" LowPower:\n");
+ printf(" Frequence: %d\n", GetFrequence());
+ printf(" Task: total num: %d\n", TaskManager::GetInstance()->GetTotalTaskNum());
+ printf(" Animator: total num: %d, active num: %d\n",
+ AnimatorManager::GetInstance()->GetTotalAnimatorNum(),
+ AnimatorManager::GetInstance()->GetActiveAnimatorNum());
+ printf(" InputEvent Exist: %d\n", InputDeviceManager::GetInstance()->IsEventExist());
+ printf(" PendingFrame: %d\n", LiteMGfxEngine::GetInstance()->HasPendingFrame());
+ printf(" SufaceView Exist: %d\n", LowPowerManager::GetInstance()->IsLiteSurfaceInRootView());
}
void LeakPanic(int argc, char *argv[])
}
}
+void ForceRefresh(int argc, char *argv[])
+{
+ if (argc == 0) {
+ GraphicService::GetInstance()->PostGraphicEvent([]() { RootView::GetInstance()->Invalidate(); });
+ } else {
+ printf("param err.\n");
+ }
+}
+
void HideFPS(int argc, char *argv[])
{
FPSTask::GetInstance()->HideFPS();
{"hidefps", OHOS::HideFPS},
{"showfps", OHOS::ShowFPS},
{"showtime", OHOS::ShowTime},
+ {"refresh", OHOS::ForceRefresh},
#if ENABLE_MEMORY_CHECK
{"dumpstate", OHOS::DumpState},
{"dumpmem", OHOS::DumpMemoryCmd},
for (i = 0; i < sizeof(g_dfxCmdList) / sizeof(g_dfxCmdList[0]); i++) {
if (!strcmp(g_dfxCmdList[i].cmdType, argv[0])) {
- OHOS::LowPowerManager::GetInstance()->ExitLowPower();
+ if (strcmp(argv[0], "dumpstate") != 0) {
+ OHOS::LowPowerManager::GetInstance()->ExitLowPower();
+ }
g_dfxCmdList[i].func(argc - 1, &argv[1]);
return true;
}
{UI_TRANSFORM_LIST, "UI_TRANSFORM_LIST"},
{UI_COVER_FLOW_2, "UI_COVER_FLOW_2"},
{UI_SPHERE_VIEW, "UI_SPHERE_VIEW"},
+ {UI_PARTICLE_VIEW, "UI_PARTICLE_VIEW"},
{UI_NUMBER_MAX, "UI_NUMBER_MAX"},
};
{FrameTraceType::HW_DRAW_FLUSH, "hw_flush"},
{FrameTraceType::HW_DRAW_WAIT, "hw_wait"},
{FrameTraceType::HW_DRAW_ARC_RECT, "hw_arc_rect"},
+ {FrameTraceType::HW_DRAW_LINE, "hw_line"},
+ {FrameTraceType::HW_DRAW_ARC, "hw_arc"},
+ {FrameTraceType::HW_DRAW_CUBICBEZIER, "hw_bezier"},
};
int DfxFrameTrace::evtCnt_ = 0;
printf("Total: E %d, T %d, F %d\n", evtCnt_, tskCnt_, frmCnt_);
for (EventRecord *it = events_; it != nullptr; it = it->next) {
EventRecord &evt = *it;
- printf("\nE %d: %llu\n", evtIndex, GetDuration(evt.startTime, evt.endTime));
+ printf("\nE %d: %llu, (%llu, %llu)\n", evtIndex, GetDuration(evt.startTime, evt.endTime),
+ evt.startTime, evt.endTime);
taskIndex = 0;
for (TaskRecord *it1 = evt.tasks; it1 != nullptr; it1 = it1->next) {
TaskRecord &tsk = *it1;
- printf(" T %d: %llu\n", taskIndex, GetDuration(tsk.startTime, tsk.endTime));
+ printf(" T %d: %llu, (%llu, %llu)\n", taskIndex, GetDuration(tsk.startTime, tsk.endTime),
+ tsk.startTime, tsk.endTime);
if (tsk.frameInfo != nullptr) {
ShowFrameRecord(tsk.frameInfo);
}
}\r
KeyEvent event({data.keyId, data.state});\r
RootView::GetInstance()->OnKeyEvent(event);\r
- #ifdef SUPPORT_OHOSFWK\r
+#ifdef SUPPORT_OHOSFWK\r
if (!GraphicService::GetInstance()->IsNativeRunning()) {\r
OHOS::ACELite::KeyListener::GetInstance()->OnKeyEvent(event);\r
}\r
- #endif\r
+#endif\r
}\r
\r
bool LiteKeyDevice::IsEventEmpty()\r
}
void ClipImg::ClipImgByPath(ImageInfo& dstInfo, ImageInfo& srcInfo, const Path* path, Rect* srcImgArea,
- const Matrix4<float>* pathMatrix, const Matrix4<float>* imgMatrix)
+ const Matrix4<float>* pathMatrix, const Matrix4<float>* imgMatrix, bool isAlphaFF)
{
if (path == nullptr || path->cmds == nullptr || path->data == nullptr) {
return;
uintptr_t handle = LiteMGfxEngine::GetInstance()->InitPath(true);
LiteMGfxEngine::GetInstance()->SetPathData(handle, path->cmdNum, path->cmds, path->dataNum, path->data);
- LiteMGfxEngine::GetInstance()->ClipImgByPath(dstInfo, srcInfo, handle, srcImgArea, pathMatrix, imgMatrix);
+ if (isAlphaFF) {
+ LiteMGfxEngine::GetInstance()->ClipImgByPath(dstInfo, srcInfo, handle, srcImgArea, pathMatrix, imgMatrix, true);
+ } else {
+ LiteMGfxEngine::GetInstance()->ClipImgByPath(dstInfo, srcInfo, handle, srcImgArea, pathMatrix, imgMatrix);
+ }
}
ImageInfo ClipImg::ClipImgByCircle(ImageInfo& srcInfo, Point center, int16_t radius,
class ClipImg : public HeapBase {
public:
static void ClipImgByPath(ImageInfo& dstInfo, ImageInfo& srcInfo, const Path* path, Rect* srcImgArea,
- const Matrix4<float>* pathMatrix, const Matrix4<float>* imgMatrix);
+ const Matrix4<float>* pathMatrix, const Matrix4<float>* imgMatrix, bool isAlphaFF = false);
static ImageInfo ClipImgByCircle(ImageInfo& srcInfo, Point center, int16_t radius,
ColorMode mode = RGB888, bool immediatelySync = false);
static ImageInfo ClipImgByRect(ImageInfo& srcInfo, Rect* srcImgArea, Rect clipArea, ColorMode mode = RGB888);
#if ENABLE_VGU_ENGINE && CAPABILITY_HWDRAW_PATH
namespace OHOS {
constexpr float ARC_TO_BEZIER_90_DEG = 0.551915024494f;
-#define RAD_90_DEG (90 / RADIAN_TO_ANGLE)
-constexpr int16_t DEG_360 = 360;
-constexpr int16_t DEG_90 = 90;
-constexpr int16_t DATA_NUM_PER_BEZIER = 6;
+constexpr int16_t DATA_NUM_PER_BEZ = 6;
+constexpr float PRECISION_ANGLE = 0.01f;
+
+bool HWDrawUtils::AllocBufferForCmd(uint16_t cmdNum, uint8_t*& addr)
+{
+ AllocInfo dataInfo;
+ dataInfo.expectedSize = sizeof(uint8_t) * cmdNum;
+ dataInfo.usage = HBM_USE_ASSIGN_SIZE | HBM_USE_MEM_PATH;
+ GrallocBuffer dataBuffer;
+ if (!GrallocEngines::GetInstance()->AllocBuffer(dataInfo, dataBuffer)) {
+ GRAPHIC_LOGE("Alloc buffer for data failed.");
+ return false;
+ }
+ addr = reinterpret_cast<uint8_t*>(dataBuffer.virAddr);
+ return true;
+}
bool HWDrawUtils::AllocBufferForData(uint16_t dataNum, float*& addr)
{
return true;
}
-void HWDrawUtils::GetArcControlPoint(float* arcData, const Point& center, float mangicNum, int8_t neg)
+void HWDrawUtils::GetArcControlPoint(float* arcData, float centerX, float centerY, float mangicNum, int8_t neg)
{
- arcData[2] = arcData[0] - (neg * mangicNum * (arcData[1] - center.y)); // 2: index
- arcData[3] = arcData[1] + (neg * mangicNum * (arcData[0] - center.x)); // 3: index
- arcData[4] = arcData[6] + (neg * mangicNum * (arcData[7] - center.y)); // 4, 6, 7: index
- arcData[5] = arcData[7] - (neg * mangicNum * (arcData[6] - center.x)); // 5, 7, 6: index
+ arcData[2] = arcData[0] - (neg * mangicNum * (arcData[1] - centerY)); // 2: index
+ arcData[3] = arcData[1] + (neg * mangicNum * (arcData[0] - centerX)); // 3: index
+ arcData[4] = arcData[6] + (neg * mangicNum * (arcData[7] - centerY)); // 4, 6, 7: index
+ arcData[5] = arcData[7] - (neg * mangicNum * (arcData[6] - centerX)); // 5, 7, 6: index
}
-void HWDrawUtils::ConvertCircularDegree(float& angle)
+static float ConvertArcDegree(ArcInfo& arc, uint32_t& quaNum, uint32_t& bezNum)
{
- if (angle >= DEG_360) {
- angle = angle - DEG_360 * (angle / DEG_360);
+ // convert angle in the interface to gpu angle
+ arc.startAngle = arc.startAngle - QUARTER_IN_DEGREE;
+ arc.endAngle = arc.endAngle - QUARTER_IN_DEGREE;
+ float deltaAngle = abs(arc.endAngle - arc.startAngle);
+ if (FloatMore(deltaAngle, CIRCLE_IN_DEGREE, PRECISION_ANGLE)) {
+ arc.startAngle = 0.0f;
+ arc.endAngle = CIRCLE_IN_DEGREE;
+ quaNum = 4; // 4: num of quaerter in circle
+ bezNum = 4; // 4: num of quaerter in circle
+ return 0.0f;
}
- if (angle - DEG_90 >= 0) {
- angle -= DEG_90;
- } else {
- angle = DEG_360 - (DEG_90 - angle);
+ int neg = (arc.startAngle < arc.endAngle) ? 1 : -1;
+ uint32_t deltaAngleInt = static_cast<uint32_t>(deltaAngle);
+ if (FloatEqual(deltaAngle - deltaAngleInt, 1.0f, PRECISION_ANGLE)) {
+ deltaAngleInt += 1;
}
+ quaNum = deltaAngleInt / QUARTER_IN_DEGREE;
+ float remain = deltaAngle - quaNum * QUARTER_IN_DEGREE;
+ bezNum = FloatMore(remain, 0.0f, PRECISION_ANGLE) ? quaNum + 1: quaNum;
+ return remain;
}
-int8_t HWDrawUtils::GetArcData(float* arcData, const Point& center,
- uint16_t radius, float startAngle, float endAngle)
+void HWDrawUtils::GetArcData(float* arcData, const ArcInfo& arc, uint32_t quaNum, float remain)
{
- int neg = (startAngle < endAngle) ? 1 : -1;
- float angleExtend = endAngle - startAngle;
- int loop = static_cast<float>(angleExtend) * neg / DEG_90;
-
- ConvertCircularDegree(startAngle);
- float startAngleRad = startAngle / RADIAN_TO_ANGLE;
- float extendRad = angleExtend / RADIAN_TO_ANGLE;
- float endAngleRad = startAngleRad + extendRad;
-
- arcData[0] = center.x + radius * cos(startAngleRad);
- arcData[1] = center.y + radius * sin(startAngleRad);
- int8_t bezierSegmentCount = 0;
- float a = startAngleRad + neg * RAD_90_DEG;
- for (int i = 0; i < loop; ++i) {
- arcData[DATA_NUM_PER_BEZIER * bezierSegmentCount + 6] = center.x + radius * cos(a); // 6: x offset
- arcData[DATA_NUM_PER_BEZIER * bezierSegmentCount + 7] = center.y + radius * sin(a); // 7: y offset
- GetArcControlPoint(&arcData[DATA_NUM_PER_BEZIER * bezierSegmentCount], center, ARC_TO_BEZIER_90_DEG, neg);
- ++bezierSegmentCount;
- a += (neg * RAD_90_DEG); // when neg == 1, then clockwise; when neg == -1, counter clockwise
+ Point center = arc.center;
+ int16_t radius = arc.radius;
+ int neg = (arc.startAngle < arc.endAngle) ? 1 : -1;
+
+ arcData[0] = center.x + radius * Sin(QUARTER_IN_DEGREE - arc.startAngle);
+ arcData[1] = center.y + radius * Sin(arc.startAngle);
+ float angle = arc.startAngle;
+ for (uint32_t i = 0; i < quaNum; ++i) {
+ angle += (neg * QUARTER_IN_DEGREE); // when neg == 1, then clockwise; when neg == -1, counter clockwise
+ arcData[DATA_NUM_PER_BEZ * i + 6] = center.x + radius * Sin(QUARTER_IN_DEGREE - angle); // 6: offset
+ arcData[DATA_NUM_PER_BEZ * i + 7] = center.y + radius * Sin(angle); // 7: offset
+ GetArcControlPoint(&arcData[DATA_NUM_PER_BEZ * i], center.x, center.y, ARC_TO_BEZIER_90_DEG, neg);
}
- a = RAD_90_DEG - (a - endAngleRad) * neg;
- if (a > 1e-5) {
- arcData[DATA_NUM_PER_BEZIER * bezierSegmentCount + 6] = center.x + radius * cos(endAngleRad); // 6: x offset
- arcData[DATA_NUM_PER_BEZIER * bezierSegmentCount + 7] = center.y + radius * sin(endAngleRad); // 7: y offset
+ if (FloatMore(remain, 0.0f, PRECISION_ANGLE)) {
+ arcData[DATA_NUM_PER_BEZ * quaNum + 6] = center.x + radius * Sin(QUARTER_IN_DEGREE - arc.endAngle); // 6: offset
+ arcData[DATA_NUM_PER_BEZ * quaNum + 7] = center.y + radius * Sin(arc.endAngle); // 7: offset
// 4.0: multiplier, 3.0: divider, 2: divider
- float magicNum = 4.0f / 3.0f * (1 - cos(a / 2)) / sin(a / 2);
- GetArcControlPoint(&arcData[DATA_NUM_PER_BEZIER * bezierSegmentCount], center, magicNum, neg);
- ++bezierSegmentCount;
+ float magicNum = 4.0f / 3.0f * (1 - Sin(QUARTER_IN_DEGREE - remain / 2)) / Sin(remain / 2);
+ GetArcControlPoint(&arcData[DATA_NUM_PER_BEZ * quaNum], center.x, center.y, magicNum, neg);
}
- return bezierSegmentCount;
}
-void HWDrawUtils::Obtain30DegSectorPath(const ArcInfo& arc, uint8_t* cmd, float* data)
+void HWDrawUtils::Obtain30DegSectorPath(const ArcInfo& arc, float x, float y, uint8_t* cmd, float* data)
{
- float startAngle = arc.startAngle;
- float endAngle = arc.endAngle;
- float angleExtend = endAngle - startAngle;
+ // convert angle in the interface to gpu angle
+ float startAngle = (arc.startAngle - QUARTER_IN_DEGREE) / RADIAN_TO_ANGLE;
+ // make sure the range is accurate, not use (arc.endAngle - QUARTER_IN_DEGREE) / RADIAN_TO_ANGLE
+ float endAngle = startAngle + (arc.endAngle - arc.startAngle) / RADIAN_TO_ANGLE;
float neg = (startAngle < endAngle) ? 1 : -1;
- ConvertCircularDegree(startAngle);
- float startAngleRad = startAngle / RADIAN_TO_ANGLE;
- float extendRad = static_cast<float>(angleExtend) / RADIAN_TO_ANGLE;
- float endAngleRad = startAngleRad + extendRad;
-
cmd[0] = CMD_MOVE_TO;
cmd[1] = CMD_LINE_TO;
cmd[2] = CMD_CUBIC_TO; // 2: index
cmd[3] = CMD_CLOSE; // 3: index
- float a = startAngleRad + neg * RAD_90_DEG;
- a = RAD_90_DEG - (a - endAngleRad) * neg;
-
- data[0] = arc.center.x;
- data[1] = arc.center.y;
- data[2] = arc.center.x + arc.radius * cos(startAngleRad); // 2: index
- data[3] = arc.center.y + arc.radius * sin(startAngleRad); // 3: index
- data[8] = arc.center.x + arc.radius * cos(endAngleRad); // 8: index
- data[9] = arc.center.y + arc.radius * sin(endAngleRad); // 9: index
-
+ float a = (endAngle - startAngle) * neg;
+ data[0] = x;
+ data[1] = y;
+ data[2] = x + arc.radius * cos(startAngle); // 2: index
+ data[3] = y + arc.radius * sin(startAngle); // 3: index
+ data[8] = x + arc.radius * cos(endAngle); // 8: index
+ data[9] = y + arc.radius * sin(endAngle); // 9: index
float magicNum = 4.0f / 3.0f * (1 - cos(a / 2)) / sin(a / 2); // 2: divisor
- GetArcControlPoint(&data[2], arc.center, magicNum, neg); // 2: index
+ GetArcControlPoint(&data[2], x, y, magicNum, neg); // 2: index
}
-bool HWDrawUtils::ObtainArcPath(const ArcInfo& arc, uint32_t& cmdNum, uint8_t*& cmds, uint32_t& dataNum, float*& data)
+bool HWDrawUtils::ObtainArcPath(ArcInfo arc, uint32_t& cmdNum, uint8_t*& cmds, uint32_t& dataNum, float*& data)
{
- float startAngle = arc.startAngle;
- float endAngle = arc.endAngle;
-
- int16_t num = (abs(endAngle - startAngle) / DEG_90 + 1) * DATA_NUM_PER_BEZIER + 2; // 2: coordinate num
- AllocInfo cmdInfo;
- cmdInfo.expectedSize = sizeof(uint8_t) * (num + 1);
- cmdInfo.usage = HBM_USE_ASSIGN_SIZE | HBM_USE_MEM_PATH;
- GrallocBuffer cmdBuffer;
- if (!GrallocEngines::GetInstance()->AllocBuffer(cmdInfo, cmdBuffer)) {
- GRAPHIC_LOGE("Alloc buffer for cmd failed.");
+ uint32_t quaNum = 0;
+ uint32_t bezNum = 0;
+ float remain = ConvertArcDegree(arc, quaNum, bezNum);
+
+ cmdNum = bezNum + 1;
+ dataNum = bezNum * DATA_NUM_PER_BEZ + 2; // 2: the number of start point path data
+ if (!AllocBufferForCmd(cmdNum, cmds)) {
return false;
}
- cmds = (uint8_t *)cmdBuffer.virAddr;
- if (!AllocBufferForData(num, data)) {
+ if (!AllocBufferForData(dataNum, data)) {
GrallocEngines::GetInstance()->FreeBuffer(cmds);
cmds = nullptr;
return false;
}
- int8_t bezierSegmentCount = GetArcData(data, arc.center, arc.radius, startAngle, endAngle);
- dataNum = DATA_NUM_PER_BEZIER * bezierSegmentCount + 2; // 2: coordinate num
- cmdNum = bezierSegmentCount + 1;
+ GetArcData(data, arc, quaNum, remain);
cmds[0] = CMD_MOVE_TO;
- for (int i = 1; i <= bezierSegmentCount; i++) {
+ for (int i = 1; i < cmdNum; i++) {
+ cmds[i] = CMD_CUBIC_TO;
+ }
+ return true;
+}
+
+bool HWDrawUtils::ObtainSectorPath(ArcInfo arc, uint32_t& cmdNum, uint8_t*& cmds,
+ uint32_t& dataNum, float*& data)
+{
+ uint32_t quaNum = 0;
+ uint32_t bezNum = 0;
+ float remain = ConvertArcDegree(arc, quaNum, bezNum);
+
+ cmdNum = bezNum + 3; // 3: num of cmds, which are assigned in the below code
+ dataNum = bezNum * DATA_NUM_PER_BEZ + 4; // 4: the number of path data, include center and start point
+ if (!AllocBufferForCmd(cmdNum, cmds)) {
+ return false;
+ }
+ if (!AllocBufferForData(dataNum, data)) {
+ GrallocEngines::GetInstance()->FreeBuffer(cmds);
+ cmds = nullptr;
+ return false;
+ }
+ data[0] = arc.center.x;
+ data[1] = arc.center.y;
+ GetArcData(data + 2, arc, quaNum, remain); // 2: offset
+ cmds[0] = CMD_MOVE_TO;
+ cmds[1] = CMD_LINE_TO;
+ cmds[cmdNum - 1] = CMD_CLOSE;
+ for (int i = 2; i < cmdNum - 1; i++) {
cmds[i] = CMD_CUBIC_TO;
}
return true;
Point center = arc.center;
cmdNum = 5; // 5: Circle path command number is 5
- AllocInfo cmdInfo;
- cmdInfo.expectedSize = sizeof(uint8_t) * cmdNum;
- cmdInfo.usage = HBM_USE_ASSIGN_SIZE | HBM_USE_MEM_PATH;
- GrallocBuffer cmdBuffer;
- if (!GrallocEngines::GetInstance()->AllocBuffer(cmdInfo, cmdBuffer)) {
- GRAPHIC_LOGE("Alloc buffer for cmd failed.");
+ if (!AllocBufferForCmd(cmdNum, cmds)) {
return false;
}
- cmds = (uint8_t *)cmdBuffer.virAddr;
dataNum = 26; // Circle path data number is 26
if (!AllocBufferForData(dataNum, data)) {
GrallocEngines::GetInstance()->FreeBuffer(cmds);
bool HWDrawUtils::ObtainRectPathWithRadius(const Rect& rect, Path& path, int16_t radius)
{
path.cmdNum = 10; // 10: Circle path command number is 10
- AllocInfo cmdInfo;
- cmdInfo.expectedSize = sizeof(uint8_t) * path.cmdNum;
- cmdInfo.usage = HBM_USE_ASSIGN_SIZE | HBM_USE_MEM_PATH;
- GrallocBuffer cmdBuffer;
- if (!GrallocEngines::GetInstance()->AllocBuffer(cmdInfo, cmdBuffer)) {
- GRAPHIC_LOGE("Alloc buffer for cmd failed.");
+ if (!AllocBufferForCmd(path.cmdNum, path.cmds)) {
return false;
}
- path.cmds = (uint8_t *)cmdBuffer.virAddr;
-
path.cmds[0] = CMD_MOVE_TO;
path.cmds[1] = CMD_LINE_TO;
path.cmds[2] = CMD_CUBIC_TO; // 2: cmd index
data[32] = x1; // 32: index
data[33] = y1 + r; // 33: index
- Point center1 = {x1 + r, y2 - r};
- GetArcControlPoint(&data[2], center1, ARC_TO_BEZIER_90_DEG, -1); // 2: index
+ GetArcControlPoint(&data[2], x1 + r, y2 - r, ARC_TO_BEZIER_90_DEG, -1); // 2: index
- Point center2 = {x2 - r, y2 - r};
- GetArcControlPoint(&data[10], center2, ARC_TO_BEZIER_90_DEG, -1); // 10: index
+ GetArcControlPoint(&data[10], x2 - r, y2 - r, ARC_TO_BEZIER_90_DEG, -1); // 10: index
- Point center3 = {x2 - r, y1 + r};
- GetArcControlPoint(&data[18], center3, ARC_TO_BEZIER_90_DEG, -1); // 18: index
+ GetArcControlPoint(&data[18], x2 - r, y1 + r, ARC_TO_BEZIER_90_DEG, -1); // 18: index
- Point center4 = {x1 + r, y1 + r};
- GetArcControlPoint(&data[26], center4, ARC_TO_BEZIER_90_DEG, -1); // 26: index
+ GetArcControlPoint(&data[26], x1 + r, y1 + r, ARC_TO_BEZIER_90_DEG, -1); // 26: index
}
}
#endif
static HWDrawUtils instance;
return &instance;
}
- bool ObtainArcPath(const ArcInfo& arc, uint32_t& cmdNum, uint8_t*& cmds, uint32_t& dataNum, float*& data);
+ bool ObtainArcPath(ArcInfo arc, uint32_t& cmdNum, uint8_t*& cmds, uint32_t& dataNum, float*& data);
+ bool ObtainSectorPath(ArcInfo arc, uint32_t& cmdNum, uint8_t*& cmds, uint32_t& dataNum, float*& data);
bool ObtainCirclePath(const ArcInfo& arc, uint32_t& cmdNum, uint8_t*& cmds, uint32_t& dataNum, float*& data);
+ bool AllocBufferForCmd(uint16_t cmdNum, uint8_t*& addr);
bool AllocBufferForData(uint16_t dataNum, float*& addr);
- void Obtain30DegSectorPath(const ArcInfo& arc, uint8_t* cmd, float* data);
+ void Obtain30DegSectorPath(const ArcInfo& arc, float x, float y, uint8_t* cmd, float* data);
bool ObtainRectPathWithRadius(const Rect& rect, Path& path, int16_t radius);
private:
HWDrawUtils() {}
virtual ~HWDrawUtils() {}
- int8_t GetArcData(float* arcData, const Point& center, uint16_t radius, float startAngle, float endAngle);
- void GetArcControlPoint(float* arcData, const Point& center, float mangicNum, int8_t neg);
- void ConvertCircularDegree(float& angle);
+ void GetArcData(float* arcData, const ArcInfo& arc, uint32_t quaNum, float bezMore);
+ void GetArcControlPoint(float* arcData, float centerX, float centerY, float mangicNum, int8_t neg);
void GetFilledRoundRectData(float* data, uint16_t radius, const Rect& rect);
};
}
const Rect& subRect,
const BlendOption& blendOption) override;
- void Blur(BufferInfo& dst, uint16_t radius) override;
+ void Blur(BufferInfo& dst, float radius) override;
void Fill(BufferInfo& dst,
const Rect& fillArea,
VGUStrokeAttr* strokeAttr, VGUFillAttr* fillAttr, VGUMatrix3* matrix);
void ClipImgByPath(ImageInfo& dstInfo, ImageInfo& srcInfo, uintptr_t path, Rect* srcImgArea,
- const Matrix4<float>* pathMatrix, const Matrix4<float>* imgMatrix);
+ const Matrix4<float>* pathMatrix, const Matrix4<float>* imgMatrix, bool isAlphaFF = false);
bool Convert2VGUFormat(const ColorMode& colorMode, VGUPixelFormat& dstColorFmt) const;
void AddHardwareLayer(IHardwareView* view)
ReleasePath();
}
- void DrawRoundRect(BufferInfo& dst, const Rect& fillArea, const Style& style, const Rect& dirtyRect);
+ void DrawRectWithRound(BufferInfo& dst, const Rect& rect, const Style& style, const Rect& dirtyRect,
+ OpacityType opacity);
+ void DrawRectWithoutRound(BufferInfo& dst, const Rect& rect, const Style& style, const Rect& dirtyRect,
+ OpacityType opacity);
List<Path*> pathList_ = {};
void ReleasePath();
src.vir_buf = reinterpret_cast<td_char *>(filedata_);
src.phy_buf = reinterpret_cast<td_u32>(src.vir_buf);
src.size = g_fileLen;
- dinfo_.scale = JPEG_SCALE_1;
+ dinfo_.scale = JPEG_SCALE_1; // suggest to customize the scaling ratio based on the file name.
dinfo_.output_yuv420sp = true;
int ret = uapi_jpeg_decomress_create(&dinfo_, &src, true);
return RetCode::FAIL;
}
- dsc.imgInfo.header.width = dinfo_.image_width;
- dsc.imgInfo.header.height = dinfo_.image_height;
+ dsc.imgInfo.header.width = dinfo_.output_width;
+ dsc.imgInfo.header.height = dinfo_.output_height;
dsc.imgInfo.header.colorMode = RGB888;
+ dsc.imgInfo.header.compressMode = 0;
return RetCode::OK;
}
uint8_t* uvStart = reinterpret_cast<uint8_t*>(dst->vir_buf) + dst->uv_offset;
uint32_t uvLength = dinfo_.output.size[1];
- uint16_t imgWidth = dinfo_.image_width;
- uint16_t imgHeight = dinfo_.image_height;
+ uint16_t imgWidth = dinfo_.output_width;
+ uint16_t imgHeight = dinfo_.output_height;
uint16_t alignedImgWidth = ALIGN_BYTE(imgWidth, BYTE_ALIGNMENT);
uint32_t rgbSize = alignedImgWidth * imgHeight * 3; // 3: bpp of RGB888
ImageInfo tempImgInfo = {0};
#endif
#if ENABLE_MEMORY_CHECK
if (isMonitorEnabled_) {
- printf("[Alloc] addr = %p, size = %d, usage = %llu\n", bufferHandle->virAddr, bufferHandle->size, bufferHandle->usage);
+ printf("[Alloc] addr = %p, size = %d, usage = %llu\n",
+ bufferHandle->virAddr, bufferHandle->size, bufferHandle->usage);
}
#endif
if ((info.usage & HBM_USE_MEM_YUV) == HBM_USE_MEM_YUV) {
}
lock_.Unlock();
#ifdef __LITEOS__
+#ifdef LOSCFG_BACKTRACE
+ GRAPHIC_LOGE("Mem leak! Check backtrace!");
+ LOS_BackTrace();
+#else
LOS_Panic("mem leak here!\n");
+#endif
#endif
}
\r
namespace OHOS {\r
namespace {\r
-struct FaceInfo {\r
- const char* name;\r
- const char* path;\r
-} ;\r
-\r
static constexpr uint8_t COVERFLOW_MAX_PAGE_NUM = 6;\r
-static FaceInfo g_faceInfo[COVERFLOW_MAX_PAGE_NUM] = {\r
- {"1 rainbow", RES_PATH"/rainbow.bin"},\r
- {"2 kaleidoscope", RES_PATH"/kaleidoscope.bin"},\r
- {"3 planet", RES_PATH"/planet.bin"},\r
- {"4 rainbow", RES_PATH"/rainbow.bin"},\r
- {"5 kaleidoscope", RES_PATH"/kaleidoscope.bin"},\r
- {"6 planet", RES_PATH"/planet.bin"}\r
+const char* g_faceInfo[COVERFLOW_MAX_PAGE_NUM] = {\r
+ RES_PATH"/rainbow.bin",\r
+ RES_PATH"/kaleidoscope.bin",\r
+ RES_PATH"/planet.bin",\r
+ RES_PATH"/rainbow.bin",\r
+ RES_PATH"/kaleidoscope.bin",\r
+ RES_PATH"/planet.bin"\r
};\r
-const char* addImgPath = RES_PATH"/add.bin";\r
-const char* subImgPath = RES_PATH"/sub.bin";\r
+\r
+static const char* ADD_IMG_PATH = RES_PATH"/add.bin";\r
+static const char* SUB_IMG_PATH = RES_PATH"/sub.bin";\r
static constexpr uint8_t PAGE_MARGIN = 20;\r
static constexpr uint16_t PAGE_WIDTH = 250;\r
static constexpr uint16_t PAGE_HEIGHT = 250;\r
UIImageView* image = new UIImageView();\r
image->Resize(IMAGE_WIDTH, IMAGE_HEIGHT);\r
page->Add(image);\r
- ImageInfo* src = ImageCacheManager::GetInstance().LoadSingleRes(std::string(g_faceInfo[i].path));\r
+ ImageInfo* src = ImageCacheManager::GetInstance().LoadSingleRes(std::string(g_faceInfo[i]));\r
image->SetSrc(src);\r
image->LayoutCenterOfParent();\r
\r
UIImageView* imageSub = new UIImageView();\r
imageSub->SetPosition(200, 0, 50, 50); // 200: x position 50: width and height\r
page->Add(imageSub);\r
- src = ImageCacheManager::GetInstance().LoadSingleRes(std::string(subImgPath));\r
+ src = ImageCacheManager::GetInstance().LoadSingleRes(std::string(SUB_IMG_PATH));\r
imageSub->SetSrc(src);\r
imageSub->SetTouchable(true);\r
imageSub->SetOnClickListener(this);\r
void UITestCoverflow2::CreateAddButton()\r
{\r
UITransformGroup* page = new UITransformGroup();\r
- page->SetPosition(0, 100, PAGE_WIDTH, PAGE_HEIGHT);\r
+ page->SetPosition(0, 100, PAGE_WIDTH, PAGE_HEIGHT); // 100: y\r
\r
if (addImage_ == nullptr) {\r
addImage_ = new UIImageView();\r
page->Add(addImage_);\r
addImage_->LayoutCenterOfParent();\r
\r
- ImageInfo* src = ImageCacheManager::GetInstance().LoadSingleRes(std::string(addImgPath));\r
+ ImageInfo* src = ImageCacheManager::GetInstance().LoadSingleRes(std::string(ADD_IMG_PATH));\r
addImage_->SetSrc(src);\r
coverflow_->Add(page);\r
}\r
label_->SetPosition(127, 50, 200, 50); // 127 50 200 50: label position\r
label_->SetTextColor(Color::White());\r
label_->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER);\r
- lastIndex_ = coverflow_->GetCurrentPage();\r
- label_->SetText(g_faceInfo[lastIndex_].name);\r
+ label_->SetText("[ITEM_NAME]");\r
label_->SetFont(DEFAULT_VECTOR_FONT_FILENAME, LABEL_FONT_SIZE);\r
container_->Add(label_);\r
}\r
{\r
if (&view == addImage_) {\r
UITransformGroup* page = new UITransformGroup();\r
- page->SetPosition(0, 100, PAGE_WIDTH, PAGE_HEIGHT);\r
+ page->SetPosition(0, 100, PAGE_WIDTH, PAGE_HEIGHT); // 100: y\r
\r
UIImageView* image = new UIImageView();\r
image->Resize(IMAGE_WIDTH, IMAGE_HEIGHT);\r
UIImageView* imageSub = new UIImageView();\r
imageSub->SetPosition(200, 0, 50, 50); // 200: x position 50: width and height\r
page->Add(imageSub);\r
- src = ImageCacheManager::GetInstance().LoadSingleRes(std::string(subImgPath));\r
+ src = ImageCacheManager::GetInstance().LoadSingleRes(std::string(SUB_IMG_PATH));\r
imageSub->SetSrc(src);\r
imageSub->SetTouchable(true);\r
imageSub->SetOnClickListener(this);\r
}\r
if (newCenterIndex != lastIndex_ && newCenterIndex < COVERFLOW_MAX_PAGE_NUM) {\r
lastIndex_ = newCenterIndex;\r
- label_->SetText(g_faceInfo[newCenterIndex].name);\r
- } else if (newCenterIndex >= COVERFLOW_MAX_PAGE_NUM) {\r
- label_->SetText("");\r
}\r
\r
Rect curViewRect = coverflow_->GetViewByIndex(lastIndex_)->GetOrigRect();\r
}
}
+void UITestCross::VideoPage::OnCovered()
+{
+ videoPlay_->PauseVideoPlay();
+ animator_->Stop();
+}
+
+void UITestCross::VideoPage::OnUncovered()
+{
+ if (videoPlay_->isPause_) {
+ videoPlay_->ResumeVideoPlay();
+ } else if (!videoPlay_->isPlayed_) {
+ videoPlay_->StartVideoPlay();
+ }
+ animator_->Start();
+}
+
void UITestCross::VideoPage::StartVideo(void)
{
if (videoPlay_ != nullptr && animator_ != nullptr) {
video_->SetStyle(STYLE_BACKGROUND_OPA, OPA_OPAQUE);
video_->PageInit();
video_->StartVideo();
+ video_->SetTouchable(true);
+ video_->SetOnClickListener(this);
#endif
SetUpPage(&card1_, CROSS_CAT);
SetUpPage(&card2_, CROSS_DOVE);
down_->SetPosition(0, 0, Screen::GetInstance().GetWidth(), Screen::GetInstance().GetHeight());
down_->SetStyle(STYLE_BACKGROUND_OPA, OPA_TRANSPARENT);
down_->SetViewId("messageView");
+ down_->SetTouchable(true);
+ down_->SetOnClickListener(this);
UILabel *msg = new UILabel();
msg->SetPosition(177, 212, 100, 30); // 177, 212, 100, 30: Left, right, width, height.
msg->SetText("无消息");
{
return container_;
}
+
+bool UITestCross::OnClick(UIView& view, const ClickEvent& event)
+{
+ if (&view == down_) {
+ static uint16_t pageIndex = 0;
+ container_->SetVerCurrentPage(pageIndex);
+ printf("SetVerCurrentPage: %d", pageIndex);
+ pageIndex++;
+ if (pageIndex > 1) {
+ pageIndex = 0;
+ }
+ } else if (&view == video_) {
+ static uint16_t pageIndexFromCenter = 0;
+ container_->SetVerCurrentPage(pageIndexFromCenter);
+ printf("SetVerCurrentPage: %d", pageIndexFromCenter);
+ if (pageIndexFromCenter == 0) {
+ pageIndexFromCenter = 2; // 2: index
+ } else {
+ pageIndexFromCenter = 0;
+ }
+ }
+ return true;
+}
}
#endif
namespace OHOS {
-class UITestCross : public UITest {
+class UITestCross : public UITest, UIView::OnClickListener {
public:
class VideoAnimatorCallback : public AnimatorCallback {
public:
void ScrollEnd(bool isActive) override;
void CoverBegin(bool isCovered) override;
void CoverEnd(bool isCovered) override;
+ void OnCovered() override;
+ void OnUncovered() override;
void PageInit(void);
void StartVideo(void);
void SetUp() override;
void TearDown() override;
const UIView* GetTestView() override;
+ bool OnClick(UIView& view, const ClickEvent& event) override;
private:
UICrossView* container_ = nullptr;
const static int16_t WIDTH_100 = 100;
const static int16_t HEIGHT_50 = 50;
+void SectorAnimatorCallback::Callback(UIView *view)
+{
+ UICanvasExt* canvas = dynamic_cast<UICanvasExt*>(view);
+ if (canvas == nullptr) {
+ GRAPHIC_LOGE("callback view is not UICanvasExt");
+ return;
+ }
+ canvas->Clear();
+ sectorAngle_ += angleStep_;
+ sectorRange_ += rangeStep_;
+ if (FloatMore(sectorRange_, CIRCLE_IN_DEGREE)) {
+ sectorRange_ = 1;
+ }
+ if (FloatMore(sectorAngle_, 3600.f)) { // 3600.f: to avoid float overflow
+ sectorAngle_ = -3600.0f; // 3600.f: to avoid float overflow
+ }
+ // 300: x coordinates, 250: y coordinates, 10 ahead degree to avoid boundary problem
+ SweepGradient sweep = {200, 250, static_cast<int16_t>(sectorAngle_ - 10)};
+ PaintExt paint;
+ ColorStop stops[2] = {{0, 0x00FFFF00}, {1, 0xFFFFFF00}};
+ paint.SetStyle(Paint::PaintStyle::FILL_STYLE);
+ paint.SetSweepGradient(sweep, stops, 2); // 2: sweep stops count
+ paint.SetAntialiased(true);
+
+ // 300, 250, 130, sector parameters: x , y, radius
+ canvas->DrawSector({200, 250}, 130, sectorAngle_, sectorAngle_ + sectorRange_, paint);
+}
+
void UITestCanvasExt::SetUp()
{
if (container_ == nullptr) {
canvas_->SetStyle(STYLE_BACKGROUND_OPA, OPA_OPAQUE);
container_->Add(canvas_);
- SetUpBtn(add123Btn_, "Add 123", X_300, 0); // 0: Y coordinate
- SetUpBtn(addSquareBtn_, "Add Square", X_300, 60); // 60: Y coordinate
+ SetUpBtn(addSquareBtn_, "Add Square", X_300, 0); // 0: Y coordinate
+ SetUpBtn(addSectorBtn_, "Add Sector", X_300, 60); // 60: Y coordinate
SetUpBtn(clearBtn_, "Clear", X_300, 120); // 120: Y coordinate
SetUpBtn(transBtn_, "Y: +150", X_300, 180); // 180: Y coordinate
SetUpBtn(scaleBtn_, "Scale 0.5", X_300, 240); // 240: Y coordinate
SetUpBtn(rotateBtn_, "Rotate 90", X_300, 300); // 300: Y coordinate
SetUpBtn(matrixBtn_, "Matrix", X_300, 360); // 360: Y coordinate
+ sectorCallBack_ = new SectorAnimatorCallback();
+ if (sectorCallBack_ == nullptr) {
+ GRAPHIC_LOGE("CallBack new fail");
+ return;
+ }
+ sectorAnimator_ = new Animator(sectorCallBack_, canvas_, 0, true);
+ if (sectorAnimator_ == nullptr) {
+ delete sectorCallBack_;
+ sectorCallBack_ = nullptr;
+ GRAPHIC_LOGE("Animator new fail");
+ return;
+ }
}
void UITestCanvasExt::SetUpBtn(UILabelButton*& btn, const char* text, int16_t x, int16_t y)
void UITestCanvasExt::TearDown()
{
DeleteChildren(container_);
+ if (sectorCallBack_ != nullptr) {
+ delete sectorCallBack_;
+ sectorCallBack_ = nullptr;
+ }
+ if (sectorAnimator_ != nullptr) {
+ delete sectorAnimator_;
+ sectorAnimator_ = nullptr;
+ }
container_ = nullptr;
canvas_ = nullptr;
- add123Btn_ = nullptr;
+ addSectorBtn_ = nullptr;
addSquareBtn_ = nullptr;
clearBtn_ = nullptr;
transBtn_ = nullptr;
bool UITestCanvasExt::OnClick(UIView& view, const ClickEvent& event)
{
if (&view == addSquareBtn_) {
+ sectorAnimator_->Stop();
DrawSquare(canvas_);
} else if (&view == clearBtn_) {
+ sectorAnimator_->Stop();
canvas_->Clear();
} else if (&view == transBtn_) {
canvas_->Translate({0, 100}); // 100: y offset
Matrix3<float> mat(1, 0, 0, 0, 1, 0, 0, 50, 1); // 50: Y trans by 50
canvas_->SetMatrix(mat, matrixIndex_);
}
- } else if (&view == add123Btn_) {
- Draw123(canvas_);
+ } else if (&view == addSectorBtn_) {
+ DrawSector(canvas_);
}
return true;
}
canvas->DrawArc({cx, cy}, 40, 540, 630, paint); // 40, 540, 630: radius, startAngle, endAngle
}
+void UITestCanvasExt::DrawSector(UICanvasExt* canvas)
+{
+ if (sectorAnimator_ != nullptr) {
+ sectorAnimator_->Start();
+ }
+}
+
void UITestCanvasExt::DrawPattern(UICanvasExt* canvas)
{
PaintExt paint;
#include "common/image_cache_manager.h"
namespace OHOS {
#if ENABLE_VGU_ENGINE && CAPABILITY_HWDRAW_PATH
+class SectorAnimatorCallback : public AnimatorCallback {
+public:
+ SectorAnimatorCallback() {}
+ ~SectorAnimatorCallback() override {}
+ void Callback(UIView *view) override;
+private:
+ float sectorAngle_ = -3600.0f;
+ float sectorRange_ = 0.0f;
+ float angleStep_ = 4.0f;
+ float rangeStep_ = 4.0f;
+};
+
class UITestCanvasExt : public UITest, public UIView::OnClickListener {
public:
UITestCanvasExt() {}
void DrawRect(UICanvasExt* canvas);
void DrawLine(UICanvasExt* canvas);
void DrawArc(UICanvasExt* canvas);
+ void DrawSector(UICanvasExt* canvas);
void SetUpBtn(UILabelButton*& btn, const char* text, int16_t x, int16_t y);
void DrawPattern(UICanvasExt* canvas);
int16_t matrixIndex_ = -1;
UICanvasExt* canvas_ = nullptr;
UILabelButton* addSquareBtn_ = nullptr;
- UILabelButton* add123Btn_ = nullptr;
+ UILabelButton* addSectorBtn_ = nullptr;
UILabelButton* clearBtn_ = nullptr;
UILabelButton* transBtn_ = nullptr;
UILabelButton* scaleBtn_ = nullptr;
UILabelButton* rotateBtn_ = nullptr;
UILabelButton* matrixBtn_ = nullptr;
UIScrollView* container_ = nullptr;
+ SectorAnimatorCallback *sectorCallBack_ = nullptr;
+ Animator *sectorAnimator_ = nullptr;
ImageInfo* img_ = nullptr;
};
#endif
UILabelExt* label = new UILabelExt();
label->SetPosition(labelX_, labelY_, WIDTH, HEIGHT);
label->SetFont("HarmonyOS_Sans_Naskh_Arabic_Light.ttf", DEFAULT_VECTOR_FONT_SIZE);
- label->SetText("中文和阿拉伯语混排。الأسانسير، علشان القطط ماتاكلش منها. وننساها، ونعود الى أوراقنا موصدين الباب بإحكام.");
+ label->SetText("中文和阿拉伯语混排。"
+ "الأسانسير، علشان القطط ماتاكلش منها. وننساها، ونعود الى أوراقنا موصدين الباب بإحكام.");
container_->Add(label);
labelY_ += HEIGHT + GAP_50;
UILabelExt* label1 = new UILabelExt();
label1->SetPosition(labelX_, labelY_, WIDTH, HEIGHT);
label1->SetFont("HarmonyOS_Sans_Naskh_Arabic_Light.ttf", DEFAULT_VECTOR_FONT_SIZE);
- label1->SetText("中文和阿拉伯语混排。الأسانسير، علشان القطط ماتاكلش منها. وننساها، ونعود الى أوراقنا موصدين الباب بإحكام.");
+ label1->SetText("中文和阿拉伯语混排。"
+ "الأسانسير، علشان القطط ماتاكلش منها. وننساها، ونعود الى أوراقنا موصدين الباب بإحكام.");
label1->SetDirect(TEXT_DIRECT_RTL);
container_->Add(label1);
labelY_ += HEIGHT + GAP_50;
UILabelExt* label2 = new UILabelExt();
label2->SetPosition(labelX_, labelY_, WIDTH, HEIGHT);
label2->SetFont("HarmonyOS_Sans_Naskh_Arabic_Light.ttf", DEFAULT_VECTOR_FONT_SIZE);
- label2->SetText("1. تشبع الأكسجين في الدم (SpO2) هو النسبة المئوية للهيموغلوبين المؤكسد (HbO2) في الدم، وهو عامل فسيولوجي مهم للحفاظ على وظائف الجسم الطبيعية.");
+ label2->SetText("1. تشبع الأكسجين في الدم (SpO2) هو النسبة المئوية للهيموغلوبين المؤكسد (HbO2)"
+ " في الدم، وهو عامل فسيولوجي مهم للحفاظ على وظائف الجسم الطبيعية.");
label2->SetDirect(TEXT_DIRECT_RTL);
container_->Add(label2);
labelY_ += HEIGHT + GAP_50;
UILabelExt* label3 = new UILabelExt();
label3->SetPosition(labelX_, labelY_, WIDTH, HEIGHT);
label3->SetFont("HarmonyOS_Sans_Naskh_Arabic_Light.ttf", DEFAULT_VECTOR_FONT_SIZE);
- label3->SetText("ABCتشبع الأكسجين في الدم (SpO2) هو النسبة المئوية للهيموغلوبين المؤكسد (HbO2) في الدم، وهو عامل فسيولوجي مهم للحفاظ على وظائف الجسم الطبيعية.");
+ label3->SetText("ABCتشبع الأكسجين في الدم (SpO2) هو النسبة المئوية للهيموغلوبين المؤكسد (HbO2)"
+ " في الدم، وهو عامل فسيولوجي مهم للحفاظ على وظائف الجسم الطبيعية.");
label3->SetDirect(TEXT_DIRECT_RTL);
container_->Add(label3);
labelY_ += HEIGHT + GAP_50;
return;
}
- kaleidoscopeUtils_->Rotate(0.1f); // 0.1: rotate by 0.1
+ kaleidoscopeUtils_->Rotate(0.02f); // 0.02: rotate by 0.02
view->Invalidate();
}
container_->Add(kaleidoscope_);
kaleidoscope_->RequestFocus();
kaleidoscope_->SetRotateEventFactor(0.2f); // 0.2: rotate event factor
- kaleidoscope_->SetRotateAnimatorValue(0.1f); // 0.1: rotate animator value
+ kaleidoscope_->SetRotateAnimatorValue(0.02f); // 0.02: rotate animator value
kaleidoscope_->StartRotateAnimator();
return;
}
}
list_->SetPosition(0, 0, LIST_WIDTH, LIST_HEIGHT);
list_->SetAdapter(adapter_);
- list_->SetScrollStateListener(this);
list_->SetThrowDrag(true);
list_->SetStyle(STYLE_BACKGROUND_OPA, OPA_TRANSPARENT);
list_->SetMaxScrollDistance(1000); // 1000: max scroll distance
#include "gfx_utils/sys_info.h"
namespace OHOS {
-class UITestListExt : public UITest, UIView::OnClickListener, ListScrollListener {
+class UITestListExt : public UITest {
public:
UITestListExt() : data_(nullptr), animator_(nullptr), list_(nullptr), adapter_(nullptr) {}
~UITestListExt() override {}
}
list_->SetPosition(0, 0, LIST_WIDTH, LIST_HEIGHT);
list_->SetAdapter(adapter_);
- list_->SetScrollStateListener(this);
list_->SetThrowDrag(true);
list_->SetStyle(STYLE_BACKGROUND_OPA, OPA_TRANSPARENT);
list_->SetMaxScrollDistance(1000); // 1000: max scroll distance
#include "gfx_utils/sys_info.h"
namespace OHOS {
-class UITestListFPS : public UITest, UIView::OnClickListener, ListScrollListener {
+class UITestListFPS : public UITest {
public:
UITestListFPS() : animator_(nullptr), list_(nullptr), data_(nullptr), adapter_(nullptr) {}
~UITestListFPS() override {}
#include "animator/easing_equation.h"\r
\r
namespace OHOS {\r
+const int8_t TEXT_ARRAY_LEN = 8;\r
+const float MIN_BLUR_VALUE = 0.0f;\r
+const float MAX_BLUR_VALUE = 32.0f;\r
+const float BLUR_MODIFY_STEP = 0.4f;\r
+\r
void UITestMessage::SetUp()\r
{\r
container_ = new UIViewGroup();\r
img->SetStyle(STYLE_IMAGE_OPA, OPA_OPAQUE);\r
container_->Add(img);\r
\r
- start_ = new UILabelButton();\r
- start_->SetPosition(180, 360, 120, 60); // 180: x, 360: y, 120: width, 60: height\r
- start_->SetText("Start");\r
- start_->SetOnClickListener(this);\r
- container_->Add(start_);\r
+ msgLabel_ = new UILabel();\r
+ msgLabel_->SetPosition(100, 80, 250, 70); // 100, 80, 250, 70: Left, right, width, height.\r
+ msgLabel_->SetText("Message: comes...");\r
+ msgLabel_->SetStyle(STYLE_BACKGROUND_COLOR, 0xff505050);\r
+ msgLabel_->SetStyle(STYLE_TEXT_COLOR, Color::White().full);\r
+ msgLabel_->SetStyle(STYLE_BORDER_RADIUS, 20); // 20: Radius for label boarder.\r
+ msgLabel_->SetStyle(STYLE_BACKGROUND_OPA, 150); // 150: Opacity for background.\r
+ msgLabel_->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 35); // 35: Font size.\r
+ msgLabel_->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER);\r
+ container_->Add(msgLabel_);\r
+\r
+ add_ = new UILabelButton();\r
+ add_->SetPosition(70, 300, 100, 40); // 70: x, 300: y, 100: width, 40: height\r
+ add_->SetText("Add blur");\r
+ add_->SetOnClickListener(this);\r
+ container_->Add(add_);\r
+\r
+ reduce_ = new UILabelButton();\r
+ reduce_->SetPosition(194, 300, 100, 40); // 194: x, 300: y, 100: width, 40: height\r
+ reduce_->SetText("Reduce blur");\r
+ reduce_->SetOnClickListener(this);\r
+ container_->Add(reduce_);\r
+\r
+ clear_ = new UILabelButton();\r
+ clear_->SetPosition(318, 300, 100, 40); // 318: x, 300: y, 100: width, 40: height\r
+ clear_->SetText("Clear blur");\r
+ clear_->SetOnClickListener(this);\r
+ container_->Add(clear_);\r
\r
- label_ = new UILabel();\r
- label_->SetPosition(100, 80, 250, 70); // 100, 80, 250, 70: Left, right, width, height.\r
- label_->SetText("Message: comes...");\r
- label_->SetStyle(STYLE_BACKGROUND_COLOR, 0xff505050);\r
- label_->SetStyle(STYLE_TEXT_COLOR, Color::White().full);\r
- label_->SetStyle(STYLE_BORDER_RADIUS, 20); // 20: Radius for label boarder.\r
- label_->SetStyle(STYLE_BACKGROUND_OPA, 150); // 150: Opacity for background.\r
- label_->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 35); // 35: Font size.\r
- label_->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER);\r
- container_->Add(label_);\r
+ valueLabel_ = new UILabel();\r
+ valueLabel_->SetPosition(194, 360, 100, 40); // 194, 360, 100, 40: Left, right, width, height.\r
+ valueLabel_->SetText("0.00");\r
+ valueLabel_->SetStyle(STYLE_TEXT_COLOR, Color::Red().full);\r
+ valueLabel_->SetStyle(STYLE_BORDER_OPA, 0); // 20: Radius for label boarder.\r
+ valueLabel_->SetStyle(STYLE_BACKGROUND_OPA, 0); // 150: Opacity for background.\r
+ valueLabel_->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30); // 30: Font size.\r
+ valueLabel_->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER);\r
+ container_->Add(valueLabel_);\r
}\r
\r
void UITestMessage::TearDown()\r
{\r
- label_->ClearBackgroundBlur();\r
- DeleteChildren(container_);\r
- container_ = nullptr;\r
+ msgLabel_->ClearBackgroundBlur();\r
+ UIViewGroup::RemoveAndDeleteAllRecursively(container_);\r
+ msgLabel_ = nullptr;\r
+ add_ = nullptr;\r
+ reduce_ = nullptr;\r
+ clear_ = nullptr;\r
+ valueLabel_ = nullptr;\r
}\r
\r
const UIView* UITestMessage::GetTestView()\r
\r
bool UITestMessage::OnClick(UIView& view, const ClickEvent& event)\r
{\r
- if (!blur_) {\r
- label_->SetBackgroundBlur(10); // 10: blurRadius\r
- } else {\r
- label_->ClearBackgroundBlur();\r
+ if (&view == add_) {\r
+ blurVaule_ += BLUR_MODIFY_STEP;\r
+ } else if (&view == reduce_) {\r
+ blurVaule_ -= BLUR_MODIFY_STEP;\r
+ } else if (&view == clear_) {\r
+ blurVaule_ = MIN_BLUR_VALUE;\r
}\r
- blur_ = !blur_;\r
-\r
+ if (FloatMore(blurVaule_, MAX_BLUR_VALUE)) {\r
+ blurVaule_ = MAX_BLUR_VALUE;\r
+ } else if (FloatLess(blurVaule_, MIN_BLUR_VALUE)) {\r
+ blurVaule_ = MIN_BLUR_VALUE;\r
+ }\r
+ msgLabel_->SetBackgroundBlur(blurVaule_);\r
+ char blurText[TEXT_ARRAY_LEN] = {0};\r
+ snprintf_s(blurText, TEXT_ARRAY_LEN, 4, "%4.1f", blurVaule_); // 4, size of format string\r
+ valueLabel_->SetText(blurText);\r
return true;\r
}\r
-}\r
+}
\ No newline at end of file
\r
private:\r
UIViewGroup* container_ = nullptr;\r
- UILabel* label_ = nullptr;\r
- UILabelButton* start_ = nullptr;\r
- bool blur_ = false;\r
+ UILabel* msgLabel_ = nullptr;\r
+ UILabelButton* add_ = nullptr;\r
+ UILabelButton* reduce_ = nullptr;\r
+ UILabelButton* clear_ = nullptr;\r
+ UILabel* valueLabel_ = nullptr;\r
+ float blurVaule_ = 0.0f;\r
};\r
}\r
-#endif\r
+#endif
\ No newline at end of file
container_->Add(button);
}
+bool UITestRollerView::ChildStateListener::StateChange(UIView* view, float angle)
+{
+ if (view == nullptr) {
+ return true;
+ }
+ UIViewGroup* group = dynamic_cast<UIViewGroup*>(view);
+ UIImageView* head = dynamic_cast<UIImageView*>(group->GetChildrenHead());
+ UIImageView* tail = dynamic_cast<UIImageView*>(group->GetChildrenTail());
+ if (FloatMore(angle, 90.0f) && FloatLess(angle, 270.0f)) { // 90 270: rotate range
+ head->SetStyle(STYLE_IMAGE_OPA, OPA_OPAQUE / 2); // 2: half of opa
+ if (roller_->IsShowMirrorMode()) {
+ tail->SetStyle(STYLE_IMAGE_OPA, 50); // 50: Transparency Value
+ }
+ } else {
+ head->SetStyle(STYLE_IMAGE_OPA, OPA_OPAQUE);
+ if (roller_->IsShowMirrorMode()) {
+ tail->SetStyle(STYLE_IMAGE_OPA, 100); // 100: Transparency Value
+ }
+ }
+ return true;
+}
void UITestRollerView::CreateNoMirrorRollerView()
{
noMirrorRollerView_ = new UIRollerView(false);
rollerView_->SetItemSize(150, 150); // 150: item size
rollerView_->SetThrowDrag(true);
rollerView_->SetItemPadding(80); // 80: item padding
+ if (stateChangeListener_ == nullptr) {
+ stateChangeListener_ = new ChildStateListener();
+ stateChangeListener_->SetRollerView(rollerView_);
+ rollerView_->SetChildStateListener(stateChangeListener_);
+ }
container_->Add(rollerView_);
curRollerView_ = rollerView_;
for (uint8_t i = 0; i < ITEM_CNT; i++) {
offMirrorBtn_->SetVisible(isVisible);
isBtnVisible_ = isVisible;
}
+
void UITestRollerView::OnModeChange(UIRollerView* view, RollerViewMode targetMode)
{
printf("RollerView Change Mode to %d!\n", targetMode);
} else {
container_->Remove(noMirrorRollerView_);
}
+
+ if (stateChangeListener_ != nullptr) {
+ delete stateChangeListener_;
+ stateChangeListener_ = nullptr;
+ }
curRollerView_ = nullptr;
delete rollerView_;
delete noMirrorRollerView_;
const UIView* GetTestView() override;
bool OnClick(UIView& view, const ClickEvent& event) override;
void OnModeChange(UIRollerView* view, RollerViewMode targetMode) override;
+
private:
+ class ChildStateListener : public UIRollerView::OnChildStateListener {
+ public:
+ void SetRollerView(UIRollerView* roller)
+ {
+ roller_ = roller;
+ }
+
+ bool StateChange(UIView* view, float angle) override;
+ private:
+ UIRollerView* roller_ = nullptr;
+ };
+
void CreateButton(UILabelButton*& button, const char* text, int16_t x, int16_t y);
void HideOrShowBtn();
void CreateNoMirrorRollerView();
UILabelButton* switchAnimBtn_ = nullptr;
UILabelButton* switchBtn_ = nullptr;
UILabelButton* offMirrorBtn_ = nullptr;
+ ChildStateListener* stateChangeListener_ = nullptr;
bool isBtnVisible_ = false;
};
}
list_->SetDragACCLevel(5); // 5: drag acceleration\r
list_->SetYScrollBarVisible(true);\r
\r
- list_->EnableAutoAlign(true);\r
+ list_->EnableAutoAlign(false);\r
list_->SetSelectPosition(LIST_HEIGHT / 2); // 2: divisor\r
list_->EnableCrossDragBack(false);\r
list_->SetElastic(true);\r
list_->SetItemSpace(30); // 30: item space\r
list_->SetAutoAlignTime(300); // 300: align time\r
list_->SetScrollBlankSize(LIST_HEIGHT / 2); // 2: divisor\r
+ list_->SetScrollBlankSize(LIST_HEIGHT / 2 - ITEM_HEIGHT / 2, UIAbstractScroll::Direction::BOTTOM);\r
+ list_->SetReboundSize(0, UIAbstractScroll::Direction::BOTTOM);\r
list_->SetDragFunc(EasingEquation::QuadEaseOut);\r
}\r
} // namespace OHOS
\ No newline at end of file
waterfallList_->SetImageDistance(imgDistance_);
waterfallList_->SetImageSizeInCenter(imgSize_);
waterfallList_->SetScrollBlankSize(0);
- waterfallList_->SetReboundSize(imgDistance_ * Sin(60)); // 60, degree
+ uint16_t layoutHeight = static_cast<uint16_t>(imgDistance_ * Sin(60)); // 60: degree, row's layout height
+ waterfallList_->SetReboundSize(layoutHeight);
+ waterfallList_->SetScrollBlankSize(layoutHeight, UIAbstractScroll::Direction::TOP);
+ waterfallList_->SetScrollBlankSize(Screen::GetInstance().GetHeight() / 2 - layoutHeight, // 2: half
+ UIAbstractScroll::Direction::BOTTOM);
waterfallList_->SetThrowDrag(true);
waterfallList_->LayoutChildren(true);
waterfallList_->SetRotateFactor(10); // 10, empirical coefficient
ListNode<Animator*>* pos = list_.Begin();
Animator* animator = nullptr;
+ activeNum_ = 0;
while (pos != list_.End()) {
animator = pos->data_;
if (animator == nullptr) {
continue;
}
if (animator->GetState() == Animator::START) {
+ activeNum_++;
animator->Run();
}
pos = pos->next_;
}
}
+
+uint16_t AnimatorManager::GetTotalAnimatorNum()
+{
+ return list_.Size();
+}
+
+uint16_t AnimatorManager::GetActiveAnimatorNum()
+{
+ return activeNum_;
+}
} // namespace OHOS
*/
bool IsActive();
+ /**
+ * @brief Get total number of animators.
+ */
+ uint16_t GetTotalAnimatorNum();
+
+ /**
+ * @brief Get number of active animators which was recorded by AnimatorTask().
+ */
+ uint16_t GetActiveAnimatorNum();
+
protected:
List<Animator*> list_;
AnimatorManager() {}
AnimatorManager& operator=(const AnimatorManager&) = delete;
AnimatorManager(AnimatorManager&&) = delete;
AnimatorManager& operator=(AnimatorManager&&) = delete;
+ uint16_t activeNum_ = 0;
};
} // namespace OHOS
#endif
}
OpacityType opa = DrawUtils::GetMixOpacity(opaScale, style.textOpa_);
for (int i = 0; i < lineCount; i++) {
- if (pos.y > coords.GetBottom()) {
+ if (pos.y > mask.GetBottom() || pos.y > coords.GetBottom()) {
return;
}
int16_t nextLine = pos.y + lineHeight;
- if (nextLine >= coords.GetTop()) {
+ if (nextLine >= mask.GetTop() && nextLine >= coords.GetTop()) {
pos.x = LineStartPos(coords, textLine_[i].linePixelWidth);
LabelLineInfo labelLine{pos, offset, mask, lineHeight, textLine_[i].lineBytes,
0, opa, style, &text_[lineBegin], textLine_[i].lineBytes,
UIView* TextAdapter::GetView(UIView* inView, int16_t index)
{
- UILabel* newView = GetTextView(inView, index);
- if (newView == nullptr) {
- return nullptr;
- }
- newView->SetLineBreakMode(lineBreakMode_);
- newView->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER);
- if (width_) {
- newView->SetWidth(width_);
- }
- if (height_) {
- newView->SetHeight(height_);
- }
- newView->SetViewIndex(index);
- newView->UIView::SetStyle(style_);
- newView->GetHeight();
- if (clickListener_) {
- newView->SetOnClickListener(clickListener_);
- newView->SetTouchable(true);
- }
- return newView;
-}
-
-UILabel* TextAdapter::GetTextView(UIView* inView, int16_t index)
-{
- switch (dataMode_) {
- case DYNAMIC_TEXT_MODE:
- return GetDynamicText(inView, index);
- case CONTINUOUS_INTEGER_MODE:
- return GetIntegerText(inView, index);
- default:
+ if (dataMode_ == DYNAMIC_TEXT_MODE) {
+ if (dynamicText_.IsEmpty() || (index > dynamicText_.Size() - 1) || (index < 0)) {
return nullptr;
- }
-}
-
-UILabel* TextAdapter::GetDynamicText(UIView* inView, int16_t index)
-{
- if (dynamicText_.IsEmpty() || (index > dynamicText_.Size() - 1) || (index < 0)) {
+ }
+ } else if (dataMode_ == CONTINUOUS_INTEGER_MODE) {
+ if ((index < 0) || ((integerTextEnd_ - integerTextStart_) < index)) {
+ return nullptr;
+ }
+ } else {
return nullptr;
}
- ListNode<const char*>* node = dynamicText_.Begin();
- for (int16_t i = 0; i < index; i++) {
- node = node->next_;
+ UILabel* label = nullptr;
+ if (inView == nullptr) {
+ label = CreateUILabel();
+ } else {
+ label = dynamic_cast<UILabel*>(inView);
}
- UILabel* newView = CreateUILabel(inView);
- if (newView != nullptr) {
- newView->SetText(node->data_);
- if (fontName_ == nullptr) {
- newView->SetFontId(fontId_);
- } else {
- newView->SetFont(fontName_, fontSize_);
+
+ if (label != nullptr) {
+ if (dataMode_ == DYNAMIC_TEXT_MODE) {
+ ListNode<const char*>* node = dynamicText_.Begin();
+ for (int16_t i = 0; i < index; i++) {
+ node = node->next_;
+ }
+ label->SetText(node->data_);
+ } else if (dataMode_ == CONTINUOUS_INTEGER_MODE) {
+ if (!SetIntegerText(label, index)) {
+ if (label != nullptr && inView == nullptr) {
+ delete label;
+ }
+ return nullptr;
+ }
}
- newView->SetDirect(direct_);
+ label->ReMeasure();
+ label->SetViewIndex(index);
}
- return newView;
+ return label;
}
-UILabel* TextAdapter::GetIntegerText(UIView* inView, int16_t index)
+bool TextAdapter::SetIntegerText(UILabel* inView, int16_t index)
{
- if ((index < 0) || ((integerTextEnd_ - integerTextStart_) < index)) {
- return nullptr;
- }
- UILabel* newView = CreateUILabel(inView);
- if (newView != nullptr) {
+ if (inView != nullptr) {
char buf[BUF_LEN] = {0};
if (formatter_ != nullptr) {
if (!formatter_->Format(integerTextStart_ + index, buf, BUF_LEN)) {
- if (inView == nullptr) {
- delete newView;
- newView = nullptr;
- }
- return nullptr;
+ return false;
}
} else {
if (sprintf_s(buf, sizeof(buf), "%02d", integerTextStart_ + index) < 0) {
- if (inView == nullptr) {
- delete newView;
- newView = nullptr;
- }
- return nullptr;
+ return false;
}
}
buf[BUF_LEN - 1] = '\0';
- newView->SetText(buf);
- if (fontName_ == nullptr) {
- newView->SetFontId(fontId_);
- } else {
- newView->SetFont(fontName_, fontSize_);
- }
- newView->SetDirect(direct_);
+ inView->SetText(buf);
}
- return newView;
+ return true;
}
-UILabel* TextAdapter::CreateUILabel(UIView* inView)
+UILabel* TextAdapter::CreateUILabel()
{
- if (inView == nullptr) {
- return new UILabel();
+ UILabel* newView = new UILabel();
+ if (newView == nullptr) {
+ return nullptr;
}
- return static_cast<UILabel*>(inView);
+
+ newView->SetLineBreakMode(lineBreakMode_);
+ newView->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER);
+ if (width_) {
+ newView->SetWidth(width_);
+ }
+ if (height_) {
+ newView->SetHeight(height_);
+ }
+
+ newView->UIView::SetStyle(style_);
+ if (clickListener_) {
+ newView->SetOnClickListener(clickListener_);
+ newView->SetTouchable(true);
+ }
+ if (fontName_ == nullptr) {
+ newView->SetFontId(fontId_);
+ } else {
+ newView->SetFont(fontName_, fontSize_);
+ }
+ newView->SetDirect(direct_);
+ return newView;
}
void TextAdapter::ClearDynamicText()
uint8_t dragDirection,
bool dragBack)
{
- if (!throwDrag_ && (reboundSize_ == 0)) {
+ if (!throwDrag_ && (reboundSize_ == 0 && reboundSizeTop_ == 0 && reboundSizeBottom_ == 0 &&
+ reboundSizeLeft_ == 0 && reboundSizeRight_ == 0)) {
return false;
}
int16_t dragDistanceX = 0;
if (throwDrag_) {
CalculateDragDistance(currentPos, lastPos, dragDirection, dragDistanceX, dragDistanceY);
}
- if (reboundSize_ != 0) {
+ if (reboundSize_ != 0 || reboundSizeTop_ != 0 || reboundSizeBottom_ != 0 ||
+ reboundSizeLeft_ != 0 || reboundSizeRight_ != 0) {
CalculateReboundDistance(dragDistanceX, dragDistanceY);
}
{
if ((direction_ == VERTICAL) || (direction_ == HORIZONTAL_AND_VERTICAL)) {
dragDistanceY = (currentPos.y - lastPos.y) * DRAG_DISTANCE_COEFFICIENT;
- if (dragDistanceY > 0 || (dragDistanceY == 0 && dragDirection == DragEvent::DIRECTION_TOP_TO_BOTTOM)) {
- dragDistanceY += GetMaxDelta() * GetSwipeACCLevel() / DRAG_ACC_FACTOR;
- } else if (dragDistanceY < 0 || (dragDistanceY == 0 && dragDirection == DragEvent::DIRECTION_BOTTOM_TO_TOP)) {
- dragDistanceY -= GetMaxDelta() * GetSwipeACCLevel() / DRAG_ACC_FACTOR;
+ if (currentPos.y != lastPos.y) {
+ if (dragDistanceY > 0 || (dragDistanceY == 0 && dragDirection == DragEvent::DIRECTION_TOP_TO_BOTTOM)) {
+ dragDistanceY += GetMaxDelta() * GetSwipeACCLevel() / DRAG_ACC_FACTOR;
+ } else if (dragDistanceY < 0 || (dragDistanceY == 0 && dragDirection == DragEvent::DIRECTION_BOTTOM_TO_TOP)) {
+ dragDistanceY -= GetMaxDelta() * GetSwipeACCLevel() / DRAG_ACC_FACTOR;
+ }
}
}
if ((direction_ == HORIZONTAL) || (direction_ == HORIZONTAL_AND_VERTICAL)) {
dragDistanceX = (currentPos.x - lastPos.x) * DRAG_DISTANCE_COEFFICIENT;
- if (dragDistanceX > 0 || (dragDistanceX == 0 && dragDirection == DragEvent::DIRECTION_LEFT_TO_RIGHT)) {
- dragDistanceX += GetMaxDelta() * GetSwipeACCLevel() / DRAG_ACC_FACTOR;
- } else if (dragDistanceX < 0 || (dragDistanceX == 0 && dragDirection == DragEvent::DIRECTION_RIGHT_TO_LEFT)) {
- dragDistanceX -= GetMaxDelta() * GetSwipeACCLevel() / DRAG_ACC_FACTOR;
+ if (currentPos.x != lastPos.x) {
+ if (dragDistanceX > 0 || (dragDistanceX == 0 && dragDirection == DragEvent::DIRECTION_LEFT_TO_RIGHT)) {
+ dragDistanceX += GetMaxDelta() * GetSwipeACCLevel() / DRAG_ACC_FACTOR;
+ } else if (dragDistanceX < 0 || (dragDistanceX == 0 && dragDirection == DragEvent::DIRECTION_RIGHT_TO_LEFT)) {
+ dragDistanceX -= GetMaxDelta() * GetSwipeACCLevel() / DRAG_ACC_FACTOR;
+ }
}
}
const Point& point, const uint16_t& radius, const Vector2<float>& angle)
{
ArcInfo arcInfo = {point, {0, 0}, radius, angle.x_, angle.y_, nullptr};
- if (cmd_ == nullptr) {
- cmd_ = static_cast<uint8_t*>(AllocBufferForPath(MAX_CMD_NUM * sizeof(uint8_t)));
- if (cmd_ == nullptr) {
- GRAPHIC_LOGE("AllocBufferForPath failed for cmd.\n");
- return;
- }
- }
- if (data_ == nullptr) {
- data_ = static_cast<float*>(AllocBufferForPath(MAX_DATA_NUM * sizeof(float)));
- if (data_ == nullptr) {
- GRAPHIC_LOGE("AllocBufferForPath failed for data.\n");
- GrallocEngines::GetInstance()->FreeBuffer(cmd_);
- return;
- }
- }
arcInfo.radius -= foregroundStyle_->lineWidth_ / 2; // 2: half
+ LiteMGfxEngine::GetInstance()->SyncHwDraw();
+ if (data_ != nullptr) {
+ GrallocEngines::GetInstance()->FreeBuffer(reinterpret_cast<uint8_t*>(data_));
+ data_ = nullptr;
+ }
+ if (cmd_ != nullptr) {
+ GrallocEngines::GetInstance()->FreeBuffer(cmd_);
+ cmd_ = nullptr;
+ }
+ cmdNum_ = 0;
+ dataNum_ = 0;
if (!HWDrawUtils::GetInstance()->ObtainArcPath(arcInfo, cmdNum_, cmd_, dataNum_, data_)) {
GRAPHIC_LOGE("ObtainArcPath failed.\n");
return;
#include <cmath>
#include "hal_tick.h"
#include "components/ui_label.h"
+#include "components/root_view.h"
#include "font/ui_font.h"
#include "gfx_utils/graphic_log.h"
#include "themes/theme_manager.h"
void Callback(UIView* view) override
{
+ UILabel* label = dynamic_cast<UILabel*>(view);
+ if (label == nullptr) {
+ return;
+ }
+
+ // Check setAnimState_ and Pause or Stop animation if neccessary.
+ if (label->CheckAnimState()) {
+ return;
+ }
+
+ // If not intersected with rootview, pause animator.
+ Rect rect = view->GetRect();
+ Rect rootRect = RootView::GetInstance()->GetRect();
+ if (label != nullptr && !rect.Intersect(rect, rootRect)) {
+ if (label->hasAnimator_ && label->animator_.animator->GetState() == Animator::START) {
+ label->animator_.animator->Pause();
+ return;
+ }
+ }
+
switch (animatorMode_) {
case UILabel::LINE_BREAK_MARQUEE:
MarqueeCallback(view);
RefreshLabel();
}
}
+
+void UILabel::Resize(int16_t width, int16_t height)
+{
+ if (GetWidth() != width || GetHeight() != height) {
+ UIView::SetWidth(width);
+ UIView::SetHeight(height);
+ RefreshLabel();
+ }
+}
+
void UILabel::RefreshLabel()
{
Invalidate();
void UILabel::ReMeasure()
{
+ if (setAnimState_ == Animator::START) {
+ if (lineBreakMode_ == LINE_BREAK_OSCILLATION || lineBreakMode_ == LINE_BREAK_MARQUEE) {
+ Rect rect = GetRect();
+ Rect rootRect = RootView::GetInstance()->GetRect();
+ if (rect.Intersect(rect, rootRect)) {
+ if (hasAnimator_ && animator_.animator->GetState() == Animator::PAUSE) {
+ // resume animator if now intersected with rootview.
+ animator_.animator->Resume();
+ }
+ }
+ }
+ }
+
if (!needRefresh_) {
return;
}
switch (lineBreakMode_) {
case LINE_BREAK_ADAPT:
Resize(textSize.x, textSize.y);
+ needRefresh_ = false;
break;
case LINE_BREAK_STRETCH:
SetWidth(textSize.x);
+ needRefresh_ = false;
break;
case LINE_BREAK_WRAP:
SetHeight(textSize.y);
+ needRefresh_ = false;
break;
case LINE_BREAK_ELLIPSIS:
labelText_->SetTruncateMode(false);
return res;
}
+bool UILabel::CheckAnimState()
+{
+ if (setAnimState_ == Animator::START) {
+ return false;
+ }
+
+ if (hasAnimator_) {
+ Animator* anim = animator_.animator;
+ if (setAnimState_ == Animator::PAUSE && anim->GetState() == Animator::START) {
+ anim->Pause();
+ } else if (setAnimState_ == Animator::STOP && anim->GetState() != Animator::STOP) {
+ anim->Stop();
+ }
+ }
+ return true;
+}
+
void UILabel::RemeasureForAnimation(int16_t textWidth, LineBreakMode mode)
{
+ if (setAnimState_ != Animator::START) {
+ return;
+ }
int16_t rectWidth = GetWidth();
if (textWidth > rectWidth) {
offsetX_ = GetRollStartPos();
animator_.animator = animator;
hasAnimator_ = true;
}
- animator_.animator->Start();
+ if (animator_.animator->GetState() == Animator::PAUSE) {
+ animator_.animator->Resume();
+ } else {
+ animator_.animator->Start();
+ }
} else {
offsetX_ = 0;
labelText_->SetAlign(horAlign_, labelText_->GetVerAlign());
origContentRect, offsetX_, style, truncateIndex_, opa);
}
}
+
+void UILabel::SetAnimState(uint8_t state)
+{
+ if (setAnimState_ == state) {
+ return;
+ }
+
+ switch (state) {
+ case Animator::START:
+ setAnimState_ = Animator::START;
+ break;
+ case Animator::STOP:
+ setAnimState_ = Animator::STOP;
+ break;
+ case Animator::PAUSE:
+ setAnimState_ = Animator::PAUSE;
+ break;
+ default:
+ setAnimState_ = Animator::START;
+ GRAPHIC_LOGE("Invalid state. Set to Animator::START instead!");
+ break;
+ }
+}
+
+uint8_t UILabel::GetAnimRealState()
+{
+ if (!hasAnimator_) {
+ GRAPHIC_LOGE("Do not have animator.");
+ return Animator::STOP;
+ }
+ return animator_.animator->GetState();
+}
} // namespace OHOS
if (distance == 0) {
return true;
}
- int16_t reboundSize = reboundSize_;
+ int16_t reboundSizeLeft = reboundSizeLeft_;
+ int16_t reboundSizeRight = reboundSizeRight_;
if (isLoopList_ || (scrollAnimator_.GetState() != Animator::STOP)) {
- reboundSize = 0;
+ reboundSizeLeft = 0;
+ reboundSizeRight = 0;
}
bool ret = 0;
do {
if (distance > 0) {
if (childrenHead_ != nullptr) {
- if (isElastic_ && (reboundSize > 0) &&
- (childrenHead_->GetX() > (scrollBlankSize_ + childrenHead_->GetStyle(STYLE_MARGIN_LEFT)))) {
- int16_t offset = childrenHead_->GetX() - (scrollBlankSize_ + childrenHead_->GetStyle(STYLE_MARGIN_LEFT));
- if (offset > reboundSize) {
- offset = reboundSize;
+ if (isElastic_ && (reboundSizeLeft > 0) &&
+ (childrenHead_->GetX() > (scrollBlankSizeLeft_ + childrenHead_->GetStyle(STYLE_MARGIN_LEFT)))) {
+ int16_t offset = childrenHead_->GetX() -
+ (scrollBlankSizeLeft_ + childrenHead_->GetStyle(STYLE_MARGIN_LEFT));
+ if (offset > reboundSizeLeft) {
+ offset = reboundSizeLeft;
}
- distance = CalculateElasticDragLen(reboundSize, offset, distance);
+ distance = CalculateElasticDragLen(reboundSizeLeft, offset, distance);
}
if ((childrenHead_->GetX() + distance) >
- (scrollBlankSize_ + reboundSize + childrenHead_->GetStyle(STYLE_MARGIN_LEFT))) {
- distance =
- scrollBlankSize_ + reboundSize + childrenHead_->GetStyle(STYLE_MARGIN_LEFT) - childrenHead_->GetX();
+ (scrollBlankSizeLeft_ + reboundSizeLeft + childrenHead_->GetStyle(STYLE_MARGIN_LEFT))) {
+ distance = scrollBlankSizeLeft_ + reboundSizeLeft + childrenHead_->GetStyle(STYLE_MARGIN_LEFT) -
+ childrenHead_->GetX();
}
}
} else {
if (childrenTail_ != nullptr) {
- if (isElastic_ && (reboundSize > 0) &&
+ if (isElastic_ && (reboundSizeRight > 0) &&
(childrenTail_->GetRelativeRect().GetRight() <
- (listWidth - scrollBlankSize_ - childrenTail_->GetStyle(STYLE_MARGIN_RIGHT)))) {
- int16_t offset = (listWidth - scrollBlankSize_ - childrenTail_->GetStyle(STYLE_MARGIN_RIGHT))
+ (listWidth - scrollBlankSizeRight_ - childrenTail_->GetStyle(STYLE_MARGIN_RIGHT)))) {
+ int16_t offset = (listWidth - scrollBlankSizeRight_ - childrenTail_->GetStyle(STYLE_MARGIN_RIGHT))
- (childrenTail_->GetRelativeRect().GetRight());
- if (offset > reboundSize) {
- offset = reboundSize;
+ if (offset > reboundSizeRight) {
+ offset = reboundSizeRight;
}
- distance = CalculateElasticDragLen(reboundSize, offset, distance);
+ distance = CalculateElasticDragLen(reboundSizeRight, offset, distance);
}
if (childrenTail_->GetRelativeRect().GetRight() <
- (listWidth - scrollBlankSize_ - reboundSize - childrenTail_->GetStyle(STYLE_MARGIN_RIGHT))) {
+ (listWidth - scrollBlankSizeRight_ - reboundSizeRight - childrenTail_->GetStyle(STYLE_MARGIN_RIGHT))) {
distance = 0;
} else if ((childrenTail_->GetRelativeRect().GetRight() + distance) <
- (listWidth - scrollBlankSize_ - reboundSize - childrenTail_->GetStyle(STYLE_MARGIN_RIGHT))) {
- distance = listWidth - scrollBlankSize_ - reboundSize - childrenTail_->GetStyle(STYLE_MARGIN_RIGHT)
- - childrenTail_->GetRelativeRect().GetRight();
+ (listWidth - scrollBlankSizeRight_ - reboundSizeRight - childrenTail_->GetStyle(STYLE_MARGIN_RIGHT))) {
+ distance = listWidth - scrollBlankSizeRight_ - reboundSizeRight -
+ childrenTail_->GetStyle(STYLE_MARGIN_RIGHT) - childrenTail_->GetRelativeRect().GetRight();
}
}
}
if (distance == 0) {
return true;
}
- int16_t reboundSize = reboundSize_;
+ int16_t reboundSizeTop = reboundSizeTop_;
+ int16_t reboundSizeBottom = reboundSizeBottom_;
if (isLoopList_ || (scrollAnimator_.GetState() != Animator::STOP)) {
- reboundSize = 0;
+ reboundSizeTop = 0;
+ reboundSizeBottom = 0;
}
bool ret = 0;
do {
if (distance > 0) {
if (childrenHead_ != nullptr) {
- if (isElastic_ && (reboundSize > 0) &&
- (childrenHead_->GetY() > (scrollBlankSize_ + childrenHead_->GetStyle(STYLE_MARGIN_TOP)))) {
- int16_t offset = childrenHead_->GetY() - (scrollBlankSize_ + childrenHead_->GetStyle(STYLE_MARGIN_TOP));
- if (offset > reboundSize) {
- offset = reboundSize;
+ if (isElastic_ && (reboundSizeTop > 0) &&
+ (childrenHead_->GetY() > (scrollBlankSizeTop_ + childrenHead_->GetStyle(STYLE_MARGIN_TOP)))) {
+ int16_t offset = childrenHead_->GetY() -
+ (scrollBlankSizeTop_ + childrenHead_->GetStyle(STYLE_MARGIN_TOP));
+ if (offset > reboundSizeTop) {
+ offset = reboundSizeTop;
}
- distance = CalculateElasticDragLen(reboundSize, offset, distance);
+ distance = CalculateElasticDragLen(reboundSizeTop, offset, distance);
}
if ((childrenHead_->GetY() + distance) >
- (scrollBlankSize_ + reboundSize + childrenHead_->GetStyle(STYLE_MARGIN_TOP))) {
- distance =
- scrollBlankSize_ + reboundSize + childrenHead_->GetStyle(STYLE_MARGIN_TOP) - childrenHead_->GetY();
+ (scrollBlankSizeTop_ + reboundSizeTop + childrenHead_->GetStyle(STYLE_MARGIN_TOP))) {
+ distance = scrollBlankSizeTop_ + reboundSizeTop + childrenHead_->GetStyle(STYLE_MARGIN_TOP) -
+ childrenHead_->GetY();
}
}
} else {
if (childrenTail_ != nullptr) {
- if (isElastic_ && (reboundSize > 0) &&
+ if (isElastic_ && (reboundSizeBottom > 0) &&
(childrenTail_->GetRelativeRect().GetBottom() <
- (listHeight - scrollBlankSize_ - childrenTail_->GetStyle(STYLE_MARGIN_BOTTOM)))) {
- int16_t offset = (listHeight - scrollBlankSize_ - childrenTail_->GetStyle(STYLE_MARGIN_BOTTOM))
- - (childrenTail_->GetRelativeRect().GetBottom());
- if (offset > reboundSize) {
- offset = reboundSize;
+ (listHeight - scrollBlankSizeBottom_ - childrenTail_->GetStyle(STYLE_MARGIN_BOTTOM)))) {
+ int16_t offset = listHeight - scrollBlankSizeBottom_ - childrenTail_->GetStyle(STYLE_MARGIN_BOTTOM) -
+ childrenTail_->GetRelativeRect().GetBottom();
+ if (offset > reboundSizeBottom) {
+ offset = reboundSizeBottom;
}
- distance = CalculateElasticDragLen(reboundSize, offset, distance);
+ distance = CalculateElasticDragLen(reboundSizeBottom, offset, distance);
}
if (childrenTail_->GetRelativeRect().GetBottom() <
- (listHeight - scrollBlankSize_ - reboundSize - childrenTail_->GetStyle(STYLE_MARGIN_BOTTOM))) {
+ (listHeight - scrollBlankSizeBottom_ - reboundSizeBottom -
+ childrenTail_->GetStyle(STYLE_MARGIN_BOTTOM))) {
distance = 0;
} else if ((childrenTail_->GetRelativeRect().GetBottom() + distance) <
- (listHeight - scrollBlankSize_ - reboundSize - childrenTail_->GetStyle(STYLE_MARGIN_BOTTOM))) {
- distance = listHeight - scrollBlankSize_ - reboundSize - childrenTail_->GetStyle(STYLE_MARGIN_BOTTOM)
- - childrenTail_->GetRelativeRect().GetBottom();
+ (listHeight - scrollBlankSizeBottom_ - reboundSizeBottom -
+ childrenTail_->GetStyle(STYLE_MARGIN_BOTTOM))) {
+ distance = listHeight - scrollBlankSizeBottom_ - reboundSizeBottom -
+ childrenTail_->GetStyle(STYLE_MARGIN_BOTTOM) - childrenTail_->GetRelativeRect().GetBottom();
}
}
}
void UIList::UpdateScrollBar()
{
Rect allItemsRect = recycle_.GetAdapterItemsReletiveRect();
- int16_t totalHeight = allItemsRect.GetHeight() + 2 * scrollBlankSize_; // 2: two blank spaces on both sides
- int16_t height = GetHeight();
- yScrollBar_->SetForegroundProportion(static_cast<float>(height) / totalHeight);
- yScrollBar_->SetScrollProgress(static_cast<float>(scrollBlankSize_ - allItemsRect.GetTop()) /
- (totalHeight - height));
+ if (yScrollBarVisible_) {
+ int16_t totalHeight = allItemsRect.GetHeight() + scrollBlankSizeTop_ + scrollBlankSizeBottom_;
+ int16_t height = GetHeight();
+ yScrollBar_->SetForegroundProportion(static_cast<float>(height) / totalHeight);
+ yScrollBar_->SetScrollProgress(static_cast<float>(scrollBlankSizeTop_ - allItemsRect.GetTop()) /
+ (totalHeight - height));
+ }
+ if (xScrollBarVisible_) {
+ int16_t totalWidth = allItemsRect.GetWidth() + scrollBlankSizeLeft_ + scrollBlankSizeRight_;
+ int16_t width = GetWidth();
+ xScrollBar_->SetForegroundProportion(static_cast<float>(width) / totalWidth);
+ xScrollBar_->SetScrollProgress(static_cast<float>(scrollBlankSizeLeft_ - allItemsRect.GetLeft()) /
+ (totalWidth - width));
+ }
RefreshAnimator();
}
int16_t right = rect.GetRight();
int16_t scrollWidth = GetWidth();
if ((direction_ == VERTICAL) || (direction_ == HORIZONTAL_AND_VERTICAL)) {
- if (top > scrollBlankSize_) {
- if ((dragDistanceY + top) > (scrollBlankSize_ + reboundSize_)) {
+ if (top > scrollBlankSizeTop_) {
+ if ((dragDistanceY + top) > (scrollBlankSizeTop_ + reboundSizeTop_)) {
dragDistanceY = 0;
}
- dragDistanceY += scrollBlankSize_ - (top + dragDistanceY);
+ dragDistanceY += scrollBlankSizeTop_ - (top + dragDistanceY);
}
- if (bottom < (scrollHeight - scrollBlankSize_ - 1)) {
- if ((dragDistanceY + bottom) < (scrollHeight - scrollBlankSize_ - reboundSize_ - 1)) {
+ if (bottom < (scrollHeight - scrollBlankSizeBottom_ - 1)) {
+ if ((dragDistanceY + bottom) < (scrollHeight - scrollBlankSizeBottom_ - reboundSizeBottom_ - 1)) {
dragDistanceY = 0;
}
- dragDistanceY += scrollHeight - scrollBlankSize_ - 1 - (bottom + dragDistanceY);
+ dragDistanceY += scrollHeight - scrollBlankSizeBottom_ - 1 - (bottom + dragDistanceY);
}
} else {
- if (left > scrollBlankSize_) {
- if ((dragDistanceX + left) > (scrollBlankSize_ + reboundSize_)) {
+ if (left > scrollBlankSizeLeft_) {
+ if ((dragDistanceX + left) > (scrollBlankSizeLeft_ + reboundSizeLeft_)) {
dragDistanceX = 0;
}
- dragDistanceX += scrollBlankSize_ - (left + dragDistanceX);
+ dragDistanceX += scrollBlankSizeLeft_ - (left + dragDistanceX);
}
- if (right < (scrollWidth - scrollBlankSize_ - 1)) {
- if ((dragDistanceX + right) < (scrollWidth - scrollBlankSize_ - reboundSize_ - 1)) {
+ if (right < (scrollWidth - scrollBlankSizeRight_ - 1)) {
+ if ((dragDistanceX + right) < (scrollWidth - scrollBlankSizeRight_ - reboundSizeRight_ - 1)) {
dragDistanceX = 0;
}
- dragDistanceX += scrollWidth - scrollBlankSize_ - 1 - (right + dragDistanceX);
+ dragDistanceX += scrollWidth - scrollBlankSizeRight_ - 1 - (right + dragDistanceX);
}
}
}
return;
}
+ if (!autoAlign_) {
+ return;
+ }
+
if (direction_ == VERTICAL) {
FixVerDistance(distanceY);
} else {
#if ENABLE_VIBRATOR
totalRotateLen_ = 0;
lastVibratorRotateLen_ = 0;
+ vibrationLenThreshold_ = DEFAULT_SCROLL_VIEW_VIBRATION_LEN;
#endif
#if ENABLE_FOCUS_MANAGER
focusable_ = true;
bool lastIsEdge = false;
Rect childRect = GetAllChildRelativeRect();
if (direction_ == HORIZONTAL) {
- if (childRect.GetLeft() - scrollBlankSize_ >= 0 || childRect.GetRight() + scrollBlankSize_ <= GetWidth()) {
+ if (childRect.GetLeft() - scrollBlankSizeLeft_ >= 0 ||
+ childRect.GetRight() + scrollBlankSizeRight_ <= GetWidth()) {
lastIsEdge = true;
}
} else {
- if (childRect.GetTop() - scrollBlankSize_ >= 0 || childRect.GetBottom() + scrollBlankSize_ <= GetHeight()) {
+ if (childRect.GetTop() - scrollBlankSizeTop_ >= 0 ||
+ childRect.GetBottom() + scrollBlankSizeBottom_ <= GetHeight()) {
lastIsEdge = true;
}
}
childRect = GetAllChildRelativeRect();
bool isEdge = false;
if (direction_ == HORIZONTAL) {
- if (childRect.GetLeft() - scrollBlankSize_ >= 0 || childRect.GetRight() + scrollBlankSize_ <= GetWidth()) {
+ if (childRect.GetLeft() - scrollBlankSizeLeft_ >= 0 ||
+ childRect.GetRight() + scrollBlankSizeRight_ <= GetWidth()) {
isEdge = true;
}
} else {
- if (childRect.GetTop() - scrollBlankSize_ >= 0 || childRect.GetBottom() + scrollBlankSize_ <= GetHeight()) {
+ if (childRect.GetTop() - scrollBlankSizeTop_ >= 0 ||
+ childRect.GetBottom() + scrollBlankSizeBottom_ <= GetHeight()) {
isEdge = true;
}
}
VibratorFunc vibratorFunc = VibratorManager::GetInstance()->GetVibratorFunc();
if (vibratorFunc != nullptr && !isEdge) {
uint16_t rotateLen = MATH_ABS(totalRotateLen_ - lastVibratorRotateLen_);
- if (rotateLen > DEFAULT_SCROLL_VIEW_VIBRATION_LEN) {
- uint16_t vibrationCnt = rotateLen / DEFAULT_SCROLL_VIEW_VIBRATION_LEN;
+ if (rotateLen > vibrationLenThreshold_) {
+ uint16_t vibrationCnt = rotateLen / vibrationLenThreshold_;
for (uint16_t i = 0; i < vibrationCnt; i++) {
GRAPHIC_LOGI("UIScrollView::OnRotateEvent calls TYPE_ONE vibrator");
vibratorFunc(VibratorType::VIBRATOR_TYPE_ONE);
bool UIScrollView::DragXInner(int16_t distance)
{
Rect childRect = GetAllChildRelativeRect();
- int16_t reboundSize = reboundSize_;
+ int16_t reboundSizeLeft = reboundSizeLeft_;
+ int16_t reboundSizeRight = reboundSizeRight_;
if (scrollAnimator_.GetState() != Animator::STOP) {
- reboundSize = 0;
+ reboundSizeLeft = 0;
+ reboundSizeRight = 0;
}
- if (childRect.GetWidth() <= (GetWidth() - (scrollBlankSize_ << 1)) ||
+ if (childRect.GetWidth() <= (GetWidth() - scrollBlankSizeLeft_ - scrollBlankSizeRight_) ||
!(direction_ == HORIZONTAL || direction_ == HORIZONTAL_AND_VERTICAL)) {
return false;
}
if (distance > 0) {
- if (childRect.GetLeft() > scrollBlankSize_ + reboundSize) {
+ if (childRect.GetLeft() > scrollBlankSizeLeft_ + reboundSizeLeft) {
distance = 0;
- } else if ((childRect.GetLeft() + distance) > scrollBlankSize_ + reboundSize) {
- distance = scrollBlankSize_ - childRect.GetLeft() + reboundSize;
+ } else if ((childRect.GetLeft() + distance) > scrollBlankSizeLeft_ + reboundSizeLeft) {
+ distance = scrollBlankSizeLeft_ - childRect.GetLeft() + reboundSizeLeft;
}
} else {
int16_t childRight = childRect.GetRight();
int16_t scrollWidth = GetWidth();
- if (childRight < scrollWidth - (scrollBlankSize_ + reboundSize)) {
+ if (childRight < scrollWidth - (scrollBlankSizeRight_ + reboundSizeRight)) {
distance = 0;
- } else if (childRight + distance < scrollWidth - (scrollBlankSize_ + reboundSize)) {
- distance = scrollWidth - (scrollBlankSize_ + reboundSize) - childRight - 1;
+ } else if (childRight + distance < scrollWidth - (scrollBlankSizeRight_ + reboundSizeRight)) {
+ distance = scrollWidth - (scrollBlankSizeRight_ + reboundSizeRight) - childRight - 1;
}
}
bool UIScrollView::DragYInner(int16_t distance)
{
Rect childRect = GetAllChildRelativeRect();
- int16_t reboundSize = reboundSize_;
+ int16_t reboundSizeTop = reboundSizeTop_;
+ int16_t reboundSizeBottom = reboundSizeBottom_;
if (scrollAnimator_.GetState() != Animator::STOP) {
- reboundSize = 0;
+ reboundSizeTop = 0;
+ reboundSizeBottom = 0;
}
- if (childRect.GetHeight() <= (GetHeight() - (scrollBlankSize_ << 1)) ||
+ if (childRect.GetHeight() <= (GetHeight() - scrollBlankSizeTop_ - scrollBlankSizeBottom_) ||
!(direction_ == VERTICAL || direction_ == HORIZONTAL_AND_VERTICAL)) {
return false;
}
if (distance > 0) {
- if (childRect.GetTop() > scrollBlankSize_ + reboundSize) {
+ if (childRect.GetTop() > scrollBlankSizeTop_ + reboundSizeTop) {
distance = 0;
- } else if ((childRect.GetTop() + distance) > scrollBlankSize_ + reboundSize) {
- distance = scrollBlankSize_ - childRect.GetTop() + reboundSize;
+ } else if ((childRect.GetTop() + distance) > scrollBlankSizeTop_ + reboundSizeTop) {
+ distance = scrollBlankSizeTop_ - childRect.GetTop() + reboundSizeTop;
}
} else {
int16_t childBottom = childRect.GetBottom();
int16_t scrollHeight = GetHeight();
- if (childBottom < scrollHeight - (scrollBlankSize_ + reboundSize)) {
+ if (childBottom < scrollHeight - (scrollBlankSizeBottom_ + reboundSizeBottom)) {
distance = 0;
- } else if (childBottom + distance < scrollHeight - (scrollBlankSize_ + reboundSize)) {
- distance = scrollHeight - (scrollBlankSize_ + reboundSize) - childBottom - 1;
+ } else if (childBottom + distance < scrollHeight - (scrollBlankSizeBottom_ + reboundSizeBottom)) {
+ distance = scrollHeight - (scrollBlankSizeBottom_ + reboundSizeBottom) - childBottom - 1;
}
}
{
Rect childrenRect = GetAllChildRelativeRect();
/* calculate scrollBar's the proportion of foreground */
- int16_t totalLen = childrenRect.GetHeight() + 2 * scrollBlankSize_; // 2: two blank space on both sizes
- int16_t len = GetHeight();
if (yScrollBarVisible_) {
+ int16_t totalLen = childrenRect.GetHeight() + scrollBlankSizeTop_ + scrollBlankSizeBottom_;
+ int16_t len = GetHeight();
yScrollBar_->SetForegroundProportion(static_cast<float>(len) / totalLen);
/* calculate scrolling progress */
- yScrollBar_->SetScrollProgress(static_cast<float>(scrollBlankSize_ - childrenRect.GetTop()) /
+ yScrollBar_->SetScrollProgress(static_cast<float>(scrollBlankSizeTop_ - childrenRect.GetTop()) /
(totalLen - len));
}
if (xScrollBarVisible_) {
/* so do x-bar */
- totalLen = childrenRect.GetWidth() + 2 * scrollBlankSize_; // 2: two blank space on both sizes
- len = GetWidth();
+ int16_t totalLen = childrenRect.GetWidth() + scrollBlankSizeLeft_ + scrollBlankSizeRight_;
+ int16_t len = GetWidth();
xScrollBar_->SetForegroundProportion(static_cast<float>(len) / totalLen);
- xScrollBar_->SetScrollProgress(static_cast<float>(scrollBlankSize_ - childrenRect.GetLeft()) /
+ xScrollBar_->SetScrollProgress(static_cast<float>(scrollBlankSizeLeft_ - childrenRect.GetLeft()) /
(totalLen - len));
}
RefreshAnimator();
int16_t left = rect.GetLeft();
int16_t right = rect.GetRight();
int16_t scrollWidth = GetWidth();
- if (scrollBlankSize_ < top) {
- dragDistanceY = scrollBlankSize_ - top;
+ if (scrollBlankSizeTop_ < top) {
+ dragDistanceY = scrollBlankSizeTop_ - top;
} else if (bottom < scrollHeight - 1) {
- dragDistanceY = scrollHeight - scrollBlankSize_ - bottom - 1;
+ dragDistanceY = scrollHeight - scrollBlankSizeBottom_ - bottom - 1;
}
- if (scrollBlankSize_ < left) {
- dragDistanceX = scrollBlankSize_ - left;
+ if (scrollBlankSizeLeft_ < left) {
+ dragDistanceX = scrollBlankSizeLeft_ - left;
} else if (right < scrollWidth - 1) {
- dragDistanceX = scrollWidth - scrollBlankSize_ - right - 1;
+ dragDistanceX = scrollWidth - scrollBlankSizeRight_ - right - 1;
}
}
#if ENABLE_VIBRATOR
lastIndex_ = 0;
needVibration_ = false;
+ vibrateIndex_ = 0;
#endif
direction_ = direction;
tickTime_ = ANIMATOR_TIME;
}
#if ENABLE_VIBRATOR
needVibration_ = true;
+ lastIndex_ = vibrateIndex_;
#endif
return UIView::OnRotateStartEvent(event);
}
}
RefreshCurrentView(lastRotateLen_, dir);
if (curView_ == nullptr) {
+#if ENABLE_VIBRATOR
+ needVibration_ = false;
+#endif
return UIView::OnRotateEndEvent(event);
}
SwitchToPage(curIndex_);
lastRotateLen_ = 0;
-#if ENABLE_VIBRATOR
- needVibration_ = false;
-#endif
return UIView::OnRotateEndEvent(event);
}
#endif
if (swipeListener_ != nullptr) {
swipeListener_->OnSwipe(*this);
}
+#if ENABLE_VIBRATOR
+ needVibration_ = false;
+#endif
}
void UISwipeView::SortChild()
}
}
}
-#if ENABLE_VIBRATOR
- VibratorFunc vibratorFunc = VibratorManager::GetInstance()->GetVibratorFunc();
- if (vibratorFunc != nullptr && needVibration_ && curIndex_ != lastIndex_) {
- if (!loop_ && (curIndex_ == 0 || curIndex_ == childrenNum_ - 1)) {
- vibratorFunc(VibratorType::VIBRATOR_TYPE_THREE);
- GRAPHIC_LOGI("UISwipeView::RefreshCurrentViewInner calls TYPE_THREE vibrator");
- } else {
- vibratorFunc(VibratorType::VIBRATOR_TYPE_ONE);
- GRAPHIC_LOGI("UISwipeView::RefreshCurrentViewInner calls TYPE_ONE vibrator");
- }
- lastIndex_ = curIndex_;
- }
-#endif
}
void UISwipeView::RefreshCurrentView(int16_t distance, uint8_t dragDirection)
{
UIViewGroup::MoveChildByOffset(xOffset, yOffset);
MoveHeadOrTailChild();
+#if ENABLE_VIBRATOR
+ Vibrate();
+#endif
}
bool UISwipeView::isNeedLoop()
view = view->GetNextSibling();
}
}
+
+#if ENABLE_VIBRATOR
+void UISwipeView::Vibrate()
+{
+ UIView* view = childrenHead_;
+ int16_t swipeMid;
+ int16_t (UIView::*pfnGetXOrY)() const;
+ int16_t (UIView::*pfnGetWidthOrHeight)();
+ if (direction_ == HORIZONTAL) {
+ pfnGetXOrY = &UIView::GetX;
+ pfnGetWidthOrHeight = &UIView::GetWidthWithMargin;
+ } else {
+ pfnGetXOrY = &UIView::GetY;
+ pfnGetWidthOrHeight = &UIView::GetHeightWithMargin;
+ }
+ if (alignMode_ == ALIGN_LEFT) {
+ swipeMid = 0;
+ } else if (alignMode_ == ALIGN_RIGHT) {
+ swipeMid = (this->*pfnGetWidthOrHeight)();
+ } else {
+ swipeMid = (this->*pfnGetWidthOrHeight)() / 2;
+ }
+ bool isFind = false;
+ while (view != nullptr) {
+ if ((swipeMid >= (view->*pfnGetXOrY)()) &&
+ (swipeMid <= (view->*pfnGetXOrY)() + (view->*pfnGetWidthOrHeight)()) && !isFind) {
+ vibrateIndex_ = view->GetViewIndex();
+ isFind = true;
+ break;
+ }
+ view = view->GetNextSibling();
+ }
+
+ if (!isFind) {
+ if ((childrenHead_->*pfnGetXOrY)() > swipeMid) {
+ vibrateIndex_ = childrenHead_->GetViewIndex();
+ } else {
+ vibrateIndex_ = childrenTail_->GetViewIndex();
+ }
+ }
+
+ VibratorFunc vibratorFunc = VibratorManager::GetInstance()->GetVibratorFunc();
+ if (vibratorFunc != nullptr && needVibration_ && vibrateIndex_ != lastIndex_) {
+ if (!loop_ && (vibrateIndex_ == 0 || vibrateIndex_ == childrenNum_ - 1)) {
+ vibratorFunc(VibratorType::VIBRATOR_TYPE_THREE);
+ GRAPHIC_LOGI("UISwipeView::Vibrate calls TYPE_THREE vibrator");
+ } else {
+ vibratorFunc(VibratorType::VIBRATOR_TYPE_ONE);
+ GRAPHIC_LOGI("UISwipeView::Vibrate calls TYPE_ONE vibrator");
+ }
+ lastIndex_ = vibrateIndex_;
+ }
+}
+#endif
} // namespace OHOS
viewExtraMsg_(nullptr),
rect_(0, 0, -1, -1),
visibleRect_(nullptr),
- blurRadius_(0)
+ blurRadius_(0.0f)
{
SetupThemeStyles();
}
#endif
ClearBackgroundBlur();
if (parent_ != nullptr) {
- GRAPHIC_LOGE("UIView::~UIView failed, parent is not nullptr! Need to remove from parent component first %d",parent_->GetViewType());
+ GRAPHIC_LOGE("UIView::~UIView failed, parent is not nullptr! Need to remove from parent component first");
}
if (transMap_ != nullptr) {
delete transMap_;
void UIView::HandleGaussianBlur(BufferInfo& gfxDstBuffer)
{
- if (visible_ && (blurRadius_ != 0)) {
+ if (visible_ && (!FloatEqual(blurRadius_, 0.0f))) {
BufferInfo gfxTargetBuffer = gfxDstBuffer;
Rect mask = {0, 0, gfxTargetBuffer.width - 1, gfxTargetBuffer.height - 1};
if (!fullScreenBlur_) {
}
}
-void UIView::SetBackgroundBlur(uint16_t radius)
+void UIView::SetBackgroundBlur(float radius)
{
- if (RootView::GetInstance()->SetBlurView(this)) {
+ if (FloatEqual(radius, 0.0f)) {
+ RootView::GetInstance()->ClearBlurView(this);
+ blurRadius_ = 0.0f;
+ } else if (RootView::GetInstance()->SetBlurView(this)) {
blurRadius_ = radius;
- RootView::GetInstance()->Invalidate();
}
+ RootView::GetInstance()->Invalidate();
}
void UIView::ClearBackgroundBlur()
{
- if (blurRadius_ != 0) {
+ if (!FloatEqual(blurRadius_, 0.0f)) {
RootView::GetInstance()->ClearBlurView(this);
- blurRadius_ = 0;
+ blurRadius_ = 0.0f;
RootView::GetInstance()->Invalidate();
}
}
}
}
+uint16_t TaskManager::GetTotalTaskNum()
+{
+ return list_.Size();
+}
+
/**
* @brief TaskManager::ResetTaskHandlerMutex Reset the running flag.
*
dragLen_.y += dragStep_.y;
if (!isDragging_) {
if ((MATH_ABS(dragLen_.x) >= INDEV_DRAG_LIMIT) || (MATH_ABS(dragLen_.y) >= INDEV_DRAG_LIMIT)) {
- if ((touchableView_ != nullptr) && !cancelSent_) {
- DispatchCancelEvent();
- }
+ // HISI delete begin
+ //if ((touchableView_ != nullptr) && !cancelSent_) {
+ // DispatchCancelEvent();
+ //}
+ // HISI delete end
// Send Drag Begin Event.
DragEvent evt(curPos_, lastPos_, dragLen_);
UIView* parent = draggableView_->GetParent();
if (!draggableView_->OnDragEndEvent(evt)) {
while (parent != nullptr) {
DragEvent evtParent(curPos_, lastPos_, dragLen_);
+ evtParent.SetPreLastPoint(dragLastPos_);
if (parent->OnDragEndEvent(evtParent)) {
break;
}
if (!mask.Intersect(mask, blendOption.transMap.GetBoxRect())) {
return;
}
- if (!FloatEqual(scaleX, 1.0f) || !FloatEqual(scaleY, 1.0f)) { // to avoid twinkle
+ Matrix4<float> matrix = blendOption.transMap.GetTransformMatrix();
+ if (!(FloatEqual(matrix[0][0], 1) && FloatEqual(matrix[0][1], 0) && FloatEqual(matrix[0][3], 0) &&
+ FloatEqual(matrix[1][0], 0) && FloatEqual(matrix[1][1], 1) && FloatEqual(matrix[1][3], 0) && // 3: pos
+ FloatEqual(matrix[3][3], 1))) { // 3: pos, to avoid twinkle
mask.SetLeft(mask.GetLeft() + 1);
mask.SetRight(mask.GetRight() - 1);
mask.SetTop(mask.GetTop() + 1);
mask.SetBottom(mask.GetBottom() - 1);
} else { // to avoid vau error (srcRect is not euqal to dstRect) when no scale
- int16_t srcLeft = mask.GetLeft() - posX;
- int16_t srcTop = mask.GetTop() - posY;
+ int16_t srcLeft = mask.GetLeft() - matrix[3][0];
+ int16_t srcTop = mask.GetTop() - matrix[3][1];
src.rect = {srcLeft, srcTop, srcLeft + mask.GetWidth() - 1, srcTop + mask.GetHeight() - 1};
}
DrawUtils::GetInstance()->FillAreaWithSoftWare(dst, fillArea, color, opacity);
}
-void BaseGfxEngine::Blur(BufferInfo& dst, uint16_t radius)
+void BaseGfxEngine::Blur(BufferInfo& dst, float radius)
{
GRAPHIC_LOGE("Blur not support.");
}
*/
uint32_t GetMinimumCustomerTaskPeriod();
+ /**
+ * @brief Get total number of tasks.
+ */
+ uint16_t GetTotalTaskNum();
+
protected:
List<Task*> list_; /* the task list */
bool canTaskRun_;
const ColorType color,
const OpacityType opacity);
- virtual void Blur(BufferInfo& dst, uint16_t radius);
+ virtual void Blur(BufferInfo& dst, float radius);
virtual uint8_t* AllocBuffer(uint32_t size, uint32_t usage);
if (blurView_ == nullptr) {
blurView_ = view;
return true;
+ } else if (view == blurView_) {
+ return true;
} else {
#ifndef USE_DIAG_LOG
GRAPHIC_LOGE("BlurView already exists. Can only set once.");
formatter_ = formatter;
}
protected:
- virtual UILabel* GetTextView(UIView* inView, int16_t index);
- virtual UILabel* CreateUILabel(UIView* inView);
+ virtual UILabel* CreateUILabel();
uint8_t dataMode_;
private:
static constexpr uint8_t DYNAMIC_TEXT_MODE = 0;
static constexpr uint8_t CONTINUOUS_INTEGER_MODE = 3;
static constexpr uint8_t BUF_LEN = 7;
- UILabel* GetDynamicText(UIView* inView, int16_t index);
- UILabel* GetIntegerText(UIView* inView, int16_t index);
+ bool SetIntegerText(UILabel* inView, int16_t index);
void ClearDynamicText();
uint8_t fontId_;
char* fontName_;
return UI_ABSTRACT_SCROLL;
}
+ enum class Direction {
+ ALL,
+ TOP,
+ BOTTOM,
+ LEFT,
+ RIGHT,
+ };
+
/**
* @brief Sets the blank size for this scroll view.
*
* example, the value <b>0</b> indicates that the head node can only scroll downwards the top of the
* view and the tail node scroll upwards the bottom; the value <b>10</b> indicates that the head node
* can continue scrolling down by 10 pixels after it reaches the top of the view.
+ * @param direction Indicates the direction of blank size to set. Default is ALL. Direction can be specified for UIList and UIScrollView.
* @since 1.0
* @version 1.0
*/
- void SetScrollBlankSize(uint16_t size)
+ void SetScrollBlankSize(uint16_t size, UIAbstractScroll::Direction direction = UIAbstractScroll::Direction::ALL)
{
- scrollBlankSize_ = size;
+ switch (direction) {
+ case UIAbstractScroll::Direction::ALL:
+ scrollBlankSize_ = size;
+ scrollBlankSizeTop_ = size;
+ scrollBlankSizeBottom_ = size;
+ scrollBlankSizeLeft_ = size;
+ scrollBlankSizeRight_ = size;
+ break;
+ case UIAbstractScroll::Direction::TOP:
+ scrollBlankSizeTop_ = size;
+ break;
+ case UIAbstractScroll::Direction::BOTTOM:
+ scrollBlankSizeBottom_ = size;
+ break;
+ case UIAbstractScroll::Direction::LEFT:
+ scrollBlankSizeLeft_ = size;
+ break;
+ case UIAbstractScroll::Direction::RIGHT:
+ scrollBlankSizeRight_ = size;
+ break;
+ }
}
/**
- * @brief Sets the maximum scroll distance after a finger lifts the screen.
- *
- * @param distance Indicates the maximum scroll distance to set. The default value is <b>0</b>, indicating that the
- * scroll distance is not limited.
- * @since 1.0
- * @version 1.0
+ * @brief Sets the rebound size in a specific direction.
+ * @param size Indicates the rebound size to set.
+ * @param direction Indicates the direction of rebound size to set. Default is ALL. Direction can be specified for UIList and UIScrollView.
*/
- void SetMaxScrollDistance(uint16_t distance)
+ void SetReboundSize(uint16_t size, UIAbstractScroll::Direction direction = UIAbstractScroll::Direction::ALL)
{
- maxScrollDistance_ = distance;
+ switch (direction) {
+ case UIAbstractScroll::Direction::ALL:
+ reboundSize_ = size;
+ reboundSizeTop_ = size;
+ reboundSizeBottom_ = size;
+ reboundSizeLeft_ = size;
+ reboundSizeRight_ = size;
+ break;
+ case UIAbstractScroll::Direction::TOP:
+ reboundSizeTop_ = size;
+ break;
+ case UIAbstractScroll::Direction::BOTTOM:
+ reboundSizeBottom_ = size;
+ break;
+ case UIAbstractScroll::Direction::LEFT:
+ reboundSizeLeft_ = size;
+ break;
+ case UIAbstractScroll::Direction::RIGHT:
+ reboundSizeRight_ = size;
+ break;
+ }
}
/**
- * @brief Sets the rebound size, which is the distance a knob moves after being released when it reaches the end of
- * a scrollbar.
+ * @brief Sets the maximum scroll distance after a finger lifts the screen.
*
- * @param size Indicates the rebound size to set.
+ * @param distance Indicates the maximum scroll distance to set. The default value is <b>0</b>, indicating that the
+ * scroll distance is not limited.
* @since 1.0
* @version 1.0
*/
- void SetReboundSize(uint16_t size)
+ void SetMaxScrollDistance(uint16_t distance)
{
- reboundSize_ = size;
+ maxScrollDistance_ = distance;
}
/**
int16_t CalculateElasticDragLen(int16_t maxLen, int16_t currLen, int16_t dragLen);
uint16_t scrollBlankSize_ = 0;
+ uint16_t scrollBlankSizeTop_ = 0;
+ uint16_t scrollBlankSizeBottom_ = 0;
+ uint16_t scrollBlankSizeLeft_ = 0;
+ uint16_t scrollBlankSizeRight_ = 0;
+ uint16_t reboundSizeTop_ = 0;
+ uint16_t reboundSizeBottom_ = 0;
+ uint16_t reboundSizeLeft_ = 0;
+ uint16_t reboundSizeRight_ = 0;
uint16_t reboundSize_ = 0;
int16_t accumulatedSize_ = 0;
uint16_t elasticTime_ = 200;
*/
void SetHeight(int16_t height) override;
+ /**
+ * @brief Adjusts the size of the view.
+ * @param width Indicates the new width.
+ * @param height Indicates the new height.
+ * @since 1.0
+ * @version 1.0
+ */
+ void Resize(int16_t width, int16_t height) override;
+
void ReMeasure() override;
std::string GetGuiInfo() const override;
+ /**
+ * @brief Set animator state. This may not immediately change the state.
+ * It is used when label has an animator due to LINE_BREAK_MARQUEE or LINE_BREAK_OSCILLATION mode.
+ * START: Enable animator. Start or Resume animator if it was mannually stopped or paused.
+ * STOP: Stop animator. Once set, animator cannot be started automatically.
+ * PAUSE: Pause animator. Once set, animator cannot be resumed automatically.
+ */
+ void SetAnimState(uint8_t state);
+
+ /**
+ * @brief Get animator's real state.
+ */
+ uint8_t GetAnimRealState();
+
#if ENABLE_FONT_VECTOR_GLOBAL
virtual void ForceResetText() {};
#endif
} animator_;
UITextLanguageAlignment horAlign_ = TEXT_ALIGNMENT_LEFT;
+
+ bool CheckAnimState();
+ uint8_t setAnimState_ = Animator::START;
};
} // namespace OHOS
#endif // GRAPHIC_LITE_UI_LABEL_H
scrollListener_ = scrollListener;
}
+ void SetVibrationLenThreshold(uint16_t value)
+ {
+ vibrationLenThreshold_ = value;
+ }
+
+ uint16_t GetVibrationLenThreshold() const
+ {
+ return vibrationLenThreshold_;
+ }
+
protected:
void StopAnimator() override;
bool DragXInner(int16_t distance) override;
#if ENABLE_VIBRATOR
int16_t totalRotateLen_;
int16_t lastVibratorRotateLen_;
+ uint16_t vibrationLenThreshold_;
#endif
};
} // namespace OHOS
#if ENABLE_VIBRATOR
uint16_t lastIndex_;
bool needVibration_;
+ uint16_t vibrateIndex_;
+ void Vibrate();
#endif
private:
UI_COVER_FLOW_2,
UI_WATERFALL_LIST,
UI_SPHERE_VIEW,
+ UI_PARTICLE_VIEW,
UI_NUMBER_MAX
};
void ResetTransParameter();
- void SetBackgroundBlur(uint16_t radius);
+ /**
+ * @brief Sets blur radius
+ * @param radius Indicates the blur effect of different degrees, the valid range is [0.0f, 32.0f]
+ * @since 1.0
+ * @version 1.0
+ */
+ void SetBackgroundBlur(float radius);
void ClearBackgroundBlur();
OnRotateListener* onRotateListener_;
#endif
ViewExtraMsg* viewExtraMsg_;
- uint16_t blurRadius_;
+ float blurRadius_;
uint8_t GetMixOpaScale() const;
bool IsInvalid(float percent);
*/
#define ENABLE_STATIC_FONT 0
+#ifdef XTS_SUPPORT
+#define ENABLE_JPEG_AND_PNG 1
+#else
#define ENABLE_JPEG_AND_PNG 0
+#endif
/**
* @brief Cache the decoded content for Jpeg and Png image
*/
+#ifdef XTS_SUPPORT
+#define CACHE_JPEG_AND_PNG 1
+#else
#define CACHE_JPEG_AND_PNG 0
+#endif
/**
* @brief Customize the memory area when loading image resources
*/
}\r
}\r
\r
-bool InterruptMgrGetActiveStream(AudioStreamStrategy *streamStrategy, bool isOutput)\r
+bool InterruptMgrGetActiveStream(AudioStreamStrategy *streamStrategy, AudioStreamType streamType, bool isOutput)\r
{\r
/* 获取流和对应的混音权重 */\r
ALOGD("isOutput:%d", isOutput);\r
AUDIO_LOCK(g_interruptMgrCtx.interruptLock);\r
for (ListIterator it = ListIterBegin(list); it != ListIterEnd(list); it = ListIterNext(list, it)) {\r
InterruptElement *interruptEl = (InterruptElement *)ListIterData(it);\r
- bool isValidActiveStream = !interruptEl->isInterrupted &&\r
+ /* 可以恢复的流即使被打断,也需要默认是active的 */\r
+ bool isValidActiveStream = (!interruptEl->isInterrupted || IsNeedResumeForStream(interruptEl->streamType)) &&\r
interruptEl->streamType == interruptEl->routedStreamDesc.streamDesc.streamType;\r
if (isValidActiveStream) {\r
ret = GetRoutedDeviceForStream(&interruptEl->routedStreamDesc, isOutput);\r
if (ret != AUDIO_SUCCESS) {\r
- ALOGE("Get Routed Device For Stream (0x%x) failed", interruptEl->streamType);\r
- AUDIO_UNLOCK(g_interruptMgrCtx.interruptLock);\r
- return false;\r
+ if (interruptEl->streamType == streamType) {\r
+ ALOGE("Get Routed Device For Stream (0x%x) failed", interruptEl->streamType);\r
+ AUDIO_UNLOCK(g_interruptMgrCtx.interruptLock);\r
+ return false;\r
+ }\r
+ continue;\r
}\r
/* 第一条流作为混音权重 100% */\r
if (index == 0) {\r
bool InterruptMgrCreateStream(AudioSession sessionID, const AudioStreamDescriptor *streamDesc, bool isOutput);\r
bool InterruptMgrDestroyStream(AudioSession sessionID, const AudioStreamDescriptor *streamDesc, bool isOutput);\r
\r
-bool InterruptMgrGetActiveStream(AudioStreamStrategy *streamStrategy, bool isOutput);\r
+bool InterruptMgrGetActiveStream(AudioStreamStrategy *streamStrategy, AudioStreamType streamType, bool isOutput);\r
/* interrupt might already be time out in the stack, handle it */\r
void InterruptMgrSignalExceptionCheckThread(void);\r
void InterruptMgrHandleException(void);\r
}
ResetActiveStreams();
/* 获取流和对应的混音权重 */
- if (!InterruptMgrGetActiveStream(&g_policyMgrCtx.streamStrategy, isOutput)) {
+ if (!InterruptMgrGetActiveStream(&g_policyMgrCtx.streamStrategy, streamDesc->streamType, isOutput)) {
ResetActiveStreams();
return NULL;
}
return &g_policyMgrCtx.streamStrategy;
}
-static AudioStreamStrategy *GetStrategyForStreamResume(bool isOutput)
+static AudioStreamStrategy *GetStrategyForStreamResume(const AudioStreamDescriptor *streamDesc, bool isOutput)
{
ResetActiveStreams();
/* 获取流和对应的混音权重 */
- if (!InterruptMgrGetActiveStream(&g_policyMgrCtx.streamStrategy, isOutput)) {
+ if (!InterruptMgrGetActiveStream(&g_policyMgrCtx.streamStrategy, streamDesc->streamType, isOutput)) {
ResetActiveStreams();
return NULL;
}
return NULL;
}
/* 获取流和对应的混音权重 */
- if (!InterruptMgrGetActiveStream(&g_policyMgrCtx.streamStrategy, isOutput)) {
+ if (!InterruptMgrGetActiveStream(&g_policyMgrCtx.streamStrategy, streamDesc->streamType, isOutput)) {
ResetActiveStreams();
ALOGE("sessionID:%u get active stream:0x%x failed", sessionID, streamDesc->streamType);
return NULL;
return GetStrategyForStreamCreate(sessionID, streamDesc, isOutput);
case STREAM_OUT_RESUME:
case STREAM_IN_RESUME:
- return GetStrategyForStreamResume(isOutput);
+ return GetStrategyForStreamResume(streamDesc, isOutput);
case STREAM_OUT_DESTROY:
case STREAM_IN_DESTROY:
return GetStrategyForStreamDestroy(sessionID, streamDesc, isOutput);
int32_t StreamMgrDestroyStreamOut(uintptr_t handle)
{
- if (!g_inited) {
- return AUDIO_SUCCESS;
- }
CHK_NULL_RETURN((void*)handle, AUDIO_ERROR, "handle is NULL when destroy");
int32_t streamId;
AudioSession sessionId;
int32_t ret = GetHandleId(handle, &streamId, &sessionId);
CHK_FAILED_RETURN(ret, AUDIO_SUCCESS, AUDIO_ERROR, "get handle failed");
-
+ MediaMutexLock(g_mutex);
// 告知策略模块即将清掉的流
AudioStreamInfo streamInfForDestroy = { 0 };
streamInfForDestroy.streamType = GetStreamType(handle);
streamInfForDestroy.sessionID = sessionId;
AudioStreamStrategy *strategy =
GetStrategyFromPolicyManager(&streamInfForDestroy, (uint32_t)streamId, STREAM_OUT_DESTROY);
- CHK_NULL_RETURN(strategy, AUDIO_ERROR, "get strategy fail when destroy out stream");
+ if (strategy == NULL) {
+ ALOGE("get strategy fail when destroy out stream");
+ MediaMutexUnLock(g_mutex);
+ return AUDIO_ERROR;
+ }
#ifdef SUPPORT_SET_DSP_CLOCK_FREQ
AudioStreamType streamType = GetStreamType(handle);
AudioDeviceType deviceType = (AudioDeviceType)GetStreamDeviceId(handle);
#endif
// hal 销毁
if (DestroyTrackHandle(handle) != AUDIO_SUCCESS) {
+ MediaMutexUnLock(g_mutex);
return AUDIO_ERROR;
}
// 更新的话,先把流从管理中删除
// 然后根据新的策略,把老流的信息该更新了
// 通知外界流销毁了
- MediaMutexLock(g_mutex);
DeleteOneStream(streamId, true);
#ifdef SUPPORT_SET_DSP_CLOCK_FREQ
if (IsAllStreamDestroyed(streamType)) {\r
if (streamType == AUDIO_STREAM_VOICE_CALL_VOLTE) {
int32_t ret = SetSourceVolume(streamHandle, typeVolume);
if (ret == AUDIO_ERROR) {
- MediaMutexUnLock(g_mutex);
return AUDIO_ERROR;
}
} else {
// 获取混音比例,这个是不是也应该放在 trackcontext 更合适,目前先这么实现
float mixWeight;
if (!GetStreamMixWeight(streamHandle, &mixWeight)) {
- MediaMutexUnLock(g_mutex);
return AUDIO_ERROR;
}
int32_t ret = SetTrackVolume(streamHandle, typeVolume, mixWeight, NOT_SET_STREAM_VOLUME);
if (ret == AUDIO_ERROR) {
- MediaMutexUnLock(g_mutex);
return AUDIO_ERROR;
}
}
{
TrackHandleContext *context = (TrackHandleContext *)handle;
CHK_NULL_RETURN(context, AUDIO_ERROR, "track handle is NULL");
+ MediaMutexLock(context->deviceChangeMutex);
ALOGI("type is:%s", StringType(context->streamInfo.streamType));
uint32_t validFwDevice = context->userAudioOutDevice == 0 ?
context->defalutAudioOutDevice :
free(context->keyValueList);
context->keyValueList = NULL;
}
+ MediaMutexUnLock(context->deviceChangeMutex);
MediaMutexDestroy(&context->deviceChangeMutex);
free(context);
return ret;
static int32_t ChangeRouteInner(TrackHandleContext *context, int32_t deviceId)
{
CHK_NULL_RETURN(context->render, AUDIO_ERROR, "hal render is NULL");
-
// 1. process cur stream
int32_t ret = ProcessCurStream(context);
CHK_FAILED_RETURN(ret, AUDIO_SUCCESS, AUDIO_ERROR, "process cur stream fail");
return ret;
}
}
-
context->userAudioOutDevice = (uint32_t)deviceId;
return AUDIO_SUCCESS;
}
if (context->state == IDLE) {
context->userAudioOutDevice = (uint32_t)deviceId;
} else if (context->state == RUNNING) {
- (void)context->callback(context->caller, AUDIO_EVENT_OUTPUT_DEVICE_CHANGED, NULL);
- if (ChangeRouteInner(context, deviceId) != AUDIO_SUCCESS) {
- goto ERR;
- }
- } else if (context->state == PAUSE) {
- context->routeChangedDevice = (uint32_t)deviceId;
- } else {
- ALOGE("bad state[%d]", context->state);
+ (void)context->callback(context->caller, AUDIO_EVENT_OUTPUT_DEVICE_CHANGED, NULL);\r
+ if (ChangeRouteInner(context, deviceId) != AUDIO_SUCCESS) {\r
+ goto ERR;\r
+ }\r
+ } else if (context->state == PAUSE) {\r
+ context->routeChangedDevice = (uint32_t)deviceId;\r
+ } else {\r
+ ALOGE("bad state[%d]", context->state);\r
goto ERR;
}
MediaMutexUnLock(context->deviceChangeMutex);
{
TrackHandleContext *context = (TrackHandleContext *)handle;
CHK_NULL_RETURN(context, AUDIO_ERROR, "track handle is NULL");
+ MediaMutexLock(context->deviceChangeMutex);
if (context->state == RUNNING) {
+ MediaMutexUnLock(context->deviceChangeMutex);
return AUDIO_SUCCESS;
}
if (context->state == STOP) {
+ MediaMutexUnLock(context->deviceChangeMutex);
return AUDIO_ERROR;
}
// 暂停后恢复分 主动暂停后恢复 和 被动暂停后恢复,
// 由于目前还不能区分是哪种恢复,因此统一处理
// 被动暂停后恢复典型场景分析:
// 例如A1-A2混音,此时B抢占A1A2,待B结束,要恢复A1A2其中一个时(定为Ax),Ax需要重新计算权重
- int32_t ret;
if (context->state == PAUSE) {
// 蓝牙音乐中途接听蓝牙电话,通话中途手表去使能,此时手机和蓝牙设备同时和手表断开,
// 蓝牙音乐恢复和输出设备切换从不同线程触发,同时访问底层蓝牙插件资源,需要加锁保证时序
- MediaMutexLock(context->deviceChangeMutex);
- ret = ResumeTrack(context);
+ int32_t ret = ResumeTrack(context);
MediaMutexUnLock(context->deviceChangeMutex);
return ret;
}
-
// IDLE 状态要把 hal 创建起来
- ret = CreateAudioRenderHandle(context);
+ int32_t ret = CreateAudioRenderHandle(context);
if (ret != AUDIO_SUCCESS) {
+ MediaMutexUnLock(context->deviceChangeMutex);
return AUDIO_ERROR;
}
if (!CheckRenderValid(context->render)) {
if (SetVolumeAndSetMute(context) != AUDIO_SUCCESS) {
goto DESTROY_RENDER_HANDLE;
}
+ MediaMutexUnLock(context->deviceChangeMutex);
return AUDIO_SUCCESS;
DESTROY_RENDER_HANDLE:
DestroyAudioRenderHandle(context);
+ MediaMutexUnLock(context->deviceChangeMutex);
return AUDIO_ERROR;
}
MediaMutexUnLock(context->deviceChangeMutex);
return AUDIO_BAD_STATE;
}
- MediaMutexUnLock(context->deviceChangeMutex);
if (context->keyValueList != NULL) {
if (SetExtraData(context) != AUDIO_SUCCESS) {
ALOGI("set volume extra data failed!");
goto ERROR;
}
}
+ MediaMutexUnLock(context->deviceChangeMutex);
return AUDIO_SUCCESS;
ERROR:
+ MediaMutexUnLock(context->deviceChangeMutex);
return AUDIO_ERROR;
}
TrackHandleContext *context = (TrackHandleContext *)handle;
CHK_NULL_RETURN(context, AUDIO_ERROR, "track handle is NULL");
// 状态
+ MediaMutexLock(context->deviceChangeMutex);
if (context->state == STOP) {
ALOGE("track[%d] is stop", context->streamId);
+ MediaMutexUnLock(context->deviceChangeMutex);
return AUDIO_ERROR;
}
// 调南向
int32_t ret = context->render->SetRenderSpeed(context->render, speed);
if (ret != AUDIO_SUCCESS) {
+ MediaMutexUnLock(context->deviceChangeMutex);
return AUDIO_ERROR;
}
+ MediaMutexUnLock(context->deviceChangeMutex);
return AUDIO_SUCCESS;
}
TrackHandleContext *context = (TrackHandleContext *)handle;
CHK_NULL_RETURN(context, AUDIO_ERROR, "track handle is NULL");
// 状态
+ MediaMutexLock(context->deviceChangeMutex);
if (context->state != RUNNING) {
// 场景B打断场景A,策略结果是场景A业务暂停,由于中断结果上报和场景B业务启动是异步的,
// 因此当场景B业务启动时,场景A业务可能还未响应暂停,此时流管理模块会检查老流状态,
ALOGE("track[%d] is neither running or pause, write failed", context->streamId);
}
*replyBytes = 0;
+ MediaMutexUnLock(context->deviceChangeMutex);
return AUDIO_ERROR;
}
// 调南向
- MediaMutexLock(context->deviceChangeMutex);
if (context->render == NULL) {
MediaMutexUnLock(context->deviceChangeMutex);
return AUDIO_ERROR;
TrackHandleContext *context = (TrackHandleContext *)handle;
CHK_NULL_RETURN(context, AUDIO_ERROR, "track handle is NULL");
// 状态
+ MediaMutexLock(context->deviceChangeMutex);
if (context->state == STOP) {
ALOGE("track[%d] state is wrong, mute fail", context->streamId);
+ MediaMutexUnLock(context->deviceChangeMutex);
return AUDIO_BAD_STATE;
} else if (context->state == IDLE) {
context->mute = mute;
+ MediaMutexUnLock(context->deviceChangeMutex);
return AUDIO_SUCCESS;
}
// 调南向
int32_t ret = context->render->volume.SetMute((AudioHandle)context->render, mute);
if (ret != AUDIO_SUCCESS) {
+ MediaMutexUnLock(context->deviceChangeMutex);
return AUDIO_ERROR;
}
context->mute = mute;
+ MediaMutexUnLock(context->deviceChangeMutex);
return AUDIO_SUCCESS;
}
{
TrackHandleContext *context = (TrackHandleContext *)handle;
CHK_NULL_RETURN(context, AUDIO_ERROR, "track handle is NULL");
+ MediaMutexLock(context->deviceChangeMutex);
if (context->state != RUNNING) {
+ MediaMutexUnLock(context->deviceChangeMutex);
return AUDIO_BAD_STATE;
}
int32_t ret = context->render->attr.GetCurrentChannelId(context->render, channelId);
if (ret != AUDIO_SUCCESS) {
ALOGE("Get channel id failed: 0x%x", ret);
+ MediaMutexUnLock(context->deviceChangeMutex);
return AUDIO_ERROR;
}
ALOGI("Channel id: 0x%x", *channelId);
+ MediaMutexUnLock(context->deviceChangeMutex);
return AUDIO_SUCCESS;
}
{
TrackHandleContext *context = (TrackHandleContext *)handle;
CHK_NULL_RETURN(context, AUDIO_ERROR, "track handle is NULL");
+ MediaMutexLock(context->deviceChangeMutex);
if (context->state != RUNNING) {
+ MediaMutexUnLock(context->deviceChangeMutex);
return AUDIO_BAD_STATE;
}
int convertRet = sprintf_s(keyValuePair, sizeof(keyValuePair), "%s = %u", "attachId", frontendId);
if (convertRet == AUDIO_ERROR) {
ALOGE("splice key=value str fail[%d]", convertRet);
+ MediaMutexUnLock(context->deviceChangeMutex);
return AUDIO_ERROR;
}
int32_t ret = context->render->attr.SetExtraParams((AudioHandle)context->render, keyValuePair);
if (ret != AUDIO_SUCCESS) {
ALOGE("set front end id failed: 0x%x", ret);
+ MediaMutexUnLock(context->deviceChangeMutex);
return AUDIO_ERROR;
}
ALOGI("frontend Id: 0x%x", frontendId);
+ MediaMutexUnLock(context->deviceChangeMutex);
return AUDIO_SUCCESS;
}
TrackHandleContext *context = (TrackHandleContext *)handle;
CHK_NULL_RETURN(context, AUDIO_ERROR, "track handle is NULL");
// 状态
+ MediaMutexLock(context->deviceChangeMutex);
if (context->state != PAUSE) {
ALOGE("track[%d] state is wrong, mute fail", context->streamId);
+ MediaMutexUnLock(context->deviceChangeMutex);
return AUDIO_ERROR;
}
// 调南向
int32_t ret = context->render->control.Flush((AudioHandle)context->render);
if (ret != AUDIO_SUCCESS) {
+ MediaMutexUnLock(context->deviceChangeMutex);
return AUDIO_ERROR;
}
+ MediaMutexUnLock(context->deviceChangeMutex);
return AUDIO_SUCCESS;
}
ALOGE("len invalid ");
return AUDIO_ERROR;
}
+ MediaMutexLock(context->deviceChangeMutex);
if (context->keyValueList != NULL) {
free(context->keyValueList);
context->keyValueList = NULL;
context->keyValueList = malloc(len + 1);
if (context->keyValueList == NULL) {
ALOGE("malloc failed");
+ MediaMutexUnLock(context->deviceChangeMutex);
return AUDIO_ERROR;
}
int32_t ret = memcpy_s(context->keyValueList, len + 1, keyValueList, len);
ALOGE("memcpy_s failed");
free(context->keyValueList);
context->keyValueList = NULL;
+ MediaMutexUnLock(context->deviceChangeMutex);
return AUDIO_ERROR;
}
if (context->render != NULL) {
ret = SetExtraData(context);
if (ret != AUDIO_SUCCESS) {
ALOGE("Set extra data failed! ret = %d", ret);
+ MediaMutexUnLock(context->deviceChangeMutex);
return ret;
}
}
-
+ MediaMutexUnLock(context->deviceChangeMutex);
return AUDIO_SUCCESS;
}
ALOGE("len invalid ");
return AUDIO_ERROR;
}
+ MediaMutexLock(context->deviceChangeMutex);
if (context->render != NULL) {
int32_t ret = context->render->attr.GetExtraParams((AudioHandle)context->render, keyValueList, (int32_t)len);
if (ret != AUDIO_SUCCESS) {
ALOGE("get extra data failed! ret = %d", ret);
+ MediaMutexUnLock(context->deviceChangeMutex);
return ret;
}
}
+ MediaMutexUnLock(context->deviceChangeMutex);
return AUDIO_SUCCESS;
}
CHECK_NULL_RETURN_NONE(sinkManager_, "sinkManager_ nullptr");\r
sinkManager_->GetRenderPosition(position);\r
if (position >= 0 && currentPosition_ != position) {\r
- if (lastRendPos_ > 0) {\r
+ if (lastRendPos_ >= 0) {\r
currentPosition_ = position - lastRendPos_ + firstPosAfterSeek_;\r
} else {\r
currentPosition_ = position;\r
goto EXIT;
}
}
+ MediaMutexUnLock(lock_);
return 0;
EXIT:
MediaMutexUnLock(lock_);
bool ResetPlayer();
void ReleaseEventListeners();
-
+#ifdef HMF_DECRYPT_DATA_ENABLE
+ void SetDecryptLibraryPath(char *path, uint32_t len);
+#endif
void ReleaseSrc();
bool Play();
bool SetAutoPlay(bool autoPlay);
- bool SetLoop(bool loop) const;
+ bool SetLoop(bool loop);
bool SetVolume(double volume);
void SetOnTimeUpdateListener(AudioEventListener *onTimeUpdateListener);
int32_t GetSrcInnerPrefix(const char *src, char *dest);
+
+ bool IsSysSrc();
private:
AudioPlayer();
~AudioPlayer();
bool autoPlay_;
bool isRunning_;
bool isSysSrc_;
+ bool isPlayList_;
+ AudioPlayerLoopMode playLoopMode_ = AudioPlayerLoopMode::AUDIO_PLAYER_INVAILD_LOOP;
MediaThreadIdHandle updateTimeProcess_;
AudioStreamType streamType_ = AUDIO_STREAM_MUSIC;
};
} // namespace ACELite
} // namespace OHOS
-#endif // AUDIO_PLAYER_H
\ No newline at end of file
+#endif // AUDIO_PLAYER_H
#include "media_log.h"
#include "js_async_work.h"
#ifdef HMF_DECRYPT_DATA_ENABLE
-#include "js_ability.h"\r
-#include "audio_decrypt.h"\r
+#include "js_ability.h"
+#include "audio_decrypt.h"
#endif
namespace OHOS {
namespace ACELite {
constexpr char PROP_SUCCESS[] = "success";
constexpr char PROP_COMPLETE[] = "complete";
constexpr char DECRYPT_FILE_PATH[] = "/user/app/user/ace/data/%s/rawfile/lib/audio_decode.bin";
-constexpr uint32_t MAX_PATH_LEN = 128;
+constexpr uint32_t MAX_PATH_LEN = 256;
constexpr char PATH_PREFIX[] = "internal://";
+constexpr char PATH_SANDBOX_KEYWORD[] = "/assets/entry/";
static Audio::AudioManager& g_amInstance = Audio::AudioManager::GetInstance();
}
audioPlayer->ReleaseEventListeners();
audioPlayer->StopUpdateTimeThread();
-#ifdef HMF_DECRYPT_DATA_ENABLE
- AUDIO_UnLoadDecryptLibrary();
-#endif
}
void AudioModule::DefineProperty(JSIValue target,
JSI::SetBooleanProperty(data, "muted", audioPlayer->IsMuted());
JSIValue params[1] = { data };
JSI::CallFunction(successCallback, thisVal, params, 1);
- JSI::ReleaseValue(successCallback);
+ JSI::ReleaseValueList(successCallback, data);
}
JSIValue completeCallback = JSI::GetNamedProperty(options, PROP_COMPLETE);
MEDIA_UNUSED(thisVal);
MEDIA_UNUSED(args);
MEDIA_UNUSED(argsSize);
- char *src = AudioPlayer::GetInstance()->GetSrc(false);
+ char *src;
+ if (!AudioPlayer::GetInstance()->IsSysSrc()) {
+ char *sysSrc = AudioPlayer::GetInstance()->GetSrc(true);
+ std::string sysPath(sysSrc);
+ int size = sysPath.find(PATH_SANDBOX_KEYWORD) + strlen(PATH_SANDBOX_KEYWORD);
+ std::string path = sysPath.substr(size);
+ path.insert(0, PATH_PREFIX);
+ src = const_cast<char *>(path.c_str());
+ } else {
+ src = AudioPlayer::GetInstance()->GetSrc(false);
+ }
return (src == nullptr) ? JSI::CreateUndefined() : JSI::CreateString(src);
}
}
char *src = JSI::ValueToString(args[0]);
bool autoPlay = AudioPlayer::GetInstance()->GetAutoPlay();
- bool ret = AudioPlayer::GetInstance()->SetSrc(src, false);
+ bool ret = false;
+ int size = strlen(PATH_PREFIX);
+ std::string strValue(src);
+ if (strValue.find(PATH_PREFIX) == 0) {
+ std::string strNew = strValue.substr(size);
+ char *innerPath = const_cast<char *>(strNew.c_str());
+ ret = AudioPlayer::GetInstance()->SetSrc(innerPath, true);
+ delete src;
+ } else {
+ ret = AudioPlayer::GetInstance()->SetSrc(src, false);
+ }
+
AudioPlayer::GetInstance()->SetStreamType(g_streamType);
if (autoPlay) {
AudioPlayer::GetInstance()->Play();
return JSI::CreateBoolean(false);
}
srcList.push_back(std::string(absPath));
- } else {\r
- srcList.push_back(strValue);\r
+ } else {
+ srcList.push_back(strValue);
}
}
bool ret = AudioPlayer::GetInstance()->SetSrcList(srcList);
MEDIA_ERR_LOG("get package name fail");
return;
}
- char decfilePath[256] = {0};
+ char decfilePath[MAX_PATH_LEN] = {0};
int32_t ret = snprintf_s(decfilePath, sizeof(decfilePath), sizeof(decfilePath) - 1,
DECRYPT_FILE_PATH, bundleName);
if (ret < 0) {
MEDIA_ERR_LOG("format decrypt file path fail");
return;
}
- AUDIO_LoadDecryptLibrary(decfilePath);
+ AudioPlayer::GetInstance()->SetDecryptLibraryPath(decfilePath, MAX_PATH_LEN);
#endif
}
constexpr double DEFAULT_VOLUME = 1.0;
constexpr double MILLISECONDS_PER_SECOND = 1000.0;
constexpr uint32_t MICROSECONDS_PER_SECOND = 1000 * 1000;
-constexpr uint32_t MAX_PATH_LEN = 128;
char absPath[MAX_PATH_LEN] = {0};
static Audio::AudioManager &g_amInstance = Audio::AudioManager::GetInstance();
: onPlayListener_(nullptr), onPauseListener_(nullptr), onStopListener_(nullptr),
onLoadedDataListener_(nullptr), onEndedListener_(nullptr), onErrorListener_(nullptr),
onTimeUpdateListener_(nullptr), src_(nullptr), srcInner_(nullptr), status_(STATUS_STOP), volume_(DEFAULT_VOLUME),
- autoPlay_(false), isRunning_(false), isSysSrc_(false), updateTimeProcess_(nullptr)
+ autoPlay_(false), isRunning_(false), isSysSrc_(false), isPlayList_(false), updateTimeProcess_(nullptr)
{}
AudioPlayer::~AudioPlayer()
bool AudioPlayer::ResetPlayer()
{
ReleaseSrc();
+ isPlayList_ = false;
if (AudioPlayerService::GetInstance()->Reset() != 0) {
MEDIA_ERR_LOG("fail to reset audio.");
return false;
(void)memset_s(absPath, MAX_PATH_LEN, 0, MAX_PATH_LEN);
}
+#ifdef HMF_DECRYPT_DATA_ENABLE
+void AudioPlayer::SetDecryptLibraryPath(char *path, uint32_t len)
+{
+ AudioPlayerService::GetInstance()->SetDecryptLibraryPath(path, len);
+}
+#endif
+
bool AudioPlayer::Play()
{
if (AudioPlayerService::GetInstance()->GetPlayStatus() ==\r
(int32_t)AudioPlayerStates::AUDIO_PLAYER_PAUSED) {\r
- return AudioPlayerService::GetInstance()->Resume();\r
+ if (AudioPlayerService::GetInstance()->Resume() != 0) {\r
+ MEDIA_ERR_LOG("resume failed!");\r
+ return false;\r
+ }\r
+ MediaThreadCondSignal(condition_);
+ status_ = STATUS_PLAY;
+ return true;\r
}
if (AudioPlayerService::GetInstance()->SetAudioStreamType(streamType_) != 0) {
MEDIA_ERR_LOG("fail to SetAudioStreamType streamType = %x.", streamType_);
if (!str.empty()) {\r
(void)memset_s(absPath, MAX_PATH_LEN, 0, MAX_PATH_LEN);\r
if (strcpy_s(absPath, MAX_PATH_LEN, str.c_str()) != EOK) {
+ MEDIA_ERR_LOG("strcpy_s failed");
return nullptr;
}\r
return absPath;\r
bool AudioPlayer::SetSrcList(std::vector<std::string> srcList)
{
+ if (src_ != nullptr ||
+ srcInner_ != nullptr) {
+ MEDIA_ERR_LOG("the src interface should not be called before setting the playlist!");
+ return false;
+ }
int32_t ret = AudioPlayerService::GetInstance()->SetPlayListSource(srcList);
if (ret != 0) {\r
MEDIA_ERR_LOG("audio player set play list failed!.");
return false;\r
}
+ isPlayList_ = true;
+ if (playLoopMode_ != AudioPlayerLoopMode::AUDIO_PLAYER_INVAILD_LOOP) {
+ return SetLoop(true);
+ }
return true;
}
bool AudioPlayer::IsLooping() const
{
+ if (isPlayList_) {
+ return AudioPlayerService::GetInstance()->IsPlayListLooping();
+ }
return AudioPlayerService::GetInstance()->IsSingleLooping();
}
MEDIA_ERR_LOG("fail to Set PlaySource.");
return false;
}
+ if (!isPlayList_ && playLoopMode_ != AudioPlayerLoopMode::AUDIO_PLAYER_INVAILD_LOOP) {
+ return SetLoop(true);
+ }
return true;
}
return true;
}
-bool AudioPlayer::SetLoop(bool loop) const
+bool AudioPlayer::SetLoop(bool loop)
{
- if (AudioPlayerService::GetInstance()->SetSingleLoop(loop) != 0) {
- MEDIA_ERR_LOG("1 argument is required.");
+ if (isPlayList_) {\r
+ playLoopMode_ = loop ? AudioPlayerLoopMode::AUDIO_PLAYER_PLAYLIST_LOOP:
+ AudioPlayerLoopMode::AUDIO_PLAYER_INVAILD_LOOP;
+ } else {
+ playLoopMode_ = loop ? AudioPlayerLoopMode::AUDIO_PLAYER_SINGLE_LOOP:
+ AudioPlayerLoopMode::AUDIO_PLAYER_INVAILD_LOOP;
+ }\r
+ if (AudioPlayerService::GetInstance()->SetPlayLoopMode(playLoopMode_) != 0) {
+ MEDIA_ERR_LOG("set single loop failed!");
return false;
}
return true;
}
onTimeUpdateListener_ = onTimeUpdateListener;
}
+
+bool AudioPlayer::IsSysSrc()
+{
+ return isSysSrc_;
+}
+
} // namespace ACELite
} // namespace OHOS
)
endif()
-set(CCDEFINES ${CCDEFINES} "_GNU_SOURCE" "_XOPEN_SOURCE=700" "LOCAL_VOICE_CALL")
+set(CCDEFINES ${CCDEFINES} "_GNU_SOURCE" "_XOPEN_SOURCE=700" "LOCAL_VOICE_CALL" "HMF_DECRYPT_DATA_ENABLE")
list(REMOVE_ITEM CCDEFINES VERSION_STANDARD)
set(PRIVATE_DEFINES
${CCDEFINES}
return AUDIO_SUCCESS;
exit:
+ (void)ConnectBluetoothA2dpDevice();
g_amInstance.SetDeviceConnectionState(IN_BLUETOOTH_A2DP, AUDIO_DEVICE_DISCONNECTED);
g_amInstance.DeactivateAudioInterrupt(a2dpContext->interrupt);
return ret;
#include "audio_player_service.h"\r
#include "audio_manager.h"\r
#include "media_log.h"\r
+#include "securec.h"\r
+#ifdef HMF_DECRYPT_DATA_ENABLE\r
+#include "audio_decrypt.h"\r
+#endif // HMF_DECRYPT_DATA_ENABLE\r
+\r
\r
namespace OHOS {\r
static AudioManager &g_amInstance = AudioManager::GetInstance();\r
MEDIA_INFO_LOG("on playback complete!");\r
}\r
MediaMutexLock(mutex_);\r
- if (!isPlayListLoop_) {\r
+ if (playerLoopMode_ != AudioPlayerLoopMode::AUDIO_PLAYER_PLAYLIST_LOOP) {\r
MediaMutexUnLock(mutex_);\r
return;\r
}\r
MEDIA_ERR_LOG("player start failed!");\r
return ret;\r
}\r
- player_->EnableSingleLooping(isSingleLoop_);\r
+ player_->EnableSingleLooping(playerLoopMode_ == AudioPlayerLoopMode::AUDIO_PLAYER_SINGLE_LOOP);\r
currentState_ = AudioPlayerStates::AUDIO_PLAYER_PLAYED;\r
isCutSong_ = false;\r
OnPlay();\r
{\r
player_->SetPlayerCallback(shared_from_this());\r
int32_t ret = 0;\r
- MediaMutexLock(mutex_);\r
if (currentState_ != AudioPlayerStates::AUDIO_PLAYER_PAUSED) {\r
ret = AudioPlayInner();\r
if (ret != 0) {\r
}\r
}\r
}\r
- MediaMutexUnLock(mutex_);\r
return MEDIA_OK;\r
EXIT:\r
MEDIA_ERR_LOG("play failed");\r
(void)player_->Reset();\r
(void)player_->Release();\r
- MediaMutexUnLock(mutex_);\r
return MEDIA_ERR;\r
}\r
\r
!isPlaybackStopped_ &&\r
!interruptHintStop_) {\r
std::map<std::string, std::string> header;\r
+ MediaMutexLock(mutex_);\r
Source source = Source(playList_[playIndex_], header);\r
MEDIA_INFO_LOG("current play source = %s, index = %d",\r
source.GetSourceUri().c_str(), playIndex_);\r
ret = player_->SetSource(source);\r
if (ret != MEDIA_OK) {\r
MEDIA_ERR_LOG("set source failed");\r
+ MediaMutexUnLock(mutex_);\r
(void)DeinitPlayerResources();\r
return MEDIA_ERR;\r
}\r
ret = player_->Prepare();\r
if (ret != MEDIA_OK) {\r
MEDIA_ERR_LOG("prepare failed");\r
+ MediaMutexUnLock(mutex_);\r
return ReleasePlayer();\r
}\r
ret = SetAudioSessionIdAndStreamType();\r
if (ret != MEDIA_OK) {\r
+ MediaMutexUnLock(mutex_);\r
return ReleasePlayer();\r
}\r
ret = AudioPlay();\r
if (ret != MEDIA_OK) {\r
+ MediaMutexUnLock(mutex_);\r
return ReleasePlayer();\r
}\r
- MediaMutexLock(mutex_);\r
AudioStopAndExit();\r
if (!isCutSong_) {\r
playIndex_++;\r
playIndex_ = 0;\r
}\r
}\r
- if (!isPlayListLoop_) {\r
+ if (playerLoopMode_ != AudioPlayerLoopMode::AUDIO_PLAYER_PLAYLIST_LOOP) {\r
MediaMutexUnLock(mutex_);\r
MEDIA_ERR_LOG("isPlayListLoop exit");\r
break;\r
AudioPlayerService::~AudioPlayerService()\r
{\r
Reset();\r
+ if (loadDecryptPath_ != nullptr) {\r
+ delete[] loadDecryptPath_;\r
+ loadDecryptPath_ = nullptr;\r
+ loadDecryptPathLen_ = 0;\r
+ }\r
}\r
\r
std::shared_ptr<AudioPlayerService> AudioPlayerService::GetInstance()\r
}\r
playList_ = playlist;\r
playIndex_ = index;\r
- isPlayListLoop_ = true;\r
return MEDIA_OK;\r
}\r
\r
return MEDIA_OK;\r
}\r
\r
+#ifdef HMF_DECRYPT_DATA_ENABLE\r
+void AudioPlayerService::SetDecryptLibraryPath(char *path, uint32_t len)\r
+{\r
+ if (loadDecryptPath_ == nullptr) {\r
+ loadDecryptPath_ = new char[len];\r
+ loadDecryptPathLen_ = len;\r
+ }\r
+ if (loadDecryptPathLen_ != len) {\r
+ delete[] loadDecryptPath_;\r
+ loadDecryptPath_ = new char[len];\r
+ loadDecryptPathLen_ = len;\r
+ }\r
+ if (loadDecryptPath_ == nullptr) {\r
+ MEDIA_ERR_LOG("loadDecryptPath_ new failed!");\r
+ loadDecryptPathLen_ = 0;\r
+ return;\r
+ }\r
+ if (memcpy_s(loadDecryptPath_, loadDecryptPathLen_, path, len) != EOK) {\r
+ MEDIA_ERR_LOG("memcpy_s decrypt path failed!");\r
+ delete[] loadDecryptPath_;\r
+ loadDecryptPath_ = nullptr;\r
+ }\r
+}\r
+#endif\r
+\r
bool AudioPlayerService::IsBackgroundMode(void)\r
{\r
return isBackgroundMode_;\r
MEDIA_INFO_LOG("audio play is not idle status[%d], can not start!", currentState_);\r
return MEDIA_OK;\r
}\r
+#ifdef HMF_DECRYPT_DATA_ENABLE\r
+ if (loadDecryptPath_ != nullptr) {\r
+ AUDIO_LoadDecryptLibrary(loadDecryptPath_);\r
+ }\r
+#endif\r
int32_t ret = StartPrepare();\r
if (ret != 0) {\r
return ret;\r
\r
int32_t AudioPlayerService::Reset(void)\r
{\r
- (void)Stop();\r
+ if (currentState_ == AudioPlayerStates::AUDIO_PLAYER_IDLE) {\r
+ MEDIA_INFO_LOG("currently in IDLE state, no reset is required!");\r
+ return MEDIA_OK;\r
+ }\r
+ if (currentState_ != AudioPlayerStates::AUDIO_PLAYER_STOPED) {\r
+ (void)Stop();\r
+ }\r
+ MediaMutexLock(mutex_);\r
playList_.clear();\r
playIndex_ = 0;\r
isPlaybackCompleted_ = false;\r
interruptHintStop_ = false;\r
isBackgroundMode_ = false;\r
playError_ = false;\r
- isSingleLoop_ = false;\r
+ playerLoopMode_ = AudioPlayerLoopMode::AUDIO_PLAYER_INVAILD_LOOP;\r
isCutSong_ = false;\r
- isPlayListLoop_ = false;\r
currentState_ = AudioPlayerStates::AUDIO_PLAYER_IDLE;\r
streamType_ = AUDIO_STREAM_MUSIC;\r
+ MediaMutexUnLock(mutex_);\r
(void)MediaMutexDestroy(&mutex_);\r
(void)MediaThreadCondDestroy(&exitCond_);\r
+#ifdef HMF_DECRYPT_DATA_ENABLE\r
+ AUDIO_UnLoadDecryptLibrary();\r
+#endif\r
MEDIA_INFO_LOG("reset success[%d]", currentState_);\r
return MEDIA_OK;\r
}\r
return MEDIA_ERR;\r
}\r
if (isPlaybackStopped_ || isPlaybackCompleted_ || interruptHintStop_) {\r
- if (isSingleLoop_) {\r
+ if (playerLoopMode_ == AudioPlayerLoopMode::AUDIO_PLAYER_SINGLE_LOOP) {\r
if (!isPlaybackCompleted_) {\r
MEDIA_ERR_LOG("audio play already stopped");\r
MediaMutexUnLock(mutex_);\r
return state;\r
}\r
\r
-int32_t AudioPlayerService::SetSingleLoop(bool isLoop)\r
+int32_t AudioPlayerService::SetPlayLoopMode(AudioPlayerLoopMode loopMode)\r
{\r
- isSingleLoop_ = isLoop;\r
- if (player_ == nullptr) {\r
- MEDIA_INFO_LOG("player_ is NULL!");\r
- return MEDIA_OK;\r
+ if (loopMode < AudioPlayerLoopMode::AUDIO_PLAYER_PLAYLIST_LOOP ||\r
+ loopMode > AudioPlayerLoopMode::AUDIO_PLAYER_INVAILD_LOOP) {\r
+ MEDIA_INFO_LOG("invalid loop mode[%d]!", loopMode);\r
+ return MEDIA_ERR;\r
}\r
- return player_->EnableSingleLooping(isSingleLoop_);\r
+ playerLoopMode_ = loopMode;\r
+ if (player_ != nullptr) {\r
+ if (loopMode == AudioPlayerLoopMode::AUDIO_PLAYER_SINGLE_LOOP) {\r
+ return player_->EnableSingleLooping(true);\r
+ } else {\r
+ return player_->EnableSingleLooping(false);\r
+ }\r
+ }\r
+ return MEDIA_OK;\r
}\r
\r
bool AudioPlayerService::IsSingleLooping(void)\r
{\r
- if (player_ == nullptr) {\r
- MEDIA_INFO_LOG("player_ is NULL!");\r
- return isSingleLoop_;\r
- }\r
- return player_->IsSingleLooping();\r
+ return playerLoopMode_ == AudioPlayerLoopMode::AUDIO_PLAYER_SINGLE_LOOP;\r
}\r
\r
bool AudioPlayerService::IsPlayListLooping(void)\r
{\r
- return isPlayListLoop_;\r
+\r
+ return playerLoopMode_ == AudioPlayerLoopMode::AUDIO_PLAYER_PLAYLIST_LOOP;\r
}\r
\r
bool AudioPlayerService::IsPlaying(void)\r
AUDIO_PLAYER_EXITED,\r
};\r
\r
+enum class AudioPlayerLoopMode : int32_t {\r
+ AUDIO_PLAYER_PLAYLIST_LOOP,\r
+ AUDIO_PLAYER_SINGLE_LOOP,\r
+ AUDIO_PLAYER_INVAILD_LOOP,\r
+};\r
+\r
class AudioPlayerServiceCallback {\r
public:\r
AudioPlayerServiceCallback() = default;\r
int32_t SetPlaySource(std::string src);\r
int32_t SetAudioStreamType(AudioStreamType type);\r
int32_t SetBackgroundMode(bool isBackground);\r
+#ifdef HMF_DECRYPT_DATA_ENABLE\r
+ void SetDecryptLibraryPath(char *path, uint32_t len);\r
+#endif\r
bool IsBackgroundMode(void);\r
void SetAudioPlayerCallback(const std::shared_ptr<AudioPlayerServiceCallback> &cb);\r
int32_t Start(void);\r
int32_t GetDumpInfo(PlayerDebugInfo *playerInfo);\r
int32_t GetCurrentTime(int64_t &time);\r
int32_t GetPlayStatus(void);\r
- int32_t SetSingleLoop(bool isLoop);\r
+ int32_t SetPlayLoopMode(AudioPlayerLoopMode loopMode);\r
bool IsSingleLooping(void);\r
bool IsPlayListLooping(void);\r
bool IsPlaying(void);\r
int32_t StartPrepare(void);\r
void ResetAudioPlayState(void);\r
static void *AudioPlayThread(void *arg);\r
+#ifdef HMF_DECRYPT_DATA_ENABLE\r
+ char *loadDecryptPath_= nullptr;\r
+ uint32_t loadDecryptPathLen_ = 0;\r
+#endif\r
AudioPlayerStates currentState_ = AudioPlayerStates::AUDIO_PLAYER_IDLE;\r
AudioSession sessionId_ = AUDIO_SESSION_ID_NONE;\r
bool isPlaybackCompleted_ = false;\r
bool interruptHintStop_ = false;\r
bool isBackgroundMode_ = false;\r
bool playError_ = false;\r
- bool isSingleLoop_ = false;\r
bool isCutSong_ = false;\r
+ AudioPlayerLoopMode playerLoopMode_ = AudioPlayerLoopMode::AUDIO_PLAYER_INVAILD_LOOP;\r
shared_ptr<Player> player_ = nullptr;\r
MediaMutexHandle mutex_ = nullptr;\r
MediaThreadCondHandle cond_ = nullptr;\r
int32_t playIndex_ = 0;\r
std::vector<std::string> playList_;\r
AudioStreamType streamType_ = AUDIO_STREAM_MUSIC;\r
- bool isPlayListLoop_ = false;\r
static std::shared_ptr<AudioPlayerService> instance_;\r
shared_ptr<AudioPlayerServiceCallback> callBack_ = nullptr;\r
};\r
if (enableValue != 0) {\r
isLoop = true;\r
}
- return AudioPlayerService::GetInstance()->SetSingleLoop(isLoop);
+ AudioPlayerLoopMode loopMode = AudioPlayerLoopMode::AUDIO_PLAYER_INVAILD_LOOP;
+ if (isLoop) {\r
+ loopMode == AudioPlayerLoopMode::AUDIO_PLAYER_SINGLE_LOOP;\r
+ }
+ return AudioPlayerService::GetInstance()->SetPlayLoopMode(loopMode);
}
static int32_t GetCurrentPlaySource(int32_t argc, const char **param)
goto FREE_TRACK_CTX;
}
- ret = SubPortTrackInit(portCtx, inputAttr, portPin, portTrackCtx);
- if (ret != MEDIA_HAL_OK) {
+ if (SubPortTrackInit(portCtx, inputAttr, portPin, portTrackCtx) != MEDIA_HAL_OK) {
goto FREE_TRACK_CTX;
}
-
/* sound + aenc + adp for BLUETOOTH_A2DP_NORMAL workScene */
ret = EstablishTranscodeBackendPipeline(portCtx, portTrackCtx, trackId);
if (ret != MEDIA_HAL_OK) {
portTrackCtx->trackId = trackId;
portCtx->portTrack[trackId] = portTrackCtx;
*trackHandle = &portTrackCtx->common;
- /* A2dp sink 不占用蓝牙资源和aenc,所以这里默认就是暂停的状态 */
- if (portTrackCtx->workScene == BLUETOOTH_IN_A2DP_NORMAL) {\r
+ /* A2dp sink 和 sco 不占用蓝牙资源和aenc,所以这里默认就是暂停的状态 */
+ if (portTrackCtx->workScene == BLUETOOTH_IN_A2DP_NORMAL ||\r
+ portTrackCtx->workScene == BLUETOOTH_SCO) {
SetPause(trackId, true);\r
}
MediaHalMutexUnLock(portCtx->a2dpTrackMutex);
}
/* sound + aenc + adp for BLUETOOTH_A2DP_NORMAL workScene */
ret = AbrogationTranscodeBackendPipeline(portCtx, portTrackCtx);
- MediaHalMutexUnLock(portCtx->a2dpTrackMutex);
CHK_FAILED_NO_RETURN(ret, MEDIA_HAL_OK, "AbrogationTranscodeBackendPipeline failed");
MEDIA_HAL_LOGD(MODULE_NAME, "success trackId (%d)", portTrackCtx->trackId);
}
portCtx->portTrack[portTrackCtx->trackId] = NULL;
+ MediaHalMutexUnLock(portCtx->a2dpTrackMutex);
free(portTrackCtx);
return MEDIA_HAL_OK;
}
MEDIA_HAL_LOGE(MODULE_NAME, "uapi_aenc_set_attr failed: 0x%x, codec id: 0x%x", ret, aencAttr.codec_id);
goto CLOSE;
}
-
+#ifndef MELODY_AUDIO_SUPPORT\r
+ if (aencAttr.codec_id == UAPI_ACODEC_ID_OPUS) {\r
+ uint32_t bitRate = OPUS_ENC_BIT_RATE;\r
+ ret = uapi_aenc_set_param(*aencHandle, UAPI_AENC_PARAM_BIT_RATE, &bitRate, sizeof(uint32_t));\r
+ if (ret != MEDIA_HAL_OK) {\r
+ MEDIA_HAL_LOGE(MODULE_NAME, "uapi set aenc send cmd bit Rate faild, ret: 0x%x", ret);\r
+ goto CLOSE;\r
+ }\r
+ }\r
+#endif
MEDIA_HAL_LOGD(MODULE_NAME, "success");
return MEDIA_HAL_OK;
#define MODEM_DOWNLINK_SOUND_PORT_NUM 1
#define MODEM_HEADSET_DOWNLINK_SOUND_PORT_NUM 1
-#define MODEM_HEADSET_DOWNLINK_SOUND_SAMPLE_RATE 16000
-#define MODEM_HEADSET_DOWNLINK_SOUND_CHANNELS 1
#define MODEM_PORT_TRACK_NUM 2
#define SEA_ENABLE "seaenable"
return MEDIA_HAL_OK;
}
-static void GetHeadsetDownlinkAOAttr(uapi_snd_attr *sndAttr)
+static void GetHeadsetDownlinkAOAttr(uapi_snd_attr *sndAttr, SubPortTrackContext *portTrackCtx)
{
sndAttr->port_num = MODEM_HEADSET_DOWNLINK_SOUND_PORT_NUM;
sndAttr->port_attr[0].out_port = UAPI_SND_OUT_PORT_CAST0;
sndAttr->bit_depth = UAPI_AUDIO_BIT_DEPTH_16;
- sndAttr->sample_rate = MODEM_HEADSET_DOWNLINK_SOUND_SAMPLE_RATE;
- sndAttr->channels = MODEM_HEADSET_DOWNLINK_SOUND_CHANNELS;
+ sndAttr->sample_rate = portTrackCtx->inputAttr.sampleRate;
+ sndAttr->channels = portTrackCtx->inputAttr.channelCount;
}
static int32_t AODevOpen(SubPortTrackContext *portTrackCtx)
MEDIA_HAL_DOFUNC_TIME(ret = uapi_snd_open(&portTrackCtx->uplinkSoundHandle, sndId, &sndAttr));
} else {
if (portTrackCtx->workScene == MODEM_HEADSET_DOWNLINK) {
- GetHeadsetDownlinkAOAttr(&sndAttr);
+ GetHeadsetDownlinkAOAttr(&sndAttr, portTrackCtx);
} else {
GetBuiltinAOAttr(&sndAttr);
}
#define SET_SEA_PARAM "setseaparam"
#define SET_BIT_RATE "setbitrate"
#define SEA_PARAM_LEN 256
+#define MP3_ENC_BIT_RATE_PRECISION 1000
static enum AudioFormat g_supportFormats[] = {
AUDIO_FORMAT_PCM_16_BIT,
{ AUDIO_IN_MEDIA, AUDIO_FORMAT_MP3, 16000, 1 },
{ AUDIO_IN_MEDIA, AUDIO_FORMAT_SBC, 16000, 1 },
{ AUDIO_IN_MEDIA, AUDIO_FORMAT_PCM_16_BIT, 16000, 1 },
+ { AUDIO_IN_MEDIA, AUDIO_FORMAT_OPUS, 16000, 1 },
{ AUDIO_IN_COMMUNICATION, AUDIO_FORMAT_mSBC, 16000, 1 },
{ AUDIO_IN_COMMUNICATION, AUDIO_FORMAT_AMR_WB, 16000, 1 },
{ AUDIO_IN_COMMUNICATION, AUDIO_FORMAT_PCM_16_BIT, 8000, 1},
- { AUDIO_IN_COMMUNICATION, AUDIO_FORMAT_PCM_16_BIT, 16000, 1}
+ { AUDIO_IN_COMMUNICATION, AUDIO_FORMAT_PCM_16_BIT, 16000, 1},
+ { AUDIO_IN_COMMUNICATION, AUDIO_FORMAT_OPUS, 16000, 1 },\r
+ { AUDIO_IN_COMMUNICATION, AUDIO_FORMAT_MP3, 16000, 1 },
};
static bool IsSupported(const struct PortPluginAttr *inputAttr)
aencAttr.param.bit_depth = inputAttrTemp.bitWidth;
aencAttr.param.sample_rate = inputAttrTemp.sampleRate;
aencAttr.param.samples_per_frame = ((uint32_t)inputAttrTemp.sampleRate) / SAMPLERATE_TO_PTNUMPERFRM;
- aencAttr.param.private_data = NULL;
- aencAttr.param.private_data_size = 0;
-
+ uint32_t bitRate = MP3_ENC_BIT_RATE / MP3_ENC_BIT_RATE_PRECISION;
+ if (aencCodecId == UAPI_ACODEC_ID_MP3) {
+ aencAttr.param.private_data = &bitRate;
+ aencAttr.param.private_data_size = sizeof(bitRate);
+ } else {\r
+ aencAttr.param.private_data = NULL;
+ aencAttr.param.private_data_size = 0;\r
+ }
ret = AudioSDKAencOpen(&portTrackInCtx->aencHandle, aencAttr);
if (ret != MEDIA_HAL_OK) {
MEDIA_HAL_LOGE(MODULE_NAME, "aenc open failed");
bufContext->decryptSize = 0;
bufContext->pos = -1;
bufContext->isNeedDecryptData = false;
- AUDIO_UnLoadDecryptLibrary();
return MEDIA_HAL_OK;
}
return ret;
}
-STATIC errcode_t diag_gmmu_dfx_read(uint16_t cmd_id, diag_option_t *option, void *cmd_param)
-{
- errcode_t ret = ERRCODE_SUCC;
- if (cmd_param == NULL) {
- printf(" invalid gmmu_proc cmd: should input 2 params\n");
- return ERRCODE_FAIL;
- }
- char *gmmu_param[GMMU_PARAM_CNT] = { NULL };
- const td_u8 str_len = 5;
- for (td_u32 i = 0; i < GMMU_PARAM_CNT; i++) {
- gmmu_param[i] = (char *)dfx_malloc(0, str_len);
- if (gmmu_param[i] == NULL) {
- if (i == 1) {
- dfx_free(0, gmmu_param[0]);
- }
- return ERRCODE_MALLOC;
- }
- }
-
- gpu_gmmu_proc_info_t *gmmu_proc_param = (gpu_gmmu_proc_info_t *)cmd_param;
- if (sprintf_s(gmmu_param[0], str_len, "%u\n", gmmu_proc_param->proc_en) == -1) {
- dfx_free(0, gmmu_param[0]);
- return ERRCODE_FAIL;
- }
- if (sprintf_s(gmmu_param[1], str_len, "%u\n", gmmu_proc_param->lut_en) == -1) {
- dfx_free(0, gmmu_param[0]);
- dfx_free(0, gmmu_param[1]);
- return ERRCODE_FAIL;
- }
-#ifdef SUPPORT_GPU_GMMU
- ret = (errcode_t)gmmu_dfx_print_proc_info(GMMU_PARAM_CNT, (const td_char **)gmmu_param);
-#endif
- uapi_diag_report_packet(cmd_id, option, (uint8_t *)("gmmu_proc_read_succ\r\n"),
- (uint16_t)strlen("gmmu_proc_read_succ\r\n") + 1, true);
- dfx_free(0, gmmu_param[0]);
- dfx_free(0, gmmu_param[1]);
- return ret;
-}
-
STATIC errcode_t gpu_proc_read(uint16_t cmd_id, void *cmd_param, uint16_t cmd_param_size, diag_option_t *option)
{
unused(cmd_param_size);
case DIAG_CMD_GPU_DPU_PROC:
case DIAG_CMD_GPU_DPU_PRINT:
return diag_dpu_dfx_read(cmd_id, option, cmd_param);
- case DIAG_CMD_GPU_GMMU_PROC:
- return diag_gmmu_dfx_read(cmd_id, option, cmd_param);
default:
printf("gpu_proc_read:invalid cmd id:%#x.\r\n", cmd_id);
ret = ERRCODE_FAIL;
sc->squelched++; /* Errors are expected, squelch reporting. */
mmcbr_set_mode(dev, mode_sd);
mmc_power_up(sc);
+ /* delay 100ms, sometimes sdio probe fail for detect as SD, maybe slave power supply not stable */
+ mmc_ms_delay(100);
mmcbr_set_bus_mode(dev, pushpull);
#ifdef DPALCFG_DRIVERS_MMC_DBG
if (bootverbose || mmc_debug)
device_printf(sc->dev,
"MMC probe: OK (OCR: 0x%08x)\n", ocr);
#endif
+ dprintf("MMC probe: OK (OCR: 0x%08x)\n", ocr);
}
} else {
#ifdef DPALCFG_DRIVERS_MMC_DBG
device_printf(sc->dev, "SD probe: OK (OCR: 0x%08x)\n",
ocr);
#endif
+ dprintf("SD probe: OK (OCR: 0x%08x)\n", ocr);
if ((ocr & MMC_OCR_LOW_VOLTAGE) && !(host_ocr & MMC_OCR_LOW_VOLTAGE)) {
dev_logi(dev, "sd card supports 1.8v, but host can't do.\n");
ocr &= ~MMC_OCR_LOW_VOLTAGE;
return;
err_out:
+ dprintf("No compatible cards found on bus\n");
dev_logt(sc->dev, "No compatible cards found on bus\n");
if (sc->recovery == false) {
err = mmc_delete_cards(sc, false);
sc = device_get_softc(device_get_parent(func->sc->dev));
if (sc == NULL || sc->dev == NULL)
return (-EIO);
+
+ power_cycle(sc);
+ host_hw_init(device_get_ivars(sc->dev));
+ sc->last_rca = 0;
+ sc->card_init_status = MMC_CARD_UNINIT; // 需要, 否则中间过程时钟会被关掉
+
mmc_idle_cards(sc);
- mmcbr_set_clock(sc->dev, mmcbr_get_f_min(sc->dev));
ret = sdio_io_send_op_cond(sc, 0, &ocr);
if (ret)
if (ret)
goto err;
- ret = sdio_switch_hispeed(sc, SD_SWITCH_HS_MODE);
- if (ret)
- goto err;
-
- mmcbr_set_timing(sc->dev, (int)bus_timing_sd_hs);
- mmcbr_set_clock(sc->dev, mmcbr_get_f_max(sc->dev));
- ret = sdio_set_card_bus_width(sc, bus_width_4);
- if (ret)
- goto err;
-
- mmcbr_set_bus_width(sc->dev, (int)bus_width_4);
- mmcbr_update_ios(sc->dev);
+ mmc_calculate_clock(sc);
return (0);
err:
cmd->opcode, err);
}
}
-
return (err);
}
#define SDHCI_INT_STATUS 0x30
#define SDHCI_INT_ENABLE 0x34
+#define SDHCI_ERR_INT_STAT_EN 0x36
#define SDHCI_SIGNAL_ENABLE 0x38
+#define SDHCI_ERR_INT_SIGNAL_EN 0x3A
#define SDHCI_INT_RESPONSE 0x00000001
#define SDHCI_INT_DATA_END 0x00000002
#define SDHCI_INT_BLOCK_GAP 0x00000004
struct hci_softc *sc;
struct sdhci_slot *slot;
dpal_resource_t *res;
-#ifdef CFG_SDIO_EMMC_COEXIST
- static bool emmc_initialized = false;
- static bool sdio_initialized = false;
-#else
- static bool mmc_initialized = false;
-#endif
+ static bool mmc0_initialized = false;
+ static bool mmc1_initialized = false;
+
sc = dpal_zalloc(sizeof(struct hci_softc));
if (sc == NULL)
return (-ENOMEM);
err = set_mmc_resource(sc, slot->num);
if (err != 0)
goto clear_mmc_proc;
-#ifdef CFG_SDIO_EMMC_COEXIST
- if (slot->num == 0 && !emmc_initialized) {
- emmc_initialized = true;
- err = sdhci_thread_create((dpal_tsk_entry_func)sdhci_task,
- "cdsw_emmc_task", (uint32_t *)&slot->cd_tsk_id);
+
+ if (slot->num == 0 && !mmc0_initialized) {
+ mmc0_initialized = true;
+ err = sdhci_thread_create((dpal_tsk_entry_func)sdhci_task, "cdsw_mmc0_task", (uint32_t *)&slot->cd_tsk_id);
if (err) {
goto clear_mem_resource;
}
}
- if (slot->num == 1 && !sdio_initialized) {
- sdio_initialized = true;
- err = sdhci_thread_create((dpal_tsk_entry_func)sdhci_task,
- "cdsw_sdio_task", (uint32_t *)&slot->cd_tsk_id);
+ if (slot->num == 1 && !mmc1_initialized) {
+ mmc1_initialized = true;
+ err = sdhci_thread_create((dpal_tsk_entry_func)sdhci_task, "cdsw_mmc1_task", (uint32_t *)&slot->cd_tsk_id);
if (err) {
goto clear_mem_resource;
}
}
-#else
- if (!mmc_initialized) {
- mmc_initialized = true;
- err = sdhci_thread_create((dpal_tsk_entry_func)sdhci_task,
- "cdsw_task", (uint32_t *)&slot->cd_tsk_id);
- if (err) {
- goto clear_mem_resource;
- }
- }
-#endif
+
return (0);
clear_mem_resource:
#define SDHCI_ASSERT_LOCKED(_slot) mtx_assert((_slot)->mtx, MA_OWNED); //used in sdhci_exec_tuning()
#define SDHCI_ASSERT_UNLOCKED(_slot) mtx_assert((_slot)->mtx, MA_NOTOWNED); //not used
+#define SDHCI_MBIU_CTRL 0x510
#define SDHCI_EMMC_HW_RESET 0x534
-#define SDHCI_AUTO_TUNING_CTRL 0x540
+#define SDHCI_AUTO_TUNING_CTRL 0x540
#define SDHCI_SW_TUNING_EN 0x00000010
#define SDHCI_AUTO_TUNING_STATUS 0x544
* {@link VGResult} otherwise.
* @since 3.0
*/
- VGUResult (*RenderBlur)(VGUSurface *target, uint16_t blur);
+ VGUResult (*RenderBlur)(VGUSurface *target, float blur);
/* *
* @brief Blits one or multiple images to target surface.
${ROOT_DIR}/open_source/openharmony/base/global/resmgr_lite/frameworks/resmgr_lite/include
${ROOT_DIR}/open_source/openharmony/base/global/resmgr_lite/interfaces/innerkits/include
${ROOT_DIR}/open_source/openharmony/foundation/ace/ace_engine_lite/modules/keyinput
+ ${ROOT_DIR}/open_source/openharmony/foundation/ace/ace_engine_lite/modules/network
${ROOT_DIR}/open_source/openharmony/base/sensors/location/interfaces/kits/include
${ROOT_DIR}/open_source/openharmony/base/sensors/interfaces/kits/native/include
)
${CMAKE_CURRENT_SOURCE_DIR}/components/baidu_map_component.cpp
${CMAKE_CURRENT_SOURCE_DIR}/modules/app_module.cpp
${CMAKE_CURRENT_SOURCE_DIR}/modules/device_module.cpp
- ${CMAKE_CURRENT_SOURCE_DIR}/modules/network_module.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/modules/network/network_module.cpp
${CMAKE_CURRENT_SOURCE_DIR}/modules/nfc_module.cpp
${CMAKE_CURRENT_SOURCE_DIR}/modules/vibrator_module.cpp
${CMAKE_CURRENT_SOURCE_DIR}/modules/battery_module.cpp
constexpr char ATTR_LEFT[] = "left"; // image-animator
constexpr char ATTR_TOP[] = "top"; // image-animator
constexpr char ATTR_TYPE[] = "type";
+constexpr char ATTR_LOOP[] = "loop";
constexpr char COMMON_STYLE_BACKGROUND_COLOR[] = "backgroundColor";
constexpr char ARG_WATCH_EL[] = "el";
constexpr char ARG_WATCH_ATTR[] = "attr";
}
float angle = FloatOf(args[ArgsIndex::IDX_0]);
- component->paint_.Rotate(angle);
+ if (argsNum < ArgsCount::NUM_3) {
+ component->paint_.Rotate(angle);
+ } else {
+ int16_t x = IntegerOf(args[ArgsIndex::IDX_1]);
+ int16_t y = IntegerOf(args[ArgsIndex::IDX_2]);
+ component->paint_.Rotate(angle, x, y);
+ }
return UNDEFINED;
}
onTouchMoveListener_(nullptr),
onTouchCancelListener_(nullptr),
onTouchEndListener_(nullptr),
+ onTouchListener_(nullptr),
keyBoardEventListener_(nullptr),
#endif
onRotateListener_(nullptr),
view.SetTouchable(true);
}
+void Component::SetViewOnTouchListener(UIView &view)
+{
+ if (view.GetTouchListener() != nullptr) {
+ onTouchListener_ = dynamic_cast<ViewOnTouchListener*>(view.GetTouchListener());
+ } else {
+ onTouchListener_ = new ViewOnTouchListener();
+ }
+}
+
#ifdef JS_TOUCH_EVENT_SUPPORT
void Component::SetTouchStartEventListener(UIView &view, jerry_value_t eventFunc, uint16_t eventTypeId)
{
return;
}
- view.SetOnTouchListener(onTouchStartListener_);
+ SetViewOnTouchListener(view);
+ onTouchListener_->SetOnTouchStartListener(onTouchStartListener_);
+ view.SetOnTouchListener(onTouchListener_);
view.SetTouchable(true);
}
HILOG_ERROR(HILOG_MODULE_ACE, "touch start event listener create failed");
return;
}
-
- view.SetOnDragListener(onTouchMoveListener_);
+ SetViewOnTouchListener(view);
+ onTouchListener_->SetOnTouchMoveListener(onTouchMoveListener_);
+ view.SetOnDragListener(onTouchListener_);
view.SetTouchable(true);
view.SetDraggable(true);
}
return;
}
- view.SetOnTouchListener(onTouchCancelListener_);
+ SetViewOnTouchListener(view);
+ onTouchListener_->SetOnTouchCancelListener(onTouchCancelListener_);
+ view.SetOnTouchListener(onTouchListener_);
view.SetTouchable(true);
view.SetDraggable(true);
}
return;
}
- view.SetOnTouchListener(onTouchEndListener_);
+ SetViewOnTouchListener(view);
+ onTouchListener_->SetOnTouchEndListener(onTouchEndListener_);
+ view.SetOnTouchListener(onTouchListener_);
view.SetTouchable(true);
}
ACE_DELETE(onTouchCancelListener_);
ACE_DELETE(onTouchMoveListener_);
ACE_DELETE(onTouchEndListener_);
+ ACE_DELETE(onTouchListener_);
#endif
ACE_DELETE(onSwipeListener_);
ACE_DELETE(onRotateListener_);
return uiview;
}
+Component::ViewOnTouchListener::ViewOnTouchListener()
+ : onTouchStartListener_(nullptr),
+ onTouchCancelListener_(nullptr),
+ onTouchEndListener_(nullptr),
+ onTouchMoveListener_(nullptr)
+{
+}
+
+Component::ViewOnTouchListener::~ViewOnTouchListener()
+{
+ ACE_DELETE(onTouchStartListener_);
+ ACE_DELETE(onTouchCancelListener_);
+ ACE_DELETE(onTouchEndListener_);
+ ACE_DELETE(onTouchMoveListener_);
+}
+
+void Component::ViewOnTouchListener::SetOnTouchStartListener(ViewOnTouchStartListener *startListener)
+{
+ onTouchStartListener_ = startListener;
+}
+
+void Component::ViewOnTouchListener::SetOnTouchEndListener(ViewOnTouchEndListener *endListener)
+{
+ onTouchEndListener_ = endListener;
+}
+
+void Component::ViewOnTouchListener::SetOnTouchCancelListener(ViewOnTouchCancelListener *cancelListener)
+{
+ onTouchCancelListener_ = cancelListener;
+}
+
+void Component::ViewOnTouchListener::SetOnTouchMoveListener(ViewOnTouchMoveListener *moveListener)
+{
+ onTouchMoveListener_ = moveListener;
+}
+
+bool Component::ViewOnTouchListener::OnPress(UIView &view, const PressEvent &event)
+{
+ bool ret = false;
+ if (onTouchStartListener_ != nullptr) {
+ ret = onTouchStartListener_->OnPress(view, event);
+ }
+ return ret;
+}
+
+bool Component::ViewOnTouchListener::OnRelease(UIView &view, const ReleaseEvent &event)
+{
+ bool ret = false;
+ if (onTouchEndListener_ != nullptr) {
+ ret = onTouchEndListener_->OnRelease(view, event);
+ }
+ return ret;
+}
+
+bool Component::ViewOnTouchListener::OnCancel(UIView &view, const CancelEvent &event)
+{
+ bool ret = false;
+ if (onTouchCancelListener_ != nullptr) {
+ ret = onTouchCancelListener_->OnCancel(view, event);
+ }
+ return ret;
+};
+
+bool Component::ViewOnTouchListener::OnDrag(UIView &view, const DragEvent &event)
+{
+ bool ret = false;
+ if (onTouchMoveListener_ != nullptr) {
+ ret = onTouchMoveListener_->OnDrag(view, event);
+ }
+ return ret;
+}
+
+bool Component::ViewOnTouchListener::OnDragEnd(UIView &view, const DragEvent &event)
+{
+ bool ret = false;
+ if (onTouchEndListener_ != nullptr) {
+ ReleaseEvent evtRelease(event.GetLastPoint());
+ ret = onTouchEndListener_->OnRelease(view, evtRelease);
+ }
+ return ret;
+}
+
} // namespace ACELite
} // namespace OHOS
static UIView *GetScrollView(const JSValue dom, const jerry_length_t size);
private:
+ class ViewOnTouchListener final : public UIView::OnTouchListener,public UIView::OnDragListener
+ {
+ public:
+ ViewOnTouchListener();
+ ~ViewOnTouchListener();
+
+ bool OnPress(UIView &view, const PressEvent &event) override;
+ bool OnRelease(UIView &view, const ReleaseEvent &event) override;
+ bool OnCancel(UIView &view, const CancelEvent &event) override;
+ bool OnDrag(UIView &view, const DragEvent &event) override;
+ bool OnDragEnd(UIView& view, const DragEvent& event) override;
+ void SetOnTouchStartListener(ViewOnTouchStartListener *startListener);
+ void SetOnTouchEndListener(ViewOnTouchEndListener *endListener);
+ void SetOnTouchCancelListener(ViewOnTouchCancelListener *cancelListener);
+ void SetOnTouchMoveListener(ViewOnTouchMoveListener *moveListener);
+
+ private:
+ ViewOnTouchStartListener *onTouchStartListener_;
+ ViewOnTouchCancelListener *onTouchCancelListener_;
+ ViewOnTouchEndListener *onTouchEndListener_;
+ ViewOnTouchMoveListener *onTouchMoveListener_;
+ };
+
+ void SetViewOnTouchListener(UIView &view);
+
/**
* @brief Used to set animation keyframes, such as transform, background-color, height etc.
* it is set as attribute, and support binding to data, so it can be changed dynamically.
ViewOnTouchMoveListener *onTouchMoveListener_;
ViewOnTouchCancelListener *onTouchCancelListener_;
ViewOnTouchEndListener *onTouchEndListener_;
+ ViewOnTouchListener *onTouchListener_;
KeyBoardEventListener *keyBoardEventListener_;
#endif
KeyInputEventListener *onKeyInputListener_;
selectedFontSize_(PICKER_SELECTED_FONT_SIZE),
selectedFontFamily_(nullptr),
pickerItemHeight_(PICKER_ITEM_HEIGHT),
+ loopState_(true),
textSelected_(0),
pTextArray_(nullptr),
textArraySize_(0),
{
bool result = false;
pickerType_ = GetPickerType();
+ SetPickerLoopState();
switch (pickerType_) {
case PickerType::TEXT: {
result = CreateTextPicker();
HILOG_ERROR(HILOG_MODULE_ACE, "PickerViewComponent: create text picker failed!");
return false;
}
- uiPicker->SetLoopState(true);
+ uiPicker->SetLoopState(loopState_);
textPickerListener_ = new TextPickerListener();
if (textPickerListener_ == nullptr) {
HILOG_ERROR(HILOG_MODULE_ACE, "PickerViewComponent: create text picker listener failed!");
HILOG_ERROR(HILOG_MODULE_ACE, "PickerViewComponent: create time picker failed");
return false;
}
- uiTimePicker->SetLoopState(uiTimePicker->PICKER_HOUR, true);
- uiTimePicker->SetLoopState(uiTimePicker->PICKER_MIN, true);
- uiTimePicker->SetLoopState(uiTimePicker->PICKER_SEC, true);
+ uiTimePicker->SetLoopState(uiTimePicker->PICKER_HOUR, loopState_);
+ uiTimePicker->SetLoopState(uiTimePicker->PICKER_MIN, loopState_);
+ uiTimePicker->SetLoopState(uiTimePicker->PICKER_SEC, loopState_);
timePickerListener_ = new TimePickerListener();
if (timePickerListener_ == nullptr) {
HILOG_ERROR(HILOG_MODULE_ACE, "PickerViewComponent: create time picker listener failed");
return strValue;
}
+void PickerViewComponent::SetPickerLoopState()
+{
+ uint16_t length = 0;
+ char *typeStr = GetStringAttrByName(ATTR_LOOP, length);
+ loopState_ = strcmp(typeStr, "false") == 0 ? false : true;
+}
+
PickerViewComponent::PickerType PickerViewComponent::GetPickerType() const
{
uint16_t length = 0;
// can not loop when pickerview has one child
if (textArraySize_ == 1) {
textPicker->SetLoopState(false);
- } else {
- textPicker->SetLoopState(true);
}
return true;
}
bool CreateDatePicker();
#endif // FEATURE_COMPONENT_DATE_PICKER
bool SetPickerSelected(jerry_value_t selectedValue);
+ void SetPickerLoopState();
void SetPickerListener(jerry_value_t funcValue) const;
bool SetTextPickerRange(jerry_value_t rangeValue);
void ReleaseTextRange();
uint8_t selectedFontSize_;
char* selectedFontFamily_;
uint16_t pickerItemHeight_;
+ bool loopState_;
// text picker-view attributes
uint16_t textSelected_;
sliderView_.SetHeight(visibleHeight);
sliderView_.SetWidth(visibleWidth);
if (direction_ == UISlider::Direction::DIR_BOTTOM_TO_TOP) {
- sliderView_.SetValidWidth(SLIDER_WIDTH);
sliderView_.SetValidHeight(visibleHeight - DEFAULT_PADDING);
} else {
- sliderView_.SetValidHeight(SLIDER_WIDTH);
sliderView_.SetValidWidth(visibleWidth - DEFAULT_PADDING);
}
}
* limitations under the License.
*/
-
#ifndef OHOS_ACELITE_JS_TIMER_LIST_H
#define OHOS_ACELITE_JS_TIMER_LIST_H
* @fn TimerList::TimerList()
* @brief Constructor
*/
- TimerList() : timerListHead_(nullptr), index_(0) {}
+ TimerList() : timerListHead_(nullptr), index_(0)
+ {}
/**
* @fn TimerList::~TimerList()
jerry_value_t AddTimer(timerHandle_t timerId, Arguments *&arg);
- TimerNode* GetTimer(uint8_t id);
+ TimerNode *GetTimer(uint8_t id);
void DeleteTimer(uint8_t timer);
void ReleaseArguments(Arguments *&argument);
- uint8_t GetIndex()
+ /**
+ * @brief Get the next available index 0~255 for timer.
+ * @return int16_t. Returns the unused index. if there is no index, -1 is returned.
+ */
+ int16_t GetIndex()
{
- return ++index_;
+ uint8_t loopTimes = 0;
+ index_++;
+ while (GetTimer(index_) != nullptr) {
+ if (loopTimes >= UINT8_MAX) {
+ return -1;
+ }
+ // index_ = (index_ + 1) % 256;
+ index_++;
+ loopTimes++;
+ }
+ return index_;
}
private:
TimerNode *timerListHead_;
uint8_t index_;
};
-} // namespace ACELite
-} // namespace OHOS
-#endif // FEATURE_TIMER_MODULE
-#endif // OHOS_ACELITE_JS_TIMER_LIST_H
+} // namespace ACELite
+} // namespace OHOS
+#endif // FEATURE_TIMER_MODULE
+#endif // OHOS_ACELITE_JS_TIMER_LIST_H
#include "adapter.h"
#include "js_ability_impl.h"
#include "ace_log.h"
+#include "abilityms_slite_client.h"
typedef struct : public OHOS::HeapBase {
char *msgBody;
SendToJS(event);
} else if (isPress_ && !isLongPress_) {
if (event.GetKeyId() == static_cast<uint16_t>(ZliteKeyCode::ZLITE_KEY_POWER)) {
- JsAppContext::GetInstance()->TerminateAbility();
+ ElementName *elementName = OHOS::AbilityMsClient::GetInstance().GetTopAbility();
+ if (elementName != nullptr) {
+ OHOS::AbilityMsClient::GetInstance().ForceStop(elementName->bundleName);
+ FreeElement(elementName);
+ } else {
+ HILOG_ERROR(HILOG_MODULE_ACE, "KeyListener: OnRelease elementName is nullptr");
+ }
}
}
isPress_ = false;
--- /dev/null
+/*
+ * Copyright (c) CompanyNameMagicTag. 2024-2025. All rights reserved.
+ * Description: network wrapper
+ * Author: SoftwarePlatform Group
+ * Create: 2024-08-10
+ */
+
+#ifndef OHOS_ACELITE_NETWORK_LISTENER_H
+#define OHOS_ACELITE_NETWORK_LISTENER_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+// 网络类型枚举
+typedef enum {
+ NETWORK_TYPE_WIFI = 0,
+ NETWORK_TYPE_BLUETOOTH,
+ NETWORK_TYPE_BLUETOOTH_LE,
+ NETWORK_TYPE_UNKNOWN
+} NetworkType;
+
+// 连接状态枚举
+typedef enum {
+ CONNECTION_STATUS_CONNECTING = 0,
+ CONNECTION_STATUS_CONNECTED,
+ CONNECTION_STATUS_DISCONNECTING,
+ CONNECTION_STATUS_DISCONNECTED,
+ CONNECTION_STATUS_UNKNOWN
+} ConnectionState;
+
+void net_connect_status_change(uint8_t type, uint8_t netConnectState);
+#ifdef __cplusplus
+};
+#endif
+
+#endif
--- /dev/null
+/*\r
+ * Copyright (c) 2020 Huawei Device Co., Ltd.\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+\r
+#include "ace_log.h"\r
+#include "js_app_context.h"\r
+#include "js_async_work.h"\r
+#include "product_adapter.h"\r
+#include <securec.h>\r
+#include <unistd.h>\r
+#include "network_module.h"\r
+#include "BluetoothModel.h"\r
+#include "msg_center_protocol.h"\r
+#include "bts_le_gap.h"\r
+#include "network_listener.h"\r
+\r
+namespace OHOS {\r
+namespace ACELite {\r
+std::map<uint8_t, NetCallBack *> NetWorkModule::callbackSet;\r
+\r
+void NetWorkModule::TriggerCallbackListener(uint8_t type, uint8_t netConnectState)\r
+{\r
+ auto it = callbackSet.find(type);\r
+ if (it != callbackSet.end()) {\r
+ NetCallBack *callback = it->second;\r
+ callback->netParam.state = netConnectState;\r
+ callback->netParam.net_type = type;\r
+ if (!JsAsyncWork::DispatchAsyncWork(AsyncExecuteCallback, const_cast<NetCallBack *>(callback))) {\r
+ HILOG_ERROR(HILOG_MODULE_ACE, "dispatch async work failed.");\r
+ }\r
+ }\r
+}\r
+\r
+static bool ValidJsValue(JSIValue value)\r
+{\r
+ return (value != nullptr) && (!JSI::ValueIsUndefined(value));\r
+}\r
+\r
+static uint8_t GetNetConnectState(uint8_t net_type)\r
+{\r
+ uint8_t state;\r
+ switch (net_type) {\r
+ case NETWORK_TYPE_WIFI:\r
+ break;\r
+ case NETWORK_TYPE_BLUETOOTH:\r
+ state = OHOS::BluetoothModel::GetInstance()->GetAclConnected() ? CONNECTION_STATUS_CONNECTED\r
+ : CONNECTION_STATUS_DISCONNECTED;\r
+ break;\r
+ case NETWORK_TYPE_BLUETOOTH_LE:\r
+ state = (msg_center_get_ble_conn_state() == GAP_BLE_STATE_CONNECTED) ? CONNECTION_STATUS_CONNECTED\r
+ : CONNECTION_STATUS_DISCONNECTED;\r
+ break;\r
+ default:\r
+ state = CONNECTION_STATUS_UNKNOWN;\r
+ break;\r
+ }\r
+ return state;\r
+}\r
+\r
+const JSIValue GetNetworkStateString(uint8_t type, uint8_t state)\r
+{\r
+ // 网络类型\r
+ const char *networkType;\r
+ switch (type) {\r
+ case NETWORK_TYPE_WIFI:\r
+ networkType = "WIFI";\r
+ break;\r
+ case NETWORK_TYPE_BLUETOOTH:\r
+ networkType = "Bluetooth";\r
+ break;\r
+ case NETWORK_TYPE_BLUETOOTH_LE:\r
+ networkType = "Bluetooth LE";\r
+ break;\r
+ default:\r
+ networkType = "Unknown Network Type";\r
+ break;\r
+ }\r
+\r
+ // 连接状态\r
+ const char *connectionState;\r
+ switch (state) {\r
+ case CONNECTION_STATUS_CONNECTING:\r
+ connectionState = "Connecting";\r
+ break;\r
+ case CONNECTION_STATUS_CONNECTED:\r
+ connectionState = "Connected";\r
+ break;\r
+ case CONNECTION_STATUS_DISCONNECTED:\r
+ connectionState = "Disconnected";\r
+ break;\r
+ default:\r
+ connectionState = "Unknown State";\r
+ break;\r
+ }\r
+\r
+ // 静态字符串缓冲区,用于返回结果\r
+ static char description[MAX_STATUS_LENGTH];\r
+ int ret =\r
+ snprintf_s(description, sizeof(description), sizeof(description) - 1, "%s: %s", networkType, connectionState);\r
+ if (ret <= 0) {\r
+ HILOG_ERROR(HILOG_MODULE_ACE, "result buff is too long");\r
+ }\r
+ JSIValue result = JSI::CreateObject();\r
+ JSI::SetStringProperty(result, "type", networkType);\r
+ JSI::SetNumberProperty(result, "state", state);\r
+ JSI::SetStringProperty(result, "description", description);\r
+ return result;\r
+}\r
+\r
+void NetWorkModule::AsyncExecuteCallback(void *arg)\r
+{\r
+ NetCallBack *callback = static_cast<NetCallBack *>(arg);\r
+ if (ValidJsValue(callback->net_connect_callback)) {\r
+ JSIValue result = GetNetworkStateString(callback->netParam.net_type, callback->netParam.state);\r
+ JSIValue argv[ARGC_ONE] = {result};\r
+ JSI::CallFunction(callback->net_connect_callback, callback->net_connect_thisVal, argv, ARGC_ONE);\r
+ JSI::ReleaseValue(result);\r
+ }\r
+}\r
+\r
+JSIValue NetWorkModule::RegisterConnectListener(const JSIValue thisVal, const JSIValue *args, uint8_t argsNum)\r
+{\r
+ uint8_t type;\r
+ JSIValue callbackArg;\r
+ if (argsNum == 1) {\r
+ type = NETWORK_TYPE_BLUETOOTH;\r
+ callbackArg = args[0];\r
+ } else if (argsNum == 2) {\r
+ if (args == nullptr || JSI::ValueIsUndefined(args[0])) {\r
+ HILOG_ERROR(HILOG_MODULE_ACE, "Invalid type argument for registering net connection callback");\r
+ return JSI::CreateUndefined();\r
+ }\r
+ type = JSI::ValueToNumber(args[0]);\r
+ callbackArg = args[1];\r
+ } else {\r
+ HILOG_ERROR(HILOG_MODULE_ACE, "Invalid number of arguments for registering net connection callback");\r
+ return JSI::CreateUndefined();\r
+ }\r
+ auto it = callbackSet.find(type);\r
+ if (it != callbackSet.end()) {\r
+ NetCallBack *callback = it->second;\r
+ // 从 map 中移除该回调\r
+ callbackSet.erase(it);\r
+ // 如果找到了对应的回调,先清理旧的回调\r
+ Clean(callback);\r
+ }\r
+ NetCallBack *newCallback = new (std::nothrow) NetCallBack();\r
+ if (newCallback == nullptr) {\r
+ HILOG_ERROR(HILOG_MODULE_ACE, "Failed to allocate memory for NetCallBack");\r
+ return JSI::CreateUndefined();\r
+ }\r
+ // 保存新的回调\r
+ newCallback->net_connect_thisVal = JSI::AcquireValue(thisVal);\r
+ newCallback->net_connect_callback = JSI::AcquireValue(callbackArg);\r
+ if (newCallback->net_connect_callback == nullptr) {\r
+ HILOG_ERROR(HILOG_MODULE_ACE, "Failed to register net connection callback");\r
+ delete newCallback;\r
+ return JSI::CreateUndefined();\r
+ }\r
+ newCallback->netParam.net_type = type;\r
+ callbackSet[type] = newCallback;\r
+ uint8_t state = GetNetConnectState(type);\r
+ net_connect_status_change(type, state);\r
+ return JSI::CreateUndefined();\r
+}\r
+\r
+JSIValue NetWorkModule::UnregisterConnectListener(const JSIValue thisVal, const JSIValue *args, uint8_t argsNum)\r
+{\r
+ if (args == nullptr || argsNum == 0) {\r
+ HILOG_ERROR(HILOG_MODULE_ACE, "Invalid arguments for unregistering net connection callback");\r
+ return JSI::CreateUndefined();\r
+ }\r
+\r
+ uint8_t type;\r
+ if (argsNum < 1) {\r
+ type = NETWORK_TYPE_BLUETOOTH;\r
+ } else {\r
+ if (JSI::ValueIsUndefined(args[0])) {\r
+ HILOG_ERROR(HILOG_MODULE_ACE, "Invalid type argument for unregistering net connection callback");\r
+ return JSI::CreateUndefined();\r
+ }\r
+ type = JSI::ValueToNumber(args[0]);\r
+ }\r
+ auto it = callbackSet.find(type);\r
+ if (it != callbackSet.end()) {\r
+ NetCallBack *callback = it->second;\r
+ callbackSet.erase(it);\r
+ Clean(callback);\r
+ } else {\r
+ HILOG_ERROR(HILOG_MODULE_ACE, "No callback registered for the given type");\r
+ }\r
+\r
+ return JSI::CreateUndefined();\r
+}\r
+\r
+JSIValue NetWorkModule::GetConnectState(const JSIValue thisVal, const JSIValue *args, uint8_t argsNum)\r
+{\r
+ uint8_t net_type = NETWORK_TYPE_UNKNOWN;\r
+ if (argsNum < 1) {\r
+ net_type = NETWORK_TYPE_BLUETOOTH;\r
+ } else {\r
+ net_type = (uint8_t)JSI::ValueToNumber(args[0]);\r
+ }\r
+ uint8_t state = GetNetConnectState(net_type);\r
+ return GetNetworkStateString(net_type, state);\r
+}\r
+\r
+void NetWorkModule::Clean(NetCallBack *callbackToClean)\r
+{\r
+ if (callbackToClean == nullptr) {\r
+ return;\r
+ }\r
+ // 释放回调函数资源\r
+ if (callbackToClean->net_connect_callback && JSI::ValueIsFunction(callbackToClean->net_connect_callback)) {\r
+ JSI::ReleaseValue(callbackToClean->net_connect_callback);\r
+ }\r
+ // 释放回调上下文资源\r
+ if (callbackToClean->net_connect_thisVal && !JSI::ValueIsUndefined(callbackToClean->net_connect_thisVal)) {\r
+ JSI::ReleaseValue(callbackToClean->net_connect_thisVal);\r
+ }\r
+ // 删除回调对象\r
+ delete callbackToClean;\r
+}\r
+\r
+void NetWorkModule::OnTerminate()\r
+{\r
+ for (auto it = callbackSet.begin(); it != callbackSet.end();) {\r
+ NetCallBack *callback = it->second;\r
+ callbackSet.erase(it);\r
+ // 移除多余的迭代器重置代码\r
+ Clean(callback);\r
+ // 从 map 中移除该回调\r
+ it = callbackSet.begin();\r
+ }\r
+}\r
+\r
+void InitNetWorkModule(JSIValue exports)\r
+{\r
+ JSI::SetModuleAPI(exports, "registerConnectListener", NetWorkModule::RegisterConnectListener);\r
+ JSI::SetModuleAPI(exports, "unregisterConnectListener", NetWorkModule::UnregisterConnectListener);\r
+ JSI::SetModuleAPI(exports, "getConnectState", NetWorkModule::GetConnectState);\r
+ JSI::SetOnTerminate(exports, NetWorkModule::OnTerminate);\r
+}\r
+\r
+} // namespace ACELite\r
+} // namespace OHOS\r
+\r
+#ifdef __cplusplus\r
+extern "C" {\r
+#endif\r
+\r
+void net_connect_status_change(uint8_t type, uint8_t netConnectState)\r
+{\r
+ OHOS::ACELite::NetWorkModule::TriggerCallbackListener(type, netConnectState);\r
+}\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
--- /dev/null
+/*\r
+ * Copyright (c) CompanyNameMagicTag. 2024-2025. All rights reserved.\r
+ * Description: network wrapper\r
+ * Author: SoftwarePlatform Group\r
+ * Create: 2024-08-10\r
+ */\r
+\r
+#ifndef OHOS_ACELITE_NETWORK_MODULE_H\r
+#define OHOS_ACELITE_NETWORK_MODULE_H\r
+\r
+#include <cJSON.h>\r
+#include "acelite_config.h"\r
+#include "jsi.h"\r
+#include <map>\r
+#include "js_async_work.h"\r
+#include "non_copyable.h"\r
+#include "product_adapter.h"\r
+#include "abilityms_slite_client.h"\r
+#include "network_listener.h"\r
+\r
+namespace OHOS {\r
+namespace ACELite {\r
+#define MAX_STATUS_LENGTH 128\r
+\r
+struct NetParam {\r
+ uint8_t net_type = -1;\r
+ uint8_t state;\r
+};\r
+\r
+struct NetCallBack {\r
+ JSIValue net_connect_callback = nullptr;\r
+ JSIValue net_connect_thisVal = nullptr;\r
+ NetParam netParam;\r
+};\r
+\r
+class NetWorkModule final : public MemoryHeap {\r
+public:\r
+ ACE_DISALLOW_COPY_AND_MOVE(NetWorkModule);\r
+ NetWorkModule() = default;\r
+ ~NetWorkModule() = default;\r
+ static std::map<uint8_t, NetCallBack*> callbackSet;\r
+ static JSIValue RegisterConnectListener(const JSIValue thisVal, const JSIValue *args, uint8_t argsNum);\r
+ static JSIValue UnregisterConnectListener(const JSIValue thisVal, const JSIValue *args, uint8_t argsNum);\r
+ static JSIValue GetConnectState(const JSIValue thisVal, const JSIValue *args, uint8_t argsNum);\r
+ static void AsyncExecuteCallback(void *arg);\r
+ static void TriggerCallbackListener(uint8_t type, uint8_t netConnectState);\r
+ static void OnTerminate();\r
+ static void Clean(NetCallBack* callbackToClean);\r
+};\r
+\r
+} // namespace ACELite\r
+} // namespace OHOS\r
+\r
+#endif\r
BUNDLE_UNINSTALL_FAIL = 5
} InstallState;
+typedef enum {
+ SCAN_PACKAGE_OK = 0,
+ SCAN_PACKAGE_DOING = 1,
+ SCAN_PACKAGE_FAIL = 2,
+ SCAN_PACKAGE_INVALID_DIR = 3,
+ SCAN_PACKAGE_MEMORY_ERROR = 4,
+ SCAN_PACKAGE_PATH_ERROR = 5
+} ScanPackagesResultState;
+
typedef struct {
char *bundleName;
char *label;
uint8_t GetBundleInfo(const char *bundleName, int32_t flags, BundleInfo& bundleInfo);
uint8_t GetBundleInfos(const int flags, BundleInfo **bundleInfos, int32_t *len);
uint8_t GetBundleInfosNoReplication(const int flags, BundleInfo **bundleInfos, int32_t *len);
- void ScanPackages();
+ void ScanPackages(InstallerCallback ScanPackagesResultCallback);
BundleInfo *QueryBundleInfo(const char *bundleName);
void RemoveBundleInfo(const char *bundleName);
void AddBundleInfo(BundleInfo *info);
GtManagerService();
~GtManagerService();
void ScanSystemApp(const cJSON *uninstallRecord, List<ToBeInstalledApp *> *systemPathList);
- void ScanThirdApp(const char *appDir, const List<ToBeInstalledApp *> *systemPathList);
+ void ScanThirdApp(const char *appDir, const List<ToBeInstalledApp *> *systemPathList,
+ InstallerCallback ScanPackagesResultCallback);
void InstallAllSystemBundle(InstallerCallback installerCallback);
bool ReloadBundleInfo(const char *profileDir, const char *appId, bool isSystemApp);
void ReloadEntireBundleInfo(const char *appPath, const char *bundleName, List<ToBeInstalledApp *> *systemPathList,
bool ResetPlayer();
void ReleaseEventListeners();
-
+#ifdef HMF_DECRYPT_DATA_ENABLE
+ void SetDecryptLibraryPath(char *path, uint32_t len);
+#endif
void ReleaseSrc();
bool Play();
bool SetAutoPlay(bool autoPlay);
- bool SetLoop(bool loop) const;
+ bool SetLoop(bool loop);
bool SetVolume(double volume);
void SetOnTimeUpdateListener(AudioEventListener *onTimeUpdateListener);
int32_t GetSrcInnerPrefix(const char *src, char *dest);
+
+ bool IsSysSrc();
private:
AudioPlayer();
~AudioPlayer();
bool autoPlay_;
bool isRunning_;
bool isSysSrc_;
+ bool isPlayList_;
+ AudioPlayerLoopMode playLoopMode_ = AudioPlayerLoopMode::AUDIO_PLAYER_INVAILD_LOOP;
MediaThreadIdHandle updateTimeProcess_;
AudioStreamType streamType_ = AUDIO_STREAM_MUSIC;
};
} // namespace ACELite
} // namespace OHOS
-#endif // AUDIO_PLAYER_H
\ No newline at end of file
+#endif // AUDIO_PLAYER_H
TEST_ASSERT_GREATER_THAN_INT(0, fd32[i]);
}
// Open the 33th file
- char* fileName33 = "/user/testReli101-33";
+ char fileName33[LENGTH_OF_FILE_NAME_BUF] = { 0 };
+ (void)sprintf_s(fileName33, sizeof(fileName33), "%s%d", "/user/testReli101-", MAX_NUM_OF_OPENED_FILES + 1);
int fd33 = UtilsFileOpen(fileName33, O_RDWR_FS | O_CREAT_FS, 0);
TEST_ASSERT_EQUAL_INT(-1, fd33);
// Close file
band--;
continue;
}
- else if ( error != ErrRaster_Memory_Overflow )
+ else if ( error != ErrRaster_Memory_Overflow ) {
ft_sfree(buffer);
return 1;
+ }
/* render pool overflow; we will reduce the render band by half */
width >>= 1;
)
set(PRIVATE_DEFINES
- JERRY_GLOBAL_HEAP_SIZE=512
+ JERRY_GLOBAL_HEAP_SIZE=576
JERRY_ERROR_MESSAGES=1
JERRY_LINE_INFO=1
JERRY_FUNCTION_NAME
if ((src == NULL) || (dest == NULL)) {\r
return EC_FAILURE;\r
}\r
+#ifdef XTS_SUPPORT\r
+ int fpSrc = UtilsFileOpen(src, O_RDWR_FS, 0);\r
+#else\r
int fpSrc = UtilsFileOpen(src, O_RDONLY_FS, 0);\r
+#endif\r
if (fpSrc < 0) {\r
return fpSrc;\r
}\r
namespace {\r
char g_uriFullPath[FILE_NAME_MAX_LEN + 1] = {0};\r
const unsigned int PREFIX_LEN = strlen(FILE_PREFIX);\r
+const char *trustPath = "/user/music";\r
+const int trustPathSize = strlen(trustPath);\r
\r
bool IsValidPath(const char* path)\r
{\r
if (pathLen > URI_NAME_MAX_LEN) {\r
return false;\r
}\r
- if ((pathLen < PREFIX_LEN) || (strncmp(path, FILE_PREFIX, PREFIX_LEN) != 0)) {\r
+\r
+ bool isTrustPath = (strncmp(path, trustPath, trustPathSize) == 0);\r
+ if (!isTrustPath && (strncmp(path, FILE_PREFIX, PREFIX_LEN) != 0)) {\r
+ return false;\r
+ }\r
+\r
+ if (isTrustPath && (pathLen < strlen(trustPath))) {\r
return false;\r
}\r
+\r
+ if ((strncmp(path, FILE_PREFIX, PREFIX_LEN) == 0) && (pathLen < PREFIX_LEN)) {\r
+ return false;\r
+ }\r
+\r
if ((strstr(path, "/./") != nullptr) || (strstr(path, "/../") != nullptr)) {\r
return false;\r
}\r
- if (strpbrk(path + PREFIX_LEN, "\"*+,:;<=>\?[]|\x7F")) {\r
+\r
+ if (strpbrk(path + (isTrustPath ? trustPathSize : PREFIX_LEN), "\"*+,:;<=>\?[]|\x7F")) {\r
return false;\r
}\r
+\r
return true;\r
}\r
\r
return ERROR_CODE_PARAM;\r
}\r
const char* dataPath = GetDataPath();\r
+ int size = PREFIX_LEN;\r
+ bool isTrustPath = (strncmp(uri, trustPath, strlen(trustPath)) == 0);\r
+ if (isTrustPath) {\r
+ size = 0;\r
+ }\r
+\r
if (dataPath == nullptr) {\r
return ERROR_CODE_PARAM;\r
}\r
+\r
if (memset_s(fullPath, len, 0x0, len) != EOK) {\r
return ERROR_CODE_GENERAL;\r
}\r
- if (sprintf_s(fullPath, len, "%s%s", dataPath, uri + PREFIX_LEN) < 0) {\r
+\r
+ if (sprintf_s(fullPath, len, "%s%s", (isTrustPath ? "" : dataPath), uri + size) < 0) {\r
return ERROR_CODE_GENERAL;\r
}\r
+\r
return NATIVE_SUCCESS;\r
}\r
\r
\r
JSIValue NativeapiKv::Clear(const JSIValue thisVal, const JSIValue* args, uint8_t argsNum)\r
{\r
- JSIValue undefValue = JSI::CreateUndefined();\r
+ JSIValue retValue = JSI::CreateUndefined();\r
+ \r
+ if (args == nullptr || argsNum == 0 || !NativeapiCommon::IsValidJSIValue(args, argsNum)) {\r
+ retValue = JSI::CreateErrorWithCode(-1, "Invalid arguments");\r
+ return retValue;\r
+ }\r
+ \r
FuncParams* params = new(std::nothrow) FuncParams();\r
if (params == nullptr) {\r
- return undefValue;\r
+ retValue = JSI::CreateErrorWithCode(-1, "Failed to allocate FuncParams");\r
+ return retValue;\r
}\r
+ \r
params->thisVal = JSI::AcquireValue(thisVal);\r
- if (NativeapiCommon::IsValidJSIValue(args, argsNum)) {\r
- params->args = JSI::AcquireValue(args[0]);\r
+ params->args = JSI::AcquireValue(args[0]);\r
+ \r
+ bool isSuccess = JsAsyncWork::DispatchAsyncWork(reinterpret_cast<AsyncWorkHandler>(ExecuteClear), reinterpret_cast<void *>(params));\r
+ if (!isSuccess) {\r
+ JSI::ReleaseValue(params->thisVal);\r
+ JSI::ReleaseValue(params->args);\r
+ delete params;\r
+ retValue = JSI::CreateErrorWithCode(-1, "Async work dispatch failed");\r
}\r
- JsAsyncWork::DispatchAsyncWork(reinterpret_cast<AsyncWorkHandler>(ExecuteClear), reinterpret_cast<void *>(params));\r
- return undefValue;\r
+ \r
+ return retValue;\r
}\r
} // ACELite\r
} // OHOS\r
CONN_MSG_ID_REPORT_LOCAL_ADDR_CHANGED, /* 本地设备地址变化上报 */
CONN_MSG_ID_REPORT_PAIR_STATUS_CHANGED, /* 设备配对变化上报 */
CONN_MSG_ID_REPORT_REMOTE_RSSI, /* 远端设备RSSI上报 */
+ CONN_MSG_ID_REPORT_CONN_REJECTED, /* 拒绝新设备连接上报 */
} connection_manager_msg_id;
typedef enum {
* @endif
*/
typedef struct {
- struct osal_list_head node;
+ struct osal_list_head node; /*!< @if Eng List node @else 链表节点 @endif */
uint8_t client_id; /*!< @if Eng client id @else 客户端ID @endif */
uint16_t conn_id; /*!< @if Eng connect id @else 连接ID @endif */
uint16_t start_handle; /*!< @if Eng start handle @else 服务开始handle @endif */
* @endif
*/
typedef struct {
+ struct osal_list_head node; /*!< @if Eng List node @else 链表节点 @endif */
uint8_t att_id; /*!< @if Eng Attribute id @else 属性ID @endif */
uint16_t att_length; /*!< @if Eng Attribute length @else 属性长度 @endif */
uint8_t *att; /*!< @if Eng Attribute value @else 属性值 @endif */
*res = g_sample_gap_accept_conn;
}
+static void sample_gap_connect_reject_rpt_callback(const bd_addr_t *bd_addr)
+{
+ bts_sample_log("conn_request_notify_callback addr: ****%02x%02x%02x%02x\n",
+ bd_addr->addr[3], bd_addr->addr[2], /* addr下标 2 3 */
+ bd_addr->addr[1], bd_addr->addr[0]); /* addr下标 0 1 */
+}
+
/* 注册回调 params: sample_mode fill_callbacks */
void btsrv_at_cmd_gap_register_callbacks(void)
{
sample_gap_remote_cod_changed_callback,
sample_gap_remote_battery_level_changed_callback,
sample_gap_read_remote_rssi_event_callback,
- sample_gap_is_accept_conn_on_safe_mode_callback
+ sample_gap_is_accept_conn_on_safe_mode_callback,
};
int ret = gap_register_callbacks(&cb);
bts_sample_log("gap reg cbk ret %x\n", ret);
+ gap_register_br_connect_rejection_report_callback(sample_gap_connect_reject_rpt_callback);
}
/* 注册回调 params: sample_mode fill_callbacks */
int ret;
if ((sample_mode & 0x1) != 0) {
ret = gap_register_callbacks(NULL);
+ gap_register_br_connect_rejection_report_callback(NULL);
} else if (fill_callbacks != 0) {
gap_call_backs_t cb = {
sample_gap_state_changed_callback,
sample_gap_remote_cod_changed_callback,
sample_gap_remote_battery_level_changed_callback,
sample_gap_read_remote_rssi_event_callback,
- sample_gap_is_accept_conn_on_safe_mode_callback
+ sample_gap_is_accept_conn_on_safe_mode_callback,
};
ret = gap_register_callbacks(&cb);
bts_sample_log("gap_register_callbacks with funcs ret(int): %x\n", ret);
+ gap_register_br_connect_rejection_report_callback(sample_gap_connect_reject_rpt_callback);
} else {
gap_call_backs_t cb = { 0, };
ret = gap_register_callbacks(&cb);
bts_sample_log("gap_register_callbacks test ret(int): %x\n", ret);
+ gap_register_br_connect_rejection_report_callback(NULL);
}
}
BTSDK_ADD_DEVICE_TO_WHITE_LIST,
BTSDK_REMOVE_DEVICE_FROM_WHITE_LIST,
BTSDK_CLEAR_WHITE_LIST,
+ BTSDK_CONNECTION_REJECT_REPORT,
BTSDK_ENUM_MAX // let it at the bottom of the array
};
bth_addr_t bd_addr;
} connect_req_ind_struct;
+typedef struct {
+ bth_addr_t bd_addr;
+} connect_reject_info;
+
typedef struct {
uint8_t op;
void *func;
typedef void (btsdk_authorization_req_ind_func)(uint32_t svc_hdl, uint32_t dev_hdl);
typedef uint8_t (btsdk_connection_request_ind_func)(uint32_t dev_hdl, uint32_t dev_class, uint8_t link_type,
const uint8_t *remote_addr, uint8_t addr_len);
+typedef uint8_t (btsdk_connection_reject_rpt_func)(const uint8_t *remote_addr, uint8_t addr_len);
typedef void (btsdk_connection_complete_ind_func)(uint32_t dev_hdl, bt_sdk_conn_dev_info_t *conn_dev_info);
typedef void (btsdk_disconnection_complete_ind_func)(uint32_t dev_hdl, uint32_t reason);
typedef void (btsdk_connection_event_ind_func)(uint32_t conn_hdl, uint16_t event, uint8_t *arg);
from nv_binary import nv_begin
# brandy packet
-def build_brandy_other_bin(pack_style_str, flash_size):
+def build_brandy_other_bin(pack_style_str, flash_size, no_dsp):
''' build brandy partition and nv '''
chip_dir = os.path.join(SDK_DIR, "build", "config", "target_config", "brandy")
# 分区配置文件路径
partition_cfg = os.path.join(chip_dir, "param_sector")
- if flash_size.endswith("0x1000000"):
+ if flash_size == "0x1000000":
partition_cfg = os.path.join(partition_cfg, "param_sector_16M.json")
else:
- partition_cfg = os.path.join(partition_cfg, "param_sector.json")
- print("partition_cfg {}".format(partition_cfg))
+ if (no_dsp == "True"):
+ partition_cfg = os.path.join(partition_cfg, "param_sector_no_dsp.json")
+ else:
+ partition_cfg = os.path.join(partition_cfg, "param_sector.json")
+
partition_bin = os.path.join(SDK_DIR, "output", "brandy", "partition_table.bin")
# nv配置文件路径
nv_config_json = os.path.join(chip_dir, "nv_bin_cfg")
print(e)
exit(-1)
+def make_all_in_one_packet_no_dsp(pack_style_str):
+ # make all in one packet
+ bin_dir = os.path.join(PKG_DIR, "bin", "brandy")
+ application_dir = os.path.join(SDK_DIR,
+ "output",
+ "brandy",
+ "acore",
+ pack_style_str)
+ recovery_target = "%s-r" % pack_style_str
+ recovery_target = recovery_target.replace('-user', '')
+ recovery_bin = os.path.join(SDK_DIR,
+ "output",
+ "brandy",
+ "acore",
+ recovery_target,
+ "recovery.bin")
+ recovery_bx = recovery_bin + "|0x70050000|0x40000|100"
+
+ upload_app_fwpkg = os.path.join(PKG_DIR, "fwpkg", "brandy", "upload_app.fwpkg")
+
+ ssb = os.path.join(SDK_DIR, "output", "brandy", "acore", "brandy-ssb", "ssb.bin")
+ if not os.path.exists(ssb):
+ ssb = os.path.join(bin_dir, "ssb.bin")
+ print("ssb_path: ", ssb)
+ ssb_bx = ssb + "|0x70000000|0x20000|0"
+
+ partition = os.path.join(SDK_DIR, "output", "brandy", "partition_table.bin")
+ partition_bx = partition + "|0x7004F000|0x1000|100"
+ nv = os.path.join(SDK_DIR, "output", "brandy", "nv_bin", "brandy_all_nv.bin")
+ nv_bx = nv + "|0x707F9000|0x4000|100"
+
+ app = os.path.join(application_dir, "application.bin")
+ app_bx = app + "|0x70100000|0x6F9000|18"
+
+ bt = os.path.join(bin_dir, "bt.bin")
+ bt_bx = bt + "|0x70090000|0x70000|20"
+
+ fs = os.path.join(application_dir, "file.bin")
+ fs_bx = fs + "|0xFFFFFFFF|0xFFFFFFFF|101"
+
+ try:
+ packet_post_agvs = list()
+ packet_post_agvs.append(ssb_bx)
+ packet_post_agvs.append(partition_bx)
+ packet_post_agvs.append(app_bx)
+ packet_post_agvs.append(recovery_bx)
+ packet_post_agvs.append(bt_bx)
+ packet_post_agvs.append(nv_bx)
+ packet_post_agvs.append(fs_bx)
+ packet_bin(upload_app_fwpkg, packet_post_agvs)
+ except Exception as e:
+ print(e)
+ exit(-1)
+
def make_all_in_one_packet_16M(pack_style_str):
# make all in one packet
bin_dir = os.path.join(PKG_DIR, "bin", "brandy")
exit(-1)
-def make_all_in_one_packet(pack_style_str, flash_size):
+def make_all_in_one_packet(pack_style_str, flash_size, no_dsp):
# make all in one packet
- build_brandy_other_bin(pack_style_str, flash_size)
- if flash_size.endswith("0x1000000"):
+ build_brandy_other_bin(pack_style_str, flash_size, no_dsp)
+ if flash_size == "0x1000000":
make_all_in_one_packet_16M(pack_style_str)
else:
- make_all_in_one_packet_8M(pack_style_str)
+ if no_dsp == "True":
+ make_all_in_one_packet_no_dsp(pack_style_str)
+ else:
+ make_all_in_one_packet_8M(pack_style_str)
def is_packing_files_exist(soc, pack_style_str):
"""
build_soc = sys.argv[1]
build_target = sys.argv[2]
flash_size = sys.argv[3]
+ no_dsp = sys.argv[4]
load_fmt = "chip_packet.%s.packet" %build_soc
load_mod = importlib.import_module(load_fmt)
lost = ";".join(lost_file)
print(f"cannot find {lost}")
exit(-1)
- load_mod.make_all_in_one_packet(build_target, flash_size)
+ load_mod.make_all_in_one_packet(build_target, flash_size, no_dsp)
if __name__ == "__main__":
main()