¡Esta es una revisión vieja del documento!
You only need to add OpenFrameworks and Addons projects as references in your new project.
addons.make file.Crear un listener de UDP:
ofxUDPManager udpConnection; udpConnection.Create(); udpConnection.Bind(5001); udpConnection.SetNonBlocking(true); char udpMessage[10000]; udpConnection.Receive(udpMessage,10000); std::string message=udpMessage;
ofxJSONElement result; std::string url = "http://127.0.0.1:5000/sketch/1"; bool parsingSuccessful = result.open(url); if (parsingSuccessful) { //ofLogNotice("ofApp::setup") << "Ok!" << endl << result.getRawString() << endl; Json::Int64 value = result["paths"][0]["start_t"].asInt64(); ofLogNotice("ofApp::setup") << value << endl; Json::ArrayIndex npoints = result["paths"][0]["points"].size(); ofLogNotice("ofApp::setup") << npoints << endl; for (unsinged int i=0; i<result["paths"][0]["points"].size(); i++) ofxJSONElement point = result["paths"][0]["points"][i]; ofxJSONElement result2; ofLogNotice("ofApp::setup") << result2.parse("{\"hola\": \"adios\"}"); ofLogNotice("ofApp::setup") << result2["hola"].asString(); } else { ofLogNotice("ofApp::setup") << "Failed to parse JSON" << endl; }