#define MAS_METHOD_STREAMING_AUDIO_DATA "mas_method_streaming_audio_data"
#define MAS_METHOD_WAKEUP_ENGINE_COMMAND "mas_method_wakeup_engine_command"
#define MAS_METHOD_ERROR "mas_method_error"
+#define MAS_METHOD_RESTART_NOTIFICATION "mas_method_restart_notification"
#define MAS_METHOD_SEND_PREPROCESSING_INFORMATION "mas_method_send_preprocessing_information"
#define MAS_METHOD_AUDIO_STREAMING_DATA_SECTION "mas_method_audio_streaming_data_section"
#define MAS_METHOD_SEND_PREPROCESSING_RESULT "mas_method_send_preprocessing_result"
int close_connection();
int send_hello(pid_t pid);
int send_error_message(int reason, const char* err_msg);
+ int send_restart_notification();
int send_streaming_audio_data(std::string appid, int event, void* data, unsigned int data_size);
int change_active_state(pid_t pid, int state, const char* wakeup_word,
const unsigned char* wakeup_extra_data, size_t wakeup_extra_data_length,
return 0;
}
+int CServiceIpcDbus::send_restart_notification()
+{
+ if (0 != __dbus_check()) {
+ return -1; //MAS_ERROR_OPERATION_FAILED;
+ }
+
+ if (NULL == mConnectionSender) {
+ MAS_LOGE("[Dbus ERROR] Dbus connection is not available");
+ return -1;
+ }
+
+ DBusMessage* msg = NULL;
+
+ /* create a message */
+ msg = dbus_message_new_signal(
+ MA_CLIENT_SERVICE_OBJECT_PATH, /* object name of the signal */
+ MA_CLIENT_SERVICE_INTERFACE, /* interface name of the signal */
+ MAS_METHOD_RESTART_NOTIFICATION); /* name of the signal */
+
+ if (NULL == msg) {
+ MAS_LOGE("[Dbus ERROR] Fail to create error message");
+ return -1;
+ }
+
+ dbus_message_set_no_reply(msg, TRUE);
+
+ if (!dbus_connection_send(mConnectionSender, msg, NULL)) {
+ MAS_LOGE("[Dbus ERROR] <<<< error message : Out Of Memory !");
+ } else {
+ MAS_LOGI("<<<< Send restart notification message");
+ dbus_connection_flush(mConnectionSender);
+ }
+
+ dbus_message_unref(msg);
+
+ return 0;
+}
+
const char *message_port = "ma_streaming_port";
#define STREAMING_BUFFER_SIZE 4096