46 lines
1.2 KiB
C
46 lines
1.2 KiB
C
/**
|
|
* @file include/di/rpc/serialize.h
|
|
* @brief rief
|
|
* @date Aug 25, 2015
|
|
* @author rheijden
|
|
* @copyright 2015 Dual Inventive Technology Centre B.V.
|
|
*
|
|
* descr
|
|
*/
|
|
#ifndef INCLUDE_DI_CAN_DESERIALIZE_H_
|
|
#define INCLUDE_DI_CAN_DESERIALIZE_H_
|
|
|
|
#include <stddef.h>
|
|
#include <stdint.h>
|
|
|
|
#include <mpack/mpack.h>
|
|
#include <di/device.h>
|
|
#include <di/rpc/structures.h>
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
/**
|
|
* Deserialize RPC message header
|
|
*/
|
|
void di_rpc_deserialize_msg(mpack_reader_t *reader, struct di_rpc_msg *msg);
|
|
|
|
/**
|
|
* Deserialize into di_rpc_data structure
|
|
* When there is an error the data->uid is set to DI_RPC_INVALID_UID
|
|
* @param reader Mpack reader context
|
|
* @param data RPC data object
|
|
* @param str Address where string is stored when value is a string (NULL, then omitted)
|
|
* @param str_size Size of string (0, then omitted)
|
|
* @note When value is of type msgpack float it is always up-converted to a double precision
|
|
* due to limitions of json2msgpack.
|
|
*/
|
|
void di_rpc_deserialize_rpc_data(mpack_reader_t *reader, struct di_rpc_data *data, char *str, size_t str_size);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif /* INCLUDE_DI_CAN_DESERIALIZE_H_ */
|