aes67-daemon/daemon/error_code.hpp
Andrea Bondavalli 1af74dcbf0 Added support for unicast RTP stream address to daemon and WebUI, see #30
- added address field to Source struct definition to contain the destination address. If this field is left empty the default multicast address is used.
- if a unicast address is provided when creating a new Source the daemon looks in the ARP cache to retrieve the corresponding MAC address.
  If this is not found the daemon tries to connect to echo TCP service of the destination host and looks into the ARP cache up to 3 times and then returns and error.
- added RTP address field in the Source creating form of the WebUI. If this field is left empty the default multicast address is used instead.
- updated documentation and regression test suite
2021-03-04 18:31:34 +01:00

72 lines
2.7 KiB
C++

//
// error_code.hpp
//
// Copyright (c) 2019 2020 Andrea Bondavalli. All rights reserved.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
#ifndef _ERROR_CODE_HPP_
#define _ERROR_CODE_HPP_
#include <system_error>
// Driver errors
enum class DriverErrc {
unknown = 10, // unhandled code from driver
invalid_data_size = 11, // driver -315 invalid data size
invalid_value = 12, // driver -815 invalid value specified
command_failed = 13, // driver -401 command failed
command_not_found = 14, // driver -404 command not found
unknown_command = 15, // driver -314 unknown command
invalid_daemon_response = 16, // driver -303 invalid daemon response
invalid_daemon_response_size = 17 // driver -302 invalid daemon response
};
namespace std {
template <>
struct is_error_code_enum<DriverErrc> : true_type {};
} // namespace std
std::error_code make_error_code(DriverErrc);
std::error_code get_driver_error(int code);
// Daemon errors
enum class DaemonErrc {
invalid_stream_id = 40, // daemon invalid stream id
stream_id_in_use = 41, // daemon stream id is in use
stream_id_not_in_use = 42, // daemon stream not in use
invalid_url = 43, // daemon invalid URL
cannot_retrieve_sdp = 44, // daemon cannot retrieve SDP
cannot_parse_sdp = 45, // daemon cannot parse SDP
stream_name_in_use = 46, // daemon source or sink name in use
cannot_retrieve_mac = 47, // daemon cannot retrieve MAC for IP
send_invalid_size = 50, // daemon data size too big for buffer
send_u2k_failed = 51, // daemon failed to send command to driver
send_k2u_failed = 52, // daemon failed to send event response to driver
receive_u2k_failed = 53, // daemon failed to receive response from driver
receive_k2u_failed = 54, // daemon failed to receive event from driver
invalid_driver_response = 55 // unexpected driver command response code
};
namespace std {
template <>
struct is_error_code_enum<DaemonErrc> : true_type {};
} // namespace std
std::error_code make_error_code(DaemonErrc);
#endif