coreMQTT v1.0.1
MQTT 3.1.1 Client Library
transport_interface.h
Go to the documentation of this file.
1/*
2 * coreMQTT v1.0.1
3 * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
4 *
5 * Permission is hereby granted, free of charge, to any person obtaining a copy of
6 * this software and associated documentation files (the "Software"), to deal in
7 * the Software without restriction, including without limitation the rights to
8 * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9 * the Software, and to permit persons to whom the Software is furnished to do so,
10 * subject to the following conditions:
11 *
12 * The above copyright notice and this permission notice shall be included in all
13 * copies or substantial portions of the Software.
14 *
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17 * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18 * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19 * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21 */
22
28#ifndef TRANSPORT_INTERFACE_H_
29#define TRANSPORT_INTERFACE_H_
30
31#include <stdint.h>
32#include <stddef.h>
33
153/* @[define_networkcontext] */
154struct NetworkContext;
155typedef struct NetworkContext NetworkContext_t;
156/* @[define_networkcontext] */
157
168/* @[define_transportrecv] */
169typedef int32_t ( * TransportRecv_t )( NetworkContext_t * pNetworkContext,
170 void * pBuffer,
171 size_t bytesToRecv );
172/* @[define_transportrecv] */
173
184/* @[define_transportsend] */
185typedef int32_t ( * TransportSend_t )( NetworkContext_t * pNetworkContext,
186 const void * pBuffer,
187 size_t bytesToSend );
188/* @[define_transportsend] */
189
194/* @[define_transportinterface] */
195typedef struct TransportInterface
196{
201/* @[define_transportinterface] */
202
203#endif /* ifndef TRANSPORT_INTERFACE_H_ */
int32_t(* TransportRecv_t)(NetworkContext_t *pNetworkContext, void *pBuffer, size_t bytesToRecv)
Transport interface for receiving data on the network.
Definition: transport_interface.h:169
int32_t(* TransportSend_t)(NetworkContext_t *pNetworkContext, const void *pBuffer, size_t bytesToSend)
Transport interface for sending data over the network.
Definition: transport_interface.h:185
struct NetworkContext NetworkContext_t
The NetworkContext is an incomplete type. An implementation of this interface must define struct Netw...
Definition: transport_interface.h:155
The transport layer interface.
Definition: transport_interface.h:196
TransportSend_t send
Definition: transport_interface.h:198
TransportRecv_t recv
Definition: transport_interface.h:197
NetworkContext_t * pNetworkContext
Definition: transport_interface.h:199