Skip to content
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

Use QCommandLineParser class #15

Open
sevenbitbyte opened this issue Feb 19, 2019 · 0 comments
Open

Use QCommandLineParser class #15

sevenbitbyte opened this issue Feb 19, 2019 · 0 comments
Assignees

Comments

@sevenbitbyte
Copy link
Member

sevenbitbyte commented Feb 19, 2019

Utilize Qt's approach for command line parsing - https://doc.qt.io/qt-5/qcommandlineparser.html

./ble-serial-server --actor-id <actor-id> --actor-type <actor-type> --owner-id <owner-id> --owner-type <owner-type>

Update BtLESerialServer class constructor to match

namespace RosHub {
  enum DocType { User=0x1, Team =0x2, Org = 0x3, Device = 0x04, App = 0x5 }
  Q_ENUM ( DocType)

  struct Doc {
    DocType type
    QUuid/QString id
  }
}

BtLESerialServer::BtLESerialServer(ConsoleReader* input, RosHubDoc* actor=0, RosHubDoc owner=0, QObject *parent = 0)

FYI - In Qt you can easily translate enum members to and from strings -> https://stackoverflow.com/questions/34281682/how-to-convert-enum-to-qstring?answertab=votes#tab-top

@NickZ

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants