982
微信
附录__设备基于CCP接入_设备端接入手册_阿里云物联网套件-阿里云
CCP协议中字段类型为可变长数值,都需要使用该算法来实现。
The algorithm for encoding a decimal number (X) into the variable length encoding scheme is as follows:
do
digit = X MOD 128
X = X DIV 128
// if there are more digits to encode, set the top bit of this digit
if ( X > 0 )
digit = digit OR 0x80
endif
'output' digit
while ( X> 0 )
where MOD is the modulo operator (% in C), DIV is integer division (/ in C), and OR is bit-wise or (| in C).The algorithm for decoding the Number Length field is as follows:
multiplier = 1
value = 0
do
digit = 'next digit from stream'
value += (digit AND 127) * multiplier
multiplier *= 128
while ((digit AND 128) != 0)
where AND is the bit-wise and operator (& in C).LS When this algorithm terminates, value contains the Remaining Length in bytes.
最后更新:2016-11-23 17:16:07
上一篇:
接入协议__设备基于MQTT接入_设备端接入手册_阿里云物联网套件-阿里云
下一篇:
JAVA版demo__设备基于CCP接入_设备端接入手册_阿里云物联网套件-阿里云
FTP数据源配置__数据源配置_数据同步手册_用户操作指南_大数据开发套件-阿里云
快速切换API版本__API管理相关接口_API_API 网关-阿里云
马云叫你来捉妖,阿里云栖大会本周三正式召开了,去年马云提出新零售催生了三江购物,今年呢?
使用 EDAS 配置中心__开发环境搭建_开发者指南_企业级分布式应用服务 EDAS-阿里云
释放RDS实例__实例管理_API 参考_云数据库 RDS 版-阿里云
某政务网站性能优化__最佳实践_性能测试-阿里云
架构介绍__产品与_画像分析-阿里云
示例说明__基础示例—完整数据开发_场景教程_大数据开发套件-阿里云
[5]MNS API授权映射表__子账号访问MNS_控制台使用帮助_消息服务-阿里云
直播API概述__直播API_API及SDK_视频直播-阿里云
相关内容
常见错误说明__附录_大数据计算服务-阿里云
发送短信接口__API使用手册_短信服务-阿里云
接口文档__Android_安全组件教程_移动安全-阿里云
运营商错误码(联通)__常见问题_短信服务-阿里云
设置短信模板__使用手册_短信服务-阿里云
OSS 权限问题及排查__常见错误及排除_最佳实践_对象存储 OSS-阿里云
消息通知__操作指南_批量计算-阿里云
设备端快速接入(MQTT)__快速开始_阿里云物联网套件-阿里云
查询API调用流量数据__API管理相关接口_API_API 网关-阿里云
使用STS访问__JavaScript-SDK_SDK 参考_对象存储 OSS-阿里云