# telephony_sms **Repository Path**: taihe_telephony/telephony_sms ## Basic Information - **Project Name**: telephony_sms - **Description**: telephony_sms_taihe_native编写 - **Primary Language**: C++ - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-07-08 - **Last Updated**: 2025-09-30 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # telephony_sms #### 介绍 telephony_sms_taihe_native编写调试验证。 #### 使用说明 1. 下载源码 ```shell # 创建目录 mkdir -p //workspace/taihe_telephony # 切换目录 cd //workspace/taihe_telephony # 下载模板源码 git clone https://gitee.com/taihe_telephony/telephony_sms.git ``` 2. 集成到子系统 ```shell # 切换子系统目录 cd //base/telephony/sms_mms/ # 创建原始分支master和开发分支taihe git branch master git branch taihe # 切换到开发分支taihe git checkout taihe # 复制telephony_sms到framework cp -r //workspace/taihe_telephony/telephony_sms/ets/ ./frameworks/ # diff文件打patch git apply //workspace/taihe_telephony/telephony_sms/diff/bundle_json.diff ``` 3. 编译 ```shell # 切换到源码根目录 cd ../../../ # 执行命令编译 ./build.sh --product-name rk3568 –ccache --no-prebuilt-sdk --gn-flags="--export-compile-commands" -T telephony_sms_taihe # 在调试时,如果编译没有错误,可以使用fast-rebuild加快编译速度 ./build.sh --product-name rk3568 –ccache --no-prebuilt-sdk --gn-flags="--export-compile-commands" --fast-rebuild -T telephony_sms_taihe ``` 4. 调试taihe接口 调试主要是根据@ohos.telephony.sms.d.ts文件编写ets/taihe/telephony_sms/idl/ohos.telephony.sms.taihe文件。 ohos.telephony.sms.impl.cpp相关模板函数可以通过build.sh编译生成,也可以通过taihe-tryit工具生成。 - 通过build.sh生成ohos.telephony.sms.impl.cpp模板函数 ```shell # 更新ets/taihe/telephony_sms/idl/ohos.telephony.sms.taihe # 执行build.sh生成ohos.telephony.sms.impl.cpp模板函数 ./build.sh --product-name rk3568 –ccache --no-prebuilt-sdk --gn-flags="--export-compile-commands" -T telephony_sms_taihe # 对比//out/rk3568taihe/out/telephony/sms_mms/temp/ohos.telephony.sms.impl.cpp 和 # //base/telephony/sms_mms/frameworks/ets/taihe/sms_mms/src/ohos.telephony.sms.impl.cpp # 文件,将新生成的模板函数复制到子系统中。 # 重新编译生成 ./build.sh --product-name rk3568 –ccache --no-prebuilt-sdk --gn-flags="--export-compile-commands" -T telephony_sms_taihe ``` - 通过taihe-tryit工具生成ohos.telephony.sms.impl.cpp模板函数 ```shell # 配置sdk路径 cp sdk-1.5.0-dev.38856.tgz ~/.cache/taihe/panda-vm/ # 切换到tryit目录 cd //workspace/taihe_telephony/tryit # 复制更新ohos.telephony.sms.taihe文件 cp -f //base/telephony/sms_mms/frameworks/ets/taihe/sms_mms/idl/ohos.telephony.sms.taihe telephony_sms/idl/ohos.telephony.sms.taihe # 使用tryit生成ohos.telephony.sms.impl.cpp模板函数 //prebuilts/taihe/ohos/linux-x86_64/taihe/bin/taihe-tryit test ./telephony_sms/ --user sts # 对比//telephony_sms/tryit/telephony_sms/generated/temp/ohos.telephony.sms.impl.cpp 和 # //base/telephony/sms_mms/frameworks/ets/taihe/sms_mms/src/ohos.telephony.sms.impl.cpp # 文件,将新生成的模板函数复制到子系统中。 # 重新编译生成 ./build.sh --product-name rk3568 –ccache --no-prebuilt-sdk --gn-flags="--export-compile-commands" -T telephony_sms_taihe ``` - 实现ohos.telephony.sms.impl.cpp模板函数 当前@ohos.telephony.sms.d.ts已经有对应的napi实现,参考napi的逻辑,实现ani的逻辑。 //base/telephony/sms_mms/interfaces/kits/js/@ohos.telephony.sms.d.ts //base/telephony/sms_mms/frameworks/js/napi/src/napi_sms.cpp 5. 上板验证 ```shell # ./build.sh --product-name rk3568 –ccache --no-prebuilt-sdk --gn-flags="--export-compile-commands" -T telephony_sms_taihe 命令生成so和abc文件 # abc文件 //out/rk3568/obj/base/telephony/sms_mms/frameworks/ets/taihe/sms_mms/telephony_sms_abc.abc # so文件 //out/rk3568/telephony/sms_mms/libtelephony_sms_taihe_native.z.so # 推送板子进行验证 ```