USRP Hardware Driver and USRP Manual: subdev_spec.h Source File

| USRP Hardware Driver and USRP Manual Version: 4.9.0.makepkg-0-g9ec1f582 UHD and USRP Manual |

Loading...
Searching...
No Matches
subdev_spec.h
Go to the documentation of this file.
1//
2// Copyright 2015 Ettus Research LLC
3// Copyright 2018 Ettus Research, a National Instruments Company
4//
5// SPDX-License-Identifier: GPL-3.0-or-later
6//
7
8#pragma once
9
10#include <uhd/config.h>
11#include <uhd/error.h>
12
13#include <stdbool.h>
14
16 typedef struct
17{
18 // Daughterboard slot name
19 char* db_name;
21 char* sd_name;
22} uhd_subdev_spec_pair_t;
23
24#ifdef __cplusplus
25# include <uhd/usrp/subdev_spec.hpp>
26# include <string>
27
28struct uhd_subdev_spec_t
29{
30 uhd::usrp::subdev_spec_t subdev_spec_cpp;
31 std::string last_error;
32};
33
34extern "C" {
35#else
36struct uhd_subdev_spec_t;
37#endif
38
40
46 typedef struct uhd_subdev_spec_t* uhd_subdev_spec_handle;
47
49 UHD_API uhd_error uhd_subdev_spec_pair_free(uhd_subdev_spec_pair_t* subdev_spec_pair);
50
52 UHD_API uhd_error uhd_subdev_spec_pairs_equal(const uhd_subdev_spec_pair_t* first,
53 const uhd_subdev_spec_pair_t* second,
54 bool* result_out);
55
57 UHD_API uhd_error uhd_subdev_spec_make(uhd_subdev_spec_handle* h, const char* markup);
58
60
64 UHD_API uhd_error uhd_subdev_spec_free(uhd_subdev_spec_handle* h);
65
67 UHD_API uhd_error uhd_subdev_spec_size(uhd_subdev_spec_handle h, size_t* size_out);
68
70 UHD_API uhd_error uhd_subdev_spec_push_back(uhd_subdev_spec_handle h, const char* markup);
71
73 UHD_API uhd_error uhd_subdev_spec_at(
74 uhd_subdev_spec_handle h, size_t num, uhd_subdev_spec_pair_t* subdev_spec_pair_out);
75
77 UHD_API uhd_error uhd_subdev_spec_to_pp_string(
78 uhd_subdev_spec_handle h, char* pp_string_out, size_t strbuffer_len);
79
81 UHD_API uhd_error uhd_subdev_spec_to_string(
82 uhd_subdev_spec_handle h, char* string_out, size_t strbuffer_len);
83
85 UHD_API uhd_error uhd_subdev_spec_last_error(
86 uhd_subdev_spec_handle h, char* error_out, size_t strbuffer_len);
87
88#ifdef __cplusplus
89}
90
91 UHD_API uhd::usrp::subdev_spec_pair_t uhd_subdev_spec_pair_c_to_cpp(
92 const uhd_subdev_spec_pair_t* subdev_spec_pair_c);
93
94 UHD_API void uhd_subdev_spec_pair_cpp_to_c(
95 const uhd::usrp::subdev_spec_pair_t& subdev_spec_pair_cpp,
96 uhd_subdev_spec_pair_t* subdev_spec_pair_c);
97#endif
uhd::usrp::subdev_spec_t
Definition subdev_spec.hpp:60
config.h
UHD_API
#define UHD_API
Definition config.h:87
error.h
uhd_error
uhd_error
UHD error codes.
Definition error.h:20
uhd::usrp::subdev_spec_pair_t
Definition subdev_spec.hpp:21
uhd_subdev_spec_pair_t
Subdevice specification.
Definition subdev_spec.h:17
uhd_subdev_spec_pair_t::sd_name
char * sd_name
Subdevice name.
Definition subdev_spec.h:21
uhd_subdev_spec_pair_t::db_name
char * db_name
Definition subdev_spec.h:19
uhd_subdev_spec_size
UHD_API uhd_error uhd_subdev_spec_size(uhd_subdev_spec_handle h, size_t *size_out)
Check how many subdevice specifications are in this list.
uhd_subdev_spec_to_string
UHD_API uhd_error uhd_subdev_spec_to_string(uhd_subdev_spec_handle h, char *string_out, size_t strbuffer_len)
Get a markup string representation of the given list.
uhd_subdev_spec_pair_free
UHD_API uhd_error uhd_subdev_spec_pair_free(uhd_subdev_spec_pair_t *subdev_spec_pair)
Safely destroy any memory created in the generation of a uhd_subdev_spec_pair_t.
uhd_subdev_spec_make
UHD_API uhd_error uhd_subdev_spec_make(uhd_subdev_spec_handle *h, const char *markup)
Create a handle for a list of subdevice specifications.
uhd_subdev_spec_push_back
UHD_API uhd_error uhd_subdev_spec_push_back(uhd_subdev_spec_handle h, const char *markup)
Add a subdevice specification to this list.
uhd_subdev_spec_at
UHD_API uhd_error uhd_subdev_spec_at(uhd_subdev_spec_handle h, size_t num, uhd_subdev_spec_pair_t *subdev_spec_pair_out)
Get the subdevice specification at the given index.
uhd_subdev_spec_handle
struct uhd_subdev_spec_t * uhd_subdev_spec_handle
A C-level interface for working with a list of subdevice specifications.
Definition subdev_spec.h:46
uhd_subdev_spec_free
UHD_API uhd_error uhd_subdev_spec_free(uhd_subdev_spec_handle *h)
Safely destroy a subdevice specification handle.
uhd_subdev_spec_pairs_equal
UHD_API uhd_error uhd_subdev_spec_pairs_equal(const uhd_subdev_spec_pair_t *first, const uhd_subdev_spec_pair_t *second, bool *result_out)
Check to see if two subdevice specifications are equal.
uhd_subdev_spec_last_error
UHD_API uhd_error uhd_subdev_spec_last_error(uhd_subdev_spec_handle h, char *error_out, size_t strbuffer_len)
Get the last error recorded by the given handle.
uhd_subdev_spec_to_pp_string
UHD_API uhd_error uhd_subdev_spec_to_pp_string(uhd_subdev_spec_handle h, char *pp_string_out, size_t strbuffer_len)
Get a string representation of the given list.
subdev_spec.hpp