mirror of
https://github.com/Ai-Thinker-Open/Ai-Thinker-Open_RTL8710BX_ALIOS_SDK.git
synced 2025-07-31 19:31:05 +00:00
rel_1.6.0 init
This commit is contained in:
commit
27b3e2883d
19359 changed files with 8093121 additions and 0 deletions
53
Living_SDK/framework/cloud/cloud.c
Normal file
53
Living_SDK/framework/cloud/cloud.c
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
/*
|
||||
* Copyright (C) 2015-2017 Alibaba Group Holding Limited
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
#include <aos/cloud.h>
|
||||
#include <aos/aos.h>
|
||||
|
||||
static aos_cloud_cb_t cbs[MAX_EVENT_TYPE];
|
||||
static int (*report_backend)(const char *method, const char *json_buffer);
|
||||
|
||||
int aos_cloud_register_callback(int cb_type, aos_cloud_cb_t cb)
|
||||
{
|
||||
if (cb_type >= MAX_EVENT_TYPE) {
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
cbs[cb_type] = cb;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int aos_cloud_report(const char *method,
|
||||
const char *json_buffer,
|
||||
void (*done_cb)(void *),
|
||||
void *arg)
|
||||
{
|
||||
if (report_backend == NULL) {
|
||||
return -ENOSYS;
|
||||
}
|
||||
|
||||
return report_backend(method, json_buffer);
|
||||
}
|
||||
|
||||
void aos_cloud_register_backend(int (*report)(const char *method, const char *json_buffer))
|
||||
{
|
||||
report_backend = report;
|
||||
}
|
||||
|
||||
void aos_cloud_trigger(int cb_type, const char *json_buffer)
|
||||
{
|
||||
if (cb_type >= MAX_EVENT_TYPE) {
|
||||
return;
|
||||
}
|
||||
|
||||
cbs[cb_type](cb_type, json_buffer);
|
||||
}
|
||||
|
||||
int aos_cloud_init(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
6
Living_SDK/framework/cloud/cloud.mk
Normal file
6
Living_SDK/framework/cloud/cloud.mk
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
NAME := cloud
|
||||
|
||||
$(NAME)_SOURCES := cloud.c
|
||||
|
||||
$(NAME)_TYPE := kernel
|
||||
GLOBAL_DEFINES += CONFIG_CLOUD
|
||||
6
Living_SDK/framework/cloud/ucube.py
Normal file
6
Living_SDK/framework/cloud/ucube.py
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
src = Split('''
|
||||
cloud.c
|
||||
''')
|
||||
|
||||
component = aos_component('cloud', src)
|
||||
component.add_global_macros('CONFIG_CLOUD')
|
||||
Loading…
Add table
Add a link
Reference in a new issue