SinricPro Library
SinricProQueue.h
1 /*
2  * Copyright (c) 2019 Sinric. All rights reserved.
3  * Licensed under Creative Commons Attribution-Share Alike (CC BY-SA)
4  *
5  * This file is part of the Sinric Pro (https://github.com/sinricpro/)
6  */
7 
8 #ifndef __SINRICPRO_QUEUE_H__
9 #define __SINRICPRO_QUEUE_H__
10 
11 #include "extralib/QueueList/QueueList.h"
12 
13 
14 typedef enum {
15  IF_UNKNOWN = 0,
16  IF_WEBSOCKET = 1,
17  IF_UDP = 2
18 } interface_t;
19 
20 class SinricProMessage {
21 public:
22  SinricProMessage(interface_t interface, const char* message) : _interface(interface) { _message = strdup(message); };
23  ~SinricProMessage() { if (_message) free(_message); };
24  const char* getMessage() { return _message; };
25  interface_t getInterface() { return _interface; };
26 private:
27  interface_t _interface;
28  char* _message;
29 };
30 
31 typedef QueueList<SinricProMessage*> SinricProQueue_t;
32 
33 #endif