/*
 * localmsg.h
 *
 *  Created on: 20 Apr 2015
 *      Author: john
 */

#ifndef LOCALMSG_H_
#define LOCALMSG_H_

#include <klog/klog.h>
#include <kmsg/kmsg.h>
#include <kutils/properties.h>

class cLocalMsg : public cKlog
{
public:
	static void start(cProperties *props);
	static void sendMsg(KMsg * msg);

private:
	cLocalMsg(cProperties * p);

	static cLocalMsg * mInstance;
    static void * rx_thread(void *);
	cProperties * mProps;
	int mNorthSocket;
	KMsg * mRxMsg;

	void transmit_msg(KMsg *msg);
	void receive_msg();
	void process_rx_data(uint8_t * buff,int len);



};



#endif /* LOCALMSG_H_ */
