Code Review
/
src
/
libhomescreen.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Use appid between homescreen-service and apps
[src/libhomescreen.git]
/
include
/
libhomescreen.hpp
diff --git
a/include/libhomescreen.hpp
b/include/libhomescreen.hpp
index
06e9ad8
..
ea35d1e
100644
(file)
--- a/
include/libhomescreen.hpp
+++ b/
include/libhomescreen.hpp
@@
-24,7
+24,6
@@
#include <systemd/sd-event.h>
extern "C"
{
#include <systemd/sd-event.h>
extern "C"
{
-#include <afb/afb-binding.h>
#include <afb/afb-wsj1.h>
#include <afb/afb-ws-client.h>
}
#include <afb/afb-wsj1.h>
#include <afb/afb-ws-client.h>
}
@@
-35,26
+34,28
@@
public:
LibHomeScreen();
~LibHomeScreen();
LibHomeScreen();
~LibHomeScreen();
-
LibHomeScreen(const LibHomeScreen &) = delete;
-
LibHomeScreen &operator=(const LibHomeScreen &) = delete;
+ LibHomeScreen(const LibHomeScreen &) = delete;
+ LibHomeScreen &operator=(const LibHomeScreen &) = delete;
-
using handler_func = std::function<void(const char
*)>;
+
using handler_func = std::function<void(json_object
*)>;
- enum EventType {
- Event_TapShortcut = 1,
- Event_OnScreenMessage
- };
+ enum EventType {
+ Event_TapShortcut = 1,
+ Event_OnScreenMessage,
+ Event_OnScreenReply
+ };
-
static const std::vector<std::string> api_list;
-
static const std::vector<std::string> event_list;
+ static const std::vector<std::string> api_list;
+ static const std::vector<std::string> event_list;
/* Method */
/* Method */
-
int init(const int port, const std::string& token);
+ int init(const int port, const std::string& token);
- int tapShortcut(const char* application_name);
- int onScreenMessage(const char* display_message);
+ int tapShortcut(const char* application_id);
+ int onScreenMessage(const char* display_message);
+ int onScreenReply(const char* reply_message);
-
void set_event_handler(enum EventType et, handler_func f);
+ void set_event_handler(enum EventType et, handler_func f);
void registerCallback(
void (*event_cb)(const std::string& event, struct json_object* event_contents),
void registerCallback(
void (*event_cb)(const std::string& event, struct json_object* event_contents),
@@
-68,8
+69,7
@@
public:
private:
int initialize_websocket();
private:
int initialize_websocket();
- int runEventloop();
-
+
void (*onEvent)(const std::string& event, struct json_object* event_contents);
void (*onReply)(struct json_object* reply);
void (*onHangup)(void);
void (*onEvent)(const std::string& event, struct json_object* event_contents);
void (*onReply)(struct json_object* reply);
void (*onHangup)(void);
@@
-77,12
+77,13
@@
private:
struct afb_wsj1* sp_websock;
struct afb_wsj1_itf minterface;
sd_event* mploop;
struct afb_wsj1* sp_websock;
struct afb_wsj1_itf minterface;
sd_event* mploop;
+ std::string mapp_id;
std::string muri;
int mport = 2000;
std::string mtoken = "hs";
std::string muri;
int mport = 2000;
std::string mtoken = "hs";
-
std::map<EventType, handler_func> handlers;
+ std::map<EventType, handler_func> handlers;
public:
/* Don't use/ Internal only */
public:
/* Don't use/ Internal only */