API Functions | Signal Hound
device Handle of an initialized device.
Description
Stops the device operation and places the device into an idle state.
Return Values
bbNoError The device has been successfully suspended.
bbDeviceNotOpenErr The device indicated by device is not open.
bbDeviceNotConfiguredErr The device is already idle.
bbPreset
Trigger a device reset
bbStatus bbPreset(int device);
Parameters
device Handle of an open device.
Description
This function exists to invoke a hard reset of the device. This will function similarly to a power
cycle(unplug/re-plug the device). This might be useful if the device has entered an undesirable or
unrecoverable state. Often the device might become unrecoverable if a program closed unexpectedly,
not allowing the device to close properly. This function might allow the software to perform the reset
rather than ask the user perform a power cycle.
Viewing the traces returned is often the best way to determine if the device is operating normally. To
utilize this function, the device must be open. Calling this function will trigger a reset which happens
after 2 seconds. Within this time you must call bbCloseDevice() to free any remaining resources and
release the device serial number from the open device list. From the time of the bbPreset() call, we
suggest 3 to more seconds of wait time before attempting to re-open the device.
Return Values
bbNoError Function completed successfully, the device will be reset.
bbDeviceNotOpen The device specified is not currently open.
Example
1. // Notes: Invoking a sleep in the main thread of execution may be undesirable
2. // in a GUI application. This function is best performed in a separate thread.
3. // The amount of time to Sleep is dependent on how fast the device will register
4. // on your machine after it resets. A longer sleep time may be preferred or multiple
5. // attempts to open the device until it returns bbNoError
6. bool PresetRoutine() {
7.
8. bbPreset( myID );
9. bbCloseDevice( myID );
10.
11. Sleep(3000); // Windows sleep function