Skip to content

Commit

Permalink
reformat
Browse files Browse the repository at this point in the history
  • Loading branch information
rrhan0 committed Nov 2, 2024
1 parent 9d9bac4 commit e822317
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 26 deletions.
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ add_compile_options(
"$<$<CONFIG:RELEASE>:-O2>" # I don't know if O2 or O3 is better
)
# install(TARGETS ${PROJECT_NAME} DESTINATION bin)


set(BUILD_LIST core,imgcodecs,highgui)
find_package(OpenCV REQUIRED)

Expand Down Expand Up @@ -99,7 +101,7 @@ target_link_libraries(${PROJECT_NAME} PRIVATE
${OpenCV_LIBS}
${CURL_LIBRARIES}
CLI11::CLI11
cpr::cpr
# cpr::cpr
)

target_include_directories(curltest PRIVATE
Expand Down
5 changes: 3 additions & 2 deletions src/HttpTransmitter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@

#include "Pipeline.hpp"


#define MAX_ATTEMPTS 100

// Callback function to handle the response
Expand Down Expand Up @@ -171,7 +170,9 @@ bool HttpTransmitter::send_imen(const std::string &url,
fprintf(stderr, "curl_mime_name() failed\n");
return false;
}
res = curl_mime_data(field,reinterpret_cast<const char *>(encoded->buf.data()), encoded->buf.size());
res = curl_mime_data(field,
reinterpret_cast<const char *>(encoded->buf.data()),
encoded->buf.size());
if (res != CURLE_OK) {
fprintf(stderr, "curl_mime_data() failed\n");
return false;
Expand Down
4 changes: 1 addition & 3 deletions src/HttpTransmitter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,14 @@
#include <opencv2/opencv.hpp>
#include "Pipeline.hpp"


class HttpTransmitter {
public:
HttpTransmitter();
~HttpTransmitter();
bool send_imgfile(const std::string& url,
const std::string& file_path,
int64_t timestamp);
bool send_imen(const std::string& url,
std::unique_ptr<EncodedData> encoded);
bool send_imen(const std::string& url, std::unique_ptr<EncodedData> encoded);

private:
CURL* curl;
Expand Down
36 changes: 18 additions & 18 deletions src/ICamera.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class ICamera {
public:
/// @brief Virtual destructor
virtual ~ICamera() = default;

/**
* @brief Sets the pixel format for the camera.
* @param pixelformat A string specifying the pixel format.
Expand Down Expand Up @@ -81,23 +81,23 @@ class ICamera {
*/
// void get_statistics();

// protected:
// /**
// * @brief Sets default configurations for the camera.
// */
// virtual void set_default() = 0;

// /**
// * @brief Sets the epoch time.
// */
// virtual void set_epoch() = 0;

// /**
// * @brief Sets the acquisition mode for the camera.
// * @param acq_mode A string specifying the acquisition mode [Continuous,
// * SingleFrame, MultiFrame]. Continuous is default.
// */
// virtual void set_acquisitionmode(const std::string& acq_mode) = 0;
// protected:
// /**
// * @brief Sets default configurations for the camera.
// */
// virtual void set_default() = 0;

// /**
// * @brief Sets the epoch time.
// */
// virtual void set_epoch() = 0;

// /**
// * @brief Sets the acquisition mode for the camera.
// * @param acq_mode A string specifying the acquisition mode [Continuous,
// * SingleFrame, MultiFrame]. Continuous is default.
// */
// virtual void set_acquisitionmode(const std::string& acq_mode) = 0;
};

class timeout_exception : public std::runtime_error {
Expand Down
2 changes: 1 addition & 1 deletion src/Pipeline.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ struct EncodedData {
int64_t timestamp;
};

#endif // PIPELINE_HPP
#endif // PIPELINE_HPP
1 change: 0 additions & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@ void image_sender_imen(const std::string& url) {
// HttpTransmitter http_transmitter;
HttpTransmitter http_transmitter;


while (!stop_flag) {
std::unique_ptr<EncodedData> element;
try {
Expand Down

0 comments on commit e822317

Please sign in to comment.