MHEG5 1.0
DTVKit MHEG5 1.0 API Documentation
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
http_platform.h
Go to the documentation of this file.
1 /*******************************************************************************
2  * Copyright © 2014 The DTVKit Open Software Foundation Ltd (www.dtvkit.org)
3  * Copyright © 2010 Ocean Blue Software Ltd
4  *
5  * This file is part of a DTVKit Software Component
6  * You are permitted to copy, modify or distribute this file subject to the terms
7  * of the DTVKit 1.0 Licence which can be found in licence.txt or at www.dtvkit.org
8  *
9  * THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
10  * EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES
11  * OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
12  *
13  * If you or your organisation is not a member of DTVKit then you have access
14  * to this source code outside of the terms of the licence agreement
15  * and you are expected to delete this and any associated files immediately.
16  * Further information on DTVKit, membership and terms can be found at www.dtvkit.org
17  *******************************************************************************/
25 #ifndef _PM_HTTP_H
26 #define _PM_HTTP_H
27 
28 
29 /*---includes for this file--------------------------------------------------*/
30 #include <techtype.h>
31 #include <httptype.h>
32 
33 /*---Constant and macro definitions for public use---------------------------*/
34 
35 /*---Enumerations for public use---------------------------------------------*/
36 
37 /*---Global type defs for public use-----------------------------------------*/
38 
39 /* HTTP request type */
40 typedef enum
41 {
47 
48 /*---Global variable declarations for public use-----------------------------*/
49 
50 /*---Global Function prototypes for public use-------------------------------*/
51 
58 
59 
67 E_HttpErr HP_SetUserAgent(U8BIT *user_agent);
68 
69 
83 
84 
99  void **handle);
100 
101 
109 E_HttpErr HP_StartRequest(void *handle);
110 
111 
119 E_HttpErr HP_ResumeRequest(void *handle);
120 
121 
129 E_HttpErr HP_StopRequest(void *handle);
130 
131 
139 E_HttpErr HP_DestroyRequest(void *handle);
140 
141 
150 E_HttpErr HP_SetUserData(void *handle, void *userdata);
151 
152 
161 E_HttpErr HP_AddHeader(void *handle, U8BIT *header);
162 
163 
172 E_HttpErr HP_SetPostData(void *handle, U8BIT *postdata);
173 
174 
183 E_HttpErr HP_SetRange(void *handle, U8BIT *range);
184 
185 
194 E_HttpErr HP_GetRedirectUrl(void *handle, U8BIT **url);
195 
196 
206 
207 
214 
215 
225 
226 
235 E_HttpErr HP_Process(U16BIT *active_count);
236 
237 
247 void HP_HeaderCallback(void *userdata, S32BIT response_code,
248  U8BIT *data, U32BIT len);
249 
250 
262 BOOLEAN HP_ContentCallback(void *userdata, U8BIT *data, U32BIT len);
263 
264 
272 void HP_EndCallback(void *userdata, E_HttpStatus status);
273 
274 
280 E_HttpErr HP_Terminate(void);
281 
282 
283 #endif /*_PM_HTTP_H*/
E_HttpErr HP_Terminate(void)
Terminate the HTTP interface.
Definition: http_platform.h:44
E_HttpErr HP_ResumeRequest(void *handle)
Resume an HTTP request.
E_HttpErr HP_Process(U16BIT *active_count)
Process HTTP requests. This may cause request callbacks to be called.
E_HttpErr HP_DestroyRequest(void *handle)
Destroy an HTTP request.
E_HttpStatus
Definition: httptype.h:36
const char * data
Definition: mh5gate.c:65
E_HttpErr HP_Initialise(void)
Initialise the HTTP interface.
E_HttpErr HP_SetUserAgent(U8BIT *user_agent)
Set user agent for HTTP client.
Definition: http_platform.h:45
E_HttpErr HP_StopRequest(void *handle)
Stop an HTTP request.
E_HttpErr
Definition: httptype.h:29
E_HttpErr HP_GetRedirectUrl(void *handle, U8BIT **url)
Get redirection URL for HTTP request.
E_HttpErr HP_AddHeader(void *handle, U8BIT *header)
Add HTTP header to HTTP request.
uint8_t U8BIT
Definition: techtype.h:93
E_HttpErr HP_SetPostData(void *handle, U8BIT *postdata)
Set POST data for an HTTP request.
E_HttpErr HP_CreateRequest(U8BIT *url, E_HttpRequestType type, void **handle)
Create an HTTP request. The URL is provided, and is guaranteed to be either "http://..." or "https://..." The request type is also provided. Streaming request is the same as a GET request, except that a "Range:" header is also allowed for it.
E_HttpErr HP_StartRequest(void *handle)
Start an HTTP request.
int len
Definition: mh5gate.c:66
E_HttpErr HP_ClearTlsCertificates(void)
Clear TLS certificates.
int32_t S32BIT
Definition: techtype.h:98
E_HttpErr HP_SetUserData(void *handle, void *userdata)
Set user data associated with an HTTP request.
uint16_t U16BIT
Definition: techtype.h:95
E_HttpErr HP_WaitForAction(void)
Wait until there is some activity on one (or more) of the HTTP requests, or until some other conditio...
System Wide Global Technical Data Type Definitions.
BOOLEAN HP_ContentCallback(void *userdata, U8BIT *data, U32BIT len)
Callback for HTTP content data. This function is called by the HTTP client. The callback must return ...
E_HttpRequestType
Definition: http_platform.h:40
Definition: http_platform.h:42
void HP_HeaderCallback(void *userdata, S32BIT response_code, U8BIT *data, U32BIT len)
Callback for HTTP header data. This function is called by the HTTP client.
E_HttpErr HP_SetRange(void *handle, U8BIT *range)
Set "Range:" header for an HTTP request.
U8BIT BOOLEAN
Definition: techtype.h:112
HTTP types.
E_HttpErr HP_SetTimeout(U16BIT timeout)
Set timeout (in seconds) for HTTP requests. The timeout applies to connections (i.e. the time it takes to connect to the server) as well as response time (i.e the time it takes to download the content). Between sending the request and receiving the first byte of the the response there is no timeout.
uint32_t U32BIT
Definition: techtype.h:97
void HP_EndCallback(void *userdata, E_HttpStatus status)
Callback for HTTP request end. This function is called by the HTTP client.
Definition: http_platform.h:43
E_HttpErr HP_AddTlsCertificate(U8BIT *cert, U32BIT len)
Add a certificate for TLS connections.