pairing_api.h
The pairing module is used to exchange data between two devices and make them connect with each other.
- Copyright
Copyright (C) 2023 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.
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.
-
void pairing_abort(void)
Abort current pairing procedure.
The application must handle the abort event.
-
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.
-
swc_uwb_regulation_t uwb_regulation
Ultra-wideband regulation used for the pairing process.
-
uint8_t *memory_pool
Memory pool instance from which memory allocation is done.
-
uint32_t memory_pool_size
Memory pool size in bytes.
-
uint64_t app_code