Part of TI's mqtt

Dependents:   mqtt_V1 cc3100_Test_mqtt_CM3

Committer:
dflet
Date:
Sat Jun 06 13:29:08 2015 +0000
Revision:
0:547251f42a60
Part of mqtt_V1

Who changed what in which revision?

UserRevisionLine numberNew contents of line
dflet 0:547251f42a60 1 /******************************************************************************
dflet 0:547251f42a60 2 *
dflet 0:547251f42a60 3 * Copyright (C) 2014 Texas Instruments Incorporated
dflet 0:547251f42a60 4 *
dflet 0:547251f42a60 5 * All rights reserved. Property of Texas Instruments Incorporated.
dflet 0:547251f42a60 6 * Restricted rights to use, duplicate or disclose this code are
dflet 0:547251f42a60 7 * granted through contract.
dflet 0:547251f42a60 8 *
dflet 0:547251f42a60 9 * The program may not be used without the written permission of
dflet 0:547251f42a60 10 * Texas Instruments Incorporated or against the terms and conditions
dflet 0:547251f42a60 11 * stipulated in the agreement under which this program has been supplied,
dflet 0:547251f42a60 12 * and under no circumstances can it be used with non-TI connectivity device.
dflet 0:547251f42a60 13 *
dflet 0:547251f42a60 14 ******************************************************************************/
dflet 0:547251f42a60 15
dflet 0:547251f42a60 16 #ifndef __SERVER_UTIL_H__
dflet 0:547251f42a60 17 #define __SERVER_UTIL_H__
dflet 0:547251f42a60 18
dflet 0:547251f42a60 19 #include "mqtt_common.h"
dflet 0:547251f42a60 20
dflet 0:547251f42a60 21 #ifdef __cplusplus
dflet 0:547251f42a60 22 extern "C"
dflet 0:547251f42a60 23 {
dflet 0:547251f42a60 24 #endif
dflet 0:547251f42a60 25
dflet 0:547251f42a60 26 namespace mbed_mqtt {
dflet 0:547251f42a60 27
dflet 0:547251f42a60 28 #define my_malloc malloc
dflet 0:547251f42a60 29 #define my_free free
dflet 0:547251f42a60 30
dflet 0:547251f42a60 31 #define MQTT_SERVER_VERSTR "1.0.1"
dflet 0:547251f42a60 32
dflet 0:547251f42a60 33 #define MIN(a,b) ((a > b)? b : a)
dflet 0:547251f42a60 34
dflet 0:547251f42a60 35 uint16_t mqp_new_id_server(void);
dflet 0:547251f42a60 36 struct mqtt_packet *mqp_server_alloc(uint8_t msg_type, uint32_t buf_sz);
dflet 0:547251f42a60 37
dflet 0:547251f42a60 38 struct mqtt_packet *mqp_server_copy(const struct mqtt_packet *mqp);
dflet 0:547251f42a60 39
dflet 0:547251f42a60 40 extern int32_t (*util_dbg_prn)(const char *fmt, ...);
dflet 0:547251f42a60 41 extern bool util_prn_aux;
dflet 0:547251f42a60 42
dflet 0:547251f42a60 43 void util_mutex_lockin(void);
dflet 0:547251f42a60 44 void util_mutex_unlock(void);
dflet 0:547251f42a60 45
dflet 0:547251f42a60 46 #define MUTEX_LOCKIN() util_mutex_lockin()
dflet 0:547251f42a60 47 #define MUTEX_UNLOCK() util_mutex_unlock()
dflet 0:547251f42a60 48
dflet 0:547251f42a60 49 #define USR_INFO(FMT, ...) if(util_dbg_prn) util_dbg_prn(FMT, ##__VA_ARGS__)
dflet 0:547251f42a60 50
dflet 0:547251f42a60 51 #define DBG_INFO(FMT, ...) \
dflet 0:547251f42a60 52 if(util_prn_aux && util_dbg_prn) \
dflet 0:547251f42a60 53 util_dbg_prn(FMT, ##__VA_ARGS__)
dflet 0:547251f42a60 54
dflet 0:547251f42a60 55 void util_params_set(int32_t (*dbg_prn)(const char *fmt, ...),
dflet 0:547251f42a60 56 void *mutex,
dflet 0:547251f42a60 57 void (*mutex_lockin)(void*),
dflet 0:547251f42a60 58 void (*mutex_unlock)(void*));
dflet 0:547251f42a60 59
dflet 0:547251f42a60 60 }//namespace mbed_mqtt {
dflet 0:547251f42a60 61
dflet 0:547251f42a60 62 #ifdef __cplusplus
dflet 0:547251f42a60 63 }
dflet 0:547251f42a60 64 #endif
dflet 0:547251f42a60 65
dflet 0:547251f42a60 66 #endif
dflet 0:547251f42a60 67