project_files/frontlib/ipc/mapconn.c
changeset 7179 f84805e6df03
parent 7177 bf6cf4dd847a
child 7224 5143861c83bd
equal deleted inserted replaced
7177:bf6cf4dd847a 7179:f84805e6df03
     1 #include "mapconn.h"
     1 #include "mapconn.h"
     2 #include "ipcconn.h"
     2 #include "ipcconn.h"
     3 #include "ipcprotocol.h"
     3 #include "ipcprotocol.h"
     4 
     4 
     5 #include "../logging.h"
     5 #include "../util/logging.h"
     6 #include "../buffer.h"
     6 #include "../util/buffer.h"
     7 
     7 
     8 #include <stdlib.h>
     8 #include <stdlib.h>
     9 
     9 
    10 typedef enum {
    10 typedef enum {
    11 	AWAIT_CONNECTION,
    11 	AWAIT_CONNECTION,
    12 	AWAIT_REPLY,
    12 	AWAIT_REPLY,
    13 	FINISHED
    13 	FINISHED
    14 } mapconn_progress;
    14 } mapconn_state;
    15 
    15 
    16 struct _flib_mapconn {
    16 struct _flib_mapconn {
    17 	uint8_t mapBuffer[IPCCONN_MAPMSG_BYTES];
    17 	uint8_t mapBuffer[IPCCONN_MAPMSG_BYTES];
    18 	flib_ipcconn connection;
    18 	flib_ipcconn connection;
    19 	flib_vector configBuffer;
    19 	flib_vector configBuffer;
    20 
    20 
    21 	mapconn_progress progress;
    21 	mapconn_state progress;
    22 
    22 
    23 	void (*onSuccessCb)(void*, const uint8_t*, int);
    23 	void (*onSuccessCb)(void*, const uint8_t*, int);
    24 	void *onSuccessCtx;
    24 	void *onSuccessCtx;
    25 
    25 
    26 	void (*onFailureCb)(void*, const char*);
    26 	void (*onFailureCb)(void*, const char*);