SR_API int sr_dev_open(struct sr_dev_inst *sdi);
SR_API int sr_dev_close(struct sr_dev_inst *sdi);
-SR_API struct sr_dev_driver *sr_dev_inst_driver_get(struct sr_dev_inst *sdi);
-SR_API const char *sr_dev_inst_vendor_get(struct sr_dev_inst *sdi);
-SR_API const char *sr_dev_inst_model_get(struct sr_dev_inst *sdi);
-SR_API const char *sr_dev_inst_version_get(struct sr_dev_inst *sdi);
-SR_API const char *sr_dev_inst_sernum_get(struct sr_dev_inst *sdi);
-SR_API const char *sr_dev_inst_connid_get(struct sr_dev_inst *sdi);
-SR_API GSList *sr_dev_inst_channels_get(struct sr_dev_inst *sdi);
-SR_API GSList *sr_dev_inst_channel_groups_get(struct sr_dev_inst *sdi);
+SR_API struct sr_dev_driver *sr_dev_inst_driver_get(const struct sr_dev_inst *sdi);
+SR_API const char *sr_dev_inst_vendor_get(const struct sr_dev_inst *sdi);
+SR_API const char *sr_dev_inst_model_get(const struct sr_dev_inst *sdi);
+SR_API const char *sr_dev_inst_version_get(const struct sr_dev_inst *sdi);
+SR_API const char *sr_dev_inst_sernum_get(const struct sr_dev_inst *sdi);
+SR_API const char *sr_dev_inst_connid_get(const struct sr_dev_inst *sdi);
+SR_API GSList *sr_dev_inst_channels_get(const struct sr_dev_inst *sdi);
+SR_API GSList *sr_dev_inst_channel_groups_get(const struct sr_dev_inst *sdi);
/*--- hwdriver.c ------------------------------------------------------------*/
*
* @return The driver instance or NULL on error.
*/
-SR_API struct sr_dev_driver *sr_dev_inst_driver_get(struct sr_dev_inst *sdi)
+SR_API struct sr_dev_driver *sr_dev_inst_driver_get(const struct sr_dev_inst *sdi)
{
if (!sdi || !sdi->driver)
return NULL;
*
* @return The vendor string or NULL.
*/
-SR_API const char *sr_dev_inst_vendor_get(struct sr_dev_inst *sdi)
+SR_API const char *sr_dev_inst_vendor_get(const struct sr_dev_inst *sdi)
{
if (!sdi)
return NULL;
*
* @return The model string or NULL.
*/
-SR_API const char *sr_dev_inst_model_get(struct sr_dev_inst *sdi)
+SR_API const char *sr_dev_inst_model_get(const struct sr_dev_inst *sdi)
{
if (!sdi)
return NULL;
*
* @return The version string or NULL.
*/
-SR_API const char *sr_dev_inst_version_get(struct sr_dev_inst *sdi)
+SR_API const char *sr_dev_inst_version_get(const struct sr_dev_inst *sdi)
{
if (!sdi)
return NULL;
*
* @return The serial number string or NULL.
*/
-SR_API const char *sr_dev_inst_sernum_get(struct sr_dev_inst *sdi)
+SR_API const char *sr_dev_inst_sernum_get(const struct sr_dev_inst *sdi)
{
if (!sdi)
return NULL;
* @return A copy of the connection id string or NULL. The caller is responsible
* for g_free()ing the string when it is no longer needed.
*/
-SR_API const char *sr_dev_inst_connid_get(struct sr_dev_inst *sdi)
+SR_API const char *sr_dev_inst_connid_get(const struct sr_dev_inst *sdi)
{
struct drv_context *drvc;
int r, cnt, i, a, b;
/* connection_id isn't populated, let's do that here. */
serial = sdi->conn;
- sdi->connection_id = g_strdup(serial->port);
+ ((struct sr_dev_inst *)sdi)->connection_id = g_strdup(serial->port);
}
#endif
continue;
usb_get_port_path(devlist[i], connection_id, sizeof(connection_id));
- sdi->connection_id = g_strdup(connection_id);
+ ((struct sr_dev_inst *)sdi)->connection_id = g_strdup(connection_id);
break;
}
*
* @return The GSList of channels or NULL.
*/
-SR_API GSList *sr_dev_inst_channels_get(struct sr_dev_inst *sdi)
+SR_API GSList *sr_dev_inst_channels_get(const struct sr_dev_inst *sdi)
{
if (!sdi)
return NULL;
*
* @return The GSList of channel groups or NULL.
*/
-SR_API GSList *sr_dev_inst_channel_groups_get(struct sr_dev_inst *sdi)
+SR_API GSList *sr_dev_inst_channel_groups_get(const struct sr_dev_inst *sdi)
{
if (!sdi)
return NULL;