USRP Hardware Driver and USRP Manual  Version: 3.15.0.HEAD-0-g6563c537
UHD and USRP Manual
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 #ifndef INCLUDED_UHD_USRP_SUBDEV_SPEC_H
9 #define INCLUDED_UHD_USRP_SUBDEV_SPEC_H
10 
11 #include <uhd/config.h>
12 #include <uhd/error.h>
13 
14 #include <stdbool.h>
15 
17 typedef struct {
18  // Daughterboard slot name
19  char* db_name;
21  char* sd_name;
23 
24 #ifdef __cplusplus
25 #include <uhd/usrp/subdev_spec.hpp>
26 #include <string>
27 
28 struct uhd_subdev_spec_t {
29  uhd::usrp::subdev_spec_t subdev_spec_cpp;
30  std::string last_error;
31 };
32 
33 extern "C" {
34 #else
35 struct uhd_subdev_spec_t;
36 #endif
37 
39 
45 typedef struct uhd_subdev_spec_t* uhd_subdev_spec_handle;
46 
49  uhd_subdev_spec_pair_t *subdev_spec_pair
50 );
51 
54  const uhd_subdev_spec_pair_t* first,
55  const uhd_subdev_spec_pair_t* second,
56  bool *result_out
57 );
58 
61  uhd_subdev_spec_handle* h,
62  const char* markup
63 );
64 
66 
71  uhd_subdev_spec_handle* h
72 );
73 
76  uhd_subdev_spec_handle h,
77  size_t *size_out
78 );
79 
82  uhd_subdev_spec_handle h,
83  const char* markup
84 );
85 
88  uhd_subdev_spec_handle h,
89  size_t num,
90  uhd_subdev_spec_pair_t *subdev_spec_pair_out
91 );
92 
95  uhd_subdev_spec_handle h,
96  char* pp_string_out,
97  size_t strbuffer_len
98 );
99 
102  uhd_subdev_spec_handle h,
103  char* string_out,
104  size_t strbuffer_len
105 );
106 
109  uhd_subdev_spec_handle h,
110  char* error_out,
111  size_t strbuffer_len
112 );
113 
114 #ifdef __cplusplus
115 }
116 
117 UHD_API uhd::usrp::subdev_spec_pair_t uhd_subdev_spec_pair_c_to_cpp(
118  const uhd_subdev_spec_pair_t* subdev_spec_pair_c
119 );
120 
121 UHD_API void uhd_subdev_spec_pair_cpp_to_c(
122  const uhd::usrp::subdev_spec_pair_t &subdev_spec_pair_cpp,
123  uhd_subdev_spec_pair_t *subdev_spec_pair_c
124 );
125 #endif
126 
127 #endif /* INCLUDED_UHD_USRP_SUBDEV_SPEC_H */
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_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.
char * sd_name
Subdevice name.
Definition: subdev_spec.h:21
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.
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_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_API uhd_error uhd_subdev_spec_free(uhd_subdev_spec_handle *h)
Safely destroy a subdevice specification handle.
uhd_error
UHD error codes.
Definition: error.h:21
Definition: subdev_spec.hpp:21
Subdevice specification.
Definition: subdev_spec.h:17
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.
char * db_name
Definition: subdev_spec.h:19
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.
#define UHD_API
Definition: config.h:68
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.
Definition: subdev_spec.hpp:60
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:45
UHD_API uhd_error uhd_subdev_spec_push_back(uhd_subdev_spec_handle h, const char *markup)
Add a subdevice specification to this list.