Cisco Systems WVC80N Home Security System User Manual


 
Appendix D
CGI Commands
43
Wireless-N Internet Home Monitoring Camera
//Heres the decode part. There’s really only one way to do it.
chr1 = (enc1 << 2) | (enc2 >> 4);
chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);
chr3 = ((enc3 & 3) << 6) | enc4;
o_buf[j++] = (char)chr1;
if (enc3 != 64) {
o_buf[j++] = (char)chr2;
}
if (enc4 != 64) {
o_buf[j++] = (char)chr3;
}
//now clean out the variables used
chr1 = (char)0;
chr2 = (char)0;
chr3 = (char)0;
enc1 = 0;
enc2 = 0;
enc3 = 0;
enc4 = 0;
} while (i < strlen(i_buf)); //finish off the loop
//Now return the decoded values.
return j;
}