aboutsummaryrefslogtreecommitdiffstats
path: root/src/sm-helper.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/sm-helper.h')
-rw-r--r--src/sm-helper.h50
1 files changed, 5 insertions, 45 deletions
diff --git a/src/sm-helper.h b/src/sm-helper.h
index 8c87432..0eb57a7 100644
--- a/src/sm-helper.h
+++ b/src/sm-helper.h
@@ -22,17 +22,10 @@
#include <stdint.h>
#include <stdbool.h>
#include <glib.h>
+#include "sm-def.h"
#define SEND_RESULT(...) send_result(__VA_ARGS__, __FUNCTION__)
#define SEND_RESULT_NO_RESP(...) send_result_no_resp(__VA_ARGS__, __FUNCTION__)
-typedef enum REQ_ERROR
-{
- REQ_FAIL = -1,
- REQ_OK=0,
- NOT_NUMBER,
- OUT_RANGE
-}REQ_ERROR;
-
static const char* cmd_evlist[] = {
"volumeChanged",
"newMainConnection",
@@ -50,34 +43,6 @@ static const char* route_evlist[] = {
"asyncDisconnect"
};
-struct sound_property_s{
- guint16 type;
- gint16 value;
-};
-struct availability_s{
- gint32 availability;
- gint32 avalilable_reason;
-};
-struct notification_config_s{
- gint32 type;
- gint32 status;
- gint16 parameter;
-};
-struct main_sound_property_s{
- gint32 type; /* am_CustomMainSoundPropertyType_t */
- gint16 value;
-};
-
-struct domain_data{
- guint16 domainID;
- gchar* name;
- gchar* busname;
- gchar* nodename;
- gboolean early;
- gboolean complete;
- gint16 state;
-};
-
REQ_ERROR get_value_uint16(const struct afb_req request, const char *source, uint16_t *out_id);
REQ_ERROR get_value_int16(const struct afb_req request, const char *source, int16_t *out_id);
REQ_ERROR get_value_int32(const struct afb_req request, const char *source, int32_t *out_id);
@@ -86,13 +51,8 @@ void sm_add_object_to_json_object(struct json_object* j_obj, int count, ...);
void sm_add_object_to_json_object_func(struct json_object* j_obj, const char* verb_name, int count, ...);
int sm_search_event_name_index(const char* value);
int sm_search_routing_event_name_index(const char* value);
-GVariant* create_source_data(guint16 sourceID, guint16 domainID, const char* appname, guint16 sourceClassID,
- gint32 sourceState, gint16 volume, gboolean visible, struct availability_s availables,
- guint16 interrupt, struct sound_property_s soundPropertyList, gint32 connectionFormatList,
- struct main_sound_property_s mainPropertyList, struct notification_config_s NConfRouting,
- struct notification_config_s NConfCommand);
-GVariant* create_domain_data(struct domain_data*);
-bool send_result_no_resp(const GError* result_of_send, const char* function);
-bool send_result(const GError* result_of_send, struct afb_req req, const char* function);
-
+bool send_result_no_resp(ErrorCode ec, const char* function);
+bool send_result(ErrorCode ec, struct afb_req req, const char* function);
+ErrorCode is_range_over_guint16(int source);
+ErrorCode is_range_over_gint16(int source);
#endif /*AM_HELPER_H*/ \ No newline at end of file