1 /* 2 * Copyright (c) 2021 Bestechnic (Shanghai) Co., Ltd. All rights reserved. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 #ifndef __CP_IPC_H__ 16 #define __CP_IPC_H__ 17 18 #ifdef __cplusplus 19 extern "C" { 20 #endif 21 22 typedef enum { 23 CP_IPC_MSG_TRACE = 0, 24 #ifdef WIFI_ON_CP 25 CP_IPC_MSG_NET_MGMT, 26 #else 27 CP_IPC_MSG_NET_MGMT_AGENT, 28 CP_IPC_MSG_NET_MGMT_SRV, 29 #endif 30 CP_IPC_MSG_TEST, 31 IPC_MSG_TYPE_NUM 32 }CP_IPC_MSG_TYPE; 33 34 typedef struct{ 35 uint16_t id; 36 uint16_t len; 37 void * data; 38 }CP_IPC_MSG_HDR; 39 40 typedef void (*CP_IPC_MSG_CB)(void *param); 41 42 int cp_ipc_init(); 43 int cp_ipc_start(); 44 int cp_ipc_send(CP_IPC_MSG_HDR *msg); 45 int cp_ipc_send_self(CP_IPC_MSG_HDR *msg); 46 int cp_ipc_cb_set(CP_IPC_MSG_TYPE type, CP_IPC_MSG_CB func, bool tx); 47 48 #ifdef __cplusplus 49 } 50 #endif 51 #endif 52