1 /* Copyright (c) 2012 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 /* 7 * The CRAS server instance. 8 */ 9 #ifndef CRAS_SERVER_H_ 10 #define CRAS_SERVER_H_ 11 12 /* 13 * Bitmask for cras_server_run() argument profile_disable_mask 14 */ 15 #define CRAS_SERVER_PROFILE_MASK_HFP (1 << 0) 16 #define CRAS_SERVER_PROFILE_MASK_HSP (1 << 1) 17 #define CRAS_SERVER_PROFILE_MASK_A2DP (1 << 2) 18 19 /* Reserver client id 0-15 for internal server usage. */ 20 #define RESERVED_CLIENT_IDS 16 21 #define SERVER_STREAM_CLIENT_ID 0 22 23 struct cras_client_message; 24 25 /* Initialize some server setup. Mainly to add the select handler first 26 * so that client callbacks can be registered before server start running. 27 */ 28 int cras_server_init(); 29 30 /* Runs the CRAS server. Open the main socket and begin listening for 31 * connections and for messages from clients that have connected. 32 */ 33 int cras_server_run(unsigned int profile_disable_mask); 34 35 /* Send a message to all attached clients. */ 36 void cras_server_send_to_all_clients(const struct cras_client_message *msg); 37 38 #endif /* CRAS_SERVER_H_ */ 39