Update: Create param.conf and key files automatically.

BugFix: change parameter name BroadcastIp and BroadcastPortNo to
MulticastIP and MulticastPortNo, respectively.
Update: Makefile to copy param.conf and build Log monitor.
Update: README 

Signed-off-by: tomoaki <tomoaki@tomy-tech.com>
This commit is contained in:
tomoaki
2016-07-03 10:00:57 +09:00
parent 691f046078
commit 4bdec4a11f
10 changed files with 110 additions and 48 deletions

View File

@@ -25,6 +25,7 @@
#include <fcntl.h>
#include <string.h>
#include <pthread.h>
#include <unistd.h>
using namespace std;
using namespace MQTTSNGW;
@@ -235,6 +236,15 @@ void Semaphore::timedwait(uint16_t millsec)
=========================================*/
RingBuffer::RingBuffer()
{
int fp = 0;
string fileName = string(MQTTSNGW_CONFIG_DIRECTORY) + string(MQTTSNGW_RINGBUFFER_KEY);
fp = open(fileName.c_str(), O_CREAT, 0);
close(fp);
fileName = string(MQTTSNGW_CONFIG_DIRECTORY) + string(MQTTSNGW_RB_MUTEX_KEY);
fp = open(fileName.c_str(), O_CREAT, 0);
close(fp);
key_t key = ftok(MQTTSNGW_RINGBUFFER_KEY, 1);
if ((_shmid = shmget(key, PROCESS_LOG_BUFFER_SIZE,

View File

@@ -19,13 +19,12 @@
#include <pthread.h>
#include <semaphore.h>
#include "MQTTSNGWDefines.h"
namespace MQTTSNGW
{
#define MQTTSNGW_RINGBUFFER_KEY "/usr/local/etc/mqttsnGateway/config/ringbuffer.key"
#define MQTTSNGW_RB_MUTEX_KEY "/usr/local/etc/mqttsnGateway/config/rbmutex.key"
#define MQTTSNGW_RINGBUFFER_KEY "ringbuffer.key"
#define MQTTSNGW_RB_MUTEX_KEY "rbmutex.key"
#define MQTTSNGW_RB_SEMAPHOR_NAME "/rbsemaphor"
/*=====================================