HomeScreenBinding
Functions | Variables
libhomescreen.cpp File Reference
#include <stdarg.h>
#include <sys/socket.h>
#include <iostream>
#include <algorithm>
#include <thread>
#include <errno.h>
#include <cassert>
#include <cctype>
#include <cerrno>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <libhomescreen.hpp>
#include "hmi-debug.h"

Go to the source code of this file.

Functions

static bool has_verb (const string &verb)
 
static void _on_hangup_static (void *closure, struct afb_wsj1 *wsj)
 
static void _on_call_static (void *closure, const char *api, const char *verb, struct afb_wsj1_msg *msg)
 
static void _on_event_static (void *closure, const char *event, struct afb_wsj1_msg *msg)
 
static void _on_reply_static (void *closure, struct afb_wsj1_msg *msg)
 
static void * event_loop_run (void *args)
 

Variables

static const char API [] = "homescreen"
 

Function Documentation

◆ _on_call_static()

static void _on_call_static ( void *  closure,
const char *  api,
const char *  verb,
struct afb_wsj1_msg *  msg 
)
static

Definition at line 64 of file libhomescreen.cpp.

65 {
66  /* LibHomeScreen is not called from other process */
67 }

◆ _on_event_static()

static void _on_event_static ( void *  closure,
const char *  event,
struct afb_wsj1_msg *  msg 
)
static

Definition at line 69 of file libhomescreen.cpp.

70 {
71  static_cast<LibHomeScreen*>(closure)->on_event(NULL,event,msg);
72 }

◆ _on_hangup_static()

static void _on_hangup_static ( void *  closure,
struct afb_wsj1 *  wsj 
)
static

websocket

Definition at line 59 of file libhomescreen.cpp.

60 {
61  static_cast<LibHomeScreen*>(closure)->on_hangup(NULL,wsj);
62 }

◆ _on_reply_static()

static void _on_reply_static ( void *  closure,
struct afb_wsj1_msg *  msg 
)
static

Definition at line 74 of file libhomescreen.cpp.

75 {
76  static_cast<LibHomeScreen*>(closure)->on_reply(NULL,msg);
77 }

◆ event_loop_run()

static void* event_loop_run ( void *  args)
static

Definition at line 201 of file libhomescreen.cpp.

202 {
203  struct sd_event* loop = (struct sd_event*)(args);
204  HMI_DEBUG("libhomescreen","start eventloop");
205  for(;;)
206  sd_event_run(loop, 30000000);
207 }
#define HMI_DEBUG(prefix, args,...)
Definition: hmi-debug.h:22

◆ has_verb()

static bool has_verb ( const string &  verb)
static

Definition at line 518 of file libhomescreen.cpp.

519 {
520  HMI_DEBUG("libhomescreen","verb is %s", verb.c_str());
521  if(find(LibHomeScreen::api_list.begin(), LibHomeScreen::api_list.end(), verb) != LibHomeScreen::api_list.end())
522  return true;
523  else
524  return false;
525 }
#define HMI_DEBUG(prefix, args,...)
Definition: hmi-debug.h:22
static const std::vector< std::string > api_list

Variable Documentation

◆ API

const char API[] = "homescreen"
static

Definition at line 36 of file libhomescreen.cpp.