csp_if_socket.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2017 Kubos Corporation
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
23 #ifndef _CSP_IF_SOCKET_H
24 #define _CSP_IF_SOCKET_H
25 
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29 
30 #include <stdint.h>
31 
32 /* CSP includes */
33 #include <csp/csp.h>
34 #include <csp/csp_interface.h>
35 #include <csp/arch/csp_thread.h>
36 
40 typedef struct {
44  csp_thread_handle_t rx_thread_handle;
45  bool is_active;
47 
51 typedef enum {
57 
64 int csp_socket_init(csp_iface_t * socket_iface, csp_socket_handle_t * socket_driver);
65 
66 int csp_socket_close(csp_iface_t * socket_iface, csp_socket_handle_t * socket_driver);
67 
68 #define SOCKET_BUFFER_SIZE 256
69 
70 #ifdef __cplusplus
71 } /* extern "C" */
72 #endif
73 
74 #endif /* _CSP_IF_SOCKET_H */
75 
76 /* @} */
Unix socket driver handle.
Definition: csp_if_socket.h:40
csp_if_socket_modes
Enum for csp socket mode.
Definition: csp_if_socket.h:51
Interface struct.
Definition: csp_types.h:190
csp_thread_handle_t rx_thread_handle
Definition: csp_if_socket.h:44
Definition: csp_if_socket.h:55
int csp_socket_close(csp_iface_t *socket_iface, csp_socket_handle_t *socket_driver)
int socket_handle
Definition: csp_if_socket.h:42
bool is_active
Definition: csp_if_socket.h:45
int csp_socket_init(csp_iface_t *socket_iface, csp_socket_handle_t *socket_driver)
Init function for CSP socket interface.
Definition: csp_if_socket.h:53