Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //....
- switch ( (int) res.getStatus() ) {
- case 201: { // success
- cout << "DEVICE CREATED - The request has succeeded and returned new entity." << endl;
- send_message("DEVICE CREATED - The request has succeeded and returned new entity.", "cloud/debug");
- DeviceCreateResponse server_response;
- server_response.ParseFromString(content);
- string server_token = server_response.accesstoken();
- string server_endpoint = server_response.endpoint();
- string reply_info = "SERVER REPLY: TOKEN= ";
- reply_info.append(server_token);
- reply_info.append(" ENDPOINT=");
- reply_info.append(server_endpoint);
- reply_info.append("\n");
- cout << reply_info << endl;
- fbb.Clear();
- CloudConfigBuilder ccb(fbb);
- ccb.add_token(fbb.CreateString(server_token));
- ccb.add_endpoint(fbb.CreateString(server_endpoint));
- auto mloc = ccb.Finish();
- FinishCloudConfigBuffer(fbb, mloc);
- sendBuffer((const char *)fbb.GetBufferPointer(),fbb.GetSize(), "persistence/save_cloud_config");
- cout << "DEVICE CREATED - end" << endl;
- return 1;
- break;
- }
- //...
- } catch(Poco::Exception &e) {
- cerr << "Exception: " << e.what() << endl;
- cerr << e.displayText() << endl;
- }
- return 0;
- }
- ang-cloud-connector: /usr/local/include/flatbuffers/flatbuffers.h:636: void flatbuffers::FlatBufferBuilder::NotNested(): Assertion `!offsetbuf_.size()' failed.
- ==14042==
- ==14042== Process terminating with default action of signal 6 (SIGABRT)
- ==14042== at 0x6264267: raise (raise.c:55)
- ==14042== by 0x6265EC9: abort (abort.c:89)
- ==14042== by 0x625D03C: __assert_fail_base (assert.c:92)
- ==14042== by 0x625D0F1: __assert_fail (assert.c:101)
- ==14042== by 0x413755: flatbuffers::FlatBufferBuilder::CreateString(char const*, unsigned long) (flatbuffers.h:636)
- ==14042== by 0x40F990: CloudConnector::register_new_device(char const*, char const*, char const*) (flatbuffers.h:744)
- ==14042== by 0x4122CE: CloudConnector::onMessageThread(mosquitto_message*) (CloudMosquitto.cpp:306)
- ==14042== by 0x5D4F02F: ??? (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21)
- ==14042== by 0x5A7F6A9: start_thread (pthread_create.c:333)
- ==14042== by 0x6335EEC: clone (clone.S:109)
- ==14042==
- ==14042== Events : Ir
- ==14042== Collected : 14792136
- ==14042==
- ==14042== I refs: 14,792,136
- Zabit (SIGKILL)
Advertisement
Add Comment
Please, Sign In to add comment