2022-06-09 16:41:55 -04:00
|
|
|
/*
|
|
|
|
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()
|
|
|
|
{
|
2022-11-15 11:42:27 -05:00
|
|
|
/// \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.
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
*/
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
*/
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
*/
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
2023-05-20 13:34:46 -04:00
|
|
|
* @brief Device::rxArtPoll
|
|
|
|
* @param packet
|
|
|
|
*/
|
|
|
|
void Device::rxArtPoll(std::shared_ptr<ArtPoll> packet)
|
|
|
|
{
|
|
|
|
auto data_opt = packet->data<poll_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
|
2022-11-15 11:42:27 -05:00
|
|
|
*/
|
2023-05-20 13:34:46 -04:00
|
|
|
void Device::rxArtPollReply(std::shared_ptr<ArtPollReply> packet)
|
2022-11-15 11:42:27 -05:00
|
|
|
{
|
2023-05-20 13:34:46 -04:00
|
|
|
(void)packet;
|
2022-11-15 11:42:27 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
2023-05-20 13:34:46 -04:00
|
|
|
* @brief Device::rxArtDiagData
|
|
|
|
* @param packet
|
2022-11-15 11:42:27 -05:00
|
|
|
*/
|
2023-05-20 13:34:46 -04:00
|
|
|
void Device::rxArtDiagData(std::shared_ptr<ArtDiagData> packet)
|
2022-11-15 11:42:27 -05:00
|
|
|
{
|
2023-05-20 13:34:46 -04:00
|
|
|
(void)packet;
|
2022-11-15 11:42:27 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Device::rxArtCommand
|
2023-05-20 13:34:46 -04:00
|
|
|
* @param packet
|
2022-11-15 11:42:27 -05:00
|
|
|
*/
|
2023-05-20 13:34:46 -04:00
|
|
|
void Device::rxArtCommand(std::shared_ptr<ArtCommand> packet)
|
2022-11-15 11:42:27 -05:00
|
|
|
{
|
2023-05-20 13:34:46 -04:00
|
|
|
(void)packet;
|
2022-11-15 11:42:27 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
2023-05-20 13:34:46 -04:00
|
|
|
* @brief Device::rxArtDmx
|
|
|
|
* @param packet
|
2022-11-15 11:42:27 -05:00
|
|
|
*/
|
2023-05-20 13:34:46 -04:00
|
|
|
void Device::rxArtDmx(std::shared_ptr<ArtDmx> packet)
|
2022-11-15 11:42:27 -05:00
|
|
|
{
|
2023-05-20 13:34:46 -04:00
|
|
|
(void)packet;
|
2022-11-15 11:42:27 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
2023-05-20 13:34:46 -04:00
|
|
|
* @brief Device::rxArtNzs
|
|
|
|
* @param packet
|
2022-11-15 11:42:27 -05:00
|
|
|
*/
|
2023-05-20 13:34:46 -04:00
|
|
|
void Device::rxArtNzs(std::shared_ptr<ArtNzs> packet)
|
2022-11-15 11:42:27 -05:00
|
|
|
{
|
2023-05-20 13:34:46 -04:00
|
|
|
if (packet->isVLC())
|
|
|
|
rxArtVlc(packet);
|
2022-11-15 11:42:27 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
2023-05-20 13:34:46 -04:00
|
|
|
* @brief Device::rxArtVlc
|
|
|
|
* @param packet
|
2022-11-15 11:42:27 -05:00
|
|
|
*/
|
2023-05-20 13:34:46 -04:00
|
|
|
void Device::rxArtVlc(std::shared_ptr<ArtNzs> packet)
|
2022-11-15 11:42:27 -05:00
|
|
|
{
|
2023-05-20 13:34:46 -04:00
|
|
|
auto data_opt = packet->data<nzs_data>();
|
|
|
|
if (!data_opt.has_value())
|
|
|
|
return;
|
|
|
|
auto data = std::make_shared<vlc_data>(data_opt.value().get());
|
2022-11-15 11:42:27 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
2023-05-20 13:34:46 -04:00
|
|
|
* @brief Device::rxArtSync
|
|
|
|
* @param packet
|
2022-11-15 11:42:27 -05:00
|
|
|
*/
|
2023-05-20 13:34:46 -04:00
|
|
|
void Device::rxArtSync(std::shared_ptr<ArtSync> packet)
|
2022-11-15 11:42:27 -05:00
|
|
|
{
|
2023-05-20 13:34:46 -04:00
|
|
|
(void)packet;
|
2022-11-15 11:42:27 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
2023-05-20 13:34:46 -04:00
|
|
|
* @brief Device::rxArtAddress
|
|
|
|
* @param packet
|
2022-11-15 11:42:27 -05:00
|
|
|
*/
|
2023-05-20 13:34:46 -04:00
|
|
|
void Device::rxArtAddress(std::shared_ptr<ArtAddress> packet)
|
2022-11-15 11:42:27 -05:00
|
|
|
{
|
2023-05-20 13:34:46 -04:00
|
|
|
(void)packet;
|
2022-11-15 11:42:27 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
2023-05-20 13:34:46 -04:00
|
|
|
* @brief Device::rxArtInput
|
|
|
|
* @param packet
|
2022-11-15 11:42:27 -05:00
|
|
|
*/
|
2023-05-20 13:34:46 -04:00
|
|
|
void Device::rxArtInput(std::shared_ptr<ArtInput> packet)
|
2022-11-15 11:42:27 -05:00
|
|
|
{
|
2023-05-20 13:34:46 -04:00
|
|
|
(void)packet;
|
2022-11-15 11:42:27 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
2023-05-20 13:34:46 -04:00
|
|
|
* @brief Device::rxArtTodRequest
|
|
|
|
* @param packet
|
2022-11-15 11:42:27 -05:00
|
|
|
*/
|
2023-05-20 13:34:46 -04:00
|
|
|
void Device::rxArtTodRequest(std::shared_ptr<ArtTodRequest> packet)
|
2022-11-15 11:42:27 -05:00
|
|
|
{
|
2023-05-20 13:34:46 -04:00
|
|
|
(void)packet;
|
2022-11-15 11:42:27 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
2023-05-20 13:34:46 -04:00
|
|
|
* @brief Device::rxArtTodData
|
|
|
|
* @param packet
|
2022-11-15 11:42:27 -05:00
|
|
|
*/
|
2023-05-20 13:34:46 -04:00
|
|
|
void Device::rxArtTodData(std::shared_ptr<ArtTodData> packet)
|
2022-11-15 11:42:27 -05:00
|
|
|
{
|
2023-05-20 13:34:46 -04:00
|
|
|
(void)packet;
|
2022-11-15 11:42:27 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
2023-05-20 13:34:46 -04:00
|
|
|
* @brief Device::rxArtTodControl
|
|
|
|
* @param packet
|
2022-11-15 11:42:27 -05:00
|
|
|
*/
|
2023-05-20 13:34:46 -04:00
|
|
|
void Device::rxArtTodControl(std::shared_ptr<ArtTodControl> packet)
|
2022-11-15 11:42:27 -05:00
|
|
|
{
|
2023-05-20 13:34:46 -04:00
|
|
|
(void)packet;
|
2022-11-15 11:42:27 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Device::rxArtRdm
|
2023-05-20 13:34:46 -04:00
|
|
|
* @param packet
|
2022-11-15 11:42:27 -05:00
|
|
|
*/
|
2023-05-20 13:34:46 -04:00
|
|
|
void Device::rxArtRdm(std::shared_ptr<ArtRdm> packet)
|
2022-11-15 11:42:27 -05:00
|
|
|
{
|
2023-05-20 13:34:46 -04:00
|
|
|
(void)packet;
|
2022-11-15 11:42:27 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
2023-05-20 13:34:46 -04:00
|
|
|
* @brief Device::rxArtRdmSub
|
|
|
|
* @param packet
|
2022-11-15 11:42:27 -05:00
|
|
|
*/
|
2023-05-20 13:34:46 -04:00
|
|
|
void Device::rxArtRdmSub(std::shared_ptr<ArtRdmSub> packet)
|
2022-11-15 11:42:27 -05:00
|
|
|
{
|
2023-05-20 13:34:46 -04:00
|
|
|
(void)packet;
|
2022-11-15 11:42:27 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
2023-05-20 13:34:46 -04:00
|
|
|
* @brief Device::rxArtFirmwareMaster
|
|
|
|
* @param packet
|
|
|
|
*/
|
|
|
|
void Device::rxArtFirmwareMaster(std::shared_ptr<ArtFirmwareMaster> packet)
|
|
|
|
{
|
|
|
|
(void)packet;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Device::rxArtFirmwareReply
|
|
|
|
* @param packet
|
|
|
|
*/
|
|
|
|
void Device::rxArtFirmwareReply(std::shared_ptr<ArtFirmwareReply> packet)
|
|
|
|
{
|
|
|
|
(void)packet;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Device::rxArtIpProg
|
|
|
|
* @param packet
|
|
|
|
*/
|
|
|
|
void Device::rxArtIpProg(std::shared_ptr<ArtIpProg> packet)
|
|
|
|
{
|
|
|
|
(void)packet;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Device::rxArtIpProgReply
|
|
|
|
* @param packet
|
2022-11-15 11:42:27 -05:00
|
|
|
*/
|
2023-05-20 13:34:46 -04:00
|
|
|
void Device::rxArtIpProgReply(std::shared_ptr<ArtIpProgReply> packet)
|
2022-11-15 11:42:27 -05:00
|
|
|
{
|
2023-05-20 13:34:46 -04:00
|
|
|
(void)packet;
|
2022-11-15 11:42:27 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
2023-05-20 13:34:46 -04:00
|
|
|
* @brief Device::rxArtTimeCode
|
|
|
|
* @param packet
|
|
|
|
*/
|
|
|
|
void Device::rxArtTimeCode(std::shared_ptr<ArtTimeCode> packet)
|
|
|
|
{
|
|
|
|
(void)packet;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Device::rxArtTrigger
|
|
|
|
* @param packet
|
2022-11-15 11:42:27 -05:00
|
|
|
*/
|
2023-05-20 13:34:46 -04:00
|
|
|
void Device::rxArtTrigger(std::shared_ptr<ArtTrigger> packet)
|
|
|
|
{
|
|
|
|
(void)packet;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Device::txArtPollReply
|
|
|
|
*/
|
|
|
|
void Device::txArtPollReply()
|
|
|
|
{
|
|
|
|
auto packet = std::make_shared<ArtPollReply>();
|
|
|
|
/// \todo impliment txArtPollReply
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Device::txArtDiagData
|
|
|
|
*/
|
|
|
|
void Device::txArtDiagData()
|
2022-11-15 11:42:27 -05:00
|
|
|
{
|
2023-05-20 13:34:46 -04:00
|
|
|
auto packet = std::make_shared<ArtDiagData>();
|
|
|
|
/// \todo impliment txArtDiagData
|
2022-06-09 16:41:55 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace ARTNET
|