PicoScenes API Docs
 
Loading...
Searching...
No Matches
SoapySDRUtils.hxx
Go to the documentation of this file.
1//
2// Created by Zhiping Jiang on 3/30/22.
3//
4
5#ifndef PICOSCENES_PLATFORM_SOAPYSDRUTILS_HXX
6#define PICOSCENES_PLATFORM_SOAPYSDRUTILS_HXX
7
8#include <optional>
9#include <cstdint>
10#include <SoapySDR/Device.hpp>
11#include <SoapySDR/Types.hpp>
12
16enum class SoapySDRType {
18 LimeSDR,
19 BladeRF,
20};
21
26 std::string serialNumber;
27 std::string name;
28 std::string ipAddress;
29 std::string resource;
31 std::string typeString;
32
33 std::map<std::string, std::string> inverseMap;
34};
35
36namespace SoapySDRUtils {
37
43 bool isSoapySDRDeviceName(const std::string &deviceName);
44
49 const std::vector<std::map<std::string, std::string>> &findAllSoapySDRCompatibleDevices();
50
55 const std::map<std::string, std::map<std::string, std::string>> &soapySDRDeviceNamingMap();
56
61 const std::vector<std::string> &getPicoScenesDeviceNames4AllSoapySDRDevice();
62
68 std::optional<std::map<std::string, std::string>> getDeviceInformation(const std::string &deviceName);
69
75 std::optional<std::array<uint8_t, 6>> resolveMACAddress(const std::string &deviceName);
76
83 std::string determineTransferType(const SoapySDR::Device *sdr);
84
85}
86#endif //PICOSCENES_PLATFORM_SOAPYSDRUTILS_HXX
SoapySDRType
Enum representing different types of SoapySDR devices.
const std::vector< std::map< std::string, std::string > > & findAllSoapySDRCompatibleDevices()
Finds all compatible SoapySDR devices.
const std::map< std::string, std::map< std::string, std::string > > & soapySDRDeviceNamingMap()
Gets a map of SoapySDR device names to their information.
std::optional< std::array< uint8_t, 6 > > resolveMACAddress(const std::string &deviceName)
Resolves the MAC address of a device.
std::string determineTransferType(const SoapySDR::Device *sdr)
Determines the transfer type for a given SoapySDR device.
std::optional< std::map< std::string, std::string > > getDeviceInformation(const std::string &deviceName)
Gets information about a specific device.
bool isSoapySDRDeviceName(const std::string &deviceName)
Checks if a given device name is a SoapySDR device name.
const std::vector< std::string > & getPicoScenesDeviceNames4AllSoapySDRDevice()
Gets the names of all PicoScenes devices for SoapySDR.
Struct for identifying SoapySDR devices.
std::string name
The name of the device.
std::string resource
The resource identifier of the device.
std::string typeString
The type of the device as a string.
std::string serialNumber
The serial number of the device.
std::string ipAddress
The IP address of the device.
std::map< std::string, std::string > inverseMap
A map for additional device information.
SoapySDRType type
The type of the device.