1function [bytes, nbytes] = eq_get_abi(setsize) 2 3%% Return current SOF ABI header 4% 5% [bytes, nbytes] = eq_get_abi(setsize) 6% 7 8% SPDX-License-Identifier: BSD-3-Clause 9% 10% Copyright(c) 2018 Intel Corporation. All rights reserved. 11% 12% Author: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com> 13 14%% Use sof-ctl to write ABI header into a file 15abifn = 'eq_get_abi.bin'; 16cmd = sprintf('sof-ctl -g %d -b -o %s > /dev/null', setsize, abifn); 17system(cmd); 18 19%% Read file and delete it 20fh = fopen(abifn, 'r'); 21if fh < 0 22 error("Failed to get ABI header. Is sof-ctl installed?"); 23end 24[bytes, nbytes] = fread(fh, inf, 'uint8'); 25fclose(fh); 26delete(abifn); 27 28end 29