mirror of
https://github.com/openharmony/iot_link.git
synced 2026-07-19 23:23:39 -04:00
cfa0db72d2
Signed-off-by: zgit2021 <zhaowenqiang14@huawei.com> Change-Id: Ib64b866e796c5b7d702c15c3a88aa439e6f62bb3
51 lines
1.3 KiB
C
51 lines
1.3 KiB
C
/*
|
|
* 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 "demosdk.h"
|
|
|
|
#include <stdio.h>
|
|
|
|
#include "demosdk_adapter.h"
|
|
|
|
#define TASK_STACK_SIZE 1000
|
|
#define TASK_PRIO 20
|
|
#define SECOND_CNT 1000
|
|
|
|
void *DemoSdkBiz(const char *arg)
|
|
{
|
|
(void)arg;
|
|
while (1) {
|
|
printf("it is demo biz: hello world.\n");
|
|
DemoSdkSleepMs(SECOND_CNT);
|
|
}
|
|
return NULL;
|
|
}
|
|
|
|
int DemoSdkEntry(void)
|
|
{
|
|
printf("it is demosdk entry.\n");
|
|
struct TaskPara para = {0};
|
|
para.name = "demotask";
|
|
para.func = (void *)DemoSdkBiz;
|
|
para.prio = TASK_PRIO;
|
|
para.size = TASK_STACK_SIZE;
|
|
unsigned int handle;
|
|
int ret = DemoSdkCreateTask(&handle, ¶);
|
|
if (ret != 0) {
|
|
printf("create task fail.\n");
|
|
return -1;
|
|
}
|
|
return 0;
|
|
}
|