code
stringlengths
1
1.05M
repo_name
stringlengths
6
83
path
stringlengths
3
242
language
stringclasses
222 values
license
stringclasses
20 values
size
int64
1
1.05M
#! /bin/env python from aostools import Make # default elf is out/<solution>@<board>.elf, and default objcopy is out/<solution>@<board>.bin # defconfig = Make(elf='out/<solution>@<board>.elf', objcopy='out/<solution>@<board>.bin') defconfig = Make() Export('defconfig') defconfig.build_components()
YifuLiu/AliOS-Things
solutions/helloworld_demo/SConstruct
Python
apache-2.0
303
/* * Copyright (C) 2015-2020 Alibaba Group Holding Limited */ #include "aos/init.h" #include "board.h" #include <aos/errno.h> #include <aos/kernel.h> #include <k_api.h> #include <stdio.h> #include <stdlib.h> int application_start(int argc, char *argv[]) { int count = 0; printf("nano entry here!\r\n"); ...
YifuLiu/AliOS-Things
solutions/helloworld_demo/helloworld.c
C
apache-2.0
424
/* user space */ #ifndef RHINO_CONFIG_USER_SPACE #define RHINO_CONFIG_USER_SPACE 0 #endif
YifuLiu/AliOS-Things
solutions/helloworld_demo/k_app_config.h
C
apache-2.0
106
/* * Copyright (C) 2015-2020 Alibaba Group Holding Limited */ #include <stdio.h> #include <stdlib.h> #include <aos/kernel.h> #include "aos/init.h" #include "board.h" #include <k_api.h> #ifndef AOS_BINS extern int application_start(int argc, char *argv[]); #endif /* If board have no component for example board_xx_i...
YifuLiu/AliOS-Things
solutions/helloworld_demo/maintask.c
C
apache-2.0
1,192
var fanSwitch = 0; var waterSwitch = 0; var beepSwitch = 0; var gpio = require('gpio'); var beep = gpio.open({ id: 'D4' }); var relay1 = gpio.open({ id: 'D3' }); var relay2 = gpio.open({ id: 'D2' }); // GPIO will ouput high in default // Turn off beep and relay immediately beep.writeValue(beepSwitch); relay1.writeVa...
YifuLiu/AliOS-Things
solutions/javascript_demo/agriculture_demo/app.js
JavaScript
apache-2.0
6,792
var i2c = require('i2c'); var calibParamT1; var calibParamT2; var calibParamT3; var calibParamP1; var calibParamP2; var calibParamP3; var calibParamP4; var calibParamP5; var calibParamP6; var calibParamP7; var calibParamP8; var calibParamP9; var calibParamT_FINE; const INVALID_TEMP = -273.15; const INVALID_PRESS = 0;...
YifuLiu/AliOS-Things
solutions/javascript_demo/agriculture_demo/bmp280.js
JavaScript
apache-2.0
5,871
var gpio = require("gpio"); var dht11 = gpio.open({ di: 'dht11' }); function usleep(us) { // TODO } function msleep(ms) { return new Promise(resolve => setTimeout(resolve, ms)); } function gpioSet(level) { dht11.writeValue(level); } function gpioGet() { return dht11.readValue(); } function reset(...
YifuLiu/AliOS-Things
solutions/javascript_demo/agriculture_demo/dht11.js
JavaScript
apache-2.0
2,158
/** * @license GPS.js v0.6.0 26/01/2016 * * Copyright (c) 2016, Robert Eisele (robert@xarg.org) * Dual licensed under the MIT or GPL Version 2 licenses. **/ (function (root) { 'use strict'; var D2R = Math.PI / 180; var collectSats = {}; var lastSeenSat = {}; function updateState(state, data) { ...
YifuLiu/AliOS-Things
solutions/javascript_demo/agriculture_demo/gps.js
JavaScript
apache-2.0
24,532
/* Please insert below lines to app.json file if you want to enable lm75: "I2C0": { "type": "I2C", "port": 0, "addrWidth": 7, "freq": 400000, "mode": "master", "devAddr": 72 }, */ var i2c = require('i2c'); var lm75 = function lm75Init() { lm75 = i2c.op...
YifuLiu/AliOS-Things
solutions/javascript_demo/agriculture_demo/lm75.js
JavaScript
apache-2.0
724
function Modbus(uartPort, dirPort) { var rtn = {} var lastTid = 1 rtn.readTimeout = 500; rtn.readTimeouthandler; rtn.packetBufferLength = 100 rtn.packets = [] rtn.stream = Serial(uartPort, dirPort) rtn.protocal = 'rtu' rtn.read = function (unitId, address, timeout, callback) { ...
YifuLiu/AliOS-Things
solutions/javascript_demo/agriculture_demo/modbus.js
JavaScript
apache-2.0
11,179
import * as adc from 'adc' var vol = adc.open({ id: 'battery', success: function () { console.log('adc: open adc success') }, fail: function () { console.log('adc: open adc failed') } }); var value = vol.readValue() console.log('adc value is ' + value)
YifuLiu/AliOS-Things
solutions/javascript_demo/board/haas-edu-k1/adc.js
JavaScript
apache-2.0
296
import * as dac from 'dac' // led灯 var vol = dac.open({ id: 'voltage', success: function () { console.log('open dac success') }, fail: function () { console.log('open dac failed') } }); vol.writeValue(65536 / 2) var value = vol.readValue(); console.log('voltage value is ' + value...
YifuLiu/AliOS-Things
solutions/javascript_demo/board/haas-edu-k1/dac.js
JavaScript
apache-2.0
340
import * as DS18B20 from 'ds18b20' /* Please add this section into app.json when run this script as app.js. This configuration is designed for haas100 edu k1. { "version": "1.0.0", "io": { "DS18B20": { "type": "GPIO", "port": 4, "dir": "output", "pull"...
YifuLiu/AliOS-Things
solutions/javascript_demo/board/haas-edu-k1/ds18b20.js
JavaScript
apache-2.0
670
import * as fs from 'fs' var path = '/workspace/dev_amp/test.data'; //var path = '/tmp/test.data'; var content = 'this is amp fs test file'; console.log('testing fs write...'); // write file fs.writeSync(path, content); console.log('testing fs read...'); // read file var data = fs.readSync(path); console.log('fs rea...
YifuLiu/AliOS-Things
solutions/javascript_demo/board/haas-edu-k1/fs.js
JavaScript
apache-2.0
393
import * as i2c from 'i2c' var memaddr = 0x18 var msgbuf = [0x10, 0xee] var sensor = i2c.open({ id: 'I2C0', success: function () { console.log('open i2c success') }, fail: function () { console.log('open i2c failed') } }); sensor.write(msgbuf) var value = sensor.read(2) console....
YifuLiu/AliOS-Things
solutions/javascript_demo/board/haas-edu-k1/i2c.js
JavaScript
apache-2.0
593
import * as kv from 'kv' console.log('testing kv...'); var key = 'key-test'; var value = 'this is amp kv test file'; // kv set kv.setStorageSync(key, value); // kv get var val = kv.getStorageSync(key); console.log('kv read: ' + val); // kv remove kv.removeStorageSync(key); console.log('testing kv end');
YifuLiu/AliOS-Things
solutions/javascript_demo/board/haas-edu-k1/kv.js
JavaScript
apache-2.0
310
import * as lcd from 'lcd' var msgbuf = 'this is amp lcd test' lcd.open(); //var value = lcd.show(0, 0, 320, 240, buf); var value = lcd.fill(0, 0, 320, 240, 0xffffffff); console.log('lcd fill value is ' + value) lcd.close();
YifuLiu/AliOS-Things
solutions/javascript_demo/board/haas-edu-k1/lcd.js
JavaScript
apache-2.0
231
// { // "version": "1.0.0", // "io": { // "oled_dc": { // "type": "GPIO", // "port": 28, // "dir": "output", // "pull": "pulldown" // }, // "oled_res": { // "type": "GPIO", // "port": 30, // "dir": "outpu...
YifuLiu/AliOS-Things
solutions/javascript_demo/board/haas-edu-k1/oled.js
JavaScript
apache-2.0
1,217
/* * PWM's options are configured in app.json. { "version": "0.0.1", "io": { "pwm0": { "type": "PWM", "port": 0 }, "timer1": { "type":"TIMER", "port": 0 } }, "debugLevel": "DEBUG" } */ import * as pwm from 'pwm' import...
YifuLiu/AliOS-Things
solutions/javascript_demo/board/haas-edu-k1/pwm.js
JavaScript
apache-2.0
1,706
import * as rtc from 'rtc' rtc.start(); var current_time = rtc.getTime(); console.log('rtc1: current time is ' + current_time); var my_date = new Date(); my_date.setFullYear(2008,7,9); console.log('rtc1: time.getYear() ' + my_date.getYear()); console.log('rtc1: time.getMonth() ' + my_date.getMonth()); console.log('...
YifuLiu/AliOS-Things
solutions/javascript_demo/board/haas-edu-k1/rtc.js
JavaScript
apache-2.0
725
import * as uart from 'uart' /* Uart's options are configured in app.json. { "version": "0.0.1", "io": { "serial": { "type": "UART", "port": 2, "dataWidth":8, "baudRate":115200, "stopBits":0, "flowControl":"disable", "pa...
YifuLiu/AliOS-Things
solutions/javascript_demo/board/haas-edu-k1/uart.js
JavaScript
apache-2.0
1,266
#waring { font-color: #ffffff; font-size: 16px; }
YifuLiu/AliOS-Things
solutions/javascript_demo/board/haas-edu-k1/uipages/page/waring.css
CSS
apache-2.0
55
var ui = require('ui'); if (!(ui && ui.redirectTo)) { throw new Error("ui: [failed] require(\'ui\')"); } Page({ onShow: function() { console.log('enter page onShow'); }, onExit: function() { console.log('enter page onExit'); }, onUpdate: function() { console.log('enter page onUpdate'); ...
YifuLiu/AliOS-Things
solutions/javascript_demo/board/haas-edu-k1/uipages/page/waring.js
JavaScript
apache-2.0
327
import * as wdg from 'wdg' console.log("hello world\n") wdg.start(2000); wdg.feed(); wdg.stop();
YifuLiu/AliOS-Things
solutions/javascript_demo/board/haas-edu-k1/wdg.js
JavaScript
apache-2.0
100
import * as adc from 'adc' var vol = adc.open({ id: 'battery', success: function () { console.log('adc: open adc success') }, fail: function () { console.log('adc: open adc failed') } }); var value = vol.readValue() console.log('adc value is ' + value)
YifuLiu/AliOS-Things
solutions/javascript_demo/board/haas100/adc.js
JavaScript
apache-2.0
296
import * as dac from 'dac' // led灯 var vol = dac.open({ id: 'voltage', success: function () { console.log('open dac success') }, fail: function () { console.log('open dac failed') } }); vol.writeValue(65536 / 2) var value = vol.readValue(); console.log('voltage value is ' + value...
YifuLiu/AliOS-Things
solutions/javascript_demo/board/haas100/dac.js
JavaScript
apache-2.0
340
import * as DS18B20 from 'ds18b20' /* Please add this section into app.json when run this script as app.js. This configuration is designed for haas100 edu k1. { "version": "1.0.0", "io": { "DS18B20": { "type": "GPIO", "port": 4, "dir": "output", "pull"...
YifuLiu/AliOS-Things
solutions/javascript_demo/board/haas100/ds18b20.js
JavaScript
apache-2.0
670
import * as fs from 'fs' var path = '/workspace/dev_amp/test.data'; //var path = '/tmp/test.data'; var content = 'this is amp fs test file'; console.log('testing fs write...'); // write file fs.writeSync(path, content); console.log('testing fs read...'); // read file var data = fs.readSync(path); console.log('fs rea...
YifuLiu/AliOS-Things
solutions/javascript_demo/board/haas100/fs.js
JavaScript
apache-2.0
393
import * as i2c from 'i2c' var memaddr = 0x18 var msgbuf = [0x10, 0xee] var sensor = i2c.open({ id: 'I2C0', success: function () { console.log('open i2c success') }, fail: function () { console.log('open i2c failed') } }); sensor.write(msgbuf) var value = sensor.read(2) console....
YifuLiu/AliOS-Things
solutions/javascript_demo/board/haas100/i2c.js
JavaScript
apache-2.0
593
import * as kv from 'kv' console.log('testing kv...'); var key = 'key-test'; var value = 'this is amp kv test file'; // kv set kv.setStorageSync(key, value); // kv get var val = kv.getStorageSync(key); console.log('kv read: ' + val); // kv remove kv.removeStorageSync(key); console.log('testing kv end');
YifuLiu/AliOS-Things
solutions/javascript_demo/board/haas100/kv.js
JavaScript
apache-2.0
310
import * as lcd from 'lcd' var msgbuf = 'this is amp lcd test' lcd.open(); //var value = lcd.show(0, 0, 320, 240, buf); var value = lcd.fill(0, 0, 320, 240, 0xffffffff); console.log('lcd fill value is ' + value) lcd.close();
YifuLiu/AliOS-Things
solutions/javascript_demo/board/haas100/lcd.js
JavaScript
apache-2.0
231
// { // "version": "1.0.0", // "io": { // "oled_dc": { // "type": "GPIO", // "port": 28, // "dir": "output", // "pull": "pulldown" // }, // "oled_res": { // "type": "GPIO", // "port": 30, // "dir": "outpu...
YifuLiu/AliOS-Things
solutions/javascript_demo/board/haas100/oled.js
JavaScript
apache-2.0
1,525
/* * PWM's options are configured in app.json. * HaaS100 { "version": "0.0.1", "io": { "pwm1": { "type": "PWM", "port": 1 }, "timer1": { "type":"TIMER", "port": 0 } }, "debugLevel": "DEBUG" } */ /* * PWM's options are ...
YifuLiu/AliOS-Things
solutions/javascript_demo/board/haas100/pwm.js
JavaScript
apache-2.0
1,925
import * as rtc from 'rtc' rtc.start(); var current_time = rtc.getTime(); console.log('rtc1: current time is ' + current_time); var my_date = new Date(); my_date.setFullYear(2008,7,9); console.log('rtc1: time.getYear() ' + my_date.getYear()); console.log('rtc1: time.getMonth() ' + my_date.getMonth()); console.log('...
YifuLiu/AliOS-Things
solutions/javascript_demo/board/haas100/rtc.js
JavaScript
apache-2.0
725
import * as uart from 'uart' /* Uart's options are configured in app.json. { "version": "0.0.1", "io": { "serial": { "type": "UART", "port": 2, "dataWidth":8, "baudRate":115200, "stopBits":0, "flowControl":"disable", "pa...
YifuLiu/AliOS-Things
solutions/javascript_demo/board/haas100/uart.js
JavaScript
apache-2.0
1,266
import * as wdg from 'wdg' console.log("hello world\n") wdg.start(2000); wdg.feed(); wdg.stop();
YifuLiu/AliOS-Things
solutions/javascript_demo/board/haas100/wdg.js
JavaScript
apache-2.0
100
import * as adc from 'adc' var vol = adc.open({ id: 'battery', success: function () { console.log('adc: open adc success') }, fail: function () { console.log('adc: open adc failed') } }); var value = vol.readValue() console.log('adc value is ' + value)
YifuLiu/AliOS-Things
solutions/javascript_demo/board/haas600/adc.js
JavaScript
apache-2.0
296
import * as dac from 'dac' // led灯 var vol = dac.open({ id: 'voltage', success: function () { console.log('open dac success') }, fail: function () { console.log('open dac failed') } }); vol.writeValue(65536 / 2) var value = vol.readValue(); console.log('voltage value is ' + value...
YifuLiu/AliOS-Things
solutions/javascript_demo/board/haas600/dac.js
JavaScript
apache-2.0
340
import * as DS18B20 from 'ds18b20' /* Please add this section into app.json when run this script as app.js. This configuration is designed for haas100 edu k1. { "version": "1.0.0", "io": { "DS18B20": { "type": "GPIO", "port": 4, "dir": "output", "pull"...
YifuLiu/AliOS-Things
solutions/javascript_demo/board/haas600/ds18b20.js
JavaScript
apache-2.0
670
import * as fs from 'fs' var path = '/workspace/dev_amp/test.data'; //var path = '/tmp/test.data'; var content = 'this is amp fs test file'; console.log('testing fs write...'); // write file fs.writeSync(path, content); console.log('testing fs read...'); // read file var data = fs.readSync(path); console.log('fs rea...
YifuLiu/AliOS-Things
solutions/javascript_demo/board/haas600/fs.js
JavaScript
apache-2.0
393
import * as i2c from 'i2c' var memaddr = 0x18 var msgbuf = [0x10, 0xee] var sensor = i2c.open({ id: 'I2C0', success: function () { console.log('open i2c success') }, fail: function () { console.log('open i2c failed') } }); sensor.write(msgbuf) var value = sensor.read(2) console....
YifuLiu/AliOS-Things
solutions/javascript_demo/board/haas600/i2c.js
JavaScript
apache-2.0
593
import * as kv from 'kv' console.log('testing kv...'); var key = 'key-test'; var value = 'this is amp kv test file'; // kv set kv.setStorageSync(key, value); // kv get var val = kv.getStorageSync(key); console.log('kv read: ' + val); // kv remove kv.removeStorageSync(key); console.log('testing kv end');
YifuLiu/AliOS-Things
solutions/javascript_demo/board/haas600/kv.js
JavaScript
apache-2.0
310
import * as lcd from 'lcd' var msgbuf = 'this is amp lcd test' lcd.open(); //var value = lcd.show(0, 0, 320, 240, buf); var value = lcd.fill(0, 0, 320, 240, 0xffffffff); console.log('lcd fill value is ' + value) lcd.close();
YifuLiu/AliOS-Things
solutions/javascript_demo/board/haas600/lcd.js
JavaScript
apache-2.0
231
// { // "version": "1.0.0", // "io": { // "oled_dc": { // "type": "GPIO", // "port": 28, // "dir": "output", // "pull": "pulldown" // }, // "oled_res": { // "type": "GPIO", // "port": 30, // "dir": "outpu...
YifuLiu/AliOS-Things
solutions/javascript_demo/board/haas600/oled.js
JavaScript
apache-2.0
1,525
/* * PWM's options are configured in app.json. { "version": "0.0.1", "io": { "pwm1": { "type": "PWM", "port": 1 }, "timer1": { "type":"TIMER", "port": 1 } }, "debugLevel": "DEBUG" } */ import * as pwm from 'pwm' import * as timer from 'TIMER' co...
YifuLiu/AliOS-Things
solutions/javascript_demo/board/haas600/pwm.js
JavaScript
apache-2.0
1,453
import * as rtc from 'rtc' rtc.start(); var current_time = rtc.getTime(); console.log('rtc1: current time is ' + current_time); var my_date = new Date(); my_date.setFullYear(2008,7,9); console.log('rtc1: time.getYear() ' + my_date.getYear()); console.log('rtc1: time.getMonth() ' + my_date.getMonth()); console.log('...
YifuLiu/AliOS-Things
solutions/javascript_demo/board/haas600/rtc.js
JavaScript
apache-2.0
725
import * as uart from 'uart' /* Uart's options are configured in app.json. { "version": "0.0.1", "io": { "serial": { "type": "UART", "port": 2, "dataWidth":8, "baudRate":115200, "stopBits":0, "flowControl":"disable", "pa...
YifuLiu/AliOS-Things
solutions/javascript_demo/board/haas600/uart.js
JavaScript
apache-2.0
1,266
import * as wdg from 'wdg' console.log("hello world\n") wdg.start(2000); wdg.feed(); wdg.stop();
YifuLiu/AliOS-Things
solutions/javascript_demo/board/haas600/wdg.js
JavaScript
apache-2.0
100
import * as netmgr from 'netmgr'; import * as iot from 'iot'; import * as ulog from 'ulog'; var productKey = '*****'; /* 输入你的product key*/ var deviceName = '*****'; /* 输入你的device name */ var deviceSecret = '*****'; /* 输入你的deviceSecret */ var device; /* set different log level */ /*设置本地日志输出等级为debug*/ ulog...
YifuLiu/AliOS-Things
solutions/javascript_demo/common/ulog_demo.js
JavaScript
apache-2.0
2,319
import * as netmgr from 'netmgr'; import * as oss from 'oss'; console.log('hello amp!'); var network = netmgr.openNetMgrClient({ name: '/dev/wifi0' }); var status; status = network.getState(); console.log('status is ' + status); network.connect({ ssid: 'own_ssid', //请替换为自己的热点ssid password: 'own_passw...
YifuLiu/AliOS-Things
solutions/javascript_demo/network/oss.js
JavaScript
apache-2.0
1,266
import * as netmgr from 'netmgr'; console.log('hello amp!'); var network = netmgr.openNetMgrClient({ name: '/dev/wifi0' }); var status; status = network.getState(); console.log('status is ' + status); network.connect({ ssid: 'own_ssid', //请替换为自己的热点ssid password: 'own_password' //请替换为自己热点的密码 }); n...
YifuLiu/AliOS-Things
solutions/javascript_demo/network/wifi.js
JavaScript
apache-2.0
504
var appota = require('appota'); var iot = require('iot'); /* device info */ var productKey = ''; /* your productKey */ var deviceName = ''; /* your deviceName */ var deviceSecret = ''; /* your deviceSecret */ var module_name = 'default'; var default_ver = '1.0.0'; var ota; var status; /* download info */ v...
YifuLiu/AliOS-Things
solutions/javascript_demo/ota_demo/ota_4g.js
JavaScript
apache-2.0
2,258
import * as netmgr from 'netmgr'; import * as iot from 'iot'; import * as appota from 'appota' //此脚本包含了wifi连网功能,仅适合haas100、haaseduk1 var productKey = ''; /* your productKey */ var deviceName = ''; /* your deviceName */ var deviceSecret = ''; /* your deviceSecret */ var device; var module_name = 'default'; ...
YifuLiu/AliOS-Things
solutions/javascript_demo/ota_demo/ota_wifi.js
JavaScript
apache-2.0
2,901
CPRE := @ ifeq ($(V),1) CPRE := VERB := --verbose endif MK_GENERATED_IMGS_PATH:=generated PRODUCT_BIN:=product .PHONY:startup startup: all all: @echo "Build Solution by $(BOARD) " $(CPRE) scons $(VERB) --board=$(BOARD) $(MULTITHREADS) $(MAKEFLAGS) @echo ucloud ai demo build Done @echo [INFO] Create bin files # ...
YifuLiu/AliOS-Things
solutions/kws_demo/Makefile
Makefile
apache-2.0
882
#! /bin/env python from aostools import Make # defconfig = Make(elf='yoc.elf', objcopy='generated/data/prim', objdump='yoc.asm') defconfig = Make(elf='aos.elf', objcopy='binary/kws_demo@haas100.bin') Export('defconfig') defconfig.build_components()
YifuLiu/AliOS-Things
solutions/kws_demo/SConstruct
Python
apache-2.0
253
#!/usr/bin/env python3 import os import sys import getpass import shutil #!/usr/bin/env python3 import os import sys import getpass import shutil comp_path = sys.path[0] print("comp_path:") print(comp_path) # original folder src_mp3_path = comp_path + "/resources/mp3" # new folder data_path = comp_path + "/../../...
YifuLiu/AliOS-Things
solutions/kws_demo/cp_resources.py
Python
apache-2.0
644
#include "kws.h" #include "ulog/ulog.h" #include "aiagent_service.h" #include "aiagent_common.h" #if (BOARD_HAAS100 == 1) #include "led.h" #endif #include "uvoice_init.h" #include "uvoice_types.h" #include "uvoice_event.h" #include "uvoice_player.h" #include "uvoice_recorder.h" #include "uvoice_os.h" #define TAG "kws...
YifuLiu/AliOS-Things
solutions/kws_demo/kws.c
C
apache-2.0
4,412
#ifndef __KWS_H__ #define __KWS_H__ #include <stdint.h> #include <stdio.h> extern int audio_install_codec_driver(); int32_t kws_init(void); int32_t kws_uninit(void); #endif
YifuLiu/AliOS-Things
solutions/kws_demo/kws.h
C
apache-2.0
177
/* * Copyright (c) 2014-2016 Alibaba Group. All rights reserved. * License-Identifier: Apache-2.0 * * 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...
YifuLiu/AliOS-Things
solutions/kws_demo/main.c
C
apache-2.0
980
/* * Copyright (C) 2015-2020 Alibaba Group Holding Limited */ #include <stdio.h> #include <stdlib.h> #include <aos/kernel.h> #include "aos/init.h" #include "board.h" #include <k_api.h> #ifndef AOS_BINS extern int application_start(int argc, char *argv[]); #endif /* If board have no component for example board_xx_i...
YifuLiu/AliOS-Things
solutions/kws_demo/maintask.c
C
apache-2.0
1,362
CPRE := @ ifeq ($(V),1) CPRE := VERB := --verbose endif .PHONY:startup startup: all all: @echo "Build Solution by $(BOARD) " $(CPRE) scons $(VERB) --board=$(BOARD) -j4 @echo AOS SDK Done sdk: $(CPRE) aos sdk .PHONY:clean clean: $(CPRE) scons -c ifeq ($(OS), Windows_NT) $(CPRE) if exist aos_sdk rmdir /s /q aos...
YifuLiu/AliOS-Things
solutions/linkkit_genie_demo/Makefile
Makefile
apache-2.0
557
#! /bin/env python from aostools import Make # default elf is out/<solution>@<board>.elf, and default objcopy is out/<solution>@<board>.bin # defconfig = Make(elf='out/<solution>@<board>.elf', objcopy='out/<solution>@<board>.bin') defconfig = Make() Export('defconfig') defconfig.build_components()
YifuLiu/AliOS-Things
solutions/linkkit_genie_demo/SConstruct
Python
apache-2.0
303
/* * Copyright (C) 2015-2020 Alibaba Group Holding Limited */ #include "aos/init.h" #include "board.h" #include <aos/errno.h> #include <aos/kernel.h> #include <k_api.h> #include <stdio.h> #include <string.h> #include <stdlib.h> #include "netmgr.h" #include "linkkit/wifi_provision_api.h" #include "linkkit/infra/infra...
YifuLiu/AliOS-Things
solutions/linkkit_genie_demo/genie_demo.c
C
apache-2.0
14,946
/* user space */ #ifndef RHINO_CONFIG_USER_SPACE #define RHINO_CONFIG_USER_SPACE 0 #endif
YifuLiu/AliOS-Things
solutions/linkkit_genie_demo/k_app_config.h
C
apache-2.0
106
/* * Copyright (C) 2015-2020 Alibaba Group Holding Limited */ #include <stdio.h> #include <stdlib.h> #include <aos/kernel.h> #include "aos/init.h" #include "board.h" #include <k_api.h> #ifndef AOS_BINS extern int application_start(int argc, char *argv[]); #endif /* If board have no component for example board_xx_i...
YifuLiu/AliOS-Things
solutions/linkkit_genie_demo/maintask.c
C
apache-2.0
1,192
CPRE := @ ifeq ($(V),1) CPRE := VERB := --verbose endif .PHONY:startup startup: all all: @echo "Build Solution by $(BOARD) " $(CPRE) scons $(VERB) --board=$(BOARD) $(MULTITHREADS) $(MAKEFLAGS) @echo AOS SDK Done sdk: $(CPRE) aos sdk .PHONY:clean clean: $(CPRE) scons -c --board=$(BOARD) ifeq ($(OS), Windows_NT)...
YifuLiu/AliOS-Things
solutions/linksdk_demo/Makefile
Makefile
apache-2.0
599
#! /bin/env python from aostools import Make # default elf is out/<solution>@<board>.elf, and default objcopy is out/<solution>@<board>.bin # defconfig = Make(elf='out/<solution>@<board>.elf', objcopy='out/<solution>@<board>.bin') defconfig = Make() Export('defconfig') defconfig.build_components()
YifuLiu/AliOS-Things
solutions/linksdk_demo/SConstruct
Python
apache-2.0
303
/* * Copyright (C) 2015-2020 Alibaba Group Holding Limited */ #include <stdio.h> #include <stdlib.h> #include <aos/kernel.h> #include "aos/init.h" #include "board.h" #include <k_api.h> #ifndef AOS_BINS extern int application_start(int argc, char *argv[]); #endif /* * If board have no component for example board_xx...
YifuLiu/AliOS-Things
solutions/linksdk_demo/maintask.c
C
apache-2.0
1,324
/* * 这个例程演示了用SDK配置MQTT参数并建立连接, 之后创建2个线程 * * + 一个线程用于保活长连接 * + 一个线程用于接收消息, 并在有消息到达时进入默认的数据回调, 在连接状态变化时进入事件回调 * * 接着演示了在MQTT连接上进行属性上报, 事件上报, 以及处理收到的属性设置, 服务调用, 取消这些代码段落的注释即可观察运行效果 * * 需要用户关注或修改的部分, 已经用 TODO 在注释中标明 * */ #include <stdio.h> #include <string.h> #include <unistd.h> #include <aos/kernel.h> #include...
YifuLiu/AliOS-Things
solutions/linksdk_demo/separate_app/data_model_basic_demo.c
C
apache-2.0
16,372
/* * Copyright (C) 2015-2020 Alibaba Group Holding Limited */ /** * @file main.c * * This file includes the entry code of link sdk related demo * */ #include <string.h> #include <stdio.h> #include <aos/kernel.h> #include "netmgr.h" #include <uservice/uservice.h> #include <uservice/eventid.h> extern int demo_ma...
YifuLiu/AliOS-Things
solutions/linksdk_demo/separate_app/main.c
C
apache-2.0
1,321
CPRE := @ ifeq ($(V),1) CPRE := VERB := --verbose endif .PHONY:startup startup: all all: @echo "Build Solution by $(BOARD) " $(CPRE) scons $(VERB) --board=$(BOARD) $(MULTITHREADS) $(MAKEFLAGS) @echo AOS SDK Done sdk: $(CPRE) aos sdk .PHONY:clean clean: $(CPRE) scons -c --board=$(BOARD) $(CPRE) find . -name "*...
YifuLiu/AliOS-Things
solutions/linksdk_gateway_demo/Makefile
Makefile
apache-2.0
397
#! /bin/env python from aostools import Make # default elf is out/<solution>@<board>.elf, and default objcopy is out/<solution>@<board>.bin # defconfig = Make(elf='out/<solution>@<board>.elf', objcopy='out/<solution>@<board>.bin') defconfig = Make() Export('defconfig') defconfig.build_components()
YifuLiu/AliOS-Things
solutions/linksdk_gateway_demo/SConstruct
Python
apache-2.0
303
/* * Copyright (C) 2015-2020 Alibaba Group Holding Limited */ /** * @file main.c * * This file includes the entry code of link sdk related demo * */ #include <string.h> #include <stdio.h> #include <aos/kernel.h> #include "ulog/ulog.h" #include "netmgr.h" #include <uservice/uservice.h> #include <uservice/eventid...
YifuLiu/AliOS-Things
solutions/linksdk_gateway_demo/main.c
C
apache-2.0
1,351
/* * Copyright (C) 2015-2020 Alibaba Group Holding Limited */ #include <stdio.h> #include <stdlib.h> #include <aos/kernel.h> #include "aos/init.h" #include "board.h" #include <k_api.h> #ifndef AOS_BINS extern int application_start(int argc, char *argv[]); #endif /* If board have no component for example board_xx_i...
YifuLiu/AliOS-Things
solutions/linksdk_gateway_demo/maintask.c
C
apache-2.0
1,248
/* * 这个例程演示了用SDK代理子设备,之后创建2个线程 * * + 一个线程用于保活长连接 * + 一个线程用于接收消息, 并在有消息到达时进入默认的数据回调, 在连接状态变化时进入事件回调 * * 接着演示了在MQTT连接上进行属性上报, 事件上报, 以及处理收到的属性设置, 服务调用, 取消这些代码段落的注释即可观察运行效果 * * 需要用户关注或修改的部分, 已经用 TODO 在注释中标明 * */ #include <stdio.h> #include <string.h> #include <unistd.h> #include <aos/kernel.h> #include "aiot_st...
YifuLiu/AliOS-Things
solutions/linksdk_gateway_demo/subdev_basic_demo.c
C
apache-2.0
15,751
CPRE := @ ifeq ($(V),1) CPRE := VERB := --verbose endif .PHONY:startup startup: all all: @echo "Build Solution by $(BOARD) " $(CPRE) scons $(VERB) --board=$(BOARD) $(MULTITHREADS) $(MAKEFLAGS) @echo AOS SDK Done sdk: $(CPRE) aos sdk .PHONY:clean clean: $(CPRE) scons -c --board=$(BOARD) $(CPRE) find . -name "*...
YifuLiu/AliOS-Things
solutions/lora_p2p_demo/Makefile
Makefile
apache-2.0
397
#! /bin/env python from aostools import Make # defconfig = Make(elf='yoc.elf', objcopy='generated/data/prim', objdump='yoc.asm') defconfig = Make(elf='aos.elf', objcopy='binary/helloworld_demo@haas100.bin') Export('defconfig') defconfig.build_components()
YifuLiu/AliOS-Things
solutions/lora_p2p_demo/SConstruct
Python
apache-2.0
260
/* * Copyright (C) 2015-2020 Alibaba Group Holding Limited */ #include <string.h> #include "board.h" #include "radio.h" #include "aos/hal/gpio.h" #include "aos/hal/spi.h" #include "sx126x-board.h" #include "aos/hal/timer.h" #include "ulog/ulog.h" #define TRANS_MODE_TX (0xEF) #define TRANS_MODE_RX (0xF...
YifuLiu/AliOS-Things
solutions/lora_p2p_demo/demo.c
C
apache-2.0
3,592
/* * Copyright (C) 2015-2020 Alibaba Group Holding Limited */ #include <stdio.h> #include <stdlib.h> #include <aos/kernel.h> #include "aos/init.h" #include "board.h" #include <k_api.h> #ifndef AOS_BINS extern int application_start(int argc, char *argv[]); #endif /* If board have no component for example board_xx_i...
YifuLiu/AliOS-Things
solutions/lora_p2p_demo/maintask.c
C
apache-2.0
1,192
/*! * \file radio.c * * \brief Radio driver API definition * * \copyright Revised BSD License, see section \ref LICENSE. * * \code * ______ _ * / _____) _ | | * ( (____ _____ ____ _| |_ _____ ____| |__ ...
YifuLiu/AliOS-Things
solutions/lora_p2p_demo/radio.c
C
apache-2.0
42,006
/*! * \file radio.h * * \brief Radio driver API definition * * \copyright Revised BSD License, see section \ref LICENSE. * * \code * ______ _ * / _____) _ | | * ( (____ _____ ____ _| |_ _____ ____| |__ ...
YifuLiu/AliOS-Things
solutions/lora_p2p_demo/radio.h
C
apache-2.0
16,114
/*! * \file sx126x-board.h * * \brief Target board SX126x driver implementation * * \copyright Revised BSD License, see section \ref LICENSE. * * \code * ______ _ * / _____) _ | | * ( (____ _____ ____ _| ...
YifuLiu/AliOS-Things
solutions/lora_p2p_demo/sx126x-board.h
C
apache-2.0
4,563
/*! * \file sx1261mbxbas-board.c * * \brief Target board SX1261MBXBAS shield driver implementation * * \copyright Revised BSD License, see section \ref LICENSE. * * \code * ______ _ * / _____) _ | | * ( (_...
YifuLiu/AliOS-Things
solutions/lora_p2p_demo/sx126x-haas.c
C
apache-2.0
8,674
/*! * \file sx126x.c * * \brief SX126x driver implementation * * \copyright Revised BSD License, see section \ref LICENSE. * * \code * ______ _ * / _____) _ | | * ( (____ _____ ____ _| |_ _____ ____| |__...
YifuLiu/AliOS-Things
solutions/lora_p2p_demo/sx126x.c
C
apache-2.0
22,099
/*! * \file sx126x.h * * \brief SX126x driver implementation * * \copyright Revised BSD License, see section \ref LICENSE. * * \code * ______ _ * / _____) _ | | * ( (____ _____ ____ _| |_ _____ ____| |__...
YifuLiu/AliOS-Things
solutions/lora_p2p_demo/sx126x.h
C
apache-2.0
39,069
CPRE := @ ifeq ($(V),1) CPRE := VERB := --verbose endif .PHONY:startup startup: all all: @echo "Build Solution by $(BOARD) " $(CPRE) scons $(VERB) --board=$(BOARD) $(MULTITHREADS) $(MAKEFLAGS) @echo AOS SDK Done sdk: $(CPRE) aos sdk .PHONY:clean clean: $(CPRE) scons -c --board=$(BOARD) ifeq ($(OS), Windows_NT)...
YifuLiu/AliOS-Things
solutions/miniapp_agent_demo/Makefile
Makefile
apache-2.0
599
#! /bin/env python from aostools import Make # default elf is out/<solution>@<board>.elf, and default objcopy is out/<solution>@<board>.bin # defconfig = Make(elf='out/<solution>@<board>.elf', objcopy='out/<solution>@<board>.bin') defconfig = Make() Export('defconfig') defconfig.build_components()
YifuLiu/AliOS-Things
solutions/miniapp_agent_demo/SConstruct
Python
apache-2.0
303
/* * Copyright (C) 2015-2020 Alibaba Group Holding Limited */ #include <stdio.h> #include <stdlib.h> #include <aos/kernel.h> #include "aos/init.h" #include "board.h" #include <k_api.h> #ifndef AOS_BINS extern int application_start(int argc, char *argv[]); #endif /* * If board have no component for example board_x...
YifuLiu/AliOS-Things
solutions/miniapp_agent_demo/maintask.c
C
apache-2.0
1,525
App({ globalData: { sysname: '', }, onLaunch(options) { let sysInfo = my.getSystemInfoSync() let sysname = sysInfo.platform.toLowerCase() if (sysname.includes('ios') || sysname.includes('iphone')) { this.globalData.sysname = 'ios' } else { this.globalData.sysname = 'android' } ...
YifuLiu/AliOS-Things
solutions/miniapp_agent_demo/miniapp/app.js
JavaScript
apache-2.0
470
Page({ data: {}, onLoad() { }, scan() { my.scan({ scanType: ['qrCode'], success: (res) => { console.log(res.code) if (/.*\.vapp.cloudhost.link/.test(res.code)) { my.alert({ contant: "请扫描正确的预览二维码" }); return; } my.navigateTo({ url: '/pages/webview...
YifuLiu/AliOS-Things
solutions/miniapp_agent_demo/miniapp/pages/linkIot/linkIot.js
JavaScript
apache-2.0
421
var app = getApp(); var ble_util = require("../../utils/ble_util.js") var hex_util = require("../../utils/hex_util.js") Page({ data: { ProductKey: '', DeviceName: '', DeviceSecret: '', link_lp_devices: [], selected_device_index: 0, LinkLpState: { scanning: false, linking: false,...
YifuLiu/AliOS-Things
solutions/miniapp_agent_demo/miniapp/pages/linkLP/linkLP.js
JavaScript
apache-2.0
6,347
var app = getApp(); var ble_util = require("../../utils/ble_util.js") var hex_util = require("../../utils/hex_util.js") Page({ data: { ssid: '', ssidList: [], password: '', net_config_devices: [], selected_device_index: 0, netCfgState: { scanning: false, configing: false, },...
YifuLiu/AliOS-Things
solutions/miniapp_agent_demo/miniapp/pages/netCfg/netCfg.js
JavaScript
apache-2.0
10,292
export default { getDeviceNameList(devices) { let device_name_list = [] for(let index = 0; index < devices.length; index++){ device_name_list.push(devices[index].localName) } console.log(device_name_list) return device_name_list } }
YifuLiu/AliOS-Things
solutions/miniapp_agent_demo/miniapp/pages/netCfg/netCfg.sjs
JavaScript
apache-2.0
264
Page({ data: { link: '' }, onLoad(query) { console.warn(decodeURIComponent(query.address)) this.setData({ link: decodeURIComponent(query.address) }) }, });
YifuLiu/AliOS-Things
solutions/miniapp_agent_demo/miniapp/pages/webview/webview.js
JavaScript
apache-2.0
176
const UUID_VENDOR_SERVICE = { "android": "0000FFA0-0000-1000-8000-00805F9B34FB", "ios": "FFA0" } const UUID_VENDOR_CHAR_READ = { "android": "0000FFA1-0000-1000-8000-00805F9B34FB", "ios": "FFA1" } const UUID_VENDOR_CHAR_WRITE = { "android": "0000FFA2-0000-1000-8000-00805F9B34FB", "ios": "FFA2" } const UUID_VENDOR_CHAR_N...
YifuLiu/AliOS-Things
solutions/miniapp_agent_demo/miniapp/utils/ble_util.js
JavaScript
apache-2.0
3,652
function String2hexString(str) { var val = ""; for (var i = 0; i < str.length; i++) { if (val == "") val = str.charCodeAt(i).toString(16); else val += str.charCodeAt(i).toString(16); } return val } function hexString2String(hex) { var arr = hex.split("") var out = "" for (var i = 0; i...
YifuLiu/AliOS-Things
solutions/miniapp_agent_demo/miniapp/utils/hex_util.js
JavaScript
apache-2.0
577
CPRE := @ ifeq ($(V),1) CPRE := VERB := --verbose endif MK_GENERATED_IMGS_PATH:=generated PRODUCT_BIN:=product .PHONY:startup startup: all all: @echo "Build Solution by $(BOARD) " $(CPRE) scons $(VERB) --board=$(BOARD) $(MULTITHREADS) $(MAKEFLAGS) @echo YoC SDK Done @echo [INFO] Create bin files # $(CPRE) $(PRO...
YifuLiu/AliOS-Things
solutions/ota_demo/Makefile
Makefile
apache-2.0
868
#! /bin/env python from aostools import Make defconfig = Make() Export('defconfig') defconfig.build_components()
YifuLiu/AliOS-Things
solutions/ota_demo/SConstruct
Python
apache-2.0
117
/* user space */ #ifndef RHINO_CONFIG_USER_SPACE #define RHINO_CONFIG_USER_SPACE 0 #endif
YifuLiu/AliOS-Things
solutions/ota_demo/k_app_config.h
C
apache-2.0
106
/* * Copyright (C) 2015-2020 Alibaba Group Holding Limited */ #include <stdio.h> #include <stdlib.h> #include <aos/kernel.h> #include "aos/init.h" #include "board.h" #include <k_api.h> #ifndef AOS_BINS extern int application_start(int argc, char *argv[]); #endif /* If board have no component for example board_xx_i...
YifuLiu/AliOS-Things
solutions/ota_demo/maintask.c
C
apache-2.0
1,192