Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Send DMX data from ALF file to upload using ola/libartnet #1908

Open
hyren5 opened this issue Oct 3, 2023 · 0 comments
Open

Send DMX data from ALF file to upload using ola/libartnet #1908

hyren5 opened this issue Oct 3, 2023 · 0 comments

Comments

@hyren5
Copy link

hyren5 commented Oct 3, 2023

I was wondering if firmware upload of an ALF file was supported using the built in libartnet library.

If it is supported, where might I find the documentation in creating the libartnet code to upload a firmware file?

Here is some of the code that I have as a work in progress:

#include
#include
#include <ola/DmxBuffer.h>
#include <ola/Logging.h>
#include <ola/client/StreamingClient.h>
#include <ola/client/StreamingClientOptions.h>

int main() {
// Initialize OLA logging
ola::InitLogging(ola::OLA_LOG_INFO, ola::OLA_LOG_STDERR);

// Create an OLA streaming client
ola::client::StreamingClientOptions options;
ola::client::StreamingClient ola_client(options);

// Set the target device's IP address
std::string target_ip = "2.0.0.1";

// Create a DMX buffer
ola::DmxBuffer buffer;

for (int i = 0; i < 512; ++i) {
    buffer[i] = rand() % 256;
}

// Send the DMX data (ALF) to the target device over Art-Net
if (ola_client.SendDmx(target_ip, 0, buffer)) {
    std::cout << "ALF data sent successfully to " << target_ip << std::endl;
} else {
    std::cerr << "Failed to send ALF data to " << target_ip << std::endl;
    return 1;
}

return 0;

}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant