1 //******************************************************************
3 // Copyright 2015 Intel Mobile Communications GmbH All Rights Reserved.
5 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
7 // Licensed under the Apache License, Version 2.0 (the "License");
8 // you may not use this file except in compliance with the License.
9 // You may obtain a copy of the License at
11 // http://www.apache.org/licenses/LICENSE-2.0
13 // Unless required by applicable law or agreed to in writing, software
14 // distributed under the License is distributed on an "AS IS" BASIS,
15 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 // See the License for the specific language governing permissions and
17 // limitations under the License.
19 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
24 * This API only works with:
30 #ifndef TWSOCKETLIST_H_
31 #define TWSOCKETLIST_H_
37 #include "plugintypes.h"
38 #include "telegesis_socket.h"
40 #include <coap/utlist.h>
42 // TODO: Use OICThread instead of pthread directly.
43 // TODO: Use OICMutex instead of mutex directly.
48 PIPlugin_Zigbee * plugin; // Handle
49 char * eui; // The associated Zigbee radio's EUI.
52 /** 'queue' MUST BE ACCESSED THREAD SAFE **/
54 pthread_mutex_t mutex; // TODO: Use OIC_MUTEX instead.
55 pthread_cond_t queueCV;
57 /** 'queue' MUST BE ACCESSED THREAD SAFE **/
58 pthread_t threadHandle;
59 pthread_attr_t threadAttr;
63 TWResultCode TWAddTWSock(TWSock * sock, PIPlugin_Zigbee * plugin, const char * fileLoc);
65 TWSock * TWGetSock(PIPlugin_Zigbee * plugin);
67 TWResultCode TWDeleteTWSock(TWSock * sock);
69 TWResultCode TWDeleteAllTWSock();
71 TWResultCode TWFreeQueue(PIPlugin_Zigbee * plugin);
77 #endif /* TWSOCKETLIST_H_ */