diff options
author | rioskao <rioskao@google.com> | 2018-08-13 16:36:04 +0800 |
---|---|---|
committer | rioskao <rioskao@google.com> | 2018-09-11 14:16:19 +0800 |
commit | 3a167a7bab688c81586e877892abe50230f60e76 (patch) | |
tree | 21a75b46a866226a90c112e76e9ba2ee92d3b423 /tunnel.h | |
download | android_hardware_knowles_athletico_sound_trigger_hal-3a167a7bab688c81586e877892abe50230f60e76.tar.gz android_hardware_knowles_athletico_sound_trigger_hal-3a167a7bab688c81586e877892abe50230f60e76.tar.bz2 android_hardware_knowles_athletico_sound_trigger_hal-3a167a7bab688c81586e877892abe50230f60e76.zip |
sthal: athletico: porting knowels sthal v1
Test: local test
Bug: 113311012
Change-Id: Ib88fcda56701c893d61e38fac454daf1a593fff4
note: The release from knowles, which contain multiple sound models
support and detection simulate. By default it would enable simulation.
Diffstat (limited to 'tunnel.h')
-rw-r--r-- | tunnel.h | 75 |
1 files changed, 75 insertions, 0 deletions
diff --git a/tunnel.h b/tunnel.h new file mode 100644 index 0000000..c71c704 --- /dev/null +++ b/tunnel.h @@ -0,0 +1,75 @@ +#ifndef _TUNNEL_H_ +#define _TUNNEL_H_ + +#if __cplusplus +extern "C" +{ +#endif + +struct ia_tunneling_hal; + +/** + * Opens up the tunnel port and sets it up to start the tunneling of data + * + * Input - buffering size + * If buffering size is non-zero, then set Non Buffering Flag + * Output - Handle to Tunneling HAL + * - NULL on failure, non null on success + */ +struct ia_tunneling_hal* ia_start_tunneling(int buffering_size); + +/** + * Enable the tunneling of the data for a particular tunnel id and a source id + * + * Input - tun_hdl - Handle to the Tunneling HAL. + * src_id - Source system ID for this tunnel + * tunl_mode - tunnel out in sync or async mode. + * tunl_encode -tunnel encoding format. + * + * Output - Zero on success, errno on failure. + */ +int ia_enable_tunneling_source(struct ia_tunneling_hal *tun_hdl, + unsigned int src_id, + unsigned int tunl_mode, + unsigned int tunl_encode); + +/** + * Disable the tunneling of the data for a particular tunnel id and a source id + * + * Input - tun_hdl - Handle to the Tunneling HAL. + * src_id - Source system ID for this tunnel + * tunl_mode - tunnel out in sync or async mode. + * tunl_encode -tunnel encoding format. + * + * Output - Zero on success, errno on failure. + */ +int ia_disable_tunneling_source(struct ia_tunneling_hal *tun_hdl, + unsigned int src_id, + unsigned int tunl_mode, + unsigned int tunl_encode); + + +/** + * Get the tunneled data. This data is an interleaved data from all the tunnels that were + * enabled. + * + * Input - tun_hdl - Handle to the Tunneling HAL. + * buf - buffer in which the data will be filled. + * buf_size - Size of the buffer buf + * Output - Number of bytes filled into the buffer + */ +int ia_read_tunnel_data(struct ia_tunneling_hal *tun_hdl, void *buf, int buf_size); + +/** + * Closes tunneling port + * + * Input - tun_hdl - Handle to the Tunneling HAL. + * Output - Zero on success, errno on failure. + */ +int ia_stop_tunneling(struct ia_tunneling_hal *tun_hdl); + +#if __cplusplus +} // extern "C" +#endif + +#endif |