Conversation
| @@ -0,0 +1,154 @@ | |||
| #include <ping-message-common.h> | |||
There was a problem hiding this comment.
since I didnt want to continue refactoring the generators to work with the surveyor I just stopped generating and fixed the roughly generated source files. but that means I had to add them to the repo where they normally wouldn't be here.
| f.close() No newline at end of file | ||
| f.close() | ||
|
|
||
| # f = open("%s/ping-device-surveyor240.h" % args.output_directory, "w") |
There was a problem hiding this comment.
was trying to generate the files like I'm supposed to at first. but it was harder to refactor the generators so that it worked for everything than it was to just take the generation as rough draft and then turn it off and then fix those files directly
| f = open("%s/ping-message-%s.h" % (args.output_directory, definition), "w") | ||
| f.write(g.generate(mergedJson["global"][definition], templateFile, {"definition": definition})) | ||
| f.close() | ||
| if definition in "surveyor240": |
There was a problem hiding this comment.
the other devices don't need specific generation for the message header. I needed this one while I was still trying to fix generation the right way but its because the generation created the getMessageAsString helpers and tried to directly print atof_t and float* as strings. also it did not generate atof_t structs so I had to add that.
| const auto device_type = static_cast<PingDeviceType>(device.device_information.device_type); | ||
| std::cout << "Device detected as: " << PingHelper::nameFromDeviceType(device_type) << std::endl; | ||
| PingDeviceTest::test("Device ID", device.device_id != 0, Status::OK); | ||
| // PingDeviceTest::test("Device ID", device.device_id != 0, Status::OK); |
There was a problem hiding this comment.
not sure why but the device id comes back as null or nothing. didn't really pursue this.
|
|
||
| #include <cstdio> | ||
|
|
||
| bool PingDevice::initialize() { return request(CommonId::PROTOCOL_VERSION) && request(CommonId::DEVICE_INFORMATION); } |
There was a problem hiding this comment.
there was also no protocol version information coming from the surveyor. again I didn't pursue this other than to unblock myself
also needs a ping protocol update to help with generation
although halfway through this endeavor I stopped generating the surveyor source files so maybe I dont need the generation fixes.
also I made this against a clone of bluerobotics/ping-cpp:master instead of ours because ours is behind and I didn't want to show all the diffs not related to my changes.
and I decided not to update our master because I didn't know if it was being used like that somewhere