×
Namespaces

Variants
Actions

Reading AP(Access Point) Table

From Nokia Developer Wiki
Jump to: navigation, search
Article Metadata
Article
Created: spark55 (10 Sep 2007)
Last edited: hamishwillee (27 Jul 2012)
void ReadAPTable()
{
struct ifconf ifc;
int sockfd;
 
sockfd = socket(AF_INET,SOCK_DGRAM,IPPROTO_UDP);
 
ifc.ifc_len = sizeof(ifreq) * 20;
ifc.ifc_buf = (caddr_t)malloc( ifc.ifc_len );
 
// This will get the whole access points list
// Here, ifc.ifc_len will contain the size of the buffer
ret = ioctl(sockfd, SIOCGIFCONF, &ifc);
// count will contain the number of access points
count = ifc.ifc_len / sizeof(struct ifreq) ;
 
// This will get only the active connection list
ret = ioctl(sockfd, SIOCGIFACTIVECONF, &ifc);
 
close(sockfd);
free(ifc.ifc_buf);
return;
}

The above Open C code shows that, we can either read the whole access points details(SIOCGIFCONF ) or only read active access points details(SIOCGIFACTIVECONF ).

Links

This page was last modified on 27 July 2012, at 07:17.
73 page views in the last 30 days.
×