areaDetector  3-14
EPICS areaDetector framework
Classes | Macros | Typedefs
restApi.cpp File Reference
#include "restApi.h"
#include <stdexcept>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <frozen.h>
#include <epicsStdio.h>
#include <epicsThread.h>
#include <epicsTime.h>
#include <fcntl.h>

Classes

struct  socket
 
struct  request
 
struct  response
 

Macros

#define EOL   "\r\n"
 
#define EOL_LEN   2
 
#define EOH   EOL EOL
 
#define EOH_LEN   (EOL_LEN*2)
 
#define ID_STR   "$id"
 
#define ID_LEN   3
 
#define DATA_NATIVE   "application/json; charset=utf-8"
 
#define DATA_TIFF   "application/tiff"
 
#define DATA_HDF5   "application/hdf5"
 
#define DATA_HTML   "text/html"
 
#define MAX_HTTP_RETRIES   1
 
#define MAX_MESSAGE_SIZE   512
 
#define MAX_BUF_SIZE   256
 
#define MAX_JSON_TOKENS   100
 
#define DEFAULT_TIMEOUT_INIT   240
 
#define DEFAULT_TIMEOUT_ARM   120
 
#define DEFAULT_TIMEOUT_CONNECT   1
 
#define ERR_PREFIX   "RestApi"
 
#define ERR(msg)   fprintf(stderr, ERR_PREFIX "::%s: %s\n", functionName, msg)
 
#define ERR_ARGS(fmt, ...)
 
#define REQUEST_GET
 
#define REQUEST_GET_FILE
 
#define REQUEST_PUT
 
#define REQUEST_HEAD
 
#define REQUEST_DELETE
 

Typedefs

typedef struct socket socket_t
 
typedef struct request request_t
 
typedef struct response response_t
 

Macro Definition Documentation

◆ DATA_HDF5

#define DATA_HDF5   "application/hdf5"

◆ DATA_HTML

#define DATA_HTML   "text/html"

◆ DATA_NATIVE

#define DATA_NATIVE   "application/json; charset=utf-8"

◆ DATA_TIFF

#define DATA_TIFF   "application/tiff"

◆ DEFAULT_TIMEOUT_ARM

#define DEFAULT_TIMEOUT_ARM   120

◆ DEFAULT_TIMEOUT_CONNECT

#define DEFAULT_TIMEOUT_CONNECT   1

◆ DEFAULT_TIMEOUT_INIT

#define DEFAULT_TIMEOUT_INIT   240

◆ EOH

#define EOH   EOL EOL

◆ EOH_LEN

#define EOH_LEN   (EOL_LEN*2)

◆ EOL

#define EOL   "\r\n"

◆ EOL_LEN

#define EOL_LEN   2

◆ ERR

#define ERR (   msg)    fprintf(stderr, ERR_PREFIX "::%s: %s\n", functionName, msg)

◆ ERR_ARGS

#define ERR_ARGS (   fmt,
  ... 
)
Value:
fprintf(stderr, ERR_PREFIX "::%s: " fmt "\n", \
functionName, __VA_ARGS__)
Pylon::EPixelType fmt
Definition: ADPylon.cpp:58
#define ERR_PREFIX
Definition: restApi.cpp:38

◆ ERR_PREFIX

#define ERR_PREFIX   "RestApi"

◆ ID_LEN

#define ID_LEN   3

◆ ID_STR

#define ID_STR   "$id"

◆ MAX_BUF_SIZE

#define MAX_BUF_SIZE   256

◆ MAX_HTTP_RETRIES

#define MAX_HTTP_RETRIES   1

◆ MAX_JSON_TOKENS

#define MAX_JSON_TOKENS   100

◆ MAX_MESSAGE_SIZE

#define MAX_MESSAGE_SIZE   512

◆ REQUEST_DELETE

#define REQUEST_DELETE
Value:
"DELETE %s%s HTTP/1.1" EOL\
"Host: %s" EOH
#define EOL
Definition: restApi.cpp:16
#define EOH
Definition: restApi.cpp:18

◆ REQUEST_GET

#define REQUEST_GET
Value:
"GET %s%s HTTP/1.1" EOL \
"Host: %s" EOL\
"Content-Length: 0" EOL \
"Accept: " DATA_NATIVE EOH
#define DATA_NATIVE
Definition: restApi.cpp:24

◆ REQUEST_GET_FILE

#define REQUEST_GET_FILE
Value:
"GET %s%s HTTP/1.1" EOL \
"Host: %s" EOL\
"Content-Length: 0" EOL \
"Accept: %s" EOH

◆ REQUEST_HEAD

#define REQUEST_HEAD
Value:
"HEAD %s%s HTTP/1.1" EOL\
"Host: %s" EOH

◆ REQUEST_PUT

#define REQUEST_PUT
Value:
"PUT %s%s HTTP/1.1" EOL \
"Host: %s" EOL\
"Accept-Encoding: identity" EOL\
"Content-Type: " DATA_NATIVE EOL \
"Content-Length: %lu" EOH

Typedef Documentation

◆ request_t

typedef struct request request_t

◆ response_t

typedef struct response response_t

◆ socket_t

typedef struct socket socket_t