pairing_api.h

The pairing module is used to exchange data between two devices and make them connect with each other.

Copyright

Copyright (C) 2026 SPARK Microsystems International Inc. All rights reserved.

License

This source code is proprietary and subject to the SPARK Microsystems Software EULA found in this package in file EULA.txt.

Author

SPARK FW Team.

Defines

PAIRING_SR1x20_CHANNEL_FREQUENCY 195

Channel frequency for SR1x20 radios.

This frequency corresponds to the IEEE 802.15.4 UWB channel 9.

Note

For SR1x20 radios only. Frequency code 195 corresponds to 7.987 GHz (195 × 40.96 MHz), within the SR1x20 supported range of 6.0 - 9.3 GHz GHz (codes 146-227).

PAIRING_SR1x10_CHANNEL_FREQUENCY 100

Channel frequency for SR1x10 radios.

Note

For SR1x10 radios only. Frequency code 100 corresponds to 4.096 GHz (100 × 40.96 MHz), within the SR1x10 supported range of 3.1 - 5.8 GHz (codes 75-142).

Typedefs

typedef struct pairing_cfg pairing_cfg_t

Pairing parameters from the application.

Functions

pairing_event_t pairing_coordinator_start(pairing_cfg_t *pairing_cfg, pairing_assigned_address_t *pairing_assigned_address, pairing_discovery_list_t *discovery_list, uint8_t discovery_list_size, pairing_error_t *pairing_err)

Start a pairing procedure with the coordinator.

Parameters:
  • pairing_cfg – Pairing configurations from the application.

  • pairing_assigned_address[out] Pairing addresses exchanged during the pairing procedure.

  • discovery_list[in] List of discovered devices used by the coordinator.

  • discovery_list_size[in] The size of the discovery list.

  • pairing_err[out] Pairing module error code.

Returns:

The pairing event.

pairing_event_t pairing_node_start(pairing_cfg_t *pairing_cfg, pairing_assigned_address_t *pairing_assigned_address, uint8_t device_role, pairing_error_t *pairing_err)

Start a pairing procedure with the node.

Parameters:
  • pairing_cfg – Pairing configurations from the application.

  • pairing_assigned_address[out] Pairing addresses exchanged during the pairing procedure.

  • device_role[in] Application level device role from the node.

  • pairing_err[out] Pairing module error code.

Returns:

The pairing event.

swc_error_t pairing_get_swc_error(void)

Get the SWC error that occurred during the pairing.

Returns:

The SWC error.

void pairing_abort(void)

Abort current pairing procedure.

Note

The application must handle the abort event.

void pairing_set_legacy_header_packing(bool enabled)

Enable or disable legacy header packing for the pairing procedure.

Note

When enabled, pairing uses byte-aligned headers for backward compatibility with SDK version 2.3 and earlier. Must be called before pairing_coordinator_start() or pairing_node_start().

Parameters:

enabled[in] true to enable legacy header packing, false to disable.

struct pairing_cfg
#include <pairing_api.h>

Pairing parameters from the application.

Public Members

uint64_t app_code

Application code to prevent pairing unwanted devices.

uint16_t timeout_sec

The timeout period in seconds after which the pairing process will stop.

void (*application_callback)(void)

Optional application callback function pointer.

void (*context_switch_callback)(void)

A function pointer to the logic initiating context switches.

uint8_t *memory_pool

Memory pool instance from which memory allocation is done.

uint32_t memory_pool_size

Memory pool size in bytes.