2008/1/29, Vladislav Grinchenko <[EMAIL PROTECTED]>:
> Leandro,
>
> what's the error message ioctl() reports?
>
> On as side note, you should use strncpy() and avoid mixing stdio calls
> with iostream (printf, cout).
>
> --vlg
>
> On Tue, 2008-01-29 at 10:01 -0300, Leandro Sales wrote:
> > Hi list.
> > How can I change the wireless access point via programming code in
> > maemo platform? I have the following piece of code that works
> > perfectly in my laptop, but when used in maemo, the wlan0 interface
> > disconnect but not reconnect to the new ESSID.
> > Any suggestion? Thanks
> >
> > Leandro.
> >
> > int setEssid (char iface[6], char essid[IW_ESSID_MAX_SIZE]) {
> > int soc;
> > struct iwreq wrq;
> >
> > cout << "Changing Access Points...";
> > strcpy(wrq.ifr_name, iface);
> > wrq.u.essid.pointer = (caddr_t)essid;
> > wrq.u.essid.length = strlen(essid)+1;
> > wrq.u.essid.flags = 1;
> >
> > soc = socket(AF_UNIX, SOCK_DGRAM, 0);
> > if (ioctl(soc, SIOCSIWESSID, &wrq) < 0) {
> > printf("Error setting ESSID on %s: %s\n", iface,
> > strerror(errno));
> > close(soc);
> > exit(-1);
> > } else {
> > cout << " done!\n";
> > }
> >
> > return 1;
> > }
> > _______________________________________________
> > maemo-developers mailing list
> > [email protected]
> > https://lists.maemo.org/mailman/listinfo/maemo-developers
>
>
Hi,
it is now working. The connection changes from one AP to another.
Just one detail, the hildon applet that shows the current connection,
maintained the old AP, but no problem for me.
Thanks,
Leandro.
--
Leandro Melo de Sales.
Pervasive and Embedded Computing Laboratory
BRisa and E-Phone Projects Manager
Network Admin @ http://embedded.ufcg.edu.br/indexen.html
+55 83 3310-1404 (extension 208)
http://www.leandrosales.com/
_______________________________________________
maemo-developers mailing list
[email protected]
https://lists.maemo.org/mailman/listinfo/maemo-developers