USRP Hardware Driver and USRP Manual  Version: 003.009.007-0-g50839059
UHD and USRP Manual
subdev_spec.h
Go to the documentation of this file.
1 //
2 // Copyright 2015 Ettus Research LLC
3 //
4 // This program is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU General Public License as published by
6 // the Free Software Foundation, either version 3 of the License, or
7 // (at your option) any later version.
8 //
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
13 //
14 // You should have received a copy of the GNU General Public License
15 // along with this program. If not, see <http://www.gnu.org/licenses/>.
16 //
17 
18 #ifndef INCLUDED_UHD_USRP_SUBDEV_SPEC_H
19 #define INCLUDED_UHD_USRP_SUBDEV_SPEC_H
20 
21 #include <uhd/config.h>
22 #include <uhd/error.h>
23 
24 #include <stdbool.h>
25 
27 typedef struct {
28  // Daughterboard slot name
29  char* db_name;
31  char* sd_name;
33 
34 #ifdef __cplusplus
35 #include <uhd/usrp/subdev_spec.hpp>
36 #include <string>
37 
38 struct uhd_subdev_spec_t {
39  uhd::usrp::subdev_spec_t subdev_spec_cpp;
40  std::string last_error;
41 };
42 
43 extern "C" {
44 #else
45 struct uhd_subdev_spec_t;
46 #endif
47 
49 
55 typedef struct uhd_subdev_spec_t* uhd_subdev_spec_handle;
56 
59  uhd_subdev_spec_pair_t *subdev_spec_pair
60 );
61 
64  const uhd_subdev_spec_pair_t* first,
65  const uhd_subdev_spec_pair_t* second,
66  bool *result_out
67 );
68 
71  uhd_subdev_spec_handle* h,
72  const char* markup
73 );
74 
76 
81  uhd_subdev_spec_handle* h
82 );
83 
86  uhd_subdev_spec_handle h,
87  size_t *size_out
88 );
89 
92  uhd_subdev_spec_handle h,
93  const char* markup
94 );
95 
98  uhd_subdev_spec_handle h,
99  size_t num,
100  uhd_subdev_spec_pair_t *subdev_spec_pair_out
101 );
102 
105  uhd_subdev_spec_handle h,
106  char* pp_string_out,
107  size_t strbuffer_len
108 );
109 
112  uhd_subdev_spec_handle h,
113  char* string_out,
114  size_t strbuffer_len
115 );
116 
119  uhd_subdev_spec_handle h,
120  char* error_out,
121  size_t strbuffer_len
122 );
123 
124 #ifdef __cplusplus
125 }
126 
127 UHD_API uhd::usrp::subdev_spec_pair_t uhd_subdev_spec_pair_c_to_cpp(
128  const uhd_subdev_spec_pair_t* subdev_spec_pair_c
129 );
130 
131 UHD_API void uhd_subdev_spec_pair_cpp_to_c(
132  const uhd::usrp::subdev_spec_pair_t &subdev_spec_pair_cpp,
133  uhd_subdev_spec_pair_t *subdev_spec_pair_c
134 );
135 #endif
136 
137 #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:31
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:31
Definition: subdev_spec.hpp:31
Subdevice specification.
Definition: subdev_spec.h:27
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:29
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:66
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:66
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:55
UHD_API uhd_error uhd_subdev_spec_push_back(uhd_subdev_spec_handle h, const char *markup)
Add a subdevice specification to this list.