aboutsummaryrefslogtreecommitdiffstats
path: root/src/sm-helper.h
diff options
context:
space:
mode:
authorKazumasa Mitsunari <knimitz@witz-inc.co.jp>2018-03-28 21:03:23 +0900
committerKazumasa Mitsunari <knimitz@witz-inc.co.jp>2018-05-16 18:38:27 +0900
commitcbf280b545bbb3a879c55913564796f944b217c4 (patch)
tree0fa8345f5d396bca5d4049783fb914d1bb527880 /src/sm-helper.h
parent975d5e70b89481c90df30365c660b3f5043c3150 (diff)
Clean: divide soundmanager.c into interface part and proxy part
* interface part ... soundmanager This receives request and send event to clients * proxy part ... am_proxy_audiomanager This is the proxy to call and receive audiomanager API Change-Id: If29643ba3356ec1d7ec87468b023cf8809aa4eb3 Signed-off-by: Kazumasa Mitsunari <knimitz@witz-inc.co.jp>
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
n>> <progress value="1" max="100"></progress> </div> <div class="label"> FAN SPEED </div> </div> </div> <div class="center"> <a id="LeftChair" value="0" href="#" class="seat left item button" onclick="CHAIR.left(this)"> <img class="off" src="../images/HMI_HVAC_Left_Chair_OFF.svg"/> <img class="one two" src="../images/HMI_HVAC_Left_Chair_ON.svg"/> <img class="off" src="../images/HMI_HVAC_ChairIndicator_OFF.svg"/> <img class="one" src="../images/HMI_HVAC_ChairIndicator_One.svg"/> <img class="two" src="../images/HMI_HVAC_ChairIndicator_Two.svg"/> </a> <a id="acbutton" value="false" href="#" class="ac item button" onclick="BUTTON.ac()"> <img class="disabled" src="../images/HMI_HVAC_Inactive.svg"/> <img class="enabled" src="../images/HMI_HVAC_Active.svg"/> <div class="label"> A/C </div> </a> <a id="RightChair" value="0" href="#" class="seat right item button" onclick="CHAIR.right(this)"> <img class="off" src="../images/HMI_HVAC_Right_Chair_OFF.svg"/> <img class="one two" src="../images/HMI_HVAC_Right_Chair_ON.svg"/> <img class="off" src="../images/HMI_HVAC_ChairIndicator_OFF.svg"/> <img class="one" src="../images/HMI_HVAC_ChairIndicator_One.svg"/> <img class="two" src="../images/HMI_HVAC_ChairIndicator_Two.svg"/> </a> <div class="temperatures item"> <div id="lefttemperature" class="temperatures-container" onscroll="TEMPERATURE.left(this)"></div> </div> <div class="block item"> <a id="autobutton" value="false" href="#" class="auto item button" onclick="BUTTON.auto()"> <img class="disabled" src="../images/HMI_HVAC_Inactive.svg"/> <img class="enabled" src="../images/HMI_HVAC_Active.svg"/> <div class="label"> AUTO </div> </a> <a id="circulationbutton" value="false" href="#" class="circulation item button" onclick="BUTTON.circulation()"> <img class="disabled" src="../images/HMI_HVAC_Circulation_Inactive.svg"/> <img class="enabled" src="../images/HMI_HVAC_Circulation_Active.svg"/> </a> </div> <div class="temperatures item"> <div id="righttemperature" class="temperatures-container" onscroll="TEMPERATURE.right(this)"></div> </div> </div> <div class="bottom"> <a id="downbutton" value="false" href="#" class="down item button" onclick="BUTTON.down()"> <img class="disabled" src="../images/HMI_HVAC_AirDown_Inactive.svg"> <img class="enabled" src="../images/HMI_HVAC_AirDown_Active.svg"> </a> <a id="upbutton" value="false" href="#" class="up item button" onclick="BUTTON.up()"> <img class="disabled" src="../images/HMI_HVAC_AirUp_Inactive.svg"> <img class="enabled" src="../images/HMI_HVAC_AirUp_Active.svg"> </a> <a id="rightbutton" value="false" href="#" class="right item button" onclick="BUTTON.right()"> <img class="disabled" src="../images/HMI_HVAC_AirRight_Inactive.svg"> <img class="enabled" src="../images/HMI_HVAC_AirRight_Active.svg"> </a> <a id="rearbutton" value="false" href="#" class="rear item button" onclick="BUTTON.rear()"> <img class="disabled" src="../images/HMI_HVAC_Rear_Inactive.svg"> <img class="enabled" src="../images/HMI_HVAC_Rear_Active.svg"> </a> <a id="frontbutton" value="false" href="#" class="front item button" onclick="BUTTON.front()"> <img class="disabled" src="../images/HMI_HVAC_Front_Inactive.svg"> <img class="enabled" src="../images/HMI_HVAC_Front_Active.svg"> </a> </div> <div class="log" id="log"> </div> </body> </html>