STFishFinder API  API version 0.0.0, Documentation version 3 -PRELIMINARY-
STFF::STFishFinder Class Reference

This is the main class for the STFishFinder API. More...

Public Member Functions

 ~STFishFinder ()
 This is the STFishFinder class destructor. More...
 
FF_Error_t Hello ()
 Initiates communication with the black box fish finder after a connection is established. More...
 
FF_ApiStatus_t GetApiStatus () const
 Returns the status of the STFishFinder API. More...
 
FF_Error_t Control (FF_ControlCommand_t command, const void *pParam)
 Provides a facility to alter system-related behavior of the black box and API. More...
 
FF_Error_t ParseFFInputStream (char *pInputStream, uint32_t numBytes)
 This function parses and interprets the stream of messages from the black box fish finder, and calls API methods to perform actions according to the data received. More...
 
FF_Error_t StartRecording (Replay *pReplay)
 This function enables the recording of an API session. More...
 
FF_Error_t StopRecording ()
 This function discontinues the recording of the API session that was initiated by a call to StartRecording. More...
 
void TimerTick ()
 Provides a means by which time-dependent processes within the STFishFinder API can be serviced on a periodic basis. More...
 
FF_Error_t SilenceDepthAlarm (FF_DepthAlarmType_t alarmType, int32_t durationSeconds)
 Sends a message to the black box instructing it to temporarily silence a currently active depth alarm. More...
 
FF_Error_t GetDepthAlarmState (FF_DepthAlarmState_t *pShallowAlarmState, FF_DepthAlarmState_t *pDeepAlarmState, FF_DataStatus_t *pStatus) const
 Provides the current state of both the shallow depth alarm and the deep depth alarm. More...
 
FF_Error_t GetApiVersion (Version *pApiVersion) const
 Getter function to provide an STFF::Version object containing version information for the present instance of the STFishFinder API. More...
 
FF_Error_t GetCompanyName (char *pCompanyName, uint16_t *pLength, FF_DataStatus_t *pStatus) const
 Getter function to provide the Company Name for the connected black box fish finder. More...
 
FF_Error_t GetProductName (char *pProductName, uint16_t *pLength, FF_DataStatus_t *pStatus) const
 Getter function to provide the Product Name for the connected black box fish finder. More...
 
FF_Error_t GetSerialNumber (char *pSerialNumber, uint16_t *pLength, FF_DataStatus_t *pStatus) const
 Getter function to provide the Serial Number of the connected black box fish finder. More...
 
FF_Error_t GetHWVersion (char *pHWVersion, uint16_t *pLength, FF_DataStatus_t *pStatus) const
 Getter function to provide the Hardware Version string for the connected black box fish finder. More...
 
FF_Error_t GetFWVersion (char *pFWVersion, uint16_t *pLength, FF_DataStatus_t *pStatus) const
 Getter function to provide the Firmware Version string for the connected black box fish finder. More...
 
FF_Error_t GetBootloaderVersion (char *pBootloaderVersion, uint16_t *pLength, FF_DataStatus_t *pStatus) const
 Getter function to provide the Bootloader Version string for the connected black box fish finder. More...
 
FF_Error_t GetMaxPossibleDepth (FF_Frequency_t frequency, FF_DepthUnits_t units, uint32_t *pMaxDepth, FF_DataStatus_t *pStatus) const
 Getter function to provide the maximum possible depth at the specified frequency for the connected black box fish finder. More...
 
FF_Error_t GetInputSamplesLimits (uint16_t *pMinInputSamples, uint16_t *pMaxInputSamples) const
 Getter function to provide limits for the parameter to the SetNumInputSamples() member function. More...
 
FF_Error_t GetSpeedPulsesPerNauticalMileLimits (uint32_t *pMinSpeedPPNM, uint32_t *pMaxSpeedPPNM) const
 Getter function to provide limits for the parameter to the SetSpeedPulsesPerNauticalMile() member function. More...
 
FF_Error_t GetTemperatureOffsetLimits (FF_TemperatureUnits_t units, int16_t *pMinTempOffset, int16_t *pMaxTempOffset) const
 Getter function to provide limits for the parameter to the SetTemperatureOffset() member function. More...
 
FF_Error_t GetRangeLimits (FF_DepthUnits_t units, uint32_t *pMinRangeDeep, uint32_t *pMaxRangeDeep) const
 Getter function to provide limits for the parameter to the SetRange() member function. More...
 
FF_Error_t GetGainLimits (uint16_t *pMinGain, uint16_t *pMaxGain) const
 Getter function to provide limits for the parameter to the SetGain() member function. More...
 
FF_Error_t GetGainOffsetLimits (int16_t *pMinOffset, int16_t *pMaxOffset) const
 Getter function to provide limits for the parameter to the SetGainOffset() member function. More...
 
FF_Error_t GetGainColorOffsetsLimits (uint16_t *pNumOffsets, uint16_t *pMinLargestOffset, uint16_t *pMaxLargestOffset) const
 Getter function to provide: More...
 
FF_Error_t GetTemperature (FF_TemperatureUnits_t units, FF_TemperatureData_t *pTemperatureData) const
 Getter function to provide the current water temperature data. More...
 
FF_Error_t GetSpeed (FF_SpeedUnits_t units, FF_SpeedData_t *pSpeedData) const
 Getter function to provide the current Speed Through Water data. More...
 
FF_Error_t GetDepth (FF_DepthUnits_t units, FF_DepthData_t *pDepthData) const
 Getter function to provide the current Depth data. More...
 
FF_Error_t GetBatteryVoltage (FF_BatteryVoltageData_t *pBatteryVoltageData) const
 Getter function to provide the current Battery Voltage data. More...
 
FF_Error_t GetNumInputSamples (uint16_t *pNumInputSamples, FF_SettingStatus_t *pStatus) const
 Getter function to provide the current setting for the number of samples that will be provided by the black box when transferring each column of image data to the API. More...
 
FF_Error_t GetFrequencyMode (FF_FrequencyMode_t *pFrequencyMode, FF_SettingStatus_t *pStatus) const
 Getter function to provide the current Frequency Mode setting. More...
 
FF_Error_t GetAutoGainSetting (FF_AutoGainSetting_t *pAutoGainSetting, FF_SettingStatus_t *pStatus) const
 Getter function to provide the current Auto Gain setting. More...
 
FF_Error_t GetAutoRangeSetting (FF_AutoRangeSetting_t *pAutoRange, FF_DepthUnits_t *pUnits, FF_SettingStatus_t *pStatus) const
 Getter function to provide the current Auto Range setting. More...
 
FF_Error_t GetRange (FF_RangeSetting_t *pRangeSetting, FF_SettingStatus_t *pStatus) const
 Getter function to provide the current Range setting. More...
 
FF_Error_t GetGain (FF_Frequency_t frequency, uint16_t *pGainSetting, FF_SettingStatus_t *pStatus) const
 Getter function to provide the current Gain setting. More...
 
FF_Error_t GetGainOffset (FF_Frequency_t frequency, int16_t *pGainOffset, FF_SettingStatus_t *pStatus) const
 Getter function to provide the current Gain Offset setting. More...
 
FF_Error_t GetGainColorOffsets (FF_Frequency_t frequency, uint16_t *pNumColors, uint16_t *pGainColorOffsets, FF_SettingStatus_t *pStatus) const
 Getter function to provide the number of colors used when generating the STFF::ImageColumn data, and the table of gain offset values used for separating the received sonar signal into its colors. More...
 
FF_Error_t GetFishIdSetting (FF_Frequency_t frequency, FF_FishIdSetting_t *pFishIdSetting, FF_SettingStatus_t *pStatus) const
 Getter function to provide the current Fish ID setting. More...
 
FF_Error_t GetTemperatureOffset (FF_TemperatureUnits_t units, int16_t *pTemperatureOffset, FF_SettingStatus_t *pStatus) const
 Getter function to provide the current Temperature Offset master setting. More...
 
FF_Error_t GetSpeedPulsesPerNauticalMile (uint32_t *pSpeedPPNM, FF_SettingStatus_t *pStatus) const
 Getter function to provide the current Speed PPNM master setting. More...
 
FF_Error_t GetDepthAlarmSettings (FF_DepthUnits_t *pUnits, uint32_t *pShallowAlarm, uint32_t *pDeepAlarm, FF_SettingStatus_t *pStatus) const
 Getter function to provide the current Depth Alarm master settings. More...
 
FF_Error_t SetNumInputSamples (uint16_t numInputSamples)
 Setter function to establish the number of samples that will be provided by the black box when transferring each column of image data to the API. More...
 
FF_Error_t SetFrequencyMode (FF_FrequencyMode_t frequencyMode)
 Setter function to specify the Frequency Mode setting for the black box and the API. More...
 
FF_Error_t SetAutoGainSetting (FF_AutoGainSetting_t autoGainSetting)
 Setter function to specify the Auto Gain setting for the black box and the API. More...
 
FF_Error_t SetAutoRangeSetting (FF_AutoRangeSetting_t autoRangeSetting, FF_DepthUnits_t units)
 Setter function to specify the Auto Range setting for the black box and the API. More...
 
FF_Error_t SetRange (const FF_RangeSetting_t *pRangeSetting)
 Setter function to "manually" specify the Range setting for the black box and the API. More...
 
FF_Error_t SetGain (FF_Frequency_t frequency, uint16_t gainSetting)
 Setter function to "manually" specify the Gain setting for the black box. More...
 
FF_Error_t SetGainOffset (FF_Frequency_t frequency, int16_t gainOffset)
 Setter function to specify the Gain Offset setting for the black box. More...
 
FF_Error_t SetGainColorOffsets (FF_Frequency_t frequency, uint16_t numColors, const uint16_t *pGainColorOffsets)
 Setter function to specify the number of colors the API should provide in the STFF::ImageColumn data, and the table of gain offset steps to use for separating the received sonar signal into its colors. More...
 
FF_Error_t SetFishIdSetting (FF_Frequency_t frequency, const FF_FishIdSetting_t *pFishIdSetting)
 Setter function to specify the Fish ID setting for the black box and the API. More...
 
FF_Error_t SetTemperatureOffset (FF_TemperatureUnits_t units, int16_t temperatureOffset)
 Setter function to specify the Temperature Offset calibration setting for the black box. More...
 
FF_Error_t SetSpeedPulsesPerNauticalMile (uint32_t speedPPNM)
 Setter function to specify the Speed Pulses Per Nautical Mile (PPNM) setting used by the black box to determine Speed Through Water. More...
 
FF_Error_t SetDepthAlarmSettings (FF_DepthUnits_t units, uint32_t shallowAlarmSetting, uint32_t deepAlarmSetting)
 Setter function to set the Shallow Depth Alarm and Deep Depth Alarm master settings within the black box. More...
 

Static Public Member Functions

static STFishFinderCreateFishFinder (FF_Error_t *pError)
 Use this function to create an STFishFinder API object once a connection (or session) has been established with a compatible black box fish finder. More...
 
static STFishFinderCreateSimulatedFishFinder (FF_Error_t *pError)
 Use this function to create an STFishFinder API object that provides simulated data for demonstration purposes in the absence of an actual black box fish finder. More...
 
static STFishFinderCreateFishFinderForPlayback (const Replay *pPlaybackData, FF_Error_t *pError)
 Use this function to create an STFishFinder API object for the purpose of playing back a previously recorded session. More...
 
static FF_Error_t SetCallbacks (Callback_SettingChanged_t pSettingChanged, Callback_DataItemReceived_t pDataItemReceived, Callback_DepthAlarmStateChange_t pDepthAlarmStateChange, Callback_FishAlarmTrigger_t pFishAlarmTrigger, Callback_StreamDataToFF_t pStreamDataToFF)
 Specifies the static callback functions to be called by the STFishFinder API when specific events occur. More...
 

Static Public Attributes

static const uint16_t MaxAttributeStringLength = 256
 Maximum size of character strings, including the terminating '\0', provided by certain getter member functions in this class. More...
 

Friends

class ImageColumn
 
class Replay
 
class STFF_Client
 

Detailed Description

This is the main class for the STFishFinder API.

This class should be instantiated when a connection (e.g. a TCP session over IP, or a serial port connection) has been established with a compatible black box fish finder. It must also be instantiated in order to operate the API in either Simulator Mode or Playback Mode.

The instance should be destroyed upon loss of the connection, or when the STFishFinder object is no longer needed.

This class contains the current state of the black box fish finder as it pertains to the present app. The state may be queried or changed through the various member functions provided by this class.

There are two cases where an app might want to create more than one instance of the STFishFinder class:

  • The app might display live data and previously recorded data simultaneously, in separate windows
  • Conceivably, an app could operate multiple black box fish finders simultaneously In these cases, an instance of this class would be created for each connected black box or virtual session.
Todo:
Add a member function to reset non-volatile memory in the black box to factory default
Todo:
Add a module for providing firmware updates to the black box
Todo:
Rename FishAlarmTrigger callback to FishDetected. (This callbacks would be used for both fish alarms and Fish ID.)
Todo:
Add setter and getter functions for Fish Alarm functionality.
Todo:
Eliminate FF_WaterType_t, and GetWaterType() and SetWaterType(). Replace all with GetSoundSpeed() and SetSoundSpeed(), and add constants for soundspeed for saltwater and freshwater.
Todo:
Define attribute getters to provide both short form and long form copyright and license info for both the API and the black box firmware, in a choice of limited html or plain text.
Todo:
Create SetBitDepth() and GetBitDepth() functions.
Todo:
Add getters and setters for adjusting the STC.
Todo:
Add getters and setters for adjusting sonar image filters (such as, e.g. water filter, clutter filter, noise filter, interference rejection, and DSP BW filters)

Definition at line 83 of file STFF-FishFinder.h.

Member Data Documentation

STFF::STFishFinder::MaxAttributeStringLength = 256
static

Maximum size of character strings, including the terminating '\0', provided by certain getter member functions in this class.

In the unlikely event a string were to exceed this length, it will be truncated to this length by the getter function before storing to the caller's buffer.

Definition at line 95 of file STFF-FishFinder.h.


The documentation for this class was generated from the following file: