| 34 | } |
| 35 | |
| 36 | void DeviceAgent::update() |
| 37 | { |
| 38 | _dev_handle = NULL_HANDLE; |
| 39 | _dev_name = ""; |
| 40 | _path = ""; |
| 41 | _di = NULL; |
| 42 | _dev_type = 0; |
| 43 | _is_new_device = false; |
| 44 | |
| 45 | struct ds_device_full_info info; |
| 46 | |
| 47 | if (ds_get_actived_device_info(&info) == SR_OK) |
| 48 | { |
| 49 | _dev_handle = info.handle; |
| 50 | _dev_type = info.dev_type; |
| 51 | _di = info.di; |
| 52 | _is_new_device = info.actived_times == 1; |
| 53 | |
| 54 | _dev_name = QString::fromLocal8Bit(info.name); |
| 55 | _driver_name = QString::fromLocal8Bit(info.driver_name); |
| 56 | |
| 57 | if (info.path[0] != '\0'){ |
| 58 | _path = QString::fromLocal8Bit(info.path); |
| 59 | } |
| 60 | } |
| 61 | } |
| 62 | |
| 63 | sr_dev_inst* DeviceAgent::inst() |
| 64 | { |
no test coverage detected