FreeBSD/usr.sbin/bluetooth/hccontrol/host_controller_baseband.c
/* Convert ascii hex string to the uint8_t[] */
Convert ascii hex string to the uint8_t[]
Convert ascii hex string to the uint8_t []
static int
hci_hexstring2array(char const *s, uint8_t *a, int asize)
{
	int	i, l, b;
	l = strlen(s) / 2;
	if (l > asize)
		l = asize;
	for (i = 0; i < l; i++) {
		b = hci_hexa2int8(s + i * 2);
		if (b < 0)
			return (-1);
		a[i] = (b & 0xff);
	}
	return (0);
}
static int hci_hexstring2array ( char const * s , uint8_t * a , int asize ) { int i , l , b ; l = strlen ( s ) / 2 ; if ( l > asize ) l = asize ; for ( i = 0 ; i < l ; i ++ ) { b = hci_hexa2int8 ( s + i * 2 ) ; if ( b < 0 ) return ( -1 ) ; a [ i ] = ( b & 0xff ) ; } return ( 0 ) ; }
Convert ascii hex string to the uint8_t[]
Convert ascii hex string to the uint8_t []