1 /***************************************************************************/ /**
2  * @file  sl_si91x_socket_callback_framework.h
3  *******************************************************************************
4  * # License
5  * <b>Copyright 2024 Silicon Laboratories Inc. www.silabs.com</b>
6  *******************************************************************************
7  *
8  * SPDX-License-Identifier: Zlib
9  *
10  * The licensor of this software is Silicon Laboratories Inc.
11  *
12  * This software is provided 'as-is', without any express or implied
13  * warranty. In no event will the authors be held liable for any damages
14  * arising from the use of this software.
15  *
16  * Permission is granted to anyone to use this software for any purpose,
17  * including commercial applications, and to alter it and redistribute it
18  * freely, subject to the following restrictions:
19  *
20  * 1. The origin of this software must not be misrepresented; you must not
21  *    claim that you wrote the original software. If you use this software
22  *    in a product, an acknowledgment in the product documentation would be
23  *    appreciated but is not required.
24  * 2. Altered source versions must be plainly marked as such, and must not be
25  *    misrepresented as being the original software.
26  * 3. This notice may not be removed or altered from any source distribution.
27  *
28  ******************************************************************************/
29 
30 #pragma once
31 
32 #include "sl_status.h"
33 #include "sl_si91x_types.h"
34 
35 typedef struct {
36   void *user_context;
37   void *socket_context;
38   int32_t socket_id; //socket_id to update in command trace of bus thread.
39 } sl_si91x_socket_context_t;
40 
41 /**
42  * This is internal event handler to handle all events of sockets[Including BSD]
43  * @param status 	  sl_status of rx_packet frame status
44  * @param sdk_context sl_si91x_socket_context_t that was sent at the time sending the request.
45  * @param rx_packet	  Firmware response.
46  * @return
47  */
48 sl_status_t si91x_socket_event_handler(sl_status_t status,
49                                        sl_si91x_socket_context_t *sdk_context,
50                                        sl_si91x_packet_t *rx_packet);
51