X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=src%2Fmeshlink%2B%2B.h;fp=src%2Fmeshlink%2B%2B.h;h=494c6ebda8c7ac406984cae5d0a2da25e1e57a0a;hb=b64d132129ab9ec179d1213114b29a7cbcdf4307;hp=dc32855a212a869e52b77eaf90f2bb016a0bb396;hpb=e3cb560a6d22dbe111447039098960cb353402ec;p=meshlink diff --git a/src/meshlink++.h b/src/meshlink++.h index dc32855a..494c6ebd 100644 --- a/src/meshlink++.h +++ b/src/meshlink++.h @@ -66,7 +66,7 @@ namespace meshlink { * @return This function should return true if the application accepts the incoming channel, false otherwise. * If returning false, the channel is invalid and may not be used anymore. */ - typedef bool (*channel_accept_cb_t)(mesh *mesh, channel *channel, node *node, uint16_t port, void *data, size_t len); + typedef bool (*channel_accept_cb_t)(mesh *mesh, channel *channel, node *node, uint16_t port, const void *data, size_t len); /// A callback for receiving data from a channel. /** @param mesh A handle which represents an instance of MeshLink. @@ -74,7 +74,7 @@ namespace meshlink { * @param data A pointer to a buffer containing data sent by the source. * @param len The length of the data. */ - typedef void (*channel_receive_cb_t)(mesh *mesh, channel *channel, void *data, size_t len); + typedef void (*channel_receive_cb_t)(mesh *mesh, channel *channel, const void *data, size_t len); /// A class describing a MeshLink node. class node: public meshlink_node_t { @@ -317,7 +317,7 @@ namespace meshlink { * * @return A handle for the channel, or NULL in case of an error. */ - channel *channel_open(node *node, uint16_t port, channel_receive_cb_t recv, void *data, size_t len) { + channel *channel_open(node *node, uint16_t port, channel_receive_cb_t recv, const void *data, size_t len) { return (channel *)meshlink_channel_open(this, node, port, (meshlink_channel_receive_cb_t)recv, data, len); }