*
* @return SR_OK on success, or SR_ERR_ARG on invalid arguments.
*
- * @since 0.2.0
+ * @since 0.3.0
*/
SR_API int sr_dev_channel_name_set(const struct sr_dev_inst *sdi,
int channelnum, const char *name)
* arguments, SR_ERR_ARG is returned and the channel enabled state
* remains unchanged.
*
- * @since 0.2.0
+ * @since 0.3.0
*/
SR_API int sr_dev_channel_enable(const struct sr_dev_inst *sdi, int channelnum,
gboolean state)
* Return the list of supported hardware drivers.
*
* @return Pointer to the NULL-terminated list of hardware driver pointers.
+ *
+ * @since 0.1.0
*/
SR_API struct sr_dev_driver **sr_driver_list(void)
{
* @retval SR_ERR_ARG Invalid parameter(s).
* @retval SR_ERR_BUG Internal errors.
* @retval other Another negative error code upon other errors.
+ *
+ * @since 0.2.0
*/
SR_API int sr_driver_init(struct sr_context *ctx, struct sr_dev_driver *driver)
{
* found (or errors were encountered). This list must be freed by the
* caller using g_slist_free(), but without freeing the data pointed
* to in the list.
+ *
+ * @since 0.2.0
*/
SR_API GSList *sr_driver_scan(struct sr_dev_driver *driver, GSList *options)
{
* @retval SR_ERR_ARG The driver doesn't know that key, but this is not to be
* interpreted as an error by the caller; merely as an indication
* that it's not applicable.
+ *
+ * @since 0.3.0
*/
SR_API int sr_config_get(const struct sr_dev_driver *driver,
const struct sr_dev_inst *sdi,
* @retval SR_ERR_ARG The driver doesn't know that key, but this is not to be
* interpreted as an error by the caller; merely as an indication
* that it's not applicable.
+ *
+ * @since 0.3.0
*/
SR_API int sr_config_set(const struct sr_dev_inst *sdi,
const struct sr_channel_group *cg,
* @param sdi The device instance.
*
* @return SR_OK upon success or SR_ERR in case of error.
+ *
+ * @since 0.3.0
*/
SR_API int sr_config_commit(const struct sr_dev_inst *sdi)
{
* @retval SR_ERR_ARG The driver doesn't know that key, but this is not to be
* interpreted as an error by the caller; merely as an indication
* that it's not applicable.
+ *
+ * @since 0.3.0
*/
SR_API int sr_config_list(const struct sr_dev_driver *driver,
const struct sr_dev_inst *sdi,
*
* @return A pointer to a struct sr_config_info, or NULL if the key
* was not found.
+ *
+ * @since 0.2.0
*/
SR_API const struct sr_config_info *sr_config_info_get(int key)
{
*
* @return A pointer to a struct sr_config_info, or NULL if the key
* was not found.
+ *
+ * @since 0.2.0
*/
SR_API const struct sr_config_info *sr_config_info_name_get(const char *optname)
{
NULL,
};
+/** @since 0.1.0 */
SR_API struct sr_input_format **sr_input_list(void)
{
return input_module_list;
*
* The correct way to get/use the libsigrok API functions is:
*
- @code{.c}
- #include <libsigrok/libsigrok.h>
- @endcode
+ * @code{.c}
+ * #include <libsigrok/libsigrok.h>
+ * @endcode
*/
/*
*
* @return SR_OK upon success, SR_ERR_ARG upon invalid arguments.
*
- * @since 0.1.0
+ * @since 0.3.0
*/
SR_API int sr_log_callback_set(sr_log_callback cb, void *cb_data)
{
NULL,
};
+/** @since 0.1.0 */
SR_API struct sr_output_format **sr_output_list(void)
{
return output_module_list;
}
+/** @since 0.3.0 */
SR_API struct sr_output *sr_output_new(struct sr_output_format *of,
GHashTable *params, const struct sr_dev_inst *sdi)
{
return o;
}
+/** @since 0.3.0 */
SR_API int sr_output_send(struct sr_output *o,
const struct sr_datafeed_packet *packet, GString **out)
{
return o->format->receive(o, packet, out);
}
+/** @since 0.3.0 */
SR_API int sr_output_free(struct sr_output *o)
{
int ret;
return ret;
}
-
/** @} */
*
* @retval NULL Error.
* @retval other A pointer to the newly allocated session.
+ *
+ * @since 0.1.0
*/
SR_API struct sr_session *sr_session_new(void)
{
*
* @retval SR_OK Success.
* @retval SR_ERR_BUG No session exists.
+ *
+ * @since 0.1.0
*/
SR_API int sr_session_destroy(void)
{
*
* @retval SR_OK Success.
* @retval SR_ERR_BUG No session exists.
+ *
+ * @since 0.1.0
*/
SR_API int sr_session_dev_remove_all(void)
{
* @retval SR_OK Success.
* @retval SR_ERR_ARG Invalid argument.
* @retval SR_ERR_BUG No session exists.
+ *
+ * @since 0.2.0
*/
SR_API int sr_session_dev_add(const struct sr_dev_inst *sdi)
{
*
* @retval SR_OK Success.
* @retval SR_ERR Invalid argument.
+ *
+ * @since 0.3.0
*/
SR_API int sr_session_dev_list(GSList **devlist)
{
*
* @retval SR_OK Success.
* @retval SR_ERR_BUG No session exists.
+ *
+ * @since 0.1.0
*/
SR_API int sr_session_datafeed_callback_remove_all(void)
{
*
* @retval SR_OK Success.
* @retval SR_ERR_BUG No session exists.
+ *
+ * @since 0.3.0
*/
SR_API int sr_session_datafeed_callback_add(sr_datafeed_callback cb, void *cb_data)
{
*
* @retval SR_OK Success.
* @retval SR_ERR Error occured.
+ *
+ * @since 0.1.0
*/
SR_API int sr_session_start(void)
{
*
* @retval SR_OK Success.
* @retval SR_ERR_BUG Error occured.
+ *
+ * @since 0.1.0
*/
SR_API int sr_session_run(void)
{
*
* @retval SR_OK Success.
* @retval SR_ERR_BUG No session exists.
+ *
+ * @since 0.1.0
*/
SR_API int sr_session_stop(void)
{
* @retval SR_OK Success.
* @retval SR_ERR_ARG Invalid argument.
* @retval SR_ERR_MALLOC Memory allocation error.
+ *
+ * @since 0.3.0
*/
SR_API int sr_session_source_add(int fd, int events, int timeout,
sr_receive_data_callback cb, void *cb_data)
* @retval SR_OK Success.
* @retval SR_ERR_ARG Invalid argument.
* @retval SR_ERR_MALLOC Memory allocation error.
+ *
+ * @since 0.3.0
*/
SR_API int sr_session_source_add_pollfd(GPollFD *pollfd, int timeout,
sr_receive_data_callback cb, void *cb_data)
* @retval SR_OK Success.
* @retval SR_ERR_ARG Invalid argument.
* @retval SR_ERR_MALLOC Memory allocation error.
+ *
+ * @since 0.3.0
*/
SR_API int sr_session_source_add_channel(GIOChannel *channel, int events,
int timeout, sr_receive_data_callback cb, void *cb_data)
* @retval SR_ERR_ARG Invalid argument
* @retval SR_ERR_MALLOC Memory allocation error.
* @retval SR_ERR_BUG Internal error.
+ *
+ * @since 0.3.0
*/
SR_API int sr_session_source_remove(int fd)
{
* @return SR_OK upon success, SR_ERR_ARG upon invalid arguments, or
* SR_ERR_MALLOC upon memory allocation errors, SR_ERR_BUG upon
* internal errors.
+ *
+ * @since 0.2.0
*/
SR_API int sr_session_source_remove_pollfd(GPollFD *pollfd)
{
* @retval SR_ERR_ARG Invalid argument.
* @retval SR_ERR_MALLOC Memory allocation error.
* @return SR_ERR_BUG Internal error.
+ *
+ * @since 0.2.0
*/
SR_API int sr_session_source_remove_channel(GIOChannel *channel)
{
* @retval SR_OK Success
* @retval SR_ERR_ARG Invalid arguments
* @retval SR_ERR Other errors
+ *
+ * @since 0.2.0
*/
SR_API int sr_session_save(const char *filename, const struct sr_dev_inst *sdi,
unsigned char *buf, int unitsize, int units)
* @retval SR_OK Success
* @retval SR_ERR_ARG Invalid arguments
* @retval SR_ERR Other errors
+ *
+ * @since 0.3.0
*/
SR_API int sr_session_save_init(const char *filename, uint64_t samplerate,
char **channels)
* @retval SR_OK Success
* @retval SR_ERR_ARG Invalid arguments
* @retval SR_ERR Other errors
+ *
+ * @since 0.3.0
*/
SR_API int sr_session_append(const char *filename, unsigned char *buf,
int unitsize, int units)
* @return A g_try_malloc()ed string representation of the samplerate value,
* or NULL upon errors. The caller is responsible to g_free() the
* memory.
+ *
+ * @since 0.2.0
*/
SR_API char *sr_si_string_u64(uint64_t x, const char *unit)
{
* @return A g_try_malloc()ed string representation of the samplerate value,
* or NULL upon errors. The caller is responsible to g_free() the
* memory.
+ *
+ * @since 0.1.0
*/
SR_API char *sr_samplerate_string(uint64_t samplerate)
{
* @return A g_try_malloc()ed string representation of the frequency value,
* or NULL upon errors. The caller is responsible to g_free() the
* memory.
+ *
+ * @since 0.1.0
*/
SR_API char *sr_period_string(uint64_t frequency)
{
* @return A g_try_malloc()ed string representation of the voltage value,
* or NULL upon errors. The caller is responsible to g_free() the
* memory.
+ *
+ * @since 0.2.0
*/
SR_API char *sr_voltage_string(uint64_t v_p, uint64_t v_q)
{
* a trigger value set in 'triggerstring' are NULL, the other entries
* contain the respective trigger type which is requested for the
* respective channel (e.g. "r", "c", and so on).
+ *
+ * @since 0.2.0
*/
SR_API char **sr_parse_triggerstring(const struct sr_dev_inst *sdi,
const char *triggerstring)
* @param size Pointer to uint64_t which will contain the string's size value.
*
* @return SR_OK upon success, SR_ERR upon errors.
+ *
+ * @since 0.1.0
*/
SR_API int sr_parse_sizestring(const char *sizestring, uint64_t *size)
{
* @todo Add support for "m" (minutes) and others.
* @todo Add support for picoseconds?
* @todo Allow both lower-case and upper-case? If no, document it.
+ *
+ * @since 0.1.0
*/
SR_API uint64_t sr_parse_timestring(const char *timestring)
{
return time_msec;
}
+/** @since 0.1.0 */
SR_API gboolean sr_parse_boolstring(const char *boolstr)
{
if (!boolstr)
return FALSE;
}
+/** @since 0.2.0 */
SR_API int sr_parse_period(const char *periodstr, uint64_t *p, uint64_t *q)
{
char *s;
return SR_OK;
}
-
+/** @since 0.2.0 */
SR_API int sr_parse_voltage(const char *voltstr, uint64_t *p, uint64_t *q)
{
char *s;