|
打开是这样的东西
applications/ 0000755 0000000 0000000 00000000000 13726166514 012255 5 ustar root root applications/sample/ 0000755 0000000 0000000 00000000000 13726166514 013536 5 ustar root root applications/sample/wifi-iot/ 0000755 0000000 0000000 00000000000 13726166514 015265 5 ustar root root applications/sample/wifi-iot/app/ 0000755 0000000 0000000 00000000000 13726166514 016045 5 ustar root root applications/sample/wifi-iot/app/BUILD.gn 0000755 0000000 0000000 00000001342 13726166514 017235 0 ustar root root # Copyright (c) 2020 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.
import("//build/lite/config/component/lite_component.gni")
lite_component("app") {
features = [
"startup",
]
}
applications/sample/wifi-iot/app/demolink/ 0000755 0000000 0000000 00000000000 13726166514 017647 5 ustar root root applications/sample/wifi-iot/app/demolink/BUILD.gn 0000755 0000000 0000000 00000001442 13726166514 021040 0 ustar root root # Copyright (c) 2020 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.
static_library("example_demolink") {
sources = [
"helloworld.c"
]
include_dirs = [
"//utils/native/lite/include",
"//domains/iot/link/libbuild"
]
}
applications/sample/wifi-iot/app/demolink/helloworld.c 0000755 0000000 0000000 00000001324 13726166514 022171 0 ustar root root /*
* Copyright (c) 2020 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.
*/
#include "ohos_init.h"
#include "demosdk.h"
void DemoSdkMain(void)
{
DemoSdkEntry();
}
SYS_RUN(DemoSdkMain);
applications/sample/wifi-iot/app/samgr/ 0000755 0000000 0000000 00000000000 13726166514 017156 5 ustar root root applications/sample/wifi-iot/app/samgr/feature_example.c 0000755 0000000 0000000 00000027172 13726166514 022504 0 ustar root root /*
* Copyright (c) 2020 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.
*/
#include "example.h"
#include <ohos_init.h>
#include <securec.h>
#include <los_base.h>
#include <cmsis_os.h>
#include <samgr_maintenance.h>
#include "iunknown.h"
#include "feature.h"
#include "service.h"
#include "samgr_lite.h"
#define WAIT_FEATURE_PROC 1000
enum MessageId {
MSG_PROC,
MSG_TIME_PROC,
};
struct Payload {
int id;
const char *name;
int value;
};
typedef struct DemoApi {
INHERIT_IUNKNOWN;
BOOL (*AsyncCall)(IUnknown *iUnknown, const char *buff);
BOOL (*AsyncTimeCall)(IUnknown *iUnknown);
BOOL (*SyncCall)(IUnknown *iUnknown, struct Payload *payload);
BOOL (*AsyncCallBack)(IUnknown *iUnknown, const char *buff, Handler handler);
} DemoApi;
typedef struct DemoFeature {
INHERIT_FEATURE;
INHERIT_IUNKNOWNENTRY(DemoApi);
Identity identity;
} DemoFeature;
static BOOL AsyncCall(IUnknown *iUnknown, const char *body);
static BOOL AsyncTimeCall(IUnknown *iUnknown);
static BOOL SyncCall(IUnknown *iUnknown, struct Payload *payload);
static BOOL AsyncCallBack(IUnknown *iUnknown, const char *body, Handler handler);
static const char *FEATURE_GetName(Feature *feature);
static void FEATURE_OnInitialize(Feature *feature, Service *parent, Identity identity);
static void FEATURE_OnStop(Feature *feature, Identity identity);
static BOOL FEATURE_OnMessage(Feature *feature, Request *request);
static DemoFeature g_example = {
.GetName = FEATURE_GetName,
.OnInitialize = FEATURE_OnInitialize,
.OnStop = FEATURE_OnStop,
.OnMessage = FEATURE_OnMessage,
DEFAULT_IUNKNOWN_ENTRY_BEGIN,
.AsyncCall = AsyncCall,
.AsyncTimeCall = AsyncTimeCall,
.SyncCall = SyncCall,
.AsyncCallBack = AsyncCallBack, |
|