wpa_supplicant/hidl/sprd_1.2/sta_network.cpp
/**
 * Helper function to set value in a string key field with a corresponding
 * length field in |wpa_ssid| structue instance for this network.
 * This function frees any existing data in these fields.
 */
Helper function to set value in a string key field with a corresponding
length field in |wpa_ssid| structue instance for this network.
This function frees any existing data in these fields.
Helper function to set value in a string key field with a corresponding length field in |wpa_ssid| structue instance for this network . This function frees any existing data in these fields .
int StaNetwork::setByteArrayKeyFieldAndResetState(
    const uint8_t *value, const size_t value_len, uint8_t **to_update_field,
    size_t *to_update_field_len, const char *hexdump_prefix)
{
	if (*to_update_field) {
		bin_clear_free(*to_update_field, *to_update_field_len);
	}
	*to_update_field = (uint8_t *)os_malloc(value_len);
	if (!(*to_update_field)) {
		return 1;
	}
	os_memcpy(*to_update_field, value, value_len);
	*to_update_field_len = value_len;
	wpa_hexdump_ascii_key(
	    MSG_MSGDUMP, hexdump_prefix, *to_update_field,
	    *to_update_field_len);
	resetInternalStateAfterParamsUpdate();
	return 0;
}
int StaNetwork :: setByteArrayKeyFieldAndResetState ( const uint8_t * value , const size_t value_len , uint8_t * * to_update_field , size_t * to_update_field_len , const char * hexdump_prefix ) { if ( * to_update_field ) { bin_clear_free ( * to_update_field , * to_update_field_len ) ; } * to_update_field = ( uint8_t * ) os_malloc ( value_len ) ; if ( ! ( * to_update_field ) ) { return 1 ; } os_memcpy ( * to_update_field , value , value_len ) ; * to_update_field_len = value_len ; wpa_hexdump_ascii_key ( MSG_MSGDUMP , hexdump_prefix , * to_update_field , * to_update_field_len ) ; resetInternalStateAfterParamsUpdate ( ) ; return 0 ; }
Helper function to set value in a string key field with a corresponding
 length field in |wpa_ssid| structue instance for this network.
Helper function to set value in a string key field with a corresponding length field in |wpa_ssid| structue instance for this network .