-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
High-Speed-Mode TCP Implementation #10
Open
Jmeyer1292
wants to merge
2
commits into
ros-industrial-attic:master
Choose a base branch
from
Jmeyer1292:high_speed_mode
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#ifndef KEYENCE_HIGH_SPEED_TCP_H | ||
#define KEYENCE_HIGH_SPEED_TCP_H | ||
|
||
#include "keyence/impl/keyence_tcp_client.h" | ||
#include "keyence/impl/high_speed_defs.h" | ||
|
||
#include <boost/function.hpp> | ||
|
||
namespace keyence | ||
{ | ||
|
||
class HighSpeedTcpClient | ||
{ | ||
public: | ||
// Callback types | ||
typedef boost::function<void(int32_t*, uint32_t)> callback_type; | ||
|
||
// Constructors | ||
HighSpeedTcpClient(TcpClient& client, const std::string& port); | ||
|
||
~HighSpeedTcpClient(); | ||
|
||
const ProfileInformation& profileInfo() const; | ||
|
||
void start(callback_type cb); | ||
|
||
void stop(); | ||
|
||
private: | ||
HighSpeedTcpClient operator=(const HighSpeedTcpClient&); // deleted | ||
HighSpeedTcpClient(const HighSpeedTcpClient&); // deleted | ||
|
||
|
||
TcpClient& client_; | ||
// Pimpl technique | ||
struct Impl; | ||
Impl* impl_; | ||
}; | ||
|
||
} | ||
|
||
#endif // KEYENCE_HIGH_SPEED_TCP_H | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
#ifndef PREPARE_HIGH_SPEED_H | ||
#define PREPARE_HIGH_SPEED_H | ||
|
||
#include "../keyence_message.h" | ||
#include "../high_speed_defs.h" | ||
|
||
namespace keyence | ||
{ | ||
namespace command | ||
{ | ||
|
||
class PrepareHighSpeed | ||
{ | ||
public: | ||
// Forward declares | ||
struct Request; | ||
struct Response; | ||
|
||
struct Request | ||
{ | ||
// Required definitions | ||
typedef Response response_type; | ||
const static uint32_t size = 4; | ||
const static uint8_t command_code = 0x47; | ||
// Constructor | ||
enum StartPosition { POSITION_PREVIOUS, POSITION_OLDEST, POSITION_NEXT }; | ||
|
||
Request(StartPosition position); | ||
|
||
// Request Data | ||
uint8_t send_position; | ||
|
||
// Required encode function | ||
void encodeInto(MutableBuffer buffer); | ||
}; | ||
|
||
struct Response | ||
{ | ||
ProfileInformation profile_info; | ||
uint32_t start_code; | ||
|
||
void decodeFrom(MutableBuffer buffer); | ||
}; | ||
|
||
}; | ||
|
||
} // namespace command | ||
} // namespace keyence | ||
|
||
|
||
#endif // PREPARE_HIGH_SPEED_H | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
#ifndef START_HIGH_SPEED_H | ||
#define START_HIGH_SPEED_H | ||
|
||
#include "../keyence_message.h" | ||
#include "../high_speed_defs.h" | ||
|
||
namespace keyence | ||
{ | ||
namespace command | ||
{ | ||
|
||
class StartHighSpeed | ||
{ | ||
public: | ||
// Forward declares | ||
struct Request; | ||
struct Response; | ||
|
||
struct Request | ||
{ | ||
// Required definitions | ||
typedef Response response_type; | ||
const static uint32_t size = 8; | ||
const static uint8_t command_code = 0xA0; | ||
|
||
Request(uint32_t code); | ||
|
||
// Request Data | ||
uint32_t start_code; | ||
|
||
// Required encode function | ||
void encodeInto(MutableBuffer buffer); | ||
}; | ||
|
||
struct Response | ||
{ | ||
void decodeFrom(MutableBuffer) {} | ||
}; | ||
|
||
}; | ||
|
||
} // namespace command | ||
} // namespace keyence | ||
|
||
|
||
|
||
#endif // START_HIGH_SPEED_H | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#ifndef STOP_HIGH_SPEED_H | ||
#define STOP_HIGH_SPEED_H | ||
|
||
namespace keyence | ||
{ | ||
namespace command | ||
{ | ||
|
||
class StopHighSpeed | ||
{ | ||
public: | ||
// Forward declares | ||
struct Request; | ||
struct Response; | ||
|
||
struct Request | ||
{ | ||
// Required definitions | ||
typedef Response response_type; | ||
const static uint32_t size = 0; | ||
const static uint8_t command_code = 0x48; | ||
|
||
// Required encode function | ||
void encodeInto(MutableBuffer) {} | ||
}; | ||
|
||
struct Response | ||
{ | ||
void decodeFrom(MutableBuffer) {} | ||
}; | ||
|
||
}; | ||
|
||
} // namespace command | ||
} // namespace keyence | ||
|
||
#endif // STOP_HIGH_SPEED_H | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason you chose to use relative references here? Why not include paths relative to the package include?