/*
Generated by sbus code generator
Copyright (C) 2017 Red Hat
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see .
*/
#ifndef ${file-guard}
#define ${file-guard}
#include "${sbus-path}/sbus_interface_declarations.h"
#include "${header:invokers}"
#include "${header:symbols}"
#include "${header:keygens}"
/* Interface: ${name} */
#define SBUS_IFACE_${token}(methods, signals, properties) ({ \
sbus_interface("${name}", _sbus_annotations_${token}NULL, \
(methods), (signals), (properties)); \
})
/* Method: ${interface}.${name} */
#define SBUS_METHOD_SYNC_${token}(handler, data) ({ \
SBUS_CHECK_SYNC((handler), (data), ${type}, ${type}, ${type}, ${type}); \
sbus_method_sync("${name}", \
&_sbus_args_${token}, \
_sbus_annotations_${token}NULL, \
_sbus_invoke_in_${input-signature}_out_${output-signature}_send, \
_sbus_key_${key-signature}_${key-index}NULL, \
(handler), (data)); \
})
#define SBUS_METHOD_ASYNC_${token}(handler_send, handler_recv, data) ({ \
SBUS_CHECK_SEND((handler_send), (data), ${type}, ${type}, ${type}); \
SBUS_CHECK_RECV((handler_recv), ${type}); \
sbus_method_async("${name}", \
&_sbus_args_${token}, \
_sbus_annotations_${token}NULL, \
_sbus_invoke_in_${input-signature}_out_${output-signature}_send, \
_sbus_key_${key-signature}_${key-index}NULL, \
(handler_send), (handler_recv), (data)); \
})
/* Signal: ${interface}.${name} */
#define SBUS_SIGNAL_EMITS_${token}() ({ \
sbus_signal("${name}", \
_sbus_args_${token}, \
_sbus_annotations_${token}NULL); \
})
#define SBUS_SIGNAL_SYNC_${token}(path, handler, data) ({ \
SBUS_CHECK_SYNC((handler), (data), ${type}, ${type}); \
sbus_listener_sync("${interface}", "${name}", (path), \
_sbus_invoke_in_${input-signature}_out_${output-signature}_send, \
_sbus_key_${key-signature}_${key-index}NULL, \
(handler), (data)); \
})
#define SBUS_SIGNAL_ASYNC_${token}(path, handler_send, handler_recv, data) ({ \
SBUS_CHECK_SEND((handler_send), (data), ${type}, ${type}); \
SBUS_CHECK_RECV((handler_recv)); \
sbus_listener_async("${interface}", "${name}", (path), \
_sbus_invoke_in_${input-signature}_out_${output-signature}_send, \
_sbus_key_${key-signature}_${key-index}NULL, \
(handler_send), (handler_recv), (data)); \
})
/* Property: ${interface}.${name} */
#define SBUS_GETTER_SYNC_${token}(handler, data) ({ \
SBUS_CHECK_SYNC((handler), (data), ${type}, ${type}); \
sbus_property_sync("${name}", "${type}", SBUS_PROPERTY_READABLE, \
_sbus_annotations_${token}NULL, \
_sbus_invoke_in__out_${output-signature}_send, \
(handler), (data)); \
})
#define SBUS_GETTER_ASYNC_${token}(handler_send, handler_recv, data) ({ \
SBUS_CHECK_SEND((handler_send), (data), ${type}); \
SBUS_CHECK_RECV((handler_recv), ${type}); \
sbus_property_async("${name}", "${type}", SBUS_PROPERTY_READABLE, \
_sbus_annotations_${token}NULL, \
_sbus_invoke_in__out_${output-signature}_send, \
(handler_send), (handler_recv), (data)); \
})
#define SBUS_SETTER_SYNC_${token}(handler, data) ({\
SBUS_CHECK_SYNC((handler), (data), ${type}, ${type}); \
sbus_property_sync("${name}", "${type}", SBUS_PROPERTY_WRITABLE, \
_sbus_annotations_${token}NULL, \
_sbus_invoke_in_${input-signature}_out__send, \
(handler), (data)); \
})
#define SBUS_SETTER_ASYNC_${token}(handler_send, handler_recv, data) ({ \
SBUS_CHECK_SEND((handler_send), (data), ${type}, ${type}); \
SBUS_CHECK_RECV((handler_recv)); \
sbus_property_async("${name}", "${type}", SBUS_PROPERTY_WRITABLE, \
_sbus_annotations_${token}NULL, \
_sbus_invoke_in_${input-signature}_out__send, \
(handler_send), (handler_recv), (data)); \
})
#endif /* ${file-guard} */