Mistake on this page?
Report an issue in GitHub or email us
whd_network.h
1 /* mbed Microcontroller Library
2  * Copyright (c) 2017 ARM Limited
3  * SPDX-License-Identifier: Apache-2.0
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17 #ifndef WICED_NETWORK_H
18 #define WICED_NETWORK_H
19 #include "w_dtls_types.h"
20 #include "wiced_result.h"
21 
22 #ifdef __cplusplus
23 extern "C"
24 {
25 #endif
26 
27 /******************************************************
28  * Macros
29  ******************************************************/
30 
31 #define IP_HANDLE(interface) (wiced_ip_handle[(interface) & 3])
32 
33 /******************************************************
34  * Constants
35  ******************************************************/
36 
37 #define WICED_MAXIMUM_NUMBER_OF_SOCKETS_WITH_CALLBACKS (1)
38 #define WICED_MAXIMUM_NUMBER_OF_SERVER_SOCKETS (1)
39 
40 #define SIZE_OF_ARP_ENTRY sizeof(1)
41 
42 #define IP_STACK_SIZE (2 * 1024)
43 #define ARP_CACHE_SIZE (6 * SIZE_OF_ARP_ENTRY)
44 #define DHCP_STACK_SIZE (1024)
45 #define WICED_PKT_SIZE (1500)
46 #define WICED_ANY_PORT (0)
47 
48 /******************************************************
49  * Enumerations
50  ******************************************************/
51 
52 typedef enum {
53  WICED_SOCKET_ERROR
54 } wiced_socket_state_t;
55 
56 /******************************************************
57  * Type Definitions
58  ******************************************************/
59 typedef struct {
60  uint8_t *payload;
61  uint16_t len;
62  uint16_t pktstart;
64 
65 
66 //typedef NOOS_DUMMY wiced_tls_context_type_t;
67 //typedef NOOS_DUMMY wiced_tls_context_t;
68 //typedef NOOS_DUMMY wiced_tls_session_t;
69 //typedef NOOS_DUMMY wiced_tls_certificate_t;
70 //typedef NOOS_DUMMY wiced_tls_endpoint_type_t;
71 typedef void *NOOS_TCP_SOCKET;
72 
73 /******************************************************
74  * Structures
75  ******************************************************/
76 
77 typedef struct wiced_tcp_socket_struct wiced_tcp_socket_t;
78 typedef struct wiced_udp_socket_struct wiced_udp_socket_t;
79 
80 typedef wiced_result_t (*wiced_tcp_socket_callback_t)(wiced_tcp_socket_t *socket, void *arg);
81 typedef wiced_result_t (*wiced_udp_socket_callback_t)(wiced_udp_socket_t *socket, void *arg);
82 
84  wiced_dtls_context_t *dtls_context;
85  struct {
86  wiced_tcp_socket_callback_t disconnect;
87  wiced_tcp_socket_callback_t receive;
88  wiced_tcp_socket_callback_t connect;
89  } callbacks;
90  void *callback_arg;
91 };
92 
94  NOOS_TCP_SOCKET socket;
95  wiced_tls_context_t *tls_context;
96  wiced_bool_t context_malloced;
97  struct {
98  wiced_tcp_socket_callback_t disconnect;
99  wiced_tcp_socket_callback_t receive;
100  wiced_tcp_socket_callback_t connect;
101  } callbacks;
102  void *callback_arg;
103 };
104 
105 typedef struct {
106  wiced_tcp_socket_t socket[WICED_MAXIMUM_NUMBER_OF_SERVER_SOCKETS];
107  int interface;
108  uint16_t port;
109  wiced_tls_identity_t *tls_identity;
111 
112 /******************************************************
113  * Global Variables
114  ******************************************************/
115 typedef struct {
116  int dummy;
117 } NOOS_IP;
118 typedef struct {
119  int dummy;
121 /*
122  * Note: These objects are for internal use only!
123  */
124 extern NOOS_IP wiced_ip_handle [3];
125 extern NOOS_PACKET_POOL wiced_packet_pools [2]; /* 0=TX, 1=RX */
126 
127 /******************************************************
128  * Function Declarations
129  ******************************************************/
130 
131 
132 #ifdef __cplusplus
133 } /*extern "C" */
134 #endif
135 #endif
Important Information for this Arm website

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies. If you are not happy with the use of these cookies, please review our Cookie Policy to learn how they can be disabled. By disabling cookies, some features of the site will not work.