Hardware as a Service 硬件即服务,提供物联网软硬件的统一开发框架和服务。

HaaS轻应用框架

HaaS

Hardware as a Service 硬件即服务,提供物联网软硬件的统一开发框架和服务。

轻应用框架

提供了支撑轻应用运行所需的全套基础设施。
是一套集成了包括硬件抽象、网络接口、物联网组件、运行时引擎、对象封装等功能的应用软件框架。

轻应用之所以,是因为有如下特点:

  • 硬件设备的开发可以不再依赖嵌入式软件技术栈,调用简洁的 API 即可操控硬件行为。
  • 采用解释型编程语言JavaScript,整个开发过程无需搭建嵌入式开发环境,也无需编译、烧写。
  • 支持一键热更新推送应用代码到硬件,极致开发体验。

开发说明

应用开发者

如果您希望开发轻应用,可以移步HaaS轻应用 - 使用文档,无需理解具体的实现原理。

系统和框架开发者

如果希望修改框架或移植到您的硬件平台,可以参考下述介绍。

目录结构

.
├── aos.mk               // 在AliOS Things上的编译脚本
├── Makefile             // 在Linux模拟环境的编译脚本
├── adapter              // 硬件和系统适配层
│   │── include          // 适配层接口定义
│   └── platform         // 不同平台的适配层实现
│       ├── aos-haas100  // 在HaaS100上基于AliOS Things的适配层参考实现
│       └── linux        // 在Linux模拟环境的适配层参考实现
├── components           // 功能组件
├── engine               // 运行时引擎
├── entry                // 框架主入口
├── example              // 示例代码
├── libjs                // 对象封装
├── main                 // 框架主任务
├── services             // 框架内部服务
├── test                 // 测试代码
├── tools                // 编译工具
└── utils                // 依赖的基础库

注:aos-haas100是在HaaS100上基于AliOS Things的适配层参考实现。

移植说明

移植流程

  1. adapter/platform/ 下新增一个目标硬件平台的目录。
  2. 实现 adapter/include/ 下定义的适配层接口。运行框架核心功能,需要完成以下标注(关键)的接口适配。
  3. 修改Makefile并交叉编译,或参考Makefile将源码添加到目标硬件平台的项目环境中完成编译。

适配层说明

adapter
├── include
│   ├── amp_fs.h             // 文件系统 (关键)
│   ├── amp_httpc.h          // HTTP客户端
│   ├── amp_kv.h             // 键值对存储 (关键)
│   ├── amp_location.h       // 位置服务
│   ├── amp_network.h        // 网络管理 (关键)
│   ├── amp_ota.h            // OTA系统升级
│   ├── amp_pcm.h            // 音频PCM读写
│   ├── amp_pm.h             // 电源管理
│   ├── amp_socket.h         // Socket (关键)
│   ├── amp_system.h         // 系统 (关键)
│   ├── amp_tcp.h            // TCP (关键)
│   ├── amp_tts.h            // TTS语音
│   ├── amp_udp.h            // UDP (关键)
│   └── peripheral           // 硬件外设
│       ├── amp_hal_adc.h
│       ├── amp_hal_can.h
│       ├── amp_hal_dac.h
│       ├── amp_hal_flash.h
│       ├── amp_hal_gpio.h
│       ├── amp_hal_i2c.h
│       ├── amp_hal_pwm.h
│       ├── amp_hal_rtc.h
│       ├── amp_hal_spi.h
│       ├── amp_hal_timer.h
│       ├── amp_hal_uart.h   // 串口 (关键)
│       └── amp_hal_wdg.h
└── platform
    ├── aos-haas100
    └── linux

致谢

HaaS轻应用站在巨人的肩上,由关键的开源项目强力驱动:

  • AliOS Things - 开源物联网操作系统
  • QuickJS - Bellard出品,不解释
  • Duktape - 资源开销与性能兼备的JavaScript引擎

HaaS轻应用也参考了以下优秀的开源项目:

  • Mongoose-OS - 采用mJS引擎的IoT固件开发框架
  • Espruino - 可以在MCU上运行的JavaScript框架
  • Johnny-Five - 用于搭建机器人和IoT的JavaScript框架
  • Cylon.js - 支持了40+种硬件平台的机器人和IoT编程框架

License

Apache License 2.0

Owner
Alibaba Cloud
More Than Just Cloud
Alibaba Cloud
Similar Resources

New generation message broker service

New generation message broker service

Push1st Push1st is open source multiple protocol PUB/SUB message broker server (Pusher, MQTT, RAW WebSocket). Key features Suitable for distributed on

Jan 18, 2022

This is the repo that hosts the code for Mozilla's translation service

Translation service HTTP service that uses bergamot-translator and compressed neural machine translation models for fast inference on CPU. Running loc

Sep 7, 2022

Serverless SQLite database read from and write to Object Storage Service, run on FaaS platform.

serverless-sqlite Serverless SQLite database read from and write to Object Storage Service, run on FaaS platform. NOTES: This repository is still in t

May 12, 2022

Cloud-native high-performance edge/middle/service proxy

Cloud-native high-performance edge/middle/service proxy

Cloud-native high-performance edge/middle/service proxy Envoy is hosted by the Cloud Native Computing Foundation (CNCF). If you are a company that wan

Nov 25, 2022

An example spatial lookup service. In-memory reverse geocode backed by GEOS.

Spatial Lookup Web Service This GEOS example program demonstrates the use of the STRtree index and PreparedGeometry to create a high-performance in-me

May 6, 2022

Determine if the WebClient Service (WebDAV) is running on a remote system

GetWebDAVStatus Small project to determine if the Web Client service (WebDAV) is running on a remote system by checking for the presence of the DAV RP

Nov 28, 2022

A basic, MQTT integration point service for the Waveshare 8 channel relay board

relayboard-control A basic, MQTT integration point service for the Waveshare 8 channel relay board. This was built specifically for our own home's rel

Mar 22, 2022

ServiceLocator - Service Locator Pattern Header-Only Library

Service Locator Very fast, header-only C++ Service Locator Pattern library What is the Service Locator Pattern The Service Locator Pattern is a design

Feb 21, 2022

Arduino client for the Serial To TCP Bridge Protocol PC side service

Arduino Serial to TCP Bridge Client Arduino client for the Serial To TCP Bridge Protocol gateway service. Open a TCP connection to a server from the A

Apr 12, 2022

Use eBPF to speed up your Service Mesh like crossing an Einstein-Rosen Bridge.

merbridge Use eBPF to speed up your Service Mesh like crossing an Einstein-Rosen Bridge. Usage You just only need to run the following command to your

Nov 22, 2022

Connecting an ESP8266 to a Google Calendar service to turn an useless "On Air" sign into a smart meeting indicator

Connecting an ESP8266 to a Google Calendar service to turn an useless

ESP8266-GoogleCalendar Intro I had an useless "On Air" sign hanging around my home, and I thought it would be cool to connect it to my Google Calendar

Jan 20, 2022

Implements a Windows service (in a DLL) that removes the rounded corners for windows in Windows 11

ep_dwm Implements a Windows service that removes the rounded corners for windows in Windows 11. Tested on Windows 11 build 22000.434. Pre-compiled bin

Nov 22, 2022

A WiFi-enabled microcontroller capable of communicating with web-based service APIs for fast prototyping applications.

A WiFi-enabled microcontroller capable of communicating with web-based service APIs for fast prototyping applications.

Mar 9, 2022

Allows you to observe the status of your DotA 2 (Defense of the Ancients 2) match within the Discord, through the Rich Presence service. 🎮

Allows you to observe the status of your DotA 2 (Defense of the Ancients 2) match within the Discord, through the Rich Presence service. 🎮

DotA 2 RPC (dota2-rpc-client) Allows you to observe the status of your DotA 2 (Defense of the Ancients 2) match within the Discord, through the Rich P

Nov 26, 2022

The libdispatch Project, (a.k.a. Grand Central Dispatch), for concurrency on multicore hardware

Grand Central Dispatch Grand Central Dispatch (GCD or libdispatch) provides comprehensive support for concurrent code execution on multicore hardware.

Dec 1, 2022

I have created a lower cost approximation of the Toyota PASTA:Portable Automotive Testbed with Adaptability using consumer hardware and Arduino based software

I have created a lower cost approximation of the Toyota PASTA:Portable Automotive Testbed with Adaptability using consumer hardware and Arduino based software

value-pasta-auto I have created a lower cost approximation of the Toyota PASTA:Portable Automotive Testbed with Adaptability using consumer hardware a

Jul 13, 2022

Mystikos is a set of tools for running applications in a hardware trusted execution environment (TEE)

Mystikos is a set of tools for running applications in a hardware trusted execution environment (TEE)

Mystikos is a set of tools for running applications in a hardware trusted execution environment (TEE). The current release supports Intel ® SGX while other TEEs may be supported in future releases. Linux is also a supported target, though only suitable for testing purposes as it provides no additional protection.

Nov 21, 2022

This is an example of Artificial Intelligence (AI) calculations on a very cheap hardware.

This is an example of Artificial Intelligence (AI) calculations on a very cheap hardware.

This is an example of Artificial Intelligence (AI) calculations on a very cheap hardware.

Nov 29, 2022
RetroWave is a hardware sound board series that uses vintage sound chips and works with modern hardware.
RetroWave is a hardware sound board series that uses vintage sound chips and works with modern hardware.

RetroWave Authentic sounds from vintage sound chips, on modern hardware! Introduction RetroWave is a hardware sound board series that uses vintage sou

Oct 25, 2022
The InitWare Suite of Middleware allows you to manage services and system resources as logical entities called units. Its main component is a service management ("init") system.
The InitWare Suite of Middleware allows you to manage services and system resources as logical entities called units. Its main component is a service management (

InitWare isn't ready to use yet!! Unless you are doing so for fun, to experiment, or to contribute, you most likely do not want to try to install Init

Nov 20, 2022
CLI Application that provides the Freedesktop Secret Service using Pass as its backend!

pass-secrets CLI Application that provides the Freedesktop Secret Service using Pass as its backend! Status Currently working to store secrets with pr

Sep 13, 2022
New lateral movement technique by abusing Windows Perception Simulation Service to achieve DLL hijacking code execution.
New lateral movement technique by abusing Windows Perception Simulation Service to achieve DLL hijacking code execution.

BOF - Lateral movement technique by abusing Windows Perception Simulation Service to achieve DLL hijacking ServiceMove is a POC code for an interestin

Nov 14, 2022
Demonstrates basic advantages of integrating the Data Distribution Service (DDS) and Time-Sensitive Networking (TSN) Ethernet.
Demonstrates basic advantages of integrating the Data Distribution Service (DDS) and Time-Sensitive Networking (TSN) Ethernet.

ROS2-DDS-TSN integration demo This repository demonstrates basic advantages of integrating the Data Distribution Service (DDS) and Time-Sensitive Netw

Nov 19, 2022
This is Script tools from all attack Denial of service by C programming

RemaxDos Paltfrom Attack RemaxDos This is Script tools from all attack Denial of service Remax Box Team !. Features ! Cam overflow Syn Flooding. Smurf

Sep 11, 2022
A proxy service of incremental log of OceanBase

OceanBase Migration Serivce LogProxy OceanBase增量日志代理服务,是 OMS 的一部分。基于 liboblog, 以服务的形式,提供实时增量链路接入和管理能力,方便应用接入OceanBase增量日志;能够解决网络隔离的情况下,订阅增量日志的需求;并提供多种

Nov 25, 2022
Basic Windows Service managment API

SvcManager Basic Windows Service managment API A simple C++ Windows Service management API built my me. To be honest, I havent committed anything in a

Sep 8, 2022