1 /* Copyright (c) 2014 The Chromium OS Authors. All rights reserved. 2 * Use of this source code is governed by a BSD-style license that can be 3 * found in the LICENSE file. 4 */ 5 6 #ifndef TEST_IODEV_H_ 7 #define TEST_IODEV_H_ 8 9 #include "cras_types.h" 10 11 struct cras_iodev; 12 13 /* Initializes an test iodev. The Test iodev is used to simulate hardware 14 * iodevs when they aren't available. 15 * Args: 16 * direciton - input or output. 17 * type - The test type. 18 * Returns: 19 * A pointer to the newly created iodev if successful, NULL otherwise. 20 */ 21 struct cras_iodev *test_iodev_create(enum CRAS_STREAM_DIRECTION direction, 22 enum TEST_IODEV_TYPE type); 23 24 /* Destroys an test_iodev created with test_iodev_create. */ 25 void test_iodev_destroy(struct cras_iodev *iodev); 26 27 /* Handle a test commdn to the given iodev. */ 28 void test_iodev_command(struct cras_iodev *iodev, 29 enum CRAS_TEST_IODEV_CMD command, unsigned int data_len, 30 const uint8_t *data); 31 32 #endif /* TEST_IODEV_H_ */ 33