Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: ThingPlug_Ethernet_Example
Fork of GMMP_mbed by
Define.h
00001 /** GMMP 공통 정의 00002 * @file Define.h 00003 * @date 2015/07/20 00004 * @version 0.0.1.0 00005 **/ 00006 00007 /* 00008 #include <stdio.h> 00009 #include <stdlib.h> 00010 #include <string.h> 00011 */ 00012 00013 #ifndef DEFINE_H_ 00014 #define DEFINE_H_ 00015 00016 #include "mbed.h" 00017 #define byte unsigned char 00018 00019 #include "Define_Operation.h" 00020 #include "ErrorCode.h" 00021 00022 #define true 1 00023 #define false 0 00024 00025 #define MAX_MSG_BODY 256 00026 #define MAX_SMS_MSG_BODY 38 00027 00028 #define LEN_DOMAIN_CODE 10 00029 #define LEN_GW_ID 16 00030 #define LEN_DEVICE_ID 16 00031 #define LEN_AUTH_KEY 16 00032 #define LEN_AUTH_ID 16 00033 #define LEN_MANUFACTURE_ID 16 00034 #define LEN_ENCRYTION_KEY 32 00035 #define LEN_MULTIMEDIA_URL 256 00036 #define LEN_MULTIMEDIA_ID 16 00037 #define LEN_MULTIMEDIA_PW 16 00038 #define LEN_LOB_ACCESS_KEY 20 00039 #define LEN_LOB_SECRET_KEY 16 00040 #define LEN_LOB_DIRECTORY_PATH 16 00041 #define LEN_LOB_PATH 64 00042 #define LEN_TID 4 00043 #define LEN_IP 4 00044 #define LEN_FILE_NAME 32 00045 00046 #define TID_TANGE_MIN 0 00047 #define TID_TANGE_MAX 99999 00048 00049 #define GMMP_ON_LOG true 00050 #define GMMP_OFF_LOG false 00051 00052 #define GMMP_ERROR_LEVEL_ERROR 0 00053 #define GMMP_ERROR_LEVEL_DEBUG 1 00054 #define GMMP_ERROR_LEVEL_DEBUG_DATA 2 00055 00056 #define GMMP_LOG_MARKET_OPS 0 00057 #define GMMP_LOG_MARKET_REQ 1 00058 #define GMMP_LOG_MARKET_RSP 2 00059 #define GMMP_LOG_MARKET_OPE 3 00060 #define GMMP_LOG_MARKET_ERR 4 00061 #define GMMP_LOG_MARKET_NOT 5 00062 00063 #define GMMP_LOG_KEY_KEY0 "<Well>" 00064 #define GMMP_LOG_KEY_KEY1 "<ID:%s_%d>" 00065 #define GMMP_LOG_KEY_KEY2 "<Marker:OPS>" 00066 #define GMMP_LOG_KEY_KEY3 "<Marker:REQ>" 00067 #define GMMP_LOG_KEY_KEY4 "<Marker:RSP>" 00068 #define GMMP_LOG_KEY_KEY5 "<Marker:OPE>" 00069 #define GMMP_LOG_KEY_KEY6 "<Marker:ERR>" 00070 00071 00072 #define GMMP_MARKET_LEN 15 00073 00074 00075 #define GMMP_NETWORK_ALYWAYS_OFF 0 00076 #define GMMP_NETWORK_ALYWAYS_ON 1 00077 00078 #define GMMP_GW 0x01 00079 #define GMMP_Device 0x02 00080 00081 #define GMMP_REG 0x01 00082 #define GMMP_DEREG 0x02 00083 #define GMMP_PROFILE 0x03 00084 #define GMMP_DELIVERY 0x04 00085 #define GMMP_CONTROL 0x05 00086 #define GMMP_LSENTENCE 0x06 00087 #define GMMP_FTP 0x07 00088 #define GMMP_REMOTE 0x08 00089 #define GMMP_HEARTBEAT 0x09 00090 #define GMMP_NOTIFICATION 0x0a 00091 #define GMMP_MULTIMEDIA 0x0b 00092 #define GMMP_LOB 0x0c 00093 00094 #define GMMP_REG_ENCRYPTION_INFO 0x01 00095 #define GMMP_REG_ENCRYPTION_KEY 0x02 00096 00097 #define GMMP_ENCRYPTION_USE 0x01 00098 #define GMMP_ENCRYPTION_NOT 0x02 00099 00100 #define GMMP_LOB_CLOUD 0x01 00101 #define GMMP_LOB_FTP 0x02 00102 #define GMMP_LOB_NOTIFICATION 0x03 00103 00104 #define U8 unsigned char 00105 00106 #define GMMP_VERSION 0x21 00107 00108 extern byte g_serverIp[LEN_IP]; 00109 extern int g_nServerPort; 00110 extern char g_szAuthID[LEN_AUTH_ID]; 00111 extern char g_szAuthKey[LEN_AUTH_KEY]; 00112 extern char g_szDomainCode[LEN_DOMAIN_CODE]; 00113 extern char g_szGWID[LEN_GW_ID]; 00114 extern char g_szDeviceID[LEN_DEVICE_ID]; 00115 00116 #define LOG_LEVEL 2 00117 #define LOG_LEVEL_NONE 6 00118 #define LOG_LEVEL_FATAL 5 00119 #define LOG_LEVEL_ERROR 4 00120 #define LOG_LEVEL_WARN 3 00121 #define LOG_LEVEL_INFO 2 00122 #define LOG_LEVEL_DEBUG 1 00123 #define LOG_LEVEL_ALL 0 00124 00125 #include <cstdio> 00126 #define INFO(x, ...) if (LOG_LEVEL <= LOG_LEVEL_INFO) std::printf("[INFO]"x"\r\n", ##__VA_ARGS__); 00127 #define DBG(x, ...) if (LOG_LEVEL <= LOG_LEVEL_DEBUG) std::printf("[DBG]"x"\r\n", ##__VA_ARGS__); 00128 #define WARN(x, ...) if (LOG_LEVEL <= LOG_LEVEL_WARN) std::printf("[WARN]"x"\r\n", ##__VA_ARGS__); 00129 #define ERR(x, ...) if (LOG_LEVEL <= LOG_LEVEL_ERROR) std::printf("[ERR]"x"\r\n", ##__VA_ARGS__); 00130 00131 #define fatal(x) if (LOG_LEVEL <= LOG_LEVEL_FATAL) std::printf((x)) 00132 #define fatalln(x) if (LOG_LEVEL <= LOG_LEVEL_FATAL) {std::printf(((x)); std::printf("\r\n");} 00133 #define fatal2(x, y) if (LOG_LEVEL <= LOG_LEVEL_FATAL) std::printf((x), (y)) 00134 #define fatalln2(x, y) if (LOG_LEVEL <= LOG_LEVEL_FATAL) {std::printf((x), (y)); std::printf("\r\n");} 00135 00136 #define error(x) if (LOG_LEVEL <= LOG_LEVEL_ERROR) std::printf((x)) 00137 #define errorln(x) if (LOG_LEVEL <= LOG_LEVEL_ERROR) {std::printf((x)); std::printf("\r\n");} 00138 #define error2(x, y) if (LOG_LEVEL <= LOG_LEVEL_ERROR) std::printf((x), (y)) 00139 #define errorln2(x, y) if (LOG_LEVEL <= LOG_LEVEL_ERROR) {std::printf((x), (y)); std::printf("\r\n");} 00140 00141 #define warn(x) if (LOG_LEVEL <= LOG_LEVEL_WARN) std::printf((x)) 00142 #define warnln(x) if (LOG_LEVEL <= LOG_LEVEL_WARN) {std::printf((x)); std::printf("\r\n");} 00143 #define warn2(x, y) if (LOG_LEVEL <= LOG_LEVEL_WARN) std::printf((x), (y)) 00144 #define warnln2(x, y) if (LOG_LEVEL <= LOG_LEVEL_WARN) {std::printf((x), (y)); std::printf("\r\n");} 00145 00146 #define info(x) if (LOG_LEVEL <= LOG_LEVEL_INFO) std::printf((x)) 00147 #define infoln(x) if (LOG_LEVEL <= LOG_LEVEL_INFO) {std::printf((x)); std::printf("\r\n");} 00148 #define info2(x, y) if (LOG_LEVEL <= LOG_LEVEL_INFO) std::printf((x), (y)) 00149 #define infoln2(x, y) if (LOG_LEVEL <= LOG_LEVEL_INFO) {std::printf((x), (y)); std::printf("\r\n");} 00150 00151 #define debug(x) if (LOG_LEVEL <= LOG_LEVEL_DEBUG) std::printf((x)) 00152 #define debugln(x) if (LOG_LEVEL <= LOG_LEVEL_DEBUG) {std::printf((x)); std::printf("\r\n");} 00153 #define debug2(x, y) if (LOG_LEVEL <= LOG_LEVEL_DEBUG) std::printf((x), (y)) 00154 #define debugln2(x, y) if (LOG_LEVEL <= LOG_LEVEL_DEBUG) {std::printf((x), (y)); std::printf("\r\n");} 00155 00156 #endif /* DEFINE_H_ */ 00157 00158 00159 00160
Generated on Tue Jul 12 2022 21:35:52 by
