Skip to content

Lock IDs

In the Tapkey Lock Control Protocol (TLCP), locking devices are identified by the TLCP lock ID, which is a byte array of dynamic length (in the context of the Tapkey Mobile SDK sometimes called the physicalLockId). The ID has the following format (each character represents one byte):

LLXXXX
  • LL: The length of the actual ID (XXXX), encoded in 2 bytes, little endian.
  • XXXX: The actual ID.

The following ID of six bytes length has two bytes length header and four bytes ID payload:

04001234BFFB

The TLCP lock ID is represented in various formats throughout the Tapkey ecosystem:

  • Pretty format: To the customer, the ID is always presented in pretty format, that is, HEX formatted without length header, bytes separated with dashes, e.g. 12-34-BF-FB.
  • As byte array: Throughout the TLCP protocol, IDs are simply handled as byte arrays.
  • Base 64 encoding in JSON: Within the Tapkey Management API, IDs are encoded as regular Base 64 strings when contained in JSON entities (e.g. EjS/+w==).
  • Base 64 encoding in URLs: Within the Tapkey Management API, IDs are encoded as URL-safe Base 64 strings when contained in request URLs (e.g. EjS_-w) (see RFC 3548 section 4; i.e. + and / are replaced by - and _ and trailing = are omitted).