Biometry API
The Biometry module provides access to the device's biometric and electrophysiological sensing subsystems: electromyography (EMG), photoplethysmography (PPG, covering raw waveform data, processed heart rate, and heart rate variability), bioelectrical impedance analysis (BIA), and current feedback from the haptic electrodes.
The common flow is the same across subsystems: register a data update callback, then start streaming. Once streaming has started, each new data frame produced by the device is delivered asynchronously to the registered callback. When data is no longer needed, streaming should be stopped to release the associated device and host resources.
Functions#
ts_emg_set_update_callback#
TsStatusCode ts_emg_set_update_callback(TsDeviceHandle* dev, TsEmgUpdatedCallback ts_callback, void* user_data);
Sets the EMG data update callback.
Preconditions
Parameters
dev: TsDeviceHandle*, in
handle of the attached device whose EMG sensors are being configured
ts_callback: TsEmgUpdatedCallback, in
function to invoke with each new TsEmgData frame
user_data: void*, in
opaque pointer passed through unchanged to every invocation of ts_callback
Returns: TsStatusCode
TsStatusCode indicating whether the callback was registered successfully
See also: TsEmgUpdatedCallback
ts_emg_set_options#
TsStatusCode ts_emg_set_options(TsDeviceHandle* dev, TsEmgOptions emg_options);
Sets the EMG filter and sampling configuration.
Preconditions
Parameters
dev: TsDeviceHandle*, in
handle of the attached device whose EMG sensors are being configured
emg_options: TsEmgOptions, in
filter bandwidth, sampling frequency, and sample size to apply
Returns: TsStatusCode
TsStatusCode indicating whether the options were applied successfully
See also: TsEmgOptions
ts_emg_start_streaming#
TsStatusCode ts_emg_start_streaming(TsDeviceHandle* dev);
Starts EMG sensor streaming.
Preconditions
ts_initialize or ts_initialize_with_path, ts_emg_set_update_callback
Parameters
dev: TsDeviceHandle*, in
handle of the attached device whose EMG sensors should start streaming
Returns: TsStatusCode
TsStatusCode indicating whether streaming was started successfully
See also: TsEmgUpdatedCallback, ts_emg_stop_streaming
ts_emg_stop_streaming#
TsStatusCode ts_emg_stop_streaming(TsDeviceHandle* dev);
Stops EMG sensor streaming.
Preconditions
Parameters
dev: TsDeviceHandle*, in
handle of the attached device whose EMG sensors should stop streaming
Returns: TsStatusCode
TsStatusCode indicating whether streaming was stopped successfully
See also: ts_emg_start_streaming
ts_emg_get_options#
TsStatusCode ts_emg_get_options(const TsEmgData emg_data, TsEmgOptions* sensor_options);
Gets the EMG filter and sampling configuration active when a frame was captured.
Preconditions
ts_initialize or ts_initialize_with_path, TsEmgUpdatedCallback
Parameters
emg_data: const TsEmgData, in
EMG data frame handle received from TsEmgUpdatedCallback
sensor_options: TsEmgOptions*, out
preallocated structure to receive the active EMG sensor options
Returns: TsStatusCode
TsStatusCode indicating whether the options were retrieved successfully
See also: TsEmgUpdatedCallback
ts_emg_get_number_of_nodes#
TsStatusCode ts_emg_get_number_of_nodes(const TsEmgData emg_data, uint8_t* number_of_nodes);
Gets the number of EMG sensor nodes present in a data frame.
Preconditions
ts_initialize or ts_initialize_with_path, TsEmgUpdatedCallback
Parameters
emg_data: const TsEmgData, in
EMG data frame handle received from TsEmgUpdatedCallback
number_of_nodes: uint8_t*, out
number of EMG sensor nodes reporting data in this frame
Returns: TsStatusCode
TsStatusCode indicating whether the node count was retrieved successfully
See also: TsEmgUpdatedCallback
ts_emg_get_node_indexes#
TsStatusCode ts_emg_get_node_indexes(const TsEmgData emg_data, uint8_t* node_indexes, uint8_t number_of_nodes);
Gets the indexes of the EMG sensor nodes present in a data frame.
Preconditions
ts_initialize or ts_initialize_with_path, TsEmgUpdatedCallback
Parameters
emg_data: const TsEmgData, in
EMG data frame handle received from TsEmgUpdatedCallback
node_indexes: uint8_t*, out
preallocated array to receive the node indexes
number_of_nodes: uint8_t, in
size of the node_indexes array, typically obtained from ts_emg_get_number_of_nodes
Returns: TsStatusCode
TsStatusCode indicating whether the node indexes were retrieved successfully
See also: TsEmgUpdatedCallback
ts_emg_get_number_of_channels#
TsStatusCode ts_emg_get_number_of_channels(const TsEmgData emg_data, uint8_t node_index, uint64_t* number_of_channels);
Gets the number of EMG channels available on a given node.
Preconditions
ts_initialize or ts_initialize_with_path, TsEmgUpdatedCallback
Parameters
emg_data: const TsEmgData, in
EMG data frame handle received from TsEmgUpdatedCallback
node_index: uint8_t, in
index of the node to query, obtained from ts_emg_get_node_indexes
number_of_channels: uint64_t*, out
number of EMG channels available on the specified node
Returns: TsStatusCode
TsStatusCode indicating whether the channel count was retrieved successfully
See also: TsEmgUpdatedCallback
ts_emg_get_channel_data_size#
TsStatusCode ts_emg_get_channel_data_size(const TsEmgData emg_data, uint8_t node_index, uint64_t* size);
Gets the number of raw ADC samples available for a node's EMG channels.
Preconditions
ts_initialize or ts_initialize_with_path, TsEmgUpdatedCallback
Parameters
emg_data: const TsEmgData, in
EMG data frame handle received from TsEmgUpdatedCallback
node_index: uint8_t, in
index of the node whose channel sample count is requested
size: uint64_t*, out
number of raw samples available per channel on this node
Returns: TsStatusCode
TsStatusCode indicating whether the sample count was retrieved successfully
See also: ts_emg_get_channel_data, TsEmgUpdatedCallback
ts_emg_get_channel_data#
TsStatusCode ts_emg_get_channel_data(const TsEmgData emg_data, uint8_t node_index, uint32_t channel_index, int64_t* channel_data, uint64_t channel_data_size);
Gets the raw ADC sample data for a specific EMG channel.
Preconditions
ts_initialize or ts_initialize_with_path, TsEmgUpdatedCallback
Parameters
emg_data: const TsEmgData, in
EMG data frame handle received from TsEmgUpdatedCallback
node_index: uint8_t, in
index of the node to read channel data from
channel_index: uint32_t, in
index of the channel on that node to read data from
channel_data: int64_t*, out
pointer to preallocated block of memory to fill with raw EMG sample values
channel_data_size: uint64_t, in
number of samples that channel_data can hold, typically from ts_emg_get_channel_data_size
Returns: TsStatusCode
TsStatusCode indicating whether the channel data was retrieved successfully
See also: ts_emg_get_channel_data_size, TsEmgUpdatedCallback
ts_emg_get_number_of_node_timestamps#
TsStatusCode ts_emg_get_number_of_node_timestamps(const TsEmgData emg_data, uint8_t node_index, uint64_t* number_of_timestamps);
Gets the number of timestamps recorded for a node's EMG samples.
Preconditions
ts_initialize or ts_initialize_with_path, TsEmgUpdatedCallback
Parameters
emg_data: const TsEmgData, in
EMG data frame handle received from TsEmgUpdatedCallback
node_index: uint8_t, in
index of the node whose timestamp count is requested
number_of_timestamps: uint64_t*, out
number of timestamps recorded for this node's samples
Returns: TsStatusCode
TsStatusCode indicating whether the timestamp count was retrieved successfully
See also: ts_emg_get_node_timestamps, TsEmgUpdatedCallback
ts_emg_get_node_timestamps#
TsStatusCode ts_emg_get_node_timestamps(const TsEmgData emg_data, uint8_t node_index, uint64_t* timestamps, uint64_t number_of_timestamps);
Gets the sample timestamps recorded for an EMG node.
Preconditions
ts_initialize or ts_initialize_with_path, TsEmgUpdatedCallback
Parameters
emg_data: const TsEmgData, in
EMG data frame handle received from TsEmgUpdatedCallback
node_index: uint8_t, in
index of the node to read timestamps from
timestamps: uint64_t*, out
pointer to preallocated block of memory to fill with sample timestamps
number_of_timestamps: uint64_t, in
number of timestamps that timestamps can hold, typically from ts_emg_get_number_of_node_timestamps
Returns: TsStatusCode
TsStatusCode indicating whether the timestamps were retrieved successfully
ts_ppg_set_update_callback#
TsStatusCode ts_ppg_set_update_callback(TsDeviceHandle* dev, TsPpgUpdatedCallback ts_callback, void* user_data);
Sets the processed PPG data update callback.
Preconditions
Parameters
dev: TsDeviceHandle*, in
handle of the attached device whose PPG sensors are being configured
ts_callback: TsPpgUpdatedCallback, in
function to invoke with each new TsPpgData frame
user_data: void*, in
opaque pointer passed through unchanged to every invocation of ts_callback
Returns: TsStatusCode
TsStatusCode indicating whether the callback was registered successfully
See also: ts_ppg_start_streaming
ts_hrv_set_update_callback#
TsStatusCode ts_hrv_set_update_callback(TsDeviceHandle* dev, TsHrvUpdatedCallback ts_callback, void* user_data);
Sets the HRV data update callback.
Preconditions
Parameters
dev: TsDeviceHandle*, in
handle of the attached device whose PPG sensors are being configured
ts_callback: TsHrvUpdatedCallback, in
function to invoke with each new TsHrvData result
user_data: void*, in
opaque pointer passed through unchanged to every invocation of ts_callback
Returns: TsStatusCode
TsStatusCode indicating whether the callback was registered successfully
See also: ts_ppg_start_streaming
ts_ppg_start_streaming#
TsStatusCode ts_ppg_start_streaming(TsDeviceHandle* dev);
Starts processed PPG streaming.
Preconditions
ts_initialize or ts_initialize_with_path, ts_ppg_set_update_callback
Parameters
dev: TsDeviceHandle*, in
handle of the attached device whose PPG sensors should start streaming
Returns: TsStatusCode
TsStatusCode indicating whether streaming was started successfully
See also: ts_ppg_set_update_callback, ts_ppg_stop_streaming
ts_ppg_stop_streaming#
TsStatusCode ts_ppg_stop_streaming(TsDeviceHandle* dev);
Stops processed PPG streaming.
Preconditions
Parameters
dev: TsDeviceHandle*, in
handle of the attached device whose PPG sensors should stop streaming
Returns: TsStatusCode
TsStatusCode indicating whether streaming was stopped successfully
ts_ppg_get_number_of_nodes#
TsStatusCode ts_ppg_get_number_of_nodes(const TsPpgData ppg_data, uint8_t* number_of_nodes);
Gets the number of PPG sensor nodes present in a data frame.
Preconditions
ts_initialize or ts_initialize_with_path, TsPpgUpdatedCallback
Parameters
ppg_data: const TsPpgData, in
processed PPG data frame handle received from TsPpgUpdatedCallback
number_of_nodes: uint8_t*, out
number of PPG sensor nodes reporting data in this frame
Returns: TsStatusCode
TsStatusCode indicating whether the node count was retrieved successfully
See also: ts_ppg_get_node_indexes, TsPpgUpdatedCallback
ts_ppg_get_node_indexes#
TsStatusCode ts_ppg_get_node_indexes(const TsPpgData ppg_data, uint8_t* node_indexes, uint8_t number_of_indexes);
Gets the indexes of the PPG sensor nodes present in a data frame.
Preconditions
ts_initialize or ts_initialize_with_path, TsPpgUpdatedCallback
Parameters
ppg_data: const TsPpgData, in
processed PPG data frame handle received from TsPpgUpdatedCallback
node_indexes: uint8_t*, out
preallocated array to receive the node indexes
number_of_indexes: uint8_t, in
size of the node_indexes array, typically obtained from ts_ppg_get_number_of_nodes
Returns: TsStatusCode
TsStatusCode indicating whether the node indexes were retrieved successfully
See also: ts_ppg_get_number_of_nodes, TsPpgUpdatedCallback
ts_ppg_get_heart_rate#
TsStatusCode ts_ppg_get_heart_rate(const TsPpgData ppg_data, uint8_t node_index, uint32_t* heart_rate);
Gets the heart rate calculated for a PPG sensor node.
Preconditions
ts_initialize or ts_initialize_with_path, TsPpgUpdatedCallback
Parameters
ppg_data: const TsPpgData, in
processed PPG data frame handle received from TsPpgUpdatedCallback
node_index: uint8_t, in
index of the node to read heart rate from
heart_rate: uint32_t*, out
heart rate computed by the PPG processor for this node
Returns: TsStatusCode
TsStatusCode indicating whether the heart rate was retrieved successfully
See also: ts_ppg_get_node_indexes, TsPpgUpdatedCallback
ts_ppg_is_heart_rate_valid#
TsStatusCode ts_ppg_is_heart_rate_valid(const TsPpgData ppg_data, uint8_t node_index, bool* is_valid);
Checks whether the current heart rate reading for a PPG node is valid.
Preconditions
ts_initialize or ts_initialize_with_path, TsPpgUpdatedCallback
Parameters
ppg_data: const TsPpgData, in
processed PPG data frame handle received from TsPpgUpdatedCallback
node_index: uint8_t, in
index of the node to check heart rate validity for
is_valid: bool*, out
true if the node's current heart rate reading is valid
Returns: TsStatusCode
TsStatusCode indicating whether the validity state was retrieved successfully
See also: ts_ppg_get_node_indexes, TsPpgUpdatedCallback
ts_ppg_get_timestamp#
TsStatusCode ts_ppg_get_timestamp(const TsPpgData ppg_data, uint8_t node_index, uint64_t* timestamp);
Gets the timestamp of the processed PPG data for a node.
Preconditions
ts_initialize or ts_initialize_with_path, TsPpgUpdatedCallback
Parameters
ppg_data: const TsPpgData, in
processed PPG data frame handle received from TsPpgUpdatedCallback
node_index: uint8_t, in
index of the node to read the timestamp from
timestamp: uint64_t*, out
time point of data capturing in milliseconds
Returns: TsStatusCode
TsStatusCode indicating whether the timestamp was retrieved successfully
See also: ts_ppg_get_node_indexes, TsPpgUpdatedCallback
ts_hrv_get_data#
TsStatusCode ts_hrv_get_data(const TsHrvData hrv_data, TsHrv* hrv);
Gets the processed HRV metrics from a PPG sensor.
Preconditions
ts_initialize or ts_initialize_with_path, TsPpgUpdatedCallback
Parameters
hrv_data: const TsHrvData, in
HRV result handle received from TsHrvUpdatedCallback
hrv: TsHrv*, out
preallocated structure to receive the processed HRV metrics
Returns: TsStatusCode
TsStatusCode indicating whether the HRV data was retrieved successfully
See also: TsHrvUpdatedCallback
ts_ppg_raw_set_update_callback#
TsStatusCode ts_ppg_raw_set_update_callback(TsDeviceHandle* dev, TsRawPpgUpdatedCallback ts_callback, void* user_data);
Sets the raw PPG data update callback.
Preconditions
Parameters
dev: TsDeviceHandle*, in
handle of the attached device whose PPG sensors are being configured
ts_callback: TsRawPpgUpdatedCallback, in
function to invoke with each new TsRawPpgData frame
user_data: void*, in
opaque pointer passed through unchanged to every invocation of ts_callback
Returns: TsStatusCode
TsStatusCode indicating whether the callback was registered successfully
See also: ts_ppg_raw_start_streaming
ts_ppg_raw_start_streaming#
TsStatusCode ts_ppg_raw_start_streaming(TsDeviceHandle* dev);
Parameters
dev: TsDeviceHandle*
Returns: TsStatusCode
ts_ppg_raw_stop_streaming#
TsStatusCode ts_ppg_raw_stop_streaming(TsDeviceHandle* dev);
Parameters
dev: TsDeviceHandle*
Returns: TsStatusCode
ts_ppg_calibrate#
TsStatusCode ts_ppg_calibrate(TsDeviceHandle* dev);
Re-triggers calibration of the PPG processor.
Preconditions
Parameters
dev: TsDeviceHandle*, in
handle of the attached device whose PPG processor should be recalibrated
Returns: TsStatusCode
TsStatusCode indicating whether calibration was (re)started successfully
ts_ppg_raw_get_number_of_nodes#
TsStatusCode ts_ppg_raw_get_number_of_nodes(const TsRawPpgData raw_ppg_data, uint8_t* number_of_nodes);
Gets the number of PPG sensor nodes present in a raw data frame.
Preconditions
ts_initialize or ts_initialize_with_path, TsRawPpgUpdatedCallback
Parameters
raw_ppg_data: const TsRawPpgData, in
raw PPG data frame handle received from TsRawPpgUpdatedCallback
number_of_nodes: uint8_t*, out
number of PPG sensor nodes reporting raw data in this frame
Returns: TsStatusCode
TsStatusCode indicating whether the node count was retrieved successfully
ts_ppg_raw_get_node_indexes#
TsStatusCode ts_ppg_raw_get_node_indexes(const TsRawPpgData raw_ppg_data, uint8_t* node_indexes, uint8_t number_of_indexes);
Gets the indexes of the PPG sensor nodes present in a raw data frame.
Preconditions
ts_initialize or ts_initialize_with_path, TsRawPpgUpdatedCallback
Parameters
raw_ppg_data: const TsRawPpgData, in
raw PPG data frame handle received from TsRawPpgUpdatedCallback
node_indexes: uint8_t*, out
preallocated array to receive the node indexes
number_of_indexes: uint8_t, in
size of the node_indexes array, typically obtained from ts_ppg_raw_get_number_of_nodes
Returns: TsStatusCode
TsStatusCode indicating whether the node indexes were retrieved successfully
ts_ppg_raw_get_data_size#
TsStatusCode ts_ppg_raw_get_data_size(const TsRawPpgData raw_ppg_data, uint8_t node_index, uint64_t* size);
Gets the number of raw samples available per colour channel for a node.
Preconditions
ts_initialize or ts_initialize_with_path, TsRawPpgUpdatedCallback
Parameters
raw_ppg_data: const TsRawPpgData, in
raw PPG data frame handle received from TsRawPpgUpdatedCallback
node_index: uint8_t, in
index of the node whose raw sample count is requested
size: uint64_t*, out
number of raw samples available per colour channel for this node
Returns: TsStatusCode
TsStatusCode indicating whether the sample count was retrieved successfully
See also: TsRawPpgUpdatedCallback
ts_ppg_raw_get_infrared_data#
TsStatusCode ts_ppg_raw_get_infrared_data(const TsRawPpgData raw_ppg_data, uint8_t node_index, uint64_t* infrared_data, uint64_t size);
Gets the raw infrared channel samples from a PPG sensor node.
Preconditions
ts_initialize or ts_initialize_with_path, TsRawPpgUpdatedCallback
Parameters
raw_ppg_data: const TsRawPpgData, in
raw PPG data frame handle received from TsRawPpgUpdatedCallback
node_index: uint8_t, in
index of the node to read infrared data from
infrared_data: uint64_t*, out
preallocated memory to receive raw infrared samples from the PPG sensor
size: uint64_t, in
number of samples that infrared_data can hold, from ts_ppg_raw_get_data_size
Returns: TsStatusCode
TsStatusCode indicating whether the infrared data was retrieved successfully
See also: ts_ppg_raw_get_data_size, TsRawPpgUpdatedCallback
ts_ppg_raw_get_red_data#
TsStatusCode ts_ppg_raw_get_red_data(const TsRawPpgData raw_ppg_data, uint8_t node_index, uint64_t* red_data, uint64_t size);
Gets the raw red channel samples from a PPG sensor node.
Preconditions
ts_initialize or ts_initialize_with_path, TsRawPpgUpdatedCallback
Parameters
raw_ppg_data: const TsRawPpgData, in
raw PPG data frame handle received from TsRawPpgUpdatedCallback
node_index: uint8_t, in
index of the node to read red data from
red_data: uint64_t*, out
preallocated memory to receive raw red channel samples from the PPG sensor
size: uint64_t, in
number of samples that red_data can hold, from ts_ppg_raw_get_data_size
Returns: TsStatusCode
TsStatusCode indicating whether the red channel data was retrieved successfully
See also: ts_ppg_raw_get_data_size, TsRawPpgUpdatedCallback
ts_ppg_raw_get_blue_data#
TsStatusCode ts_ppg_raw_get_blue_data(const TsRawPpgData raw_ppg_data, uint8_t node_index, uint64_t* blue_data, uint64_t size);
Gets the raw blue channel samples from a PPG sensor node.
Preconditions
ts_initialize or ts_initialize_with_path, TsRawPpgUpdatedCallback
Parameters
raw_ppg_data: const TsRawPpgData, in
raw PPG data frame handle received from TsRawPpgUpdatedCallback
node_index: uint8_t, in
index of the node to read blue data from
blue_data: uint64_t*, out
preallocated memory to receive raw blue channel samples from the PPG sensor
size: uint64_t, in
number of samples that blue_data can hold, from ts_ppg_raw_get_data_size
Returns: TsStatusCode
TsStatusCode indicating whether the blue channel data was retrieved successfully
See also: ts_ppg_raw_get_data_size, TsRawPpgUpdatedCallback
ts_ppg_raw_get_green_data#
TsStatusCode ts_ppg_raw_get_green_data(const TsRawPpgData raw_ppg_data, uint8_t node_index, uint64_t* green_data, uint64_t size);
Gets the raw green channel samples from a PPG sensor node.
Preconditions
ts_initialize or ts_initialize_with_path, TsRawPpgUpdatedCallback
Parameters
raw_ppg_data: const TsRawPpgData, in
raw PPG data frame handle received from TsRawPpgUpdatedCallback
node_index: uint8_t, in
index of the node to read green data from
green_data: uint64_t*, out
preallocated memory to receive raw green channel samples from the PPG sensor
size: uint64_t, in
number of samples that green_data can hold, from ts_ppg_raw_get_data_size
Returns: TsStatusCode
TsStatusCode indicating whether the green channel data was retrieved successfully
See also: ts_ppg_raw_get_data_size, TsRawPpgUpdatedCallback
ts_ppg_raw_get_timestamp#
TsStatusCode ts_ppg_raw_get_timestamp(const TsRawPpgData raw_ppg_data, uint8_t node_index, uint64_t* timestamp);
Gets the timestamp of the last raw PPG sample for a node.
Preconditions
ts_initialize or ts_initialize_with_path, TsPpgUpdatedCallback
Parameters
raw_ppg_data: const TsRawPpgData, in
raw PPG data frame handle received from TsRawPpgUpdatedCallback
node_index: uint8_t, in
index of the node to read the timestamp from
timestamp: uint64_t*, out
time point of raw data capturing in milliseconds
Returns: TsStatusCode
TsStatusCode indicating whether the timestamp was retrieved successfully
See also: TsRawPpgUpdatedCallback
ts_bia_set_update_callback#
TsStatusCode ts_bia_set_update_callback(TsDeviceHandle* dev, TsBiaUpdatedCallback ts_callback, void* user_data);
Sets the BIA data update callback.
Preconditions
Parameters
dev: TsDeviceHandle*, in
handle of the attached device whose BIA sensors are being configured
ts_callback: TsBiaUpdatedCallback, in
function to invoke with each new TsBiaData frame
user_data: void*, in
opaque pointer passed through unchanged to every invocation of ts_callback
Returns: TsStatusCode
TsStatusCode indicating whether the callback was registered successfully
See also: ts_bia_start_streaming
ts_bia_set_streaming_config#
TsStatusCode ts_bia_set_streaming_config(TsDeviceHandle* dev, const TsBiaConfig* config);
Sets the BIA frequency sweep configuration.
Preconditions
Parameters
dev: TsDeviceHandle*, in
handle of the attached device whose BIA sensors are being configured
config: const TsBiaConfig*, in
channel selection and frequency sweep parameters to apply
Returns: TsStatusCode
TsStatusCode indicating whether the configuration was applied successfully
ts_bia_start_streaming#
TsStatusCode ts_bia_start_streaming(TsDeviceHandle* dev);
Starts BIA data streaming.
Preconditions
ts_initialize or ts_initialize_with_path, ts_bia_set_update_callback
Parameters
dev: TsDeviceHandle*, in
handle of the attached device whose BIA sensors should start streaming
Returns: TsStatusCode
TsStatusCode indicating whether streaming was started successfully
See also: ts_bia_set_update_callback
ts_bia_stop_streaming#
TsStatusCode ts_bia_stop_streaming(TsDeviceHandle* dev);
Stops BIA data streaming.
Preconditions
Parameters
dev: TsDeviceHandle*, in
handle of the attached device whose BIA sensors should stop streaming
Returns: TsStatusCode
TsStatusCode indicating whether streaming was stopped successfully
ts_bia_get_number_of_channels#
TsStatusCode ts_bia_get_number_of_channels(const TsBiaData bia_data, uint64_t* number_of_channels);
Gets the number of BIA channels present in a data frame.
Preconditions
ts_initialize or ts_initialize_with_path, TsBiaUpdatedCallback
Parameters
bia_data: const TsBiaData, in
BIA data frame handle received from TsBiaUpdatedCallback
number_of_channels: uint64_t*, out
number of BIA channels present in this frame
Returns: TsStatusCode
TsStatusCode indicating whether the channel count was retrieved successfully
See also: ts_bia_get_node_channel_indexes, TsBiaUpdatedCallback
ts_bia_get_channels_indexes#
TsStatusCode ts_bia_get_channels_indexes(const TsBiaData bia_data, uint32_t* channel_indexes, uint64_t size);
Gets the indexes of the BIA channels present in a data frame.
Preconditions
ts_initialize or ts_initialize_with_path, TsBiaUpdatedCallback
Parameters
bia_data: const TsBiaData, in
BIA data frame handle received from TsBiaUpdatedCallback
channel_indexes: uint32_t*, out
preallocated array to receive the channel indexes
size: uint64_t, in
size of the channel_indexes array, typically obtained from ts_bia_get_number_of_channels
Returns: TsStatusCode
TsStatusCode indicating whether the channel indexes were retrieved successfully
ts_bia_get_channel_number_of_frequencies#
TsStatusCode ts_bia_get_channel_number_of_frequencies(const TsBiaData bia_data, uint32_t channel_index, uint64_t* number_of_frequencies);
Gets the number of sweep frequencies measured for a BIA channel.
Preconditions
ts_initialize or ts_initialize_with_path, TsBiaUpdatedCallback
Parameters
bia_data: const TsBiaData, in
BIA data frame handle received from TsBiaUpdatedCallback
channel_index: uint32_t, in
index of the channel whose frequency count is requested
number_of_frequencies: uint64_t*, out
number of sweep frequencies measured for this channel
Returns: TsStatusCode
TsStatusCode indicating whether the frequency count was retrieved successfully
ts_bia_get_channel_frequencies#
TsStatusCode ts_bia_get_channel_frequencies(const TsBiaData bia_data, uint32_t channel_index, uint32_t* frequencies, uint64_t size);
Gets the sweep frequency values measured for a BIA channel.
Preconditions
ts_initialize or ts_initialize_with_path, TsBiaUpdatedCallback
Parameters
bia_data: const TsBiaData, in
BIA data frame handle received from TsBiaUpdatedCallback
channel_index: uint32_t, in
index of the channel to read frequencies from
frequencies: uint32_t*, out
preallocated array to receive the sweep frequency values
size: uint64_t, in
size of the frequencies array, typically obtained from ts_bia_get_channel_number_of_frequencies
Returns: TsStatusCode
TsStatusCode indicating whether the frequency values were retrieved successfully
ts_bia_get_channel_frequency_complex_value#
TsStatusCode ts_bia_get_channel_frequency_complex_value(const TsBiaData bia_data, uint32_t channel_index, uint32_t frequency_value, TsComplex* complex_value);
Gets the complex impedance value measured at a specific frequency on a channel.
Preconditions
ts_initialize or ts_initialize_with_path, TsBiaUpdatedCallback
Parameters
bia_data: const TsBiaData, in
BIA data frame handle received from TsBiaUpdatedCallback
channel_index: uint32_t, in
index of the channel to read the measurement from
frequency_value: uint32_t, in
sweep frequency (in Hz) to retrieve the measurement for
complex_value: TsComplex*, out
complex impedance value measured at the given frequency
Returns: TsStatusCode
TsStatusCode indicating whether the complex value was retrieved successfully
See also: TsBiaUpdatedCallback
ts_current_feedback_set_update_callback#
TsStatusCode ts_current_feedback_set_update_callback(TsDeviceHandle* dev, TsCurrentFeedbackUpdatedCallback ts_callback, void* user_data);
Sets the current feedback data update callback.
Preconditions
Parameters
dev: TsDeviceHandle*, in
handle of the attached device whose current feedback is being configured
ts_callback: TsCurrentFeedbackUpdatedCallback, in
function to invoke with each new TsCurrentFeedbackData frame
user_data: void*, in
opaque pointer passed through unchanged to every invocation of ts_callback
Returns: TsStatusCode
TsStatusCode indicating whether the callback was registered successfully
See also: ts_current_feedback_start_streaming
ts_current_feedback_start_streaming#
TsStatusCode ts_current_feedback_start_streaming(TsDeviceHandle* dev);
Starts current feedback data streaming.
Preconditions
ts_initialize or ts_initialize_with_path, ts_current_feedback_set_update_callback
Parameters
dev: TsDeviceHandle*, in
handle of the attached device whose current feedback should start streaming
Returns: TsStatusCode
TsStatusCode indicating whether streaming was started successfully
See also: ts_current_feedback_set_update_callback
ts_current_feedback_stop_streaming#
TsStatusCode ts_current_feedback_stop_streaming(TsDeviceHandle* dev);
Stops current feedback data streaming.
Preconditions
Parameters
dev: TsDeviceHandle*, in
handle of the attached device whose current feedback should stop streaming
Returns: TsStatusCode
TsStatusCode indicating whether streaming was stopped successfully
ts_current_feedback_get_number_of_nodes#
TsStatusCode ts_current_feedback_get_number_of_nodes(TsCurrentFeedbackData data, uint64_t* number_of_nodes);
Gets the number of nodes present in a current feedback frame.
Preconditions
Parameters
data: TsCurrentFeedbackData, in
current feedback data frame handle received from the update callback
number_of_nodes: uint64_t*, out
number of nodes reporting current feedback data in this frame
Returns: TsStatusCode
TsStatusCode indicating whether the node count was retrieved successfully
ts_current_feedback_get_nodes_indexes#
TsStatusCode ts_current_feedback_get_nodes_indexes(TsCurrentFeedbackData data, uint8_t* nodes_indexes, uint64_t number_of_nodes);
Gets the indexes of the nodes present in a current feedback frame.
Preconditions
Parameters
data: TsCurrentFeedbackData, in
current feedback data frame handle received from the update callback
nodes_indexes: uint8_t*, out
preallocated array to receive the node indexes
number_of_nodes: uint64_t, in
size of the nodes_indexes array, typically obtained from ts_current_feedback_get_number_of_nodes
Returns: TsStatusCode
TsStatusCode indicating whether the node indexes were retrieved successfully
ts_current_feedback_get_number_of_node_channels#
TsStatusCode ts_current_feedback_get_number_of_node_channels(TsCurrentFeedbackData data, uint8_t node_index, uint64_t* number_of_channels);
Gets the number of channels reporting current feedback on a node.
Preconditions
Parameters
data: TsCurrentFeedbackData, in
current feedback data frame handle received from the update callback
node_index: uint8_t, in
index of the node whose channel count is requested
number_of_channels: uint64_t*, out
number of channels reporting current feedback on this node
Returns: TsStatusCode
TsStatusCode indicating whether the channel count was retrieved successfully
ts_current_feedback_get_channels_indexes#
TsStatusCode ts_current_feedback_get_channels_indexes(TsCurrentFeedbackData data, uint8_t node_index, uint32_t* channels_indexes, uint64_t number_of_channels);
Gets the indexes of the channels reporting current feedback on a node.
Preconditions
Parameters
data: TsCurrentFeedbackData, in
current feedback data frame handle received from the update callback
node_index: uint8_t, in
index of the node to read channel indexes from
channels_indexes: uint32_t*, out
preallocated array to receive the channel indexes
number_of_channels: uint64_t, in
size of the channels_indexes array, typically obtained from ts_current_feedback_get_number_of_node_channels
Returns: TsStatusCode
TsStatusCode indicating whether the channel indexes were retrieved successfully
ts_current_feedback_get_channel_value#
TsStatusCode ts_current_feedback_get_channel_value(TsCurrentFeedbackData data, uint8_t node_index, uint32_t channel_index, uint32_t* channel_value);
Gets the measured current feedback value for a specific channel.
Preconditions
Parameters
data: TsCurrentFeedbackData, in
current feedback data frame handle received from the update callback
node_index: uint8_t, in
index of the node to read the channel value from
channel_index: uint32_t, in
index of the channel on that node to read the value from
channel_value: uint32_t*, out
measured current feedback value for the specified channel
Returns: TsStatusCode
TsStatusCode indicating whether the channel value was retrieved successfully
