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.
MQTTSNGWDefines.h
00001 /************************************************************************************** 00002 * Copyright (c) 2016, Tomoaki Yamaguchi 00003 * 00004 * All rights reserved. This program and the accompanying materials 00005 * are made available under the terms of the Eclipse Public License v1.0 00006 * and Eclipse Distribution License v1.0 which accompany this distribution. 00007 * 00008 * The Eclipse Public License is available at 00009 * http://www.eclipse.org/legal/epl-v10.html 00010 * and the Eclipse Distribution License is available at 00011 * http://www.eclipse.org/org/documents/edl-v10.php. 00012 * 00013 * Contributors: 00014 * Tomoaki Yamaguchi - initial API and implementation and/or initial documentation 00015 **************************************************************************************/ 00016 00017 #ifndef MQTTSNGWDEFINES_H_ 00018 #define MQTTSNGWDEFINES_H_ 00019 00020 namespace MQTTSNGW 00021 { 00022 /*================================= 00023 * Config Parametrs 00024 ==================================*/ 00025 #define CONFIG_DIRECTORY "./" 00026 #define CONFIG_FILE "gateway.conf" 00027 #define CLIENT_LIST "clients.conf" 00028 #define PREDEFINEDTOPIC_FILE "predefinedTopic.conf" 00029 #define FORWARDER_LIST "forwarders.conf" 00030 00031 /*========================================================== 00032 * Gateway default parameters 00033 ===========================================================*/ 00034 #define DEFAULT_KEEP_ALIVE_TIME (900) // 900 secs = 15 mins 00035 #define DEFAULT_MQTT_VERSION (4) // Defualt MQTT version 00036 00037 /*================================= 00038 * MQTT-SN Parametrs 00039 ==================================*/ 00040 #define MAX_CLIENTS (100) // Number of Clients can be handled. 00041 #define MAX_CLIENTID_LENGTH (64) // Max length of clientID 00042 #define MAX_INFLIGHTMESSAGES (10) // Number of inflight messages 00043 #define MAX_MESSAGEID_TABLE_SIZE (500) // Number of MessageIdTable size 00044 #define MAX_SAVED_PUBLISH (20) // Max number of PUBLISH message for Asleep state 00045 #define MAX_TOPIC_PAR_CLIENT (50) // Max Topic count for a client. it should be less than 256 00046 #define MQTTSNGW_MAX_PACKET_SIZE (1024) // Max Packet size (5+2+TopicLen+PayloadLen + Foward Encapsulation) 00047 #define SIZE_OF_LOG_PACKET (500) // Length of the packet log in bytes 00048 00049 #define QOSM1_PROXY_KEEPALIVE_DURATION 900 // Secs 00050 #define QOSM1_PROXY_RESPONSE_DURATION 10 // Secs 00051 #define QOSM1_PROXY_MAX_RETRY_CNT 3 00052 /*================================= 00053 * Data Type 00054 ==================================*/ 00055 typedef unsigned char uint8_t; 00056 typedef unsigned short uint16_t; 00057 typedef unsigned int uint32_t; 00058 00059 /*================================= 00060 * Log controls 00061 ==================================*/ 00062 //#define DEBUG // print out log for debug 00063 //#define DEBUG_NWSTACK // print out SensorNetwork log 00064 00065 #ifdef DEBUG 00066 #define DEBUGLOG(...) printf(__VA_ARGS__) 00067 #else 00068 #define DEBUGLOG(...) 00069 #endif 00070 00071 } 00072 #endif /* MQTTSNGWDEFINES_H_ */
Generated on Wed Jul 13 2022 10:46:03 by
1.7.2