CHAI SDK  Version 1.3
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
The Device ID

The DeviceID is a unique identity on the network. It is composed of:

  • BrandID: a 16-bit value identifying the brand of the application.
    Some special values:
    • 0xFFFF: used as wild-card for device search
    • 0xFFFE: identifies test application (no real product can use it!)
    • 0x0000 - 0x9FFF: range for commercial brands
    • 0xA000 - 0xFFFD: range for freeware applications
  • ModelID: this value defines a product in the brand. Coupled with the Brand ID, it forms the device's identity. All devices having the same identity have also the same behavior because they are the same product/application.
    • 0xFFFF: used as wild-card for device search
    • In case of commercial or test BrandID, the ModelID can be assigned freely in the range 0x0000 - 0xFFFE at device creation.
    • If the BrandID is in the freeware range, the ModelID is forced by the key used during CHAI creation. The concatenation of the BrandID and ModelID fields gives a unique Freeware application identifier.
  • Duplicate Number: this 32-bit value can be automatically set by CopperLan or defined by the developer; moreover, it can be locked (fixed) or allowed to be changed automatically (auto) by the system as needed. It is used to avoid having more than a single device on the network with a given DeviceID. In case of fixed duplicate, a conflict can arise that will be brought forward by the system and should be resolved by the user.
  • The Module ID: 16-bit value used to identify sub-devices (Modules).

With this ID system, it is simple to find specific devices on the network, search for a particular Brand ID and Model ID. A specific device can easily detect other devices it knows and eventually establish privileged connections and behaviors with them.

Relation between identity and SDK Key

In order to use the SDK, a key is required during the CPNS::Factory::CreateCHAI call. This key determine tree possible usages:

  • No key provided: the SDK falls in Test Mode. The BrandID is forced to 0xFFFE, its name to Test; the ModelID and ModelName can be freely assigned during the root device creation.
  • Commercial key: the BrandID and BrandName are determined from the key. ModelID and ModelName can be freely assigned during the root device creation.
  • Freeware key: BrandID, BrandName, ModelID and ModelName are all determined from the key

So, anybody can use the SDK without specifying a key for prototyping or test purpose. But a SDK Key is needed as soon you want to distribute your application. You can simply get this key on request at info@copperlan.org.

Why this key?

This is to prevent accidental or deliberate usage of reserved device identities. It is important being able to identify with certainty all devices on the network. This is the foundation of the automatic connections and configurations, which are major features in CopperLan.