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

Method Pair

Controllers/NanoleafController/NanoleafController.cpp:122–135  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

120}
121
122std::string NanoleafController::Pair(std::string address, int port)
123{
124 const std::string location = address+":"+std::to_string(port);
125
126 json data;
127 if(APIRequest("POST", location, "/api/v1/new", nullptr, &data) == 200)
128 {
129 return data["auth_token"];
130 }
131 else
132 {
133 throw std::exception();
134 }
135}
136
137void NanoleafController::Unpair(std::string address, int port, std::string auth_token)
138{

Callers

nothing calls this directly

Calls 3

to_stringFunction · 0.85
APIRequestFunction · 0.85
exceptionClass · 0.50

Tested by

no test coverage detected