このページは、お客様の言語ではご利用いただけません。Huawei Cloudは、より多くの言語バージョンを追加するために懸命に取り組んでいます。ご協力ありがとうございました。

Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive
On this page

Development Guide

Updated on 2022-02-24 GMT+08:00

Overview

If a device reports binary data, a codec must be developed for data format conversion. If a device reports JSON data, codec development is not required.

For example, in the NB-IoT scenario where devices communicate with the IoT platform using CoAP, the payload of the CoAP message is data at the application layer and the data type is defined by the device. As NB-IoT devices require low power consumption, data at the application layer is in binary format instead of JSON. However, the IoT platform communicates with NAs by sending data in JSON format. Therefore, codec development is required for the IoT platform to convert data in binary and JSON formats.

Figure 1 Codec conversion

Procedure

If you have used a preset template when creating a project and product, you can directly use or modify the codecs contained in the template. If a customized product is created, you must develop your codec.

  1. In the product development space, click Codec Development.

  2. In the Online Codec Editor area, click Add Message.

  3. In the Add Message dialog box, specify Message Name, set Message Type to Data Reporting, and click OK.

    • If the IoT platform is required to return an ACK message after receiving data reported by the device, select Add Response Field. The data carried in the ACK message is the value of Response. The default value is AAAA0000.
    • Message Name can contain only letters, digits, underscores (_), and dollar signs ($) and cannot start with a digit.

  4. Click + next to Data Reporting Fields.

  5. In the Add Field dialog box, select Tagged as address field. Other parameters are set automatically. Click OK.

    When messages of the same type are created, such as two data reporting messages, Tagged as address field must be selected and this field in every such message must be in the same place on the field list. A command response can be regarded as a type of data reporting message. Therefore, if a command response exists, messageId must be added to the data reporting message.

  6. Click + next to Data Reporting Fields.

  7. In the Add Field dialog box, set the parameters and click OK.

    • Name can contain only letters, digits, underscores (_), and dollar signs ($) and cannot start with a digit.
    • Data Type is configured based on the data reported by the device and must match the type defined in the profile file.

  8. In the Online Codec Editor area, click Add Message.

  9. In the Add Message dialog box, specify Message Name, set Message Type to Command Delivery, and click OK.

    • If the device is required to return the command execution result, select Add Response Field. After the check box is selected:
      • The address field must be defined in both the data reporting message and the command response, and this field in the two messages must be in the same place on the field list, so that the codec can distinguish the data reporting message from the command response.
      • The response ID field must be defined in the command delivery message and the command response, and this field in the two messages must be in the same place on the field list, so that the codec can associate the command delivery message with the corresponding command response.
    • Message Name can contain only letters, digits, underscores (_), and dollar signs ($) and cannot start with a digit.

  10. Click + next to Command Delivery Fields.

  11. In the Add Field dialog box, select Tagged as address field. Other parameters are set automatically. Click OK.

    When messages of the same type are created, such as two command delivery messages, Tagged as address field must be selected and this field in every such message must be in the same place on the field list. A data reporting response can be regarded as a type of command delivery message. Therefore, if a data reporting response exists, messageId must be added to the command delivery message.

  12. Click + next to Command Delivery Fields.

  13. In the Add Field dialog box, select Tagged as response ID field. Other parameters are set automatically. Click OK.

  14. Click + next to Command Delivery Fields.

  15. In the Add Field dialog box, set the parameters and click OK.

    • Name can contain only letters, digits, underscores (_), and dollar signs ($) and cannot start with a digit.
    • Data Type is configured based on the data reported by the device and must match the type defined in the profile file.

  16. Click + next to Response Fields.

  17. In the Add Field dialog box, select Tagged as address field. Other parameters are set automatically. Click OK.

  18. Click + next to Response Fields.

  19. In the Add Field dialog box, select Tagged as response ID field. Other parameters are set automatically. Click OK.

  20. Click + next to Response Fields.

  21. In the Add Field dialog box, select Tagged as command execution state field, set the other parameters, and click OK.

    • The value of Name is automatically populated.
    • Data Type is configured based on the actual command response and must match the type of the corresponding field defined in the profile file.

  22. Click + next to Response Fields.

  23. In the Add Field dialog box, set the parameters and click OK.

    • Name can contain only letters, digits, underscores (_), and dollar signs ($) and cannot start with a digit.
    • Data Type is configured based on the data reported by the device and must match the type defined in the profile file.

  24. Map the property fields, command fields, and response fields in Device Model on the right with the fields in the data reporting message, command delivery message, and command response.

  25. Click Save and then Deploy to deploy the codec on the IoT platform.

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback