diff options
| author | Tero Kontkanen <tero.kontkanen@granitedevices.fi> | 2017-08-19 17:05:51 +0300 |
|---|---|---|
| committer | Tero Kontkanen <tero.kontkanen@granitedevices.fi> | 2017-08-19 17:34:34 +0300 |
| commit | 6ef9e8c44e29d270c64c22b73ae00508966b4892 (patch) | |
| tree | da4561d6e961d0403689dc175ab288d8e127f134 /simplemotion.c | |
| parent | d78fb3d4aac4ed7c28311a69ae86ffb88d03b972 (diff) | |
| download | SimpleMotionV2-6ef9e8c44e29d270c64c22b73ae00508966b4892.tar.gz SimpleMotionV2-6ef9e8c44e29d270c64c22b73ae00508966b4892.zip | |
Add functions to list compatible bus device (ftdi d2xx only)
Diffstat (limited to 'simplemotion.c')
| -rw-r--r-- | simplemotion.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/simplemotion.c b/simplemotion.c index 30220cf..45c7697 100644 --- a/simplemotion.c +++ b/simplemotion.c @@ -954,3 +954,36 @@ SM_STATUS resetCumulativeStatus( const smbus handle ) return SM_OK;
}
+
+/** Return number of bus devices found. details of each device may be consequently fetched by smGetBusDeviceDetails() */
+smint smGetNumberOfDetectedBuses()
+{
+ return smBDGetNumberOfDetectedBuses();
+}
+
+/** Fetch information of detected bus nodes at certain index. Example:
+
+ smint num=smGetNumberOfDetectedBuses();
+ for(int i=0;i<num;i++)
+ {
+ SM_BUS_DEVICE_INFO info;
+ SM_STATUS s=smGetBusDeviceDetails(i,&info);
+ if(s==SM_OK)
+ {
+ ...do something with info...
+ }
+ else
+ {
+ ...report error...
+ }
+ }
+*/
+LIB SM_STATUS smGetBusDeviceDetails( smint index, SM_BUS_DEVICE_INFO *info )
+{
+ smbool ok=smBDGetBusDeviceDetails(index,info);
+
+ if(ok==smtrue)
+ return SM_OK;
+ else
+ return SM_ERR_NODEVICE;
+}
|
