/* device.cpp Copyright (c) 2022 Kevin Matz (kevin.matz@gmail.com) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include "device.h" namespace ARTNET { Device::Device() { /// \cite ARTNET A ArtPollReply packet is broadcast to the Directed Broadcast /// address by all Art-Net devices on power up. Device::txArtPollReply(); // Always the reference implimentation, never virual. } /** */ { } /** */ { } /** */ { } /** * @brief Device::rxArtPoll * @param packet */ void Device::rxArtPoll(std::shared_ptr packet) { auto data_opt = packet->data(); if (!data_opt.has_value()) return; auto data = data_opt.value(); diagnostic_reporting_behavior = data->talk_to_me; diagnostic_reporting_threshold = data->diagnostic_level; /// All device types send an ArtPollReply in response to receiving an ArtPoll. txArtPollReply(); } /** * @brief Device::rxArtPollReply * @param packet */ void Device::rxArtPollReply(std::shared_ptr packet) { (void)packet; } /** * @brief Device::rxArtDiagData * @param packet */ void Device::rxArtDiagData(std::shared_ptr packet) { (void)packet; } /** * @brief Device::rxArtCommand * @param packet */ void Device::rxArtCommand(std::shared_ptr packet) { (void)packet; } /** * @brief Device::rxArtDmx * @param packet */ void Device::rxArtDmx(std::shared_ptr packet) { (void)packet; } /** * @brief Device::rxArtNzs * @param packet */ void Device::rxArtNzs(std::shared_ptr packet) { if (packet->isVLC()) rxArtVlc(packet); } /** * @brief Device::rxArtVlc * @param packet */ void Device::rxArtVlc(std::shared_ptr packet) { auto data_opt = packet->data(); if (!data_opt.has_value()) return; auto data = std::make_shared(data_opt.value().get()); } /** * @brief Device::rxArtSync * @param packet */ void Device::rxArtSync(std::shared_ptr packet) { (void)packet; } /** * @brief Device::rxArtAddress * @param packet */ void Device::rxArtAddress(std::shared_ptr packet) { (void)packet; } /** * @brief Device::rxArtInput * @param packet */ void Device::rxArtInput(std::shared_ptr packet) { (void)packet; } /** * @brief Device::rxArtTodRequest * @param packet */ void Device::rxArtTodRequest(std::shared_ptr packet) { (void)packet; } /** * @brief Device::rxArtTodData * @param packet */ void Device::rxArtTodData(std::shared_ptr packet) { (void)packet; } /** * @brief Device::rxArtTodControl * @param packet */ void Device::rxArtTodControl(std::shared_ptr packet) { (void)packet; } /** * @brief Device::rxArtRdm * @param packet */ void Device::rxArtRdm(std::shared_ptr packet) { (void)packet; } /** * @brief Device::rxArtRdmSub * @param packet */ void Device::rxArtRdmSub(std::shared_ptr packet) { (void)packet; } /** * @brief Device::rxArtFirmwareMaster * @param packet */ void Device::rxArtFirmwareMaster(std::shared_ptr packet) { (void)packet; } /** * @brief Device::rxArtFirmwareReply * @param packet */ void Device::rxArtFirmwareReply(std::shared_ptr packet) { (void)packet; } /** * @brief Device::rxArtIpProg * @param packet */ void Device::rxArtIpProg(std::shared_ptr packet) { (void)packet; } /** * @brief Device::rxArtIpProgReply * @param packet */ void Device::rxArtIpProgReply(std::shared_ptr packet) { (void)packet; } /** * @brief Device::rxArtTimeCode * @param packet */ void Device::rxArtTimeCode(std::shared_ptr packet) { (void)packet; } /** * @brief Device::rxArtTrigger * @param packet */ void Device::rxArtTrigger(std::shared_ptr packet) { (void)packet; } /** * @brief Device::txArtPollReply */ void Device::txArtPollReply() { auto packet = std::make_shared(); /// \todo impliment txArtPollReply } /** * @brief Device::txArtDiagData */ void Device::txArtDiagData() { auto packet = std::make_shared(); /// \todo impliment txArtDiagData } } // namespace ARTNET