| ![]() |
2.9 Receiverreceiver_enable, receiver_disablereceiver_get_buffer, receiver_get_buffer_size receiver_enableNAMEreceiver_enable, receiver_disable -- enable and disable the receiver measurementsSYNOPSIS#include <device/receiver.h>void receiver_enable (DeviceTag receiver, guint16 ms); void receiver_disable (DeviceTag receiver); DESCRIPTIONreceiver_enable allows the user to enable a receiver measurement each ms milliseconds. receiver_disable turns the receiver off, saving computation time. receiver_get_bufferNAMEreceiver_get_buffer, receiver_get_buffer_size -- get information on the receiver bufferSYNOPSIS#include <device/receiver.h>gpointer receiver_get_buffer (DeviceTag receiver); gint32 receiver_get_buffer_size (DeviceTag receiver); DESCRIPTIONThe receiver_get_buffer function returns a pointer to the buffer used by the receiver to store received data. This function needs to be called each time new data arrives in the receiver because the address of the buffer changes when new data arrives. The returned memory chunk doesn't need to be released. Memory management is done by the receiver. Moreover calling receiver_get_buffer will cause the data to be flushed out of the receiver, hence calling receiver_get_buffer_size immediatly after will return 0; The receiver_get_buffer_size function returns the size of this buffer, expressed in bytes, that is the number of bytes received and stored in the buffer. It must be called before receiver_get_buffer, otherwise, it returns always 0. ![]() ![]() ![]() ^ page top ^ |
E-mail to webmaster | Last updated: | Copyright © 2002 Cyberbotics Ltd. |