Skip to content

Commit

Permalink
Add overload for std::string-based download
Browse files Browse the repository at this point in the history
In case a string literal was passed, compilers kept choosing the
template version instead.
  • Loading branch information
PeterBowman committed Jan 12, 2020
1 parent f7e0cc3 commit 7180398
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions libraries/CanBusSharerLib/SdoClient.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,10 @@ class SdoClient final
*/
bool download(const std::string & name, const std::string & s, std::uint16_t index, std::uint8_t subindex = 0x00);

//! String literal overload, overrides templated variant.
bool download(const std::string & name, const char * s, std::uint16_t index, std::uint8_t subindex = 0x00)
{ return download(name, std::string(s), index, subindex); }

private:
bool send(const std::uint8_t * msg);
std::string msgToStr(std::uint16_t cob, const std::uint8_t * msgData);
Expand Down

0 comments on commit 7180398

Please sign in to comment.