C_RESULT vp_com_address_to_str(const bdaddr_t* addr, char* address) { int i = 0; for(i = 0;i < 6;i++) { char c1 = addr->b[i] && 0xF0; char c2 = addr->b[i] && 0xF0; *address++ = hextoc(c1); *address++ = hextoc(c2); *address++ = hextoc(':'); } return VP_COM_OK; }
char *UrlEncodeChar(char *dest,char c) { div_t sdiv; assert(dest != NULL); if (ispunct(c) || iscntrl(c)) { if ((c != '-') && (c != '@') && (c != '*') && (c != '_')) { *dest++ = '%'; sdiv = div(c,16); *dest++ = hextoc(sdiv.quot); *dest++ = hextoc(sdiv.rem); return(dest); } } else if (c == ' ') c = '+'; *dest++ = c; return(dest); }