หน้านี้ยังไม่พร้อมใช้งานในภาษาท้องถิ่นของคุณ เรากำลังพยายามอย่างหนักเพื่อเพิ่มเวอร์ชันภาษาอื่น ๆ เพิ่มเติม ขอบคุณสำหรับการสนับสนุนเสมอมา

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

Packaging the Codec

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

This topic describes how to package the codec and prepare the package.

Packaging the Codec Using Maven

After the codec is programmed, use Maven to package the codec. On the Windows OS, perform the following steps:

  1. Open the DOS window and access the directory where the pom.xml file is located.
  2. Run mvn package.
  3. After BUILD SUCCESS is displayed in the DOS window, open the target folder in the same directory as the pom.xml file to obtain the .jar package.

    The naming rule of the .jar package is as follows: device type-manufacturer ID-device model-version.jar, for example: WaterMeter-Huawei-NBIoTDevice-version.jar.

    Figure 1 Structure of the .jar file
    • The com directory stores class files.
    • The META-INF directory stores description files of .jar packages under the OSGi framework, which are generated based on configurations in the pom.xml file.
    • The OSGI-INF directory stores service configuration files and is used to register the codec as a service for the platform to call. (Only one .xml file can be called.)
    • Other .jar packages are .jar packages referenced by codecs.

Preparing a Codec Package

  1. Create a folder named package, which contains the preload/ sub-folder.
  2. Place the packaged .jar package in the preload/ folder.

    Figure 2 Structure of the codec package

  3. In the package folder, create the package-info.json file. The fields and templates in this file are described as follows:

    NOTE:

    The package-info.json file is encoded using UTF-8 without BOM. Only English characters are supported.

    Table 1 Description of fields in the package-info.json file

    Field

    Description

    Mandatory or Optional

    specVersion

    Specifies the version of the description file. The value is fixed at 1.0.

    Mandatory

    fileName

    Specifies the name of the software package. The value is fixed at codec-demo.

    Mandatory

    version

    Specifies the version number of the software package. The version of the package.zip file must be the same as the value of bundleVersion.

    Mandatory

    deviceType

    Specifies the device type, which must be the same as that defined in the profile file.

    Mandatory

    manufacturerName

    Specifies the manufacturer name, which must be the same as that defined in the profile file. Otherwise, the package-info.json file cannot be uploaded to the IoT platform.

    Mandatory

    model

    Specifies the product model, which must be the same as that defined in the profile file.

    Mandatory

    platform

    Specifies the platform type, which is the operating system of the IoT platform on which the codec package runs. The value is fixed at linux.

    Mandatory

    packageType

    Specifies the software package type. This field is used to describe the IoT platform module where the codec is deployed. The value is fixed at CIGPlugin.

    Mandatory

    date

    Specifies the time when a packet is sent. The format is as follows: yyyy-MM-dd HH-mm-ss. For example, 2017-05-06 20:48:59.

    Optional

    description

    Specifies the self-defined description about the software package.

    Optional

    ignoreList

    Specifies the list of bundles to be ignored. The default value is null.

    Mandatory

    bundles

    Specifies the description of a bundle.

    NOTE:

    A bundle is a .jar package in a compressed package. Only one bundle needs to be described.

    Mandatory

    Table 2 Description of the bundles field

    Field

    Description

    Mandatory or Optional

    bundleName

    Specifies the bundle name, which is consistent with the value of Bundle-SymbolicName in the pom.xml file.

    Mandatory

    bundleVersion

    Specifies the bundle version, which must be the same as the value of version.

    Mandatory

    priority

    Specifies the bundle priority. This parameter can be set to the default value 5.

    Mandatory

    fileName

    Specifies the codec file name.

    Mandatory

    bundleDesc

    Describes the bundle function.

    Mandatory

    versionDesc

    Describes the functions and features of different versions.

    Mandatory

    Template of the package-info.json file

    {
        "specVersion":"1.0",
        "fileName":"codec-demo",
        "version":"1.0.0",
        "deviceType":"WaterMeter",
        "manufacturerName":"Huawei",
        "model":"NBIoTDevice",
        "description":"codec",
        "platform":"linux",
        "packageType":"CIGPlugin",
        "date":"2017-02-06 12:16:59",
        "ignoreList":[],
        "bundles":[
        {
            "bundleName": "WaterMeter-Huawei-NBIoTDevice",
            "bundleVersion": "1.0.0",
            "priority":5,
            "fileName": "WaterMeter-Huawei-NBIoTDevice-1.0.0.jar",
            "bundleDesc":"",
            "versionDesc":""
        }]
    }

  4. Select all files in the package folder and compress them into a package.zip file.

    NOTE:

    The package.zip file cannot contain the package directory.

เราใช้คุกกี้เพื่อปรับปรุงไซต์และประสบการณ์การใช้ของคุณ การเรียกดูเว็บไซต์ของเราต่อแสดงว่าคุณยอมรับนโยบายคุกกี้ของเรา เรียนรู้เพิ่มเติม

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback