-
Notifications
You must be signed in to change notification settings - Fork 9
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
WIP: Sdo info support #93
base: master
Are you sure you want to change the base?
Conversation
Minimum allowed coverage is Generated by 🐒 cobertura-action against efbe925 |
@@ -101,6 +101,11 @@ int main(int argc, char *argv[]) | |||
// Map RXPDO | |||
mapPDO(0, 0x1600, pdo::rx_mapping, pdo::rx_mapping_count, 0x1C12); | |||
|
|||
// Map TXPDO |
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.
copy/paste error?
// unit_test.prefix = 0x03; | ||
// bus.getUnitDescription(ingenia, unit_test); | ||
|
||
std::abort(); |
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.
such violence 🤣
@@ -142,6 +150,26 @@ namespace kickcat | |||
uint32_t* client_data_size_; | |||
}; | |||
|
|||
class SDOInfoMessage : public AbstractMessage | |||
{ | |||
public: |
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.
indentation
@@ -76,4 +80,87 @@ namespace kickcat | |||
auto sdo = slave.mailbox.createSDO(index, subindex, CA, CoE::SDO::request::DOWNLOAD, data, &data_size, timeout); | |||
waitForMessage(sdo); | |||
} | |||
|
|||
|
|||
void Bus::getObjectDictionnaryList(Slave& slave, CoE::SDO::information::ListType type, void* data, uint32_t* data_size, nanoseconds timeout) |
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.
A lot of print here: to move in a dedicated example
} | ||
|
||
int32_t size = header->len - sizeof(CoE::ServiceDataInfo) - sizeof(CoE::Header); | ||
|
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.
line feed
|
||
std::string CoE::SDO::information::toString(ObjectAccess object_access) | ||
{ | ||
std::stringstream os; |
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.
Since only string are manipulated, you can work directly on a std::string
Need a bit of cleanup. Almost ready to be merged. |
} | ||
|
||
uint32_t request_payload_size = sizeof(type); | ||
memcpy(data, &type, request_payload_size); |
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.
prefer to call memcpy with std namespace
THROW_ERROR("This mailbox is inactive"); | ||
} | ||
|
||
memcpy(data, &index, sizeof(index)); |
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.
Maybe create dedicated pointer to copy to to have a meaningful location.
|
||
if(remaining_size < size) | ||
{ | ||
status_ = MessageStatus::COE_CLIENT_BUFFER_TOO_SMALL; |
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.
You can set it once at the end when the status OK is computed.
close #90
Example of output on an elmo gold motor driver: