/* * Copyright 2023 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #pragma once /* * Generated mock file from original source file * Functions generated:10 * * mockcify.pl ver 0.6.2 */ #include #include #include #include #include #include "btif/include/btif_uid.h" #include "hardware/bt_sock.h" #include "stack/include/bt_hdr.h" #include "types/bluetooth/uuid.h" #include "types/raw_address.h" // Original usings using bluetooth::Uuid; // Mocked compile conditionals, if any namespace test { namespace mock { namespace btif_sock_rfc { // Shared state between mocked functions and tests // Name: bta_co_rfc_data_incoming // Params: uint32_t id, BT_HDR* p_buf // Return: int struct bta_co_rfc_data_incoming { static int return_value; std::function body{ [](uint32_t /* id */, BT_HDR* /* p_buf */) { return return_value; }}; int operator()(uint32_t id, BT_HDR* p_buf) { return body(id, p_buf); } }; extern struct bta_co_rfc_data_incoming bta_co_rfc_data_incoming; // Name: bta_co_rfc_data_outgoing // Params: uint32_t id, uint8_t* buf, uint16_t size // Return: int struct bta_co_rfc_data_outgoing { static int return_value; std::function body{ [](uint32_t /* id */, uint8_t* /* buf */, uint16_t /* size */) { return return_value; }}; int operator()(uint32_t id, uint8_t* buf, uint16_t size) { return body(id, buf, size); } }; extern struct bta_co_rfc_data_outgoing bta_co_rfc_data_outgoing; // Name: bta_co_rfc_data_outgoing_size // Params: uint32_t id, int* size // Return: int struct bta_co_rfc_data_outgoing_size { static int return_value; std::function body{ [](uint32_t /* id */, int* /* size */) { return return_value; }}; int operator()(uint32_t id, int* size) { return body(id, size); } }; extern struct bta_co_rfc_data_outgoing_size bta_co_rfc_data_outgoing_size; // Name: btsock_rfc_cleanup // Params: void // Return: void struct btsock_rfc_cleanup { std::function body{[](void) {}}; void operator()(void) { body(); } }; extern struct btsock_rfc_cleanup btsock_rfc_cleanup; // Name: btsock_rfc_connect // Params: const RawAddress* bd_addr, const Uuid* service_uuid, int channel, // int* sock_fd, int flags, int app_uid Return: bt_status_t struct btsock_rfc_connect { static bt_status_t return_value; std::function body{[](const RawAddress* /*bd_addr*/, const bluetooth::Uuid* /*uuid*/, int /*channel*/, int* /*sock_fd*/, int /*flags*/, int /*app_uid*/, btsock_data_path_t /*data_path*/, const char* /*socket_name*/, uint64_t /*hub_id*/, uint64_t /*endpoint_id*/, int /*max_rx_packet_size*/) { return return_value; }}; bt_status_t operator()(const RawAddress* bd_addr, const bluetooth::Uuid* uuid, int channel, int* sock_fd, int flags, int app_uid, btsock_data_path_t data_path, const char* socket_name, uint64_t hub_id, uint64_t endpoint_id, int max_rx_packet_size) { return body(bd_addr, uuid, channel, sock_fd, flags, app_uid, data_path, socket_name, hub_id, endpoint_id, max_rx_packet_size); } }; extern struct btsock_rfc_connect btsock_rfc_connect; // Name: btsock_rfc_control_req // Params: uint8_t dlci, const RawAddress& bd_addr, uint8_t modem_signal, // uint8_t break_signal, uint8_t discard_buffers, uint8_t break_signal_seq, bool // fc Return: bt_status_t struct btsock_rfc_control_req { static bt_status_t return_value; std::function body{[](uint8_t /* dlci */, const RawAddress& /* bd_addr */, uint8_t /* modem_signal */, uint8_t /* break_signal */, uint8_t /* discard_buffers */, uint8_t /* break_signal_seq */, bool /* fc */) { return return_value; }}; bt_status_t operator()(uint8_t dlci, const RawAddress& bd_addr, uint8_t modem_signal, uint8_t break_signal, uint8_t discard_buffers, uint8_t break_signal_seq, bool fc) { return body(dlci, bd_addr, modem_signal, break_signal, discard_buffers, break_signal_seq, fc); } }; extern struct btsock_rfc_control_req btsock_rfc_control_req; // Name: btsock_rfc_disconnect // Params: const RawAddress* bd_addr // Return: bt_status_t struct btsock_rfc_disconnect { static bt_status_t return_value; std::function body{ [](const RawAddress* /* bd_addr */) { return return_value; }}; bt_status_t operator()(const RawAddress* bd_addr) { return body(bd_addr); } }; extern struct btsock_rfc_disconnect btsock_rfc_disconnect; // Name: btsock_rfc_init // Params: int poll_thread_handle, uid_set_t* set // Return: bt_status_t struct btsock_rfc_init { static bt_status_t return_value; std::function body{ [](int /* poll_thread_handle */, uid_set_t* /* set */) { return return_value; }}; bt_status_t operator()(int poll_thread_handle, uid_set_t* set) { return body(poll_thread_handle, set); } }; extern struct btsock_rfc_init btsock_rfc_init; // Name: btsock_rfc_listen // Params: const char* service_name, const Uuid* service_uuid, int channel, int* // sock_fd, int flags, int app_uid Return: bt_status_t struct btsock_rfc_listen { static bt_status_t return_value; std::function body{[](const char* /* service_name */, const Uuid* /* service_uuid */, int /* channel */, int* /* sock_fd */, int /* flags */, int /* app_uid */, btsock_data_path_t /*data_path*/, const char* /*socket_name*/, uint64_t /*hub_id*/, uint64_t /*endpoint_id*/, int /*max_rx_packet_size*/) { return return_value; }}; bt_status_t operator()(const char* service_name, const Uuid* service_uuid, int channel, int* sock_fd, int flags, int app_uid, btsock_data_path_t data_path, const char* socket_name, uint64_t hub_id, uint64_t endpoint_id, int max_rx_packet_size) { return body(service_name, service_uuid, channel, sock_fd, flags, app_uid, data_path, socket_name, hub_id, endpoint_id, max_rx_packet_size); } }; extern struct btsock_rfc_listen btsock_rfc_listen; // Name: btsock_rfc_signaled // Params: int fd, int flags, uint32_t id // Return: void struct btsock_rfc_signaled { std::function body{ [](int /* fd */, int /* flags */, uint32_t /* id */) {}}; void operator()(int fd, int flags, uint32_t id) { body(fd, flags, id); } }; extern struct btsock_rfc_signaled btsock_rfc_signaled; // Name: on_btsocket_rfc_close // Params: uint64_t socket_id // Return: void struct on_btsocket_rfc_close { std::function body{[](uint64_t /* socket_id */) {}}; void operator()(uint64_t socket_id) { body(socket_id); } }; extern struct on_btsocket_rfc_close on_btsocket_rfc_close; // Name: on_btsocket_rfc_opened_complete // Params: uint64_t socket_id, bool success // Return: void struct on_btsocket_rfc_opened_complete { std::function body{ [](uint64_t /* socket_id */, bool /* success */) {}}; void operator()(uint64_t socket_id, bool success) { body(socket_id, success); } }; extern struct on_btsocket_rfc_opened_complete on_btsocket_rfc_opened_complete; } // namespace btif_sock_rfc } // namespace mock } // namespace test // END mockcify generation