Ok, I compiled your code (pc side) to give it a try before trying to
implement your way of communicating with the e-puck in my project. I
didn't know regex could be used inside a program - WOW!! - but that
makes all a bit more complex to me.
If I don't go wrong your program looks for a string (or two
substrings?!?) in the rfcomm.conf and then assigns that MAC to a
socket...but let's look at this first stage: in my case it always
exits with the message "Error : device not found in rfcomm.conf"
These are the entries in my rfcomm.conf file:
rfcomm0 {
bind yes;
device 08:00:17:2D:52:81;
channel 1;
comment "e-puck_0272";
}
rfcomm1 {
bind yes;
device 08:00:17:2D:47:AB;
channel 1;
comment "e-puck_0273";
}
what do I have to change to have things working?
The str_regex should look like this:
"rfcomm0273\\{device
(([0-9A-F]{2}:[0-9A-F]{2}:[0-9A-F]{2}:[0-9A-F]{2}:[0-9A-F]{2}:[0-9A-F]{2}));\\}"
right?!?
I'm sorry but I'm just a novice at programming, as you can see!
Thanks a lot for the help!
Davide
Quoting Alexandre Campo <[EMAIL PROTECTED]>:
> Hi Davide,
>
> I did not really understand your whole email, but you are trying to
> communicate with the e-puck and a pc, right ?
> If this is your problem, then you can try to use the files in attachment...
>
>
> e-puck side I send data in that way :
>
> char tmp[128];
> sprintf(tmp, "sending number %d \n", c);
> btcomSendString(tmp);
>
>
> I link my code with the btcom library attached.
>
> Pc side is a bit more complicated, so I put a whole tool that reads
> data from an e-puck in attachment.
> To be compiled using -lbluetooth flag for the linker.
>
> These things should make it easy for you to use bluetooth from pc to
> e-pcuk. I think e-puck to e-puck is more easy and there are some
> good examples in the
> repository.
>
> Cheers,
> alex.
>
>
>
>
> On Sat, 15 Mar 2008 18:00:06 +0100
> Davide Donetto <[EMAIL PROTECTED]> wrote:
>
>> Hi, I'm here again
>> I've got some problems communicating via bluetooth with the e-puck
>> under linux in c++.
>> First I've tried with LibSerial (http://libserial.sourceforge.net/)
>> but never went over a certain point. Now I'm trying to use stdio and
>> termios and all that stuff. I thought it could be an 'ANSIer' approach
>> and work better with the e-puck, but I got stuck anyway. There are so
>> many different options to test for the various tcflags!
>> I've opened the port with these settings: O_RDWR | O_NOCTTY | O_NDELAY
>> and set the c_cflag = B115200 | CS8 | CLOCAL | CREAD
>> Am I going the right way? Did I miss something?
>> Is there an example I could look at?
>>
>> Thanks
>>
>> Davide
>>
>>
>>
>>
>> _______________________________________________
>> E-puck-user mailing list
>> [email protected]
>> https://mail.gna.org/listinfo/e-puck-user
>
_______________________________________________
E-puck-user mailing list
[email protected]
https://mail.gna.org/listinfo/e-puck-user