changed startcom function

This commit is contained in:
ishak jmilou.ishak
2025-01-07 14:38:38 +01:00
parent 56f085b73d
commit 806bb16662
2 changed files with 3 additions and 2 deletions

View File

@@ -254,7 +254,7 @@ void CKobuki::setSound(int noteinHz, int duration) {
void CKobuki::startCommunication(char *portname, bool CommandsEnabled,
void *userDataL) {
connect(portname);
if(connect(portname) != -1){
enableCommands(CommandsEnabled);
userData = userDataL;
@@ -265,6 +265,7 @@ void CKobuki::startCommunication(char *portname, bool CommandsEnabled,
std::cerr << "Error creating thread: " << pthread_result << std::endl;
}
}
}
int CKobuki::measure() {
while (stopVlakno == 0) {

View File

@@ -60,7 +60,7 @@ public:
long loop(void *user_data, TKobukiData &Kobuki_data);
void startCommunication(char *portname,bool CommandsEnabled,void *userDataL);
bool startCommunication(char *portname,bool CommandsEnabled,void *userDataL);
int measure(); //thread function, contains an infinite loop and reads data
void setLed(int led1 = 0, int led2 = 0); //led1 green/red 2/1, //led2 green/red 2/1
void setTranslationSpeed(int mmpersec);