Module: Lorcon

Defined in:
ext/Lorcon.c

Defined Under Namespace

Classes: Device

Class Method Summary collapse

Class Method Details

.driversObject



103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
# File 'ext/Lorcon.c', line 103

static VALUE lorcon_driver_list(VALUE self) {	
	VALUE list;
	VALUE hash;

	struct tx80211_cardlist *cards = NULL;
	int i;

	list  = rb_hash_new();
	cards = tx80211_getcardlist();
	if (cards == NULL) {
		return(Qnil);
	}
	
	for (i = 1; i < cards->num_cards; i++) {
		hash = rb_hash_new();
		rb_hash_aset(hash, rb_str_new2("name"), rb_str_new2(cards->cardnames[i]));
		rb_hash_aset(hash, rb_str_new2("description"), rb_str_new2(cards->descriptions[i]));
		rb_hash_aset(hash, rb_str_new2("capabilities"), lorcon_cap_to_list(cards->capabilities[i]));
		rb_hash_aset(list, rb_str_new2(cards->cardnames[i]), hash);
	}

	tx80211_freecardlist(cards);	
	return(list);
}

.versionObject



43
44
45
# File 'ext/Lorcon.c', line 43

VALUE lorcon_get_version(VALUE self) {
	return INT2NUM(tx80211_getversion());
}