MCPcopy Create free account
hub / github.com/CalcProgrammer1/OpenRGB / SetLEDs

Method SetLEDs

Controllers/EspurnaController/EspurnaController.cpp:62–74  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

60}
61
62void EspurnaController::SetLEDs(std::vector<RGBColor> colors)
63{
64 if (tcpport != NULL)
65 {
66 RGBColor color = colors[0];
67
68 char get_request[1024];
69 snprintf(get_request, 1024, "GET /api/rgb?apikey=%s&value=%%23%02X%02X%02X HTTP/1.1\r\nHost: %s\r\n\r\n", espurna_apikey, RGBGetRValue(color), RGBGetGValue(color), RGBGetBValue(color), client_name.c_str());
70 tcpport->tcp_client_connect();
71 tcpport->tcp_client_write(get_request, strlen(get_request));
72 tcpport->tcp_close();
73 }
74}

Callers 3

DeviceUpdateLEDsMethod · 0.45
UpdateZoneLEDsMethod · 0.45
UpdateSingleLEDMethod · 0.45

Calls 4

snprintfFunction · 0.85
tcp_client_connectMethod · 0.80
tcp_client_writeMethod · 0.80
tcp_closeMethod · 0.80

Tested by

no test coverage detected