Contents Menu Expand Light mode Dark mode Auto light/dark mode
LuatOS 文档
(NEW) Go to English site
前往中文站点
Discord
Light Logo Dark Logo

💁 LuatOS 介绍

  • 🏠️ 首页
  • 🕹️ 在线体验LuatOS
  • 🛠 LuatOS工具大全
  • 💬 技术支持

🌠 快速上手

  • 🌙 Lua教程
    • 基础语法
    • LuaTask框架
  • 🧮 芯片和开发板
    • 📊 芯片对照选型表
    • 📶 Air780EP(EC718P系列通用)
      • Air780EP模组(EC718P系列通用)
      • 硬件资料
      • LuatOS固件下的IO复用配置
      • Ec718p系列固件发行注记
      • Air780EPV的额外说明
      • Air780EPVH的额外说明
    • 📶 Air780E(EC618系列通用)
      • Air780E模组(EC618系列通用)
      • 开发板
      • 硬件资料
      • 量产刷机的说明
      • 网络特性
      • LuatOS固件下的IO复用配置
      • Air780EG的额外说明
      • Air700E的额外说明
      • TTS功能的说明
      • 固件说明
      • FOTA升级及升级包的生成
      • Air780E_PCB
      • EC618系列固件发行注记
    • 📶 Air780EP(EC718P系列通用)
      • Air780EPS模组
      • Air780EPS模组固件发行注记
    • 📡 PC模拟器
      • 使用方法
      • 模拟器的代码库
      • 生成和管理luadb文件
    • 🚢 卫星导航GNSS
      • Air510U
      • Air530Z
      • 辅助定位AGPS
      • 与通信模块一起使用(例如4G模块)
      • 其他定位方式简介
    • 核心软件LuaTools
      • 功能介绍
      • LuaTools版本历史
    • 🛴 Air001
      • Air001芯片
      • 开发板
      • 硬件资料
      • Air001基于Keil MDK的用户手册
      • Air001基于Arduino的用户手册
      • Air001_PCB
    • 🚲 Air32F103
      • AIR32F103芯片
      • 开发板
      • 硬件资料
      • Air32F103使用手册
      • 从SXX32F103移植
      • 强化功能使用说明
      • DAPLink使用手册
      • Air32F103_PCB
      • BluePill_PCB
    • 📡 Air601
      • Air601
      • Air601-12F开发板
      • Air601硬件资料
      • 固件发行注记
      • 关于mac地址的说明
      • 使用合宙IOT平台进行升级
      • SPI从机功能
    • 🚗 Air101
      • Air101芯片
      • 开发板
      • 硬件资料
      • Air101硬件设计教程
      • Air101入门手册
      • Air101_PCB
      • Air101功耗曲线
    • 🚗 Air103
      • Air103芯片
      • 开发板
      • 硬件资料
      • 段码屏/段式屏的功能说明
      • 触摸传感器/触摸按键
      • Air103_PCB
      • Air103功耗曲线
    • 🚗 Air105
      • Air105芯片
      • Air105开发板
      • 硬件资料
      • Air105_PCB
      • Air105功耗曲线
      • Air105脚本加密
    • 📡 ESP32-C3
      • ESP32C3-CORE开发板
      • 硬件资料
      • ESP32-C3_PCB
      • ESP32C3功耗曲线
      • 更换flash教程
      • 发行注记
    • 📡 ESP32-S3
      • ESP32S3-CORE开发板
      • 硬件资料
      • ESP32-S3_PCB
      • 随身wifi的资料合集
    • 📡 RP2040
      • RP2040_PCB
    • 🚲 SWM181CBT6
      • SWM181CBT6芯片
      • 开发板
      • 硬件资料
      • SWM181使用手册
      • SWM181_PCB
    • 📶 Air302
      • Air302模组
      • 开发板
      • 硬件资料
    • 📡 Air640w
      • Air640w
      • 开发板
      • 硬件资料
    • 🚗 W806
    • 性能测试(基于coremark)
    • 设备支持情况/Supported Devices
    • 常见问题列表
    • Air724UG
    • Air820UG
  • 🧷 外设扩展资料
    • Air10x系列屏幕扩展板
      • 硬件资料
      • 使用示例
    • EINK1.54墨水屏
      • 硬件资料
      • 使用示例
    • 1.8寸TFT LCD 分辨率128x160
      • 硬件资料
      • 使用示例
    • 2.4寸TFT_LCD彩屏 分辨率240x320
      • 硬件资料
      • 使用示例
    • 1.54寸TFT_LCD 分辨率240x240
      • 硬件资料
      • 使用示例
    • Air105配套GC032A摄像头
      • 硬件资料
      • 使用示例
    • 高通字体芯片
      • 硬件资料
      • 使用示例
  • 📚 开发教程
    • 推荐学习线路
    • 开发环境搭建
    • 烧录教程
    • API教程
      • log
      • sys
      • adc
      • CRYPTO
      • fdb
      • DISP
      • i2c
        • air101
        • air103
        • air105
      • spi
        • air101
        • air103
        • air105
      • uart
        • air101
        • air103
        • air105
      • LCD驱动屏幕
      • mcu
        • air101
        • air103
        • air105
      • PM
      • pwm
        • air101
        • air103
        • air105
      • RTC
      • sfd
      • sfud
        • air101
        • air103
        • air105
      • timer
  • 固件下载

📖 参考手册

  • 🍴 LuatOS-SOC接口文档
    • 适配状态
    • adc - 模数转换
    • antbot - 蚂蚁链
    • audio - 多媒体-音频
    • bit64 - 32位系统上对64位数据的基本算术运算和逻辑运算
    • camera - 摄像头
    • can - can操作库
    • cc - VoLTE通话功能
    • codec - 多媒体-编解码
    • coremark - 跑分
    • crypto - 加解密和hash函数
    • dac - 数模转换
    • disp - disp库(已废弃)
    • eink - 墨水屏操作库
    • ercoap - 新的Coap协议解析库
    • errDump - 错误上报
    • fastlz - FastLZ压缩
    • fatfs - 读写fatfs格式
    • fdb - kv数据库,掉电不丢数据
    • fonts - 字体库
    • fota - 底层固件升级
    • fs - 文件系统额外操作
    • fskv - kv数据库,掉电不丢数据
    • ftp - ftp 客户端
    • gmssl - 国密算法(SM2/SM3/SM4)
    • gpio - GPIO操作
    • gtfont - 高通字库芯片
    • hmeta - 硬件元数据
    • ht1621 - 液晶屏驱动(HT1621/HT1621B)
    • http - http 客户端
    • httpsrv - http服务端
    • i2c - I2C操作
    • i2s - 数字音频
    • icmp - ICMP协议(PING)
    • iconv - iconv操作
    • io - io操作(扩展)
    • ioqueue - io序列操作
    • iotauth - IoT鉴权库, 用于生成各种云平台的参数
    • iperf - 吞吐量测试
    • ir - 红外遥控
    • json - json生成和解析库
    • keyboard - 键盘矩阵
    • lcd - lcd驱动模块
    • lcdseg - 段式lcd
    • libcoap - coap数据处理
    • libgnss - NMEA数据处理
    • little_flash - LITTLE FLASH 软件包
    • log - 日志库
    • lora - lora驱动模块
    • lora2 - lora2驱动模块(支持多挂)
    • lvgl - LVGL图像库
    • max30102 - 心率模块(MAX30102)
    • mcu - 封装mcu一些特殊操作
    • miniz - 简易zlib压缩
    • mlx90640 - 红外测温(MLX90640)
    • mobile - 蜂窝网络
    • mqtt - mqtt客户端
    • natp - 网络地址端口转换(开发中)
    • nes - nes模拟器
    • netdrv - 网络设备管理
    • nimble - 蓝牙BLE库(nimble版)
    • onewire - 单总线协议驱动
    • os - os操作
    • otp - OTP操作库
    • pack - 打包和解包格式串
    • pin - 管脚命名映射
    • pins - 管脚外设复用
    • pm - 电源管理
    • protobuf - ProtoBuffs编解码
    • pwm - PWM模块
    • repl - “读取-求值-输出” 循环
    • rsa - RSA加密解密
    • rtc - 实时时钟
    • rtos - RTOS底层操作库
    • sdio - sdio
    • sensor - 传感器操作库
    • sfd - SPI FLASH操作库
    • sfud - SPI FLASH sfud软件包
    • sms - 短信
    • socket - 网络接口
    • softkb - 软件键盘矩阵
    • spi - spi操作库
    • sqlite3 - sqlite3数据库操作
    • statem - SM状态机
    • string - 字符串操作函数
    • sys - sys库
    • sysplus - sys库的强力补充
    • timer - 操作底层定时器
    • touchkey - 触摸按键
    • tp - 触摸库
    • u8g2 - u8g2图形处理库
    • uart - 串口操作库
    • ulwip - 用户空间的lwip集成(开发中)
    • usbapp - USB功能操作
    • w5500 - w5500以太网驱动
    • wdt - watchdog操作库
    • websocket - websocket客户端
    • wlan - wifi操作
    • wlanraw - WLAN数据RAW传输
    • ws2812 - 幻彩灯带RGB控制器(WS2812系列)
    • xxtea - xxtea加密解密
    • yhm27xx - yhm27xx充电芯片
    • ymodem - ymodem协议
    • zbuff - c内存数据操作库
    • zlib - zlib压缩/解压缩(已废弃)
  • 📮 sys系统消息
  • 🌕 原生API手册
  • 👓 CSDK开发手册
  • 🥢 扩展库接口文档
    • ads1115 - ads1115 模数转换器
    • ads1115plus - ADS1115驱动
    • adxl34x - adxl34x 3轴加速度计 目前支持 adxl345 adxl346
    • aht10 - aht10 温湿度传感器
    • air153C_wtd - 添加软件看门狗功能,防止死机
    • airlbs - airlbs 定位服务(收费服务,需自行联系销售申请)
    • ak8963 - ak8963 地磁传感器
    • aliyun - AliYun阿里云物联网平台
    • am2320 - am2320 温湿度传感器
    • ap3216c - ap3216c 光照传感器
    • bh1750 - bh1750 数字型光强度传感器
    • bmx - bmx 气压传感器 目前支持bmp180 bmp280 bme280 bme680 会自动判断器件
    • cht8305c - cht8305c 温湿度传感器
    • dhcpsrv - DHCP服务器端
    • dnsproxy - DNS代理转发
    • ds3231 - ds3231 实时时钟传感器
    • ec11 - ec11 旋转编码器
    • gt911 - gt911 驱动
    • gy53l1 - gy53l1激光测距传感器
    • httpdns - 使用Http进行域名解析
    • httpplus - http库的补充
    • ina226 - ina226 驱动
    • iotcloud - iotcloud 云平台库 (已支持: 腾讯云 阿里云 onenet 华为云 涂鸦云 百度云 Tlink云 其他也会支持,有用到的提issue会加速支持)
    • l3g4200d - l3g4200d 三轴数字陀螺仪传感器
    • lbsLoc - lbsLoc 发送基站定位请求
    • lbsLoc2 - 基站定位v2
    • libfota - libfota fota升级
    • libfota2 - fota升级v2
    • libnet - libnet 在socket库基础上的同步阻塞api,socket库本身是异步非阻塞api
    • lis2dh12 - lis2dh12 三轴传感器
    • lm75 - lm75 温度传感器 支持lm75a lm75b
    • max31856 - max31856 热电偶温度检测
    • mcp2515 - mcp2515 CAN协议控制器驱动
    • mlx90614 - mlx90614 红外温度
    • modbus_rtu - modbus_rtu MODBUS_RTU协议
    • mpu6xxx - mpu6xxx 六轴/九轴传感器 支持 mpu6500,mpu6050,mpu9250,icm2068g,icm20608d
    • necir - necir NEC协议红外接收
    • netLed - netLed 网络状态指示灯
    • openai - 对接OpenAI兼容的平台,例如deepseek
    • pca9685 - pca9685 16路PWM驱动舵机
    • pcf8563t - pcf8563t时钟模块
    • pcf8574 - pcf8574 IO扩展
    • qmc5883l - qmc5883l 地磁传感器
    • rc522 - rc522 非接触式读写卡驱动
    • rtkv - 远程KV数据库
    • sc7a20 - sc7a20
    • shift595 - shift595 74HC595芯片
    • si24r1 - si24r1 驱动
    • spl06 - spl06_01 气压传感器
    • tcs3472 - tcs3472 颜色传感器
    • tm1637 - tm1637 数码管
    • tm1640 - tm1640 数码管和LED驱动芯片
    • tm1650 - tm1650 数码管和按键扫描芯片
    • tsl2561 - tsl2561 光强传感器
    • udpsrv - UDP服务器
    • vl6180 - VL6180激光测距传感器
    • xmodem - xmodem 驱动
    • ze08g_ch2o - ZE08G-CH2O 电化学甲醛模组
    • zh07 - ZH07 激光粉尘传感器
  • 社区扩展库

🖥️ 内核开发

  • 👨‍💻 编译源码
    • ☁️ 云编译
    • 📶 Air780E编译指南
    • 📶 Air780EP编译指南
    • 🚗 Air101 / Air103
    • 🚗 Air105
    • 📡 ESP32系列编译文档
    • 🖥️ Win32
    • 🖥️ Linux
    • 📡 Air640w
    • 📶 Air302
  • 📁 开发文档
    • 开发实践
      • 添加自定义函数(急速版)
      • 添加自定义库和函数(完整版)
      • Lua库文件编写指南(纯lua编写)
      • C接口实现Task等待功能
      • 命令行刷机指南
    • 开发资料
      • LuatOS-SoC的文件系统
      • 详解lua的string与hex数据(十六进制)
      • LuaDB 文件格式
      • LuatOS-SoC通用固件格式soc
  • ❤️ 贡献代码
    • 编码规范
    • 添加新库
    • 设计文档
      • 核心层
        • Luat核心
        • Luat调试器
        • 文件系统
        • 内存池
        • 消息总线
        • Luat 平台层
        • 电源及低功耗管理
        • Luat定时器
        • C风格的缓冲区
        • C接口实现Task等待功能
        • C风格的结构体
      • 外设API
        • GPIO
        • IR
        • SPI
        • UART
        • WLAN

💼 实战参考

  • ⌨️ 应用开发
    • 外设
      • LuatOS-Soc驱动WS2812教程
    • lvgl
      • LVGL for LuatOS 手册
      • 简介
      • LVGL基础
      • LVGL组件
      • LVGL进阶
      • 注意事项
    • 视频播放
      • Air105视频播放

🗄️ 其他资料

  • ⏳ IoT Power功耗测试神器
    • 🔋 IoT Power - V1
    • ⚡ IoT Power - CC
      • 技术指标
      • 连接与组装
      • 操作说明
      • 常见问题
    • 🔍 版本对比
    • 🖥 PC客户端
  • 🗃️ 资料存档
    • Luat框架
    • Luat框架(进阶-底层机制)
    • Lua 5.3 参考手册
Back to top

iotcloud - iotcloud 云平台库 (已支持: 腾讯云 阿里云 onenet 华为云 涂鸦云 百度云 Tlink云 其他也会支持,有用到的提issue会加速支持)#

示例

--注意:因使用了sys.wait()所有api需要在协程中使用

    -- 腾讯云 
    -- 动态注册
    -- iotcloudc = iotcloud.new(iotcloud.TENCENT,{product_id = "xxx" ,product_secret = "xxx"})
    -- 密钥校验
    -- iotcloudc = iotcloud.new(iotcloud.TENCENT,{product_id = "xxx",device_name = "123456789",device_secret = "xxx=="})
    -- 证书校验
    -- iotcloudc = iotcloud.new(iotcloud.TENCENT,{product_id = "xxx",device_name = "123456789"},{tls={client_cert=io.readFile("/luadb/client_cert.crt")}})

    -- 阿里云  
    -- 一型一密(免预注册-仅企业版支持)
    -- iotcloudc = iotcloud.new(iotcloud.ALIYUN,{instance_id = "xxx",product_id = "xxx",product_secret = "xxx"}) -- 企业版公共实例
    -- 一型一密(预注册)
    -- iotcloudc = iotcloud.new(iotcloud.ALIYUN,{product_id = "xxx",device_name = "xxx",product_secret = "xxx"})                     -- 旧版公共实例
    -- iotcloudc = iotcloud.new(iotcloud.ALIYUN,{instance_id = "xxx",product_id = "xxx",device_name = "xxx",product_secret = "xxx"}) -- 新版公共实例
    -- 一机一密(预注册)
    -- iotcloudc = iotcloud.new(iotcloud.ALIYUN,{product_id = "xxx",device_name = "xxx",device_secret = "xxx"})                    -- 旧版公共实例
    -- iotcloudc = iotcloud.new(iotcloud.ALIYUN,{instance_id = "xxx",product_id = "xxx",device_name = "xxx",device_secret = "xxx"})-- 新版公共实例


    -- ONENET云
    -- 动态注册
    -- iotcloudc = iotcloud.new(iotcloud.ONENET,{product_id = "xxx",userid = "xxx",userkey = "xxx"})
    -- 一型一密
    -- iotcloudc = iotcloud.new(iotcloud.ONENET,{product_id = "xxx",product_secret = "xxx"})
    -- 一机一密
    -- iotcloudc = iotcloud.new(iotcloud.ONENET,{product_id = "xxx",device_name = "xxx",device_secret = "xxx"})

    -- 华为云
    -- 动态注册(免预注册)
    -- iotcloudc = iotcloud.new(iotcloud.HUAWEI,{product_id = "xxx",project_id = "xxx",endpoint = "xxx",
    --                         iam_username="xxx",iam_password="xxx",iam_domain="xxx"})
    -- 手动注册(预注册)
    -- iotcloudc = iotcloud.new(iotcloud.HUAWEI,{product_id = "xxx",endpoint = "xxx",device_name = "xxx",device_secret = "xxx"})

    -- 涂鸦云 
    -- iotcloudc = iotcloud.new(iotcloud.TUYA,{device_name = "xxx",device_secret = "xxx"})

    -- 百度云 
    -- iotcloudc = iotcloud.new(iotcloud.BAIDU,{product_id = "afadjlw",device_name = "test",device_secret = "BBDVsSRGefaknffT"})
    -- iotcloudc = iotcloud.new(iotcloud.BAIDU,{product_id = "xxx",device_name = "xxx"},{tls={server_cert=io.readFile("/luadb/GlobalSign.cer"),client_cert=io.readFile("/luadb/client_cert"),client_key=io.readFile("/luadb/client_private_key")}})

    -- Tlink云  
    -- iotcloudc = iotcloud.new(iotcloud.TLINK,{product_id = "xxx",product_secret = "xxx",device_name = "xxx"})
    -- iotcloudc = iotcloud.new(iotcloud.TLINK,{product_id = "xxx",product_secret = "xxx",device_name = "xxx"},{tls={client_cert=io.readFile("/luadb/client_cert.crt")}})

常量#

常量

类型

解释

iotcloud.TENCENT

string

腾讯云

iotcloud.ALIYUN

string

阿里云

iotcloud.ONENET

string

ONENET云

iotcloud.HUAWEI

string

华为云

iotcloud.TUYA

string

涂鸦云

iotcloud.BAIDU

string

百度云

iotcloud.TLINK

string

Tlink云

iotcloud.CONNECT

string

连接上服务器

iotcloud.SEND

string

发送消息

iotcloud.RECEIVE

string

接收到消息

iotcloud.DISCONNECT

string

服务器连接断开

iotcloud.OTA

string

ota消息

iotcloud.new(cloud,iot_config,connect_config)#

创建云平台对象

参数

传入值类型

解释

string

云平台 iotcloud.TENCENT:腾讯云 iotcloud.ALIYUN:阿里云 iotcloud.ONENET:中国移动云 iotcloud.HUAWEI:华为云 iotcloud.TUYA:涂鸦云 iotcloud.BAIDU: 百度云 iotcloud.TLINK: Tlink云

table

iot云平台配置, device_name:可选,默认为imei否则为unique_id iot_config.product_id:产品id(阿里云则为产品key) iot_config.product_secret:产品密钥,有此项则为动态注册 iot_config.device_secret:设备秘钥,有此项则为秘钥连接 instance_id:公共实例id,新版阿里云公共实例专用 userid:用户ID,onenet专用,动态注册使用 userkey:用户Accesskey,onenet专用,动态注册使用

table

mqtt配置, host:可选,默认为平台默认host ip:可选,默认为平台默认ip tls:加密,若有此项一般为产品认证 keepalive:心跳时间,单位s 可选,默认240 autoreconn:自动重连,number:重连时间,单位ms /bool 是否重连,默认3000ms 可选,默认不自动重连

返回值

返回值类型

解释

table

云平台对象

例子

    -- 腾讯云 
    -- 动态注册
    -- iotcloudc = iotcloud.new(iotcloud.TENCENT,{product_id = "xxx" ,product_secret = "xxx"})
    -- 密钥校验
    -- iotcloudc = iotcloud.new(iotcloud.TENCENT,{product_id = "xxx",device_name = "123456789",device_secret = "xxx=="})
    -- 证书校验
    -- iotcloudc = iotcloud.new(iotcloud.TENCENT,{product_id = "xxx",device_name = "123456789"},{tls={client_cert=io.readFile("/luadb/client_cert.crt")}})

    -- 阿里云  
    -- 一型一密(免预注册-仅企业版支持)
    -- iotcloudc = iotcloud.new(iotcloud.ALIYUN,{instance_id = "xxx",product_id = "xxx",product_secret = "xxx"}) -- 企业版公共实例
    -- 一型一密(预注册)
    -- iotcloudc = iotcloud.new(iotcloud.ALIYUN,{product_id = "xxx",device_name = "xxx",product_secret = "xxx"})                     -- 旧版公共实例
    -- iotcloudc = iotcloud.new(iotcloud.ALIYUN,{instance_id = "xxx",product_id = "xxx",device_name = "xxx",product_secret = "xxx"}) -- 新版公共实例
    -- 一机一密 (预注册)
    -- iotcloudc = iotcloud.new(iotcloud.ALIYUN,{product_id = "xxx",device_name = "xxx",device_secret = "xxx"})                    -- 旧版公共实例
    -- iotcloudc = iotcloud.new(iotcloud.ALIYUN,{instance_id = "xxx",product_id = "xxx",device_name = "xxx",device_secret = "xxx"})-- 新版公共实例

    -- ONENET云
    -- 动态注册
    -- iotcloudc = iotcloud.new(iotcloud.ONENET,{product_id = "xxx",userid = "xxx",userkey = "xxx"})
    -- 一型一密
    -- iotcloudc = iotcloud.new(iotcloud.ONENET,{product_id = "xxx",product_secret = "xxx"})
    -- 一机一密
    -- iotcloudc = iotcloud.new(iotcloud.ONENET,{product_id = "xxx",device_name = "xxx",device_secret = "xxx"})

    -- 华为云
    -- 动态注册(免预注册)
    -- iotcloudc = iotcloud.new(iotcloud.HUAWEI,{product_id = "xxx",project_id = "xxx",endpoint = "xxx",
    --                         iam_username="xxx",iam_password="xxx",iam_domain="xxx"})
    -- 密钥校验 (预注册)
    -- iotcloudc = iotcloud.new(iotcloud.HUAWEI,{product_id = "xxx",endpoint = "xxx",device_name = "xxx",device_secret = "xxx"})

    -- 涂鸦云 
    -- iotcloudc = iotcloud.new(iotcloud.TUYA,{device_name = "xxx",device_secret = "xxx"})

    -- 百度云 
    -- iotcloudc = iotcloud.new(iotcloud.BAIDU,{product_id = "afadjlw",device_name = "test",device_secret = "BBDVsSRGefaknffT"})
    -- iotcloudc = iotcloud.new(iotcloud.BAIDU,{product_id = "xxx",device_name = "xxx"},{tls={server_cert=io.readFile("/luadb/GlobalSign.cer"),client_cert=io.readFile("/luadb/client_cert"),client_key=io.readFile("/luadb/client_private_key")}})

    -- Tlink云  
    -- iotcloudc = iotcloud.new(iotcloud.TLINK,{product_id = "xxx",product_secret = "xxx",device_name = "xxx"})
    -- iotcloudc = iotcloud.new(iotcloud.TLINK,{product_id = "xxx",product_secret = "xxx",device_name = "xxx"},{tls={client_cert=io.readFile("/luadb/client_cert.crt")}})

cloudc:connect()#

云平台连接

参数

无

返回值

无

例子

iotcloudc:connect()

cloudc:disconnect()#

云平台断开

参数

无

返回值

无

例子

iotcloudc:disconnect()

cloudc:subscribe(topic, qos)#

云平台订阅

参数

传入值类型

解释

string/table

主题

number

topic为string时生效 0/1/2 默认0

返回值

无

例子

无


cloudc:unsubscribe(topic)#

云平台取消订阅

参数

传入值类型

解释

string/table

主题

返回值

无

例子

无


cloudc:publish(topic,data,qos,retain)#

云平台发布

参数

传入值类型

解释

string/table

主题

string

消息,必填,但长度可以是0

number

消息级别 0/1 默认0

number

是否存档, 0/1,默认0

返回值

无

例子

无


cloudc:close()#

云平台关闭

参数

无

返回值

无

例子

iotcloudc:close()

Next
l3g4200d - l3g4200d 三轴数字陀螺仪传感器
Previous
ina226 - ina226 驱动
Copyright © LuatOS团队 | 下载离线版文档

目录
  • iotcloud - iotcloud 云平台库 (已支持: 腾讯云 阿里云 onenet 华为云 涂鸦云 百度云 Tlink云 其他也会支持,有用到的提issue会加速支持)
    • 常量
    • iotcloud.new(cloud,iot_config,connect_config)
    • cloudc:connect()
    • cloudc:disconnect()
    • cloudc:subscribe(topic, qos)
    • cloudc:unsubscribe(topic)
    • cloudc:publish(topic,data,qos,retain)
    • cloudc:close()