muse_core_msg_json_deserialize(#param, buf, NULL, ¶m, &e, MUSE_TYPE_ANY)
/**
- * @brief Send the message from proxy to module via ipc.
- * @param[in] api The enumeration of the corresponding api.
- * @param[in] fd The socket fd that connected to the module via ipc.
- * @param[in] cb_info The callback information, waiting for the ack from the module.
- * @param[out] ret The delivered return value from the module to proxy side.
- */
-#define muse_recorder_msg_send(api, fd, cb_info, ret) \
- do { \
- char *__sndMsg__; \
- int __len__; \
- __sndMsg__ = muse_core_msg_json_factory_new(api, 0); \
- __len__ = muse_core_ipc_send_msg(fd, __sndMsg__); \
- if (__len__ <= 0) { \
- LOGE("sending message failed"); \
- ret = RECORDER_ERROR_INVALID_OPERATION; \
- } else \
- ret = client_wait_for_cb_return(api, cb_info, RECORDER_CALLBACK_TIME_OUT); \
- muse_core_msg_json_factory_free(__sndMsg__); \
- } while (0)
-
-
-/**
- * @brief Send the message from proxy to module via ipc, adding 1 more parameter.
- * @param[in] api The enumeration of the corresponding api.
- * @param[in] fd The socket fd that connected to the module via ipc.
- * @param[in] cb_info The callback information, waiting for the ack from the module.
- * @param[out] ret The delivered return value from the module to proxy side.
- * @param[in] type The data type of the parameter.
- * @param[in] param A single parameter to be included in the message.
- */
-#define muse_recorder_msg_send1(api, fd, cb_info, ret, type, param) \
- do { \
- char *__sndMsg__; \
- int __len__; \
- type __value__ = (type)param; \
- __sndMsg__ = muse_core_msg_json_factory_new(api, \
- MUSE_TYPE_##type, #param, __value__, \
- 0); \
- __len__ = muse_core_ipc_send_msg(fd, __sndMsg__); \
- if (__len__ <= 0) { \
- LOGE("sending message failed"); \
- ret = RECORDER_ERROR_INVALID_OPERATION; \
- } else \
- ret = client_wait_for_cb_return(api, cb_info, RECORDER_CALLBACK_TIME_OUT); \
- muse_core_msg_json_factory_free(__sndMsg__); \
- } while (0)
-
-/**
- * @brief Send the message from proxy to module via ipc, adding 1 more parameter.
- * @param[in] api The enumeration of the corresponding api.
- * @param[in] fd The socket fd that connected to the module via ipc.
- * @param[in] cb_info The callback information, waiting for the ack from the module.
- * @param[in] type The data type of the parameter.
- * @param[in] param A single parameter to be included in the message.
- */
-#define muse_recorder_msg_send1_no_return(api, fd, cb_info, type, param) \
- do { \
- char *__sndMsg__; \
- int __len__; \
- type __value__ = (type)param; \
- __sndMsg__ = muse_core_msg_json_factory_new(api, \
- MUSE_TYPE_##type, #param, __value__, \
- 0); \
- __len__ = muse_core_ipc_send_msg(fd, __sndMsg__); \
- if (__len__ <= 0) { \
- LOGE("sending message failed"); \
- } \
- muse_core_msg_json_factory_free(__sndMsg__); \
- } while (0)
-
-/**
- * @brief Send the message from proxy to module via ipc, adding 2 more parameters.
- * @param[in] api The enumeration of the corresponding api.
- * @param[in] fd The socket fd that connected to the module via ipc.
- * @param[in] cb_info The callback information, waiting for the ack from the module.
- * @param[out] ret The delivered return value from the module to proxy side.
- * @param[in] type1 The data type of the parameter.
- * @param[in] param1 The first parameter to be included in the message.
- * @param[in] type2 The data type of the parameter.
- * @param[in] param2 The 2nd parameter to be included in the message.
- */
-#define muse_recorder_msg_send2(api, fd, cb_info, ret, type1, param1, type2, param2) \
- do { \
- char *__sndMsg__; \
- int __len__; \
- type1 __value1__ = (type1)param1; \
- type2 __value2__ = (type2)param2; \
- __sndMsg__ = muse_core_msg_json_factory_new(api, \
- MUSE_TYPE_##type1, #param1, __value1__, \
- MUSE_TYPE_##type2, #param2, __value2__, \
- 0); \
- __len__ = muse_core_ipc_send_msg(fd, __sndMsg__); \
- if (__len__ <= 0) { \
- LOGE("sending message failed"); \
- ret = RECORDER_ERROR_INVALID_OPERATION; \
- } else \
- ret = client_wait_for_cb_return(api, cb_info, RECORDER_CALLBACK_TIME_OUT); \
- muse_core_msg_json_factory_free(__sndMsg__); \
- } while (0)
-
-
-/**
- * @brief Send the message from proxy to module via ipc, adding an array data.
- * @param[in] api The enumeration of the corresponding api.
- * @param[in] fd The socket fd that connected to the module via ipc.
- * @param[in] cb_info The callback information, waiting for the ack from the module.
- * @param[out] ret The delivered return value from the module to proxy side.
- * @param[in] param The array data parameter to be included in the message.
- * @param[in] length The length of the array.
- * @param[in] datum_size The size of the array.
- */
-#define muse_recorder_msg_send_array(api, fd, cb_info, ret, param, length, datum_size) \
- do { \
- char *__sndMsg__; \
- int __len__; \
- int *__value__ = (int *)param; \
- __sndMsg__ = muse_core_msg_json_factory_new(api, \
- MUSE_TYPE_INT, #length, length, \
- MUSE_TYPE_ARRAY, #param, \
- datum_size == sizeof(int) ? length : \
- length / sizeof(int) + (length % sizeof(int) ? 1 : 0), \
- __value__, \
- 0); \
- __len__ = muse_core_ipc_send_msg(fd, __sndMsg__); \
- if (__len__ <= 0) { \
- LOGE("sending message failed"); \
- ret = RECORDER_ERROR_INVALID_OPERATION; \
- } else \
- ret = client_wait_for_cb_return(api, cb_info, RECORDER_CALLBACK_TIME_OUT); \
- muse_core_msg_json_factory_free(__sndMsg__); \
- } while (0)
-
-/**
* @brief Returning the ack message from the server to client side.
* @param[in] api The enumeration of the corresponding api.
* @param[in] class The enumeration of the api class.
} while (0)
/**
- * @brief Returning the ack message from the server to client side, adding 3 parameters.
- * @param[in] api The enumeration of the corresponding api.
- * @param[in] class The enumeration of the api class.
- * @param[out] ret The delivered return value from the module to proxy side.
- * @param[in] module The module info for the ipc transportation.
- * @param[in] type1 The data type of the parameter.
- * @param[in] param1 The 1st parameter to be included in the message.
- * @param[in] type2 The data type of the parameter.
- * @param[in] param2 The 2nd parameter to be included in the message.
- * @param[in] type3 The data type of the parameter.
- * @param[in] param3 The 3rd parameter to be included in the message.
- */
-#define muse_recorder_msg_return3(api, class, ret, module, type1, param1, type2, param2, type3, param3) \
- do { \
- char *__sndMsg__; \
- int __len__; \
- type1 __value1__ = (type1)param1; \
- type2 __value2__ = (type2)param2; \
- type3 __value3__ = (type3)param3; \
- __sndMsg__ = muse_core_msg_json_factory_new(api, \
- MUSE_TYPE_INT, PARAM_API_CLASS, class, \
- MUSE_TYPE_INT, PARAM_RET, ret, \
- MUSE_TYPE_##type1, #param1, __value1__, \
- MUSE_TYPE_##type2, #param2, __value2__, \
- MUSE_TYPE_##type3, #param3, __value3__, \
- 0); \
- __len__ = muse_core_ipc_send_msg(muse_core_client_get_msg_fd(module), __sndMsg__); \
- if (__len__ <= 0) { \
- LOGE("sending message failed"); \
- ret = RECORDER_ERROR_INVALID_OPERATION; \
- } \
- muse_core_msg_json_factory_free(__sndMsg__); \
- } while (0)
-
-/**
- * @brief Returning the ack message from the server to client side, adding array parameter.
- * @param[in] api The enumeration of the corresponding api.
- * @param[in] class The enumeration of the api class.
- * @param[out] ret The delivered return value from the module to proxy side.
- * @param[in] module The module info for the ipc transportation.
- * @param[in] param The array data parameter to be included in the message.
- * @param[in] length The length of the array.
- * @param[in] datum_size The size of the array.
- */
-#define muse_recorder_msg_return_array(api, class, ret, module, param, length, datum_size) \
- do { \
- char *__sndMsg__; \
- int __len__; \
- int *__value__ = (int *)param; \
- __sndMsg__ = muse_core_msg_json_factory_new(api, \
- MUSE_TYPE_INT, PARAM_API_CLASS, class, \
- MUSE_TYPE_INT, PARAM_RET, ret, \
- MUSE_TYPE_INT, #length, length, \
- MUSE_TYPE_ARRAY, #param, \
- datum_size == sizeof(int) ? length : \
- length / sizeof(int) + (length % sizeof(int) ? 1 : 0), \
- __value__, \
- 0); \
- __len__ = muse_core_ipc_send_msg(muse_core_client_get_msg_fd(module), __sndMsg__); \
- if (__len__ <= 0) { \
- LOGE("sending message failed"); \
- ret = RECORDER_ERROR_INVALID_OPERATION; \
- } \
- muse_core_msg_json_factory_free(__sndMsg__); \
- } while (0)
-
-/**
* @brief Returning the event ack message from the server to client side.
* @param[in] api The enumeration of the corresponding api.
* @param[in] event The enumeration of the event.