Cp client new provisioning message

A specific topic!

When a client sends a provisioning message to a server using the cp (Control Protocol) protocol, it's typically a request to provision a new device or update an existing one. Here's a breakdown of the message:

Message format:

The provisioning message is a JSON object that contains the following fields:

Example message:

{
  "type": "new",
  "device_id": "1234567890",
  "device_info": {
    "hardware": {
      "model": "Raspberry Pi 4",
      "firmware": "v1.2"
    },
    "software": {
      "os": "Raspbian",
      "version": "10.0"
    }
  },
  "provisioning_data": {
    "config": {
      "ssid": "MyNetwork",
      "password": "mysecretpassword"
    },
    "certificates": [
      {
        "type": "x509",
        "data": "-----BEGIN CERTIFICATE-----...-----END CERTIFICATE-----"
      }
    ]
  }
}

Server response:

The server will respond to the provisioning message with a JSON object containing the result of the provisioning operation. The response may include a success or error message, as well as any additional information required for the device to complete the provisioning process.

For example:

{
  "result": "success",
  "message": "Device provisioned successfully",
  "provisioning_data": {
    "config": {
      "ssid": "MyNetwork",
      "password": "mysecretpassword"
    },
    "certificates": [
      {
        "type": "x509",
        "data": "-----BEGIN CERTIFICATE-----...-----END CERTIFICATE-----"
      }
    ]
  }
}