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 struct cras_client_message; 20 21 /* Initialize some server setup. Mainly to add the select handler first 22 * so that client callbacks can be registered before server start running. 23 */ 24 int cras_server_init(); 25 26 /* Runs the CRAS server. Open the main socket and begin listening for 27 * connections and for messages from clients that have connected. 28 */ 29 int cras_server_run(unsigned int profile_disable_mask); 30 31 /* Send a message to all attached clients. */ 32 void cras_server_send_to_all_clients(const struct cras_client_message *msg); 33 34 #endif /* CRAS_SERVER_H_ */ 35