Teonet library  0.4.7
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
async_calls.h
Go to the documentation of this file.
1 /*
2  * \file: async_calls.h
3  * \author: max
4  *
5  * Created on June 25, 2018, 8:46 PM
6  */
7 
8 #ifndef ASYNC_CALLS_H
9 #define ASYNC_CALLS_H
10 
11 #include "subscribe.h"
12 
16 typedef struct teoAsyncClass {
17 
18  void *ke; // Pointer to ksnEvMgrClass
19  void *event_cb; // Pointer to event callback
20  pthread_t t_id; // Self thread id
21  int f_multi_thread; // Multi thread flag
22  uint8_t test;
23  pthread_mutex_t cv_mutex; // Condition variables mutex
24  pthread_cond_t cv_threshold; // Condition variable threshold
25  pthread_mutex_t async_func_mutex; // Async functions mutex
26 
28 
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32 
40 
47 
48 
49 // # case 1:
50 void ksnCoreSendCmdtoA(void *ke, const char *peer, uint8_t cmd, void *data,
51  size_t data_length);
52 
53 // # case 2:
54 void teoSScrSendA(void *ke, uint16_t event, void *data, size_t data_length,
55  uint8_t cmd);
56 
57 // # case 3:
58 void sendCmdAnswerToBinaryA(void *ke, void *rd, uint8_t cmd, void *data,
59  size_t data_length);
60 
61 // # case 4:
69 void teoSScrSubscribeA(teoSScrClass *sscr, char *peer_name, uint16_t ev);
70 
71 #ifdef __cplusplus
72 }
73 #endif
74 
75 #endif /* ASYNC_CALLS_H */
76 
pthread_mutex_t async_func_mutex
Definition: async_calls.h:25
pthread_mutex_t cv_mutex
Definition: async_calls.h:23
const char data[]
Make it with: gcc -o post-callback post-callback.c -lcurl.
Definition: post-callback.c:23
void ksnCoreSendCmdtoA(void *ke, const char *peer, uint8_t cmd, void *data, size_t data_length)
Definition: async_calls.c:368
pthread_t t_id
Definition: async_calls.h:20
pthread_cond_t cv_threshold
Definition: async_calls.h:24
void teoSScrSendA(void *ke, uint16_t event, void *data, size_t data_length, uint8_t cmd)
Definition: async_calls.c:396
Teonet Async class data definition.
Definition: async_calls.h:16
void teoSScrSubscribeA(teoSScrClass *sscr, char *peer_name, uint16_t ev)
Send command to subscribe this host to event at remote peer.
Definition: async_calls.c:461
#define rd
void sendCmdAnswerToBinaryA(void *ke, void *rd, uint8_t cmd, void *data, size_t data_length)
Definition: async_calls.c:422
void * event_cb
Definition: async_calls.h:19
#define ke
void * ke
Definition: async_calls.h:18
uint8_t test
Definition: async_calls.h:22
struct teoAsyncClass teoAsyncClass
Teonet Async class data definition.
int f_multi_thread
Definition: async_calls.h:21
teoAsyncClass * teoAsyncInit(void *ke)
Async module initialize.
Definition: async_calls.c:252
File: subscribe.h Author: Kirill Scherba kirill@scherba.ru
Definition: subscribe.h:19
void teoAsyncDestroy(teoAsyncClass *ta)
Async module destroy and free allocated memory.
Definition: async_calls.c:275