El contenido no se encuentra disponible en el idioma seleccionado. Estamos trabajando continuamente para agregar más idiomas. Gracias por su apoyo.

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

PCP Introduction

Updated on 2024-10-12 GMT+08:00

The PCP protocol stipulates the communication content and format between the IoT platform and devices.

PCP runs at the application layer for device upgrade.

Communication Method

  1. PCP runs at the application layer. LwM2M, CoAP, MQTT, or other non-streaming protocols can be used at the underlying layer.
  2. PCP messages are not allocated with independent ports and are independent from protocols at the underlying layer. To differentiate PCP messages from device service messages, 0XFFFE is used as the start bytes of the PCP messages, and the first two bytes of the service messages cannot be 0XFFFE. For details, see PCP Message Identification.
  3. PCP uses a question-and-answer communication mode. All request messages have a response message.

Message Structure

Field

Type

Description

Start ID

WORD

The value is fixed at 0XFFFE.

Version

BYTE

The four most significant bits are reserved. The four least significant bits indicate the protocol version. Currently, the version is 1.

Message code

BYTE

Type of the request exchanged between the platform and device. The message code of a response is the same as that of the request. The following message codes have been defined:

  • 0-18: reserved
  • 19: device version query
  • 20: software package notification
  • 21: software package download
  • 22: download result reporting
  • 23: upgrade execution
  • 24: upgrade result reporting
  • 25-127: reserved

Check code

WORD

CRC16 check value calculated from the start ID to the last byte of the data zone. Before the calculation, this field is set to 0. The result is then written to the field after the CRC16 calculation.

NOTE:

CRC16 algorithm: CRC16/CCITT x16+x12+x5+1

Data zone length

WORD

Length of the data zone.

Data zone

BYTE[n]

Variable length, which is defined by each instruction. For details, see the definitions of the request and response corresponding to each instruction.

Data Type

Data Type

Description

BYTE

Unsigned 1-byte integer

WORD

Unsigned 2-byte integer

DWORD

Unsigned 4-byte integer

BYTE[n]

Hexadecimal number of n bytes

STRING

String

NOTE:

PCP uses the network sequence to transmit WORD and DWORD data.

Device Version Query

Request

Direction: from the platform to a device

Field

Data Type

Description

No data zone

Response

Direction: from a device to the platform

Field

Data Type

Description

Result code

BYTE

The value is 0X00, indicating that the processing was successful.

Current version

BYTE[16]

The version is described using ASCII characters. If there are not enough available digits, 0X00 is appended.

NOTE:
  • The platform determines whether the device needs to be upgraded based on the version. If it does, the platform sends a request to upgrade the device.
  • If the response times out, the platform stops the upgrade task.

Software Package Notification

Request

Direction: from the platform to a device

Field

Data Type

Description

Target version

BYTE[16]

The version is described using ASCII characters. If there are not enough available digits, 0X00 is appended.

Upgrade package segment size

WORD

Size of each segment.

Number of upgrade package segments

WORD

Number of upgrade package segments

Check code

WORD

The value is fixed at 0000.

Response

Direction: from a device to the platform

Field

Data Type

Description

Result code

BYTE

0X00: The upgrade is allowed.

0X01: The device is in use.

0X02: The signal is weak.

0X03: The latest version is in use.

0X04: The battery power is low.

0X05: The remaining space is insufficient.

0X09: The memory is insufficient.

0X7F: An internal error has occurred.

NOTE:
  • If the upgrade is not allowed by the device, the platform stops the upgrade task.
  • If the response times out, and the request for the upgrade package is not received, the platform stops the upgrade task.

Software Package Requesting

Request

Direction: from a device to the platform

Field

Data Type

Description

Target version

BYTE[16]

The version is described using ASCII characters. If there are not enough available digits, 0X00 is appended.

Segment sequence number

WORD

Sequence number of the requested segment. The value starts from 0. The total number of segments is obtained by rounding up the result of the software package size divided by the segment size. The device can save the received segments and request for the missing segments next time. Resumable download is supported.

Response

Direction: from the platform to a device

Field

Data Type

Description

Result code

BYTE

0X00: The processing was successful.

0X80: The upgrade task does not exist.

0X81: The specified segment does not exist.

Segment sequence number

WORD

Sequence number of a returned segment.

Segment data

BYTE[n]

Content of the segment. n indicates the segment size. If the result code is not 0, this field is not included.

Download Result Reporting

Request

Direction: from a device to the platform

Field

Data Type

Description

Download status

BYTE

0X00: The upgrade package has been downloaded.

0X05: The remaining space is insufficient.

0X06: The download timed out.

0X07: The upgrade package failed to be verified.

0X08: The upgrade package is not supported.

Response

Direction: from the platform to a device

Field

Data Type

Description

Result code

BYTE

0X00: The processing was successful.

0X80: The upgrade task does not exist.

Upgrade Execution

Request

Direction: from the platform to a device

Field

Data Type

Description

No data zone

Response

Direction: from a device to the platform

Field

Data Type

Description

Result code

BYTE

0X00: The processing was successful.

0X01: The device is in use.

0X04: The battery power is low.

0X05: The remaining space is insufficient.

0X09: The memory is insufficient.

Upgrade Result Reporting

Request

Direction: from a device to the platform

Field

Data Type

Description

Result code

BYTE

0X00: The upgrade was successful.

0X01: The device is in use.

0X04: The battery power is low.

0X05: The remaining space is insufficient.

0X09: The memory is insufficient.

0X0A: The upgrade package failed to be installed.

0X7F: An internal error has occurred.

Current version

BYTE[16]

Current version of the device.

Response

Direction: from the platform to a device

Field

Data Type

Description

Result code

BYTE

0X00: The processing was successful.

0X80: The upgrade task does not exist.

PCP Message Identification

PCP messages and device service messages share the same port and URL. When receiving a message from the device, the platform performs the following steps to determine whether the message is a PCP message or a service message:

  1. Checks whether the device supports software upgrades (defined by omCapability.upgradeCapability in the product model). If the device does not support software upgrades, the message is considered to be a service message.
  2. Checks whether the software upgrade protocol is PCP. If the protocol is not PCP, the message is considered to be a service message.
  3. Checks whether the first two bytes of the message are 0XFFFE. If the bytes are not 0XFFFE, the message is considered to be a service message.
  4. Checks whether the version is valid. If the version is invalid, the message is considered as a service message.
  5. Checks whether the message code is valid. If the message code is invalid, the message is considered as a service message.
  6. Checks whether the check code is correct. If the check code is incorrect, the service message is considered to be a service message.
  7. Checks whether the length of the data zone is correct. If the length is incorrect, the message is considered to be a service message.
  8. If all the preceding check items are passed, the message is considered as a PCP message.
NOTE:

The start bytes of a service message cannot be 0XFFFE.

Utilizamos cookies para mejorar nuestro sitio y tu experiencia. Al continuar navegando en nuestro sitio, tú aceptas nuestra política de cookies. Descubre más

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback