- memcpy(curr->addr, mac->MacAddress, 6);
-
- if (ap_vendorext == VERNET) {
- curr->Status = mac->Status;
- curr->Port = mac->Port;
- memcpy(curr->ParentMacAddress, mac->ParentMacAddress, 6);
- curr->rssi = mac->RSSI;
- memcpy(&(curr->IP.s_addr), mac->IP, 4);
+ /* lets not use black magic (casting) here, ok? */
+ if (ap_type == ATMEL410) {
+ memcpy(&ap_410, varbinds[0].value, sizeof(ap_410));
+
+ memcpy(curr->addr, ap_410.MacAddress, 6);
+ if (ap_vendorext == SBRIDGES) {
+ memcpy(curr->ParentMacAddress, ap_410.ParentMacAddress, 6);
+ memcpy(&(curr->IP.s_addr), ap_410.IP, 4);
+ curr->rssi = ap_410.RSSI;
+ curr->quality = 100 - (minimum(ap_410.LinkQuality,40))*2,5;
+ curr->Status = ap_410.Status;
+ curr->Port = ap_410.Port;
+ }
+ } else { /* ap_type == ATMEL12350 */
+ memcpy(&ap_12350, varbinds[0].value, sizeof(ap_12350));
+
+ memcpy(curr->addr, ap_12350.MacAddress, 6);
+ if (ap_vendorext == EZYNET) {
+ memcpy(curr->ParentMacAddress, ap_12350.ParentMacAddress, 6);
+ memcpy(&(curr->IP.s_addr), ap_12350.IP, 4);
+ curr->rssi = ap_12350.RSSI;
+ /* curr->quality stays empty */
+ curr->Status = ap_12350.Status;
+ curr->Port = ap_12350.Port;
+ }