tuxmartin

Untitled

Jan 14th, 2016
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.35 KB | None | 0 0
  1. //....
  2.         switch ( (int) res.getStatus() ) {
  3.         case 201: { // success
  4.             cout << "DEVICE CREATED - The request has succeeded and returned new entity." << endl;
  5.             send_message("DEVICE CREATED - The request has succeeded and returned new entity.", "cloud/debug");
  6.  
  7.             DeviceCreateResponse server_response;
  8.             server_response.ParseFromString(content);
  9.             string server_token = server_response.accesstoken();
  10.             string server_endpoint = server_response.endpoint();
  11.        
  12.             string reply_info = "SERVER REPLY: TOKEN= ";
  13.             reply_info.append(server_token);
  14.             reply_info.append(" ENDPOINT=");
  15.             reply_info.append(server_endpoint);
  16.             reply_info.append("\n");
  17.  
  18.             cout << reply_info << endl;
  19.    
  20.             fbb.Clear();
  21.             CloudConfigBuilder ccb(fbb);
  22.             ccb.add_token(fbb.CreateString(server_token));
  23.             ccb.add_endpoint(fbb.CreateString(server_endpoint));
  24.             auto mloc = ccb.Finish();
  25.             FinishCloudConfigBuffer(fbb, mloc);
  26.             sendBuffer((const char *)fbb.GetBufferPointer(),fbb.GetSize(), "persistence/save_cloud_config");
  27.            
  28.             cout << "DEVICE CREATED - end" << endl;
  29.  
  30.             return 1;
  31.             break;
  32.         }
  33. //...
  34.  
  35.     } catch(Poco::Exception &e) {
  36.         cerr << "Exception: " << e.what() << endl;
  37.         cerr << e.displayText() << endl;
  38.     }
  39.     return 0;
  40. }
  41.  
  42.  
  43.  
  44. ang-cloud-connector: /usr/local/include/flatbuffers/flatbuffers.h:636: void flatbuffers::FlatBufferBuilder::NotNested(): Assertion `!offsetbuf_.size()' failed.
  45. ==14042==
  46. ==14042== Process terminating with default action of signal 6 (SIGABRT)
  47. ==14042==    at 0x6264267: raise (raise.c:55)
  48. ==14042==    by 0x6265EC9: abort (abort.c:89)
  49. ==14042==    by 0x625D03C: __assert_fail_base (assert.c:92)
  50. ==14042==    by 0x625D0F1: __assert_fail (assert.c:101)
  51. ==14042==    by 0x413755: flatbuffers::FlatBufferBuilder::CreateString(char const*, unsigned long) (flatbuffers.h:636)
  52. ==14042==    by 0x40F990: CloudConnector::register_new_device(char const*, char const*, char const*) (flatbuffers.h:744)
  53. ==14042==    by 0x4122CE: CloudConnector::onMessageThread(mosquitto_message*) (CloudMosquitto.cpp:306)
  54. ==14042==    by 0x5D4F02F: ??? (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21)
  55. ==14042==    by 0x5A7F6A9: start_thread (pthread_create.c:333)
  56. ==14042==    by 0x6335EEC: clone (clone.S:109)
  57. ==14042==
  58. ==14042== Events    : Ir
  59. ==14042== Collected : 14792136
  60. ==14042==
  61. ==14042== I   refs:      14,792,136
  62. Zabit (SIGKILL)
Advertisement
Add Comment
Please, Sign In to add comment