5.4.3.2 Define Service Characteristic (PC…)

Format: PC,<hex16/hex128>,<hex8>,<hex8>

Command PC sets private characteristics. It expects three parameters:

  • The first parameter is a 16-bit UUID for public characteristics or a 128-bit UUID for private characteristics. There are many ways to generate a 128-bit UUID with little possibility of conflict. For more details on UUID, refer to the Universally Unique Identifier (UUID).
  • The second parameter is an eight-bit property bitmap of the characteristics. For more details on the characteristic property, see Table 9-1.
  • The third parameter is an eight-bit value that indicates the maximum data size in octet that holds the value of the characteristics.

The user must call command PC after the service UUID is set by command PS. For more details on command PS, refer to 5.4.3.3 Define Service UUID (PS,<hex16/hex128>). If service UUID is set to be a 16-bit public UUID in command PS, then the UUID input parameter for command PC must also be a 16-bit public UUID. In addition, if the service UUID is set to be a 128-bit private UUID by command PS, then the UUID input parameter must also be a 128-bit private UUID by command PC. The user issues this command to add the characteristic to the service one by one until the characteristic is defined.

Note: Do not issue a command with the same UUID, it cannot replace a previous identical UUID characteristic but creates a redundant one.

The RNBD451 module supports up to four private services with eight characteristics for each service and six public services with eight characteristics for each service.

Example: PC,11223344556677889900AABBCCDDEEFF,1A,05

// Define a private characteristic with UUID 0x11223344556677889900AABBCCDDEEFF.

// It is readable, writable and can perform notification.

// Maximum data size for this characteristic is five octets.

Response: AOK // Success
Err

// Syntax error, invalid parameter or not enough space to add new characteristics

Note: The PDS stores the defined services. The defined services are effective immediately.