mirror of
https://github.com/openharmony/developtools_syscap_codec.git
synced 2026-08-27 20:29:57 -04:00
Merge branch 'master' of https://gitee.com/openharmony/developtools_syscap_codec into syscap-extern
Change-Id: I4958028e552cd85fa31ae44f86c6b8129f291914
This commit is contained in:
@@ -55,7 +55,7 @@ struct SystemCapabilityAsyncContext {
|
||||
int status = 0;
|
||||
};
|
||||
|
||||
static char* getSystemCapability()
|
||||
static char* GetSystemCapability()
|
||||
{
|
||||
bool retBool;
|
||||
int retError, priOutputLen, priCapArrayCnt, sumLen;
|
||||
@@ -179,7 +179,7 @@ napi_value QuerySystemCapability(napi_env env, napi_callback_info info)
|
||||
env, nullptr, resource,
|
||||
[](napi_env env, void* data) {
|
||||
SystemCapabilityAsyncContext *asyncContext = (SystemCapabilityAsyncContext *)data;
|
||||
char *syscapStr = getSystemCapability();
|
||||
char *syscapStr = GetSystemCapability();
|
||||
if (syscapStr != nullptr) {
|
||||
asyncContext->value = syscapStr;
|
||||
asyncContext->status = 0;
|
||||
@@ -248,7 +248,7 @@ static napi_module g_systemCapabilityModule = {
|
||||
/*
|
||||
* Module register function
|
||||
*/
|
||||
extern "C" __attribute__((constructor)) void systemCapabilityRegisterModule(void)
|
||||
extern "C" __attribute__((constructor)) void SystemCapabilityRegisterModule(void)
|
||||
{
|
||||
napi_module_register(&g_systemCapabilityModule);
|
||||
}
|
||||
|
||||
+17
-2
@@ -1,7 +1,22 @@
|
||||
/*
|
||||
* Copyright (c) 2022 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
// 首先需要通过requireInternal函数加载本模块
|
||||
const systemCapability = requireInternal('systemCapability');
|
||||
|
||||
// 这里定义了模块对外暴露的所有api
|
||||
export default {
|
||||
querySystemCapabilities: systemCapability.querySystemCapabilities
|
||||
}
|
||||
querySystemCapabilities: systemCapability.querySystemCapabilities
|
||||
};
|
||||
Reference in New Issue
Block a user