User:Njustus/Temp/HC12ModuleInterfaceDesc.doc

From WikiEducator
Jump to: navigation, search

Note:

The variable fd is defined as an int. It is the fpga file handle that you get when you open the fpgs device.


The variable errCode of of type “HC12ErrorPacketType”.

The return values are:

HC12PACKET_ERROR_NONE Operation successed. HC12PACKET_ERROR_TIMEOUT Operation timed out. HC12PACKET_ERROR_FORMAT Dual port format error. HC12PACKET_ERROR_CMD HC12 reported an error.


ONCORE_GPS:

Get the Oncore Gps description string.

This routine gets a short description for this module.

ErrCode = getHC12ModuleDescString(fd, SUB_MODULE_ONCORE_GPS, result);

Where result is at string of size 64.


Get the Channel’s “Locked to a Signal” flag.

This routine queries if the Oncore Receiver is locked to GPS.

ErrCode = getHC12ModuleChannelLockFlags(fd, SUB_MODULE_ONCORE_GPS, lockedFlag); Where lockedFlag is at string of size 64.

Return values for lockedFlag is: “U” for unlocked.

“L” for locked.


Get the Antenna Cable delay in terms of seconds. ErrCode = getHC12ModuleCableDelay(fd, SUB_MODULE_ONCORE_GPS, &cableDelay);

Where cableDelay is a float.

Returns with cable Delay set to the GPS’s antenna delay (in terms of seconds).

Set the Antenna Cable delay in terms of seconds.

ErrCode = setHC12ModuleCableDelay(fd, SUB_MODULE_ONCORE_GPS, cableDelay); Where cableDelay is a float.

cableDelay is used to set to the GPS’s antenna delay (in terms of seconds).

Get the Oncore’s Receiver’s OK flag. ErrCode = getHC12ModuleRecvOK( fd, SUB_MODULE_ONCORE_GPS, &recvStatus); Where recvStatus is an integer.

Returns with recvStatus set to one of the following values: GpsReceiverDown : Can't communicate with GPS receiver. GpsNoSatSignal: No signals we can do nothing... GpsAcquiringSignal: May get lock later. Gps2dPosSolution: Oncore 1pps may be on time, but we don't have the UTC-GPS difference from the almanac yet, so we don't know the right time yet. Gps3dPosSolution: Same as prev state, but better position

solution. GpsPositionHold: Position hold, the automatic site survey is done. Note: the acquisition mode handling code generally only stays in this state for a moment, as soon as it is detected, we go to the GpsTimeValid state, unless a problem is detected. GpsTimeValid: Final lock state, we claim to have valid time.

Get the number of Sats that the receiver acquired. ErrCode = getHC12ModuleNumberOfSats( fd, SUB_MODULE_ONCORE_GPS, &numberOfSats); where numberOfSats is an integer.

Returns with numberOfSats shows the number of sats the receiver is monitoring.


Get the position information form the GPS unit.

errCode = getHC12ModuleCurrentPosition( fd, SUB_MODULE_ONCORE_GPS, result); where result is a string of size 256.

The format of result is:

“Lat-Degrees Lat-Minutes Lat-Seconds Lat-Milliseconds Long-Degrees Long-Minutes Long-Seconds Long-Milliseconds Altitude”

Where Lat stands for Latitude and Long stands for Longitude. All fields are integers except for Altitude, which is a long int.


Get the Antenna Status.

errCode = getHC12ModuleAntStatus(fd, SUB_MODULE_ONCORE_GPS, result); where result is a string of size 256.

The returned values for result is : "Short", "Open", "Good" and "Unknown".

Get the Oncore Receiver’s Time/Dynamic mode.

errCode = getHC12ModuleRecvStaticDynMode(fd, SUB_MODULE_ONCORE_GPS, &staticDynamicMode); where staticDynamicMode is an integer. return value for staticDynamicMode is 0 (Time Mode) or 1 (Dynamic).


Set the Oncore Receiver’s Time/Dynamic mode.

errCode = setHC12ModuleRecvStaticDynMode(fd, SUB_MODULE_ONCORE_GPS, staticDynamicMode, resultDescrString); where staticDynamicMode is defined as an integer and resultDescrString is defined as an string of length 256.

Set staticDynamicMode with ether 0 (Time Mode) or 1(Dynamic Mode).

Returns with resultDescrString being set to either “OK” or “FAILED”.


Functions for testing only:


Get the module enabled flag.

If the module is enabled, then it can accept a gps timing source and be used to steer the oscillator.

ErrCode = getHC12ModuleEnable( fd, SUB_MODULE_ONCORE_GPS,

enabledString);

enabledString is defined as a string of size 64.

Returns into the string enabledString either “Enabled” or “Disabled”.


Set the module enable flag. ErrCode = setHC12ModuleEnable( fd, SUB_MODULE_ONCORE_GPS, enabledString); enabledString is defined as a string of size 64.

If you want to enable the ONCORE GPS module, then copy the string “ON” to enabledString.

Else if you want to disabled GPS, then copy the string “OFF” to enabledString.


Get relative Bias Error from the Oncore GPS to the main Oscillator.

errCode = getHC12ModuleBias(fd, SUB_MODULE_ONCORE_GPS, &bias);

where bias is a float.

Returns with bias being equal to the error (in fractions of a second) between the GPS and the main oscillator 1pps.


IRIGB:

Get the IrigB Reader description string.

This routine gets a short description for this module.

ErrCode = getHC12ModuleDescString(fd, SUB_MODULE_IRIGB, result);

Where result is at string of size 64.


Get the Channel’s “Locked to a Signal” flag.

This routine queries if the IrigB Reader is locked to an external IRIGB signal.

ErrCode = getHC12ModuleChannelLockFlags(fd, SUB_MODULE_IRIGB, lockedFlag); Where lockedFlag is at string of size 64.

Return values for lockedFlag is: “U” for unlocked.

“L” for locked.


Get the IrigB Cable delay in terms of seconds. ErrCode = getHC12ModuleCableDelay(fd, SUB_MODULE_IRIGB, &cableDelay);

Where cableDelay is a float.

Returns with cable Delay set to the IrigB Reader’s cable delay (in terms of seconds).

Set the IrigB Cable delay in terms of seconds.

ErrCode = setHC12ModuleCableDelay(fd, SUB_MODULE_IRIGB, cableDelay); Where cableDelay is a float.

cableDelay is used to set to the IrigB Reader’s cable delay (in terms of seconds).

Get the IrigB Input Type. errCode = getHC12ModuleIrigInputType( fd, &irigType); Where irigType is defined as an integer.

Called with irigType being set to:

0: For standard IrigB.

1: For TrueTime IrigB.

2: For 1344 IrigB.


Set the IrigB Input Type. errCode = setHC12ModuleIrigInputType( fd, irigType); Where irigType is defined as an integer.

Returns with irigType being set to the IrigB type.

0: For standard IrigB.

1: For TrueTime IrigB.

2: For 1344 IrigB.


Functions for testing only:


Get the module enabled flag.

If the module is enabled, then it can accept a IrigB timing source and be used to steer the oscillator.

ErrCode = getHC12ModuleEnable( fd, SUB_MODULE_IRIGB,

enabledString);

enabledString is defined as a string of size 64.

Returns into the string enabledString either “Enabled” or “Disabled”.


Set the module enable flag. ErrCode = setHC12ModuleEnable( fd, SUB_MODULE_IRIGB, enabledString); enabledString is defined as a string of size 64.

If you want to enable the IrigB Reader module, then copy the string “ON” to enabledString.

Else if you want to disabled IrigB, then copy the string “OFF” to enabledString.


Get relative Bias Error from the IrigB Input to the main Oscillator.

errCode = getHC12ModuleBias(fd, SUB_MODULE_IRIGB, &bias);

where bias is a float.

Returns with bias being equal to the error (in fractions of a second) between the IrigB and the main oscillator 1pps.

External 1PPS:

Get the External 1PPS description string.

This routine gets a short description for this module.

ErrCode = getHC12ModuleDescString(fd, SUB_MODULE_1PPS, result); Where result is at string of size 64.


Get the Channel’s “Locked to a Signal” flag.

This routine queries if the External 1PPS Module is locked to a 1PPS.

ErrCode = getHC12ModuleChannelLockFlags(fd, SUB_MODULE_1PPS, lockedFlag); Where lockedFlag is at string of size 64.

Return values for lockedFlag is: “U” for unlocked.

“L” for locked.


Get the External 1PPS Cable delay in terms of seconds. ErrCode = getHC12ModuleCableDelay(fd, SUB_MODULE_1PPS, &cableDelay);

Where cableDelay is a float.

Returns with cable Delay set to the External 1PPS’s cable delay (in terms of seconds).

Set the External 1PPS Cable delay in terms of seconds.

ErrCode = setHC12ModuleCableDelay(fd, SUB_MODULE_1PPS, cableDelay); Where cableDelay is a float.

cableDelay is used to set to the External 1PPS’s cable delay (in terms of seconds).

Functions for testing only:


Get the module enabled flag.

If the module is enabled, then it can accept an External 1PPS timing source and be used to steer the oscillator.

ErrCode = getHC12ModuleEnable( fd, SUB_MODULE_1PPS,

enabledString);

enabledString is defined as a string of size 64.

Returns into the string enabledString either “Enabled” or “Disabled”.


Set the module enable flag. ErrCode = setHC12ModuleEnable( fd, SUB_MODULE_1PPS, enabledString); enabledString is defined as a string of size 64.

If you want to enable the External 1PPS Reader module, then copy the string “ON” to enabledString.

Else if you want to disabled External 1PPS, then copy the string “OFF” to enabledString.


Get relative Bias Error from the External 1PPS Input to the main Oscillator.

errCode = getHC12ModuleBias(fd, SUB_MODULE_1PPS, &bias);

where bias is a float.

Returns with bias being equal to the error (in fractions of a second) between the External 1PPS and the main oscillator 1pps.


External 10Mhz:

Get the External 10 Mhz Reference description string.

This routine gets a short description for this module.

ErrCode = getHC12ModuleDescString(fd, SUB_MODULE_Ext10Mhz, result); Where result is at string of size 64.


Get the Channel’s “Locked to a Signal” flag.

This routine queries if the External 10 Mhz Module is locked to an external 10 Mhz.

ErrCode = getHC12ModuleChannelLockFlags(fd, SUB_MODULE_Ext10Mhz, lockedFlag); Where lockedFlag is at string of size 64.

Return values for lockedFlag is: “U” for unlocked.

“L” for locked.


Functions for testing only:


Get the module enabled flag.

If the module is enabled, then it can accept a External 10 Mhz Reference source and be used to steer the oscillator.

ErrCode = getHC12ModuleEnable( fd, SUB_MODULE_Ext10Mhz,

enabledString);

enabledString is defined as a string of size 64.

Returns into the string enabledString either “Enabled” or “Disabled”.


Set the module enable flag. ErrCode = setHC12ModuleEnable( fd, SUB_MODULE_Ext10Mhz, enabledString); enabledString is defined as a string of size 64.

If you want to enable the External 10 Mhz Reference module, then copy the string “ON” to enabledString.

Else if you want to disabled External 10 Mhz Reference, then copy the string “OFF” to enabledString.


SYSTEM:


CALENDAR:

Get the Calendar Module description string.

This routine gets a short description for this module.

ErrCode = getHC12ModuleDescString(fd, SUB_MODULE_CALENDAR, result); Where result is at string of size 64.


Get the Leap Second and Leap Second pending flag.

errCode = getHC12ModuleLeapSecInfo( fd, &leapSecOffset, &leapSecPending); where leapSecOffset and leapSecPending are integers.

Returns with:

LeapSecOffset set to the current leap second offset.

LeapSecPending set to either:

LeapSecPendNone for No leap second pending. LeapSecPendPos for Positive leap second pending. LeapSecPendNeg for Negative leap second pending.

Get the Local Time Zone Offset (in minutes).

errCode = getHC12ModuleLocalTimeZoneOffsetInMinutes( fd, &localTimeZoneOffsetInMin); where localTimeZoneOffsetInMin is an integer.

Returns in localTimeZoneOffsetInMin the local time zone offset (in minutes).


Set the Local Time Zone Offset (in minutes).

errCode = setHC12ModuleLocalTimeZoneOffsetInMinutes( fd, localTimeZoneOffsetInMin); where localTimeZoneOffsetInMin is defined as an integer.


Set the DST Entry date.

errCode = setHC12ModuleDST_StartDate( fd, startMonth, startWeekNumber, startDayOfWeek); where startMonth, startWeekNumber and startDayOfWeek are integers. Set with:

startMonth is the start DST month. January is month 1. startWeekNumber is which week the DST starts. Its values are defined as:

DST_FirstWeekOfTheMonth: DST occurs in the 1st seven days of the month. DST_SecondWeekOfTheMonth: DST occurs in the 2nd seven days of the month. DST_ThirdWeekOfTheMonth: DST occurs in the 3rd seven days of the month. DST_FourthWeekOfTheMonth: DST occurs in the 4th seven days of the month. DST_LastWeekOfTheMonth: DST occurs in the last seven days of the month. DST_DayOfTheMonth: With this value, Day-of-Week becomes a day-of-month value.

StartDayOfWeek is which day of week (0 = Sunday, 6 = Saturday) DST happens, EXCEPT when startWeekNumber equals DST_DayOfTheMonth. In that case startDayOfWeek becomes a Day of month variable (1-31).

Set the DST Entry date.

errCode = setHC12ModuleDST_EndDate( fd, endMonth, endWeekNumber, endDayOfWeek); where endMonth, endWeekNumber and endDayOfWeek are integers. Set with:

endMonth is the end DST month. January is month 1. startWeekNumber is which week the DST ends. Its values are defined as:

DST_FirstWeekOfTheMonth: DST ending occurs in the 1st seven days of the month. DST_SecondWeekOfTheMonth: DST ending occurs in the 2nd seven days of the month. DST_ThirdWeekOfTheMonth: DST ending occurs in the 3rd seven days of the month. DST_FourthWeekOfTheMonth: DST ending occurs in the 4th seven days of the month. DST_LastWeekOfTheMonth: DST ending occurs in the last seven days of the month. DST_DayOfTheMonth: With this value, Day-of-Week becomes a day-of-month value.

EndDayOfWeek is which day of week (0 = Sunday, 6 = Saturday) DST ends, EXCEPT when startWeekNumber equals DST_DayOfTheMonth. In that case startDayOfWeek becomes a Day of month variable (1-31).

Set the time, in minutes, the DST entry and exit occurs.

errCode = setHC12ModuleDST_Hour( fd, dstMinute); where dstMinute is defined as an integer.

Set with dstMinutes equal to the time that dst entry/exit occurs (in minutes).

Set the Time Type (GPS, UTC, Standard or Local) used for DST testing.

errCode = setHC12ModuleDST_TimeType( fd, dstTimeType); where dstTimeType is defined as an integer.

Set dstTimeType with TYPE_UTC, TYPE_STANDARD, TYPE_LOCAL or TYPE_GPS.

Get the DST setup information.

errCode = getHC12ModuleDST_Settings( fd, &startMonth, &startWeekNumber, &startDayOfWeek, &endMonth, &endWeekNumber, &endDayOfWeek, &dstMinute, &dstTimeType); where startMonth, startWeekNumber, startDayOfWeek, endMonth, endWeekNumber, endDayOfWeek, dstMinute and dstTimeType are defined as integers. Definition for these variables are shown in the previous DST setting functions.


Get the DST State.

errCode = getHC12ModuleDST_State( fd, &dstState); where dstState is defined as an integer. returns values for dstState are: DST_NOT_APPLICABLE, DST_OFF, DST_PENDING_, DST_ON and DST_PENDING_OFF.

FREQSTEER:

Get the Frequency Steering Module description string.

This routine gets a short description for this module.

ErrCode = getHC12ModuleDescString(fd, SUB_MODULE_FREQSTEER, result); Where result is at string of size 64.


Get the FreqSteer’s “Locked to a Signal” flag.

This routine queries if the FreqSteer is locked to a timing/frequency source.

ErrCode = getHC12ModuleChannelLockFlags(fd, SUB_MODULE_FREQSTEER, lockedFlag); Where lockedFlag is at string of size 64.

Return values for lockedFlag is: “U” for unlocked.

“L” for locked.


Get the Distribution delay in terms of seconds. ErrCode = getHC12ModuleCableDelay(fd, SUB_MODULE_FREQSTEER, &cableDelay);

Where cableDelay is a float.

Returns with cable Delay set to the Distribution delay (in terms of seconds).

Set the Distribution delay in terms of seconds.

ErrCode = setHC12ModuleCableDelay(fd, SUB_MODULE_FREQSTEER, cableDelay); Where cableDelay is a float.

cableDelay is used to set to the Distribution delay (in terms of seconds).

Get the TAU for the system.

TAU is a measure of how slowly we control the oscillator. The larger the TAU, the slower we control the oscillator. ErrCode = getHC12ModuleTAU(fd, &tau); Where tau is a float.

Return with tau being set to the tau of the frequency control loop.


Get relative Bias Error from the Current Timing/Frequency Source to the main Oscillator.

errCode = getHC12ModuleBias(fd, SUB_MODULE_FREQSTEER, &bias);

where bias is a float.

Returns with bias being equal to the error (in fractions of a second) between the Current Timing/Frequency Source and the main oscillator 1pps.

Get the 24 Hour Drift rate.

errCode = getHC12Module24HrsDrift(fd, &driftIn24Hrs ); Where driftIn24Hrs is a float.

Returns the 24-hour drift rate of the oscillator.


Get the Current Oscillator.

errCode = getHC12ModuleOscillatorType( fd, &oscIndex);

Where oscIndex is defined as an integer.

Returns an index to which oscillator that we are using.


Get a description of an oscillator base on an index. errCode = getHC12ModuleOscillatorDescription( fd, oscIndex, resultDescrStr); Where oscInteger is an integer and resultDescrStr is a character array of size 256.

Called with oscIndex set to the oscillator type that we are trying to get a description of.

Returns with resultDescrStr having a string that describes the oscillator.


Get the maximum number of oscillator type that the HC12 has.

errCode = getHC12ModuleOscillatorMaxOscNumber( fd, &oscMax);

Where oscMax is defined as an integer.

Returns with oscMax containing the maximum oscillator number. So the oscillator numbers goes from zero to oscMax.


Set the Oscillator type.

errCode = setHC12ModuleOscillatorType( fd, oscIndex); Where oscIndex is defined as an integer.

Called with oscIndex set to the desired oscillator type.

Note: if jumper JP3 is removed, then the oscillator type will always be set to TXCO.


Get the RB Status. errCode = getHC12ModuleOscillatorTypeRbStatus( fd, rbStatus); Where rbStatus is a character array of size 256. Returned values for rbStatus are:

“L” : Rb oscillator is warmed up and ready to use.

“U” : Rb oscillator is not warmed up and is not ready.

“N” : This is not an Rb oscillator. Status is not valid.


Functions for testing only:

NOTE: Disabling of the FreqSteer Module allows the manual setting of the DAC.


Get the module enabled flag.

If the module is enabled, then it can steer the oscillator.

ErrCode = getHC12ModuleEnable( fd, SUB_MODULE_FREQSTEER,

enabledString);

enabledString is defined as a string of size 64.

Returns into the string enabledString either “Enabled” or “Disabled”.


Set the module enable flag. ErrCode = setHC12ModuleEnable( fd, SUB_MODULE_FREQSTEER, enabledString); enabledString is defined as a string of size 64.

If you want to enable the Freq Steer module, then copy the string “ON” to enabledString.

Else if you want to disabled Freq Steer, then copy the string “OFF” to enabledString.


CLOCK MANAGER:

Get the Clock Manager Module description string.

This routine gets a short description for this module.

ErrCode = getHC12ModuleDescString(fd, SUB_MODULE_CLOCK_MANAGER, result);

Get the current timing/frequency source.

errCode = getHC12ModuleClkMangCurrentSrc(fd, &steeringSrc);

where steeringSrc is an integer.

Returns with steeringSource being set to a value of SubModuleType_e. Examples returns would be SUB_MODULE_ONCORE_GPS or SUB_MODULE_Ext10Mhz.


Functions for testing only:


Get the forced condition for the Clock; Whether its forced to a certain timing/frequency source or not forced at all. errCode = getHC12ModuleClkMangForcedSrc(fd, &forcedClockSrc); where forcedClockSrc is an integer.

Returns with forcedClockSrc being set to:

  1. The clock is allowed to select it own timing/freq source.

Non-0) The number of the timing/frequency source that the clock is being forced to.


Forced the Clock to a timing/frequency source. errCode = setHC12ModuleClkMangForcedSrc(fd, forcedClockSrc); where forcedClockSrc is an integer. Set with forcedClockSrc:

0)The clock will be allowed to select it own timing/freq source.

Non-0) The number of the timing/frequency source that the clock will be forced to.


POSITION MANAGER:

IRIGB GENERATOR:

Get the IrigB Generator description string.

This routine gets a short description for this module.

ErrCode = getHC12ModuleDescString(fd, SUB_MODULE_IRIGB_GENERATOR, result); Where result is at string of size 64.


Set the IrigB Generator output type.

errCode = setHC12ModuleIrigOutputType( fd, irigType); Where irigType is defined as an integer. Called with irigType being set to:

0: For standard IrigB.

1: For TrueTime IrigB.

2: For 1344 IrigB.

Set the IrigB Generator output time type.

errCode = setHC12ModuleIrigOutputTimeType( fd, irigTimeType); Where irigTimeType is defined as an integer.

Set irigTimeType with TYPE_UTC, TYPE_STANDARD, TYPE_LOCAL or TYPE_GPS.

Get the IrigB Generator output type and time type.

errCode = getHC12ModuleIrigOutputSettings( fd, &irigType, &irigTimeType); Where irigType and irigTimeType are defined as integers.

Returns with irigType being set to 0: For standard IrigB.

1: For TrueTime IrigB.

2: For 1344 IrigB.

And irigTimeType with the value of TYPE_UTC, TYPE_STANDARD, TYPE_LOCAL or TYPE_GPS.


Set the drift window of the HC 12 in units of nanoseconds


errCode = setHC12ModuleUnlockDraftWindow( fd, driftWindow);


Inputs:

driftWindow:unsigned long.


Returns:


errCode, which may be

  • HC12PACKET_ERROR_NONE
  • HC12PACKET_ERROR_FORMAT
  • HC12PACKET_ERROR_CMD

Get the Saasm Receiver version number of the hardware


errCode = getHC12ModuleSaasm_RecvVersion_Hardware(fd, resultDescrStr);


Inputs:

resultDescrStr: char *, must already be allocated


Output:


errCode, which may be

  • HC12PACKET_ERROR_NONE
  • HC12PACKET_ERROR_FORMAT
  • HC12PACKET_ERROR_CMD

Get the Saasm Reciver's serial number:


errCode = getHC12ModuleSaasm_Recv_SerialNumber(fd, rsultDescrStr);


Inputs:

resultDescrStr: char *, must already be allocated


Output:


errCode, which may be

  • HC12PACKET_ERROR_NONE
  • HC12PACKET_ERROR_FORMAT
  • HC12PACKET_ERROR_CMD

Enable or disable the SAASM Simulation mode.


errCode = setHC12ModuleSimSaasm_Enable (fd, enableFlag, resultDescrStr)


Inputs:

enableFlag: int, set to 1 to set up Saasm mode in HC12 Code. The

SEEPROM must be configured for SAASM.

resultDescrStr: char *, must already be allocated


Output:


errCode, which may be

  • HC12PACKET_ERROR_NONE
  • HC12PACKET_ERROR_FORMAT
  • HC12PACKET_ERROR_CMD

Retrieve the Enable/Disable the SAASM Simulation mode.


errCode= getHC12ModuleSimSaasm_Enable (fd, enableFlag, resultDescrStr);


Inputs:

enableFlag: int *, set to 1 to set up Saasm mode in HC12 Code.


Output:

resultDescrStr: char *, must already be allocated

errCode, which may be

  • HC12PACKET_ERROR_NONE
  • HC12PACKET_ERROR_FORMAT
  • HC12PACKET_ERROR_CMD

Make HC12 believe it is keyed for a user-defined duration when in Saasm simulation writing a duration value.


errCode = setHC12ModuleSimSaasm_Key_With_Duration(fd, duration, resultDescrStr);


Inputs:

duration: int , minutes.


Output:

resultDescrStr: char *, must already be allocated

errCode, which may be

  • HC12PACKET_ERROR_NONE
  • HC12PACKET_ERROR_FORMAT
  • HC12PACKET_ERROR_CMD

Determine if the unit is keyed, and how much duration, in minutes, remains.


errCode=getHC12ModuleSimSaasm_Key_With_Duration(fd,keyed,duration, resultDescrStr);


Inputs:

duration: long * , minutes.


Output:

keyed: int *, must already be allocated.

duration: long * , minutes, must already be allocated

resultDescrStr: char *, must already be allocated

errCode, which may be

  • HC12PACKET_ERROR_NONE
  • HC12PACKET_ERROR_FORMAT
  • HC12PACKET_ERROR_CMD

Get HC 12 module Saasm anti-spoof status


errCode = getHC12ModuleSaasm_AntiSpoofStatus(fd, antiSpoofStruc, resultDescrStr)


Input:


Output:

antiSpoofStruc: pointer to a structure of type tMsgGPSAntiSpoof, defined in hc12ModuleDefs.h

resultDescrStr: char *, must already be allocated

errCode, which may be

  • HC12PACKET_ERROR_NONE
  • HC12PACKET_ERROR_FORMAT
  • HC12PACKET_ERROR_CMD

Set HC 12 Module Saasm anti-spoof zeroize


errCode = setHC12ModuleSaasm_AntiSpoofZeroize( fd, resultDescrStr)


Input:


Output:

resultDescrStr: char *, must already be allocated

errCode, which may be

  • HC12PACKET_ERROR_NONE
  • HC12PACKET_ERROR_FORMAT
  • HC12PACKET_ERROR_CMD

Set HC 12 Module Saasm Emergency Zeroize


errCode = setHC12ModuleSaasm_EmergencyZeroize( fd, resultDescrStr)


This function zeroizes the crypto-keys in the Saasm and everything else in the receiver.


Input:


Output:

resultDescrStr: char *, must already be allocated

errCode, which may be

  • HC12PACKET_ERROR_NONE
  • HC12PACKET_ERROR_FORMAT
  • HC12PACKET_ERROR_CMD

Get HC 12 Module Saasm GPS Track Code


errCode = getHC12ModuleSaasm_GpsTrackCode(fd,trackCode)


Input:


Output:

trackCode: char *, must be pre-allocated, returns tracking mode of receiver.

errCode, which may be

  • HC12PACKET_ERROR_NONE
  • HC12PACKET_ERROR_FORMAT
  • HC12PACKET_ERROR_CMD

Set HC 12 Module Saasm Anti-spoof select


errCode = setHC12ModuleSaasm_AntiSpoofSelect( fd, selectState)


Input:

selectSaate: int, 1 to set.


Output:

errCode, which may be

  • HC12PACKET_ERROR_NONE
  • HC12PACKET_ERROR_FORMAT
  • HC12PACKET_ERROR_CMD

Get HC 12 Module Saasm Mission Duration


errCode = getHC12ModuleSaasm_MissionDuration(fd, duration)


Input:


Output:

duration: int *, must be pre-allocated. This is the Saasm mission duration

errCode, which may be

  • HC12PACKET_ERROR_NONE
  • HC12PACKET_ERROR_FORMAT
  • HC12PACKET_ERROR_CMD

Set HC 12 Module Saasm Anti Spoof Select


errCode = setHC12ModuleSaasm_AntiSpoofSelect(fd, selectState)


Input:

selectState: int


Output:

errCode, which may be

  • HC12PACKET_ERROR_NONE
  • HC12PACKET_ERROR_FORMAT
  • HC12PACKET_ERROR_CMD

Get HC 12 Module Saasm Receiver Version Software


errCode = getHC12ModuleSaasm_RecvVersion_Softaware (fd, resultDescrStr)


This returns the Saasm Receiver's version number of the software.


Input:


Output:

resultDescrString: char *, must be pre-allocated

errCode, which may be

  • HC12PACKET_ERROR_NONE
  • HC12PACKET_ERROR_FORMAT
  • HC12PACKET_ERROR_CMD

Get the error from the receiver.


errCode = getHC12Module_Recv_Error(fd, whichModule,resultDescrStr,recvError);


Inputs:

whichModule: SubModuleType_e , defined in hc12ModuleDefs.h


Output:

resultDescrStr: char *, must already be allocated

recvError: int *, which must already be allocated. Returns 1 for receiver self test error, else 0.

errCode, which may be

  • HC12PACKET_ERROR_NONE
  • HC12PACKET_ERROR_FORMAT
  • HC12PACKET_ERROR_CMD

Set Leap Second Parameters


errCode = setHC12ModuleSystem_LeapSec_Params(fd, mode, dir, year, tempStr);


Inputs:

mode: int

dir: int

year: int


Output:

tempStr: char *, which must already be allocated.

errCode, which may be

  • HC12PACKET_ERROR_NONE
  • HC12PACKET_ERROR_FORMAT
  • HC12PACKET_ERROR_CMD

Get Leap Second Parameters


errCode = getHC12ModuleSystem_LeapSec_Params( fd, imode, dir, year, resultDescrStr)


Output:

mode: int *, must already be allocated

dir: int *, must already be allocated

year: int *, must already be allocated

resultDescrStr: char *, must already be allocated

errCode, which may be

  • HC12PACKET_ERROR_NONE
  • HC12PACKET_ERROR_FORMAT
  • HC12PACKET_ERROR_CMD

Clear HC 12 Module Leap Second History


errCode = clearHC12ModuleLeapSecondHistory(int fd, resultDescrStr)


Output:

resultDescrStr: char *, must already be allocated

errCode, which may be

  • HC12PACKET_ERROR_NONE
  • HC12PACKET_ERROR_FORMAT
  • HC12PACKET_ERROR_CMD

Get HC 12 Module Leap Second History


errCode = getHC12ModuleLeapSecondHistory(fd, leapSecApplied,resultDescrStr);


Output:

leapSecApplied: int *, must already be allocated

resultDescrStr: char *, must already be allocated

errCode, which may be

  • HC12PACKET_ERROR_NONE
  • HC12PACKET_ERROR_FORMAT
  • HC12PACKET_ERROR_CMD

Get Leap Second Event Time Src


errCode = getHC12ModuleLeapSecondEventTimeSrc(fd, timeSrc, resultDescrStr)


Output:

timeSrc: int *, must already be allocated

resultDescrStr: char *, must already be allocated

errCode, which may be

  • HC12PACKET_ERROR_NONE
  • HC12PACKET_ERROR_FORMAT
  • HC12PACKET_ERROR_CMD

Get HC 12 Receive Satellite List


errCode = getHC12ModuleRecvSatList(fd,whichModule,satListString);


Inputs:

whichModule: SubModuleType_e , defined in hc12ModuleDefs.h


Output:

satListString: char *, which must already be allocated.

errCode, which may be

  • HC12PACKET_ERROR_NONE
  • HC12PACKET_ERROR_FORMAT
  • HC12PACKET_ERROR_CMD

Reset the GPS Receiver

errCode = commandHC12ModuleRecvReset( fd, whichModule)

;


Input:

whichModule: SubModuleType_e , defined in hc12ModuleDefs.h


Output:

errCode, which may be

  • HC12PACKET_ERROR_NONE
  • HC12PACKET_ERROR_FORMAT
  • HC12PACKET_ERROR_CMD

Get HC 12 Module Oscillator DAC


errCode = getHC12ModuleOscillatorDAC(fd, dacOutputValue)


Output:

dacOutputValue: float *, must be previously allocated.

errCode, which may be

  • HC12PACKET_ERROR_NONE
  • HC12PACKET_ERROR_FORMAT
  • HC12PACKET_ERROR_CMD

Get IRIG special function field


errCode = getHC12ModuleIrigInputSpecialFuncFields( fd, resultString)


Output:

resultString: char *, which must be allocated. The result string is a string with 3 numbers. The first is the irig field that follows P5, the secona number follows P6 and the third number follows P7.

errCode, which may be

  • HC12PACKET_ERROR_NONE
  • HC12PACKET_ERROR_FORMAT
  • HC12PACKET_ERROR_CMD

Get HC 12 Module Frequency Steer Mode


errCode = getHC12ModuleFreqSteerMode( fd, steerMode)


Output:

steerMode: int *, which must be allocated.

errCode, which may be

  • HC12PACKET_ERROR_NONE
  • HC12PACKET_ERROR_FORMAT
  • HC12PACKET_ERROR_CMD

Set HC 12 Module Leap Second Information


errCode = setHC12ModuleLeapSecInfo(fd,leapSecInfo)


Input:

leapSecInfo: int


Output:

errCode, which may be

  • HC12PACKET_ERROR_NONE
  • HC12PACKET_ERROR_FORMAT
  • HC12PACKET_ERROR_CMD

Set HC 12 Module Current Position


errCode = setHC12ModuleCurrentPosition(int fd, SubModuleType_e whichModule,


int latSign, int latDegrees, int latMinutes, int latSeconds, int latMilliseconds,


int lonSign, int lonDegrees, int lonMinutes, int lonSeconds, int lonMilliseconds,


long alt )


Input:

whichModule: SubModuleType_e , defined in hc12ModuleDefs.h

latSign: int

latDegrees: int

latMinutes: int

latSeconds int;

latMilliseconds: int

lonSign: int

lonDegrees: int

lonSeconds: int

longMiliseconds: int

alt: int;


Output:

errCode, which may be

  • HC12PACKET_ERROR_NONE
  • HC12PACKET_ERROR_FORMAT
  • HC12PACKET_ERROR_CMD

Get test string from HC 12 Module


errCode = getHC12ModuleTest(fd,module,restDescrString)


Input:

module: int, which cast to SubModuleType_e , defined in hc12ModuleDefs.h inside the function.


Output:

resultDescrStr: char *, must already be allocated

errCode, which may be

  • HC12PACKET_ERROR_NONE
  • HC12PACKET_ERROR_FORMAT
  • HC12PACKET_ERROR_CMD

Write a byte to an area of the module


errCode = setHC12ModuleTestWriteByte(fd, module, address, aByte, resultDescrString)


Input:

module: int, which cast to SubModuleType_e , defined in hc12ModuleDefs.h inside the function.

address: uint

aByte: uint


Output:

resultDescrStr: char *, must already be allocated

errCode, which may be

  • HC12PACKET_ERROR_NONE
  • HC12PACKET_ERROR_FORMAT
  • HC12PACKET_ERROR_CMD

Get HC 12 Software Version Information


errCode = getHC12SW_Version( int fd, char *resultDescrString)


Output:

resultDescrStr: char *, must already be allocated

errCode, which may be

  • HC12PACKET_ERROR_NONE
  • HC12PACKET_ERROR_FORMAT
  • HC12PACKET_ERROR_CMD

Get HC 12 GPS TRAIM mode


errCode = getHC12ModuleGpsTraim( fd, whichModule, resultDescrString)


Input:

whichModule: SubModuleType_e , defined in hc12ModuleDefs.h inside the function.


Output:

resultDescrStr: char *, must already be allocated

errCode, which may be

  • HC12PACKET_ERROR_NONE
  • HC12PACKET_ERROR_FORMAT
  • HC12PACKET_ERROR_CMD

Set HC 12 GPS TRAIM mode


errCode = setHC12ModuleGpsTraim( fd, whichModule, resultDescrString)


Input:

whichModule: SubModuleType_e , defined in hc12ModuleDefs.h inside the function.


Output:

resultDescrStr: char *, must already be allocated

errCode, which may be

  • HC12PACKET_ERROR_NONE
  • HC12PACKET_ERROR_FORMAT
  • HC12PACKET_ERROR_CMD

Get HC 12 Module GPS TRAIM status


errCode = getHC12ModuleGpsTraimStatus( fd, whichModule, resultDescrString)


Input:

whichModule: SubModuleType_e , defined in hc12ModuleDefs.h inside the function.


Output:

resultDescrStr: char *, must already be allocated

errCode, which may be

  • HC12PACKET_ERROR_NONE
  • HC12PACKET_ERROR_FORMAT
  • HC12PACKET_ERROR_CMD

Set HC 12 Module Clock Epoch Time


errCode = setHC12ModuleClkEpochTime( fd, epochSec, resultDescrString)


Input:

epochSec: long


Output:

resultDescrStr: char *, must already be allocated

errCode, which may be

  • HC12PACKET_ERROR_NONE
  • HC12PACKET_ERROR_FORMAT
  • HC12PACKET_ERROR_CMD

Set HC 12 Date, Time in UTC time


errCode = setHC12ModuleDateTime(fd, month, day, year, hour, minute, second)


Input:

month: int

day: int

year: int

hour: int

minute: int

second: int


Output:

errCode, which may be

  • HC12PACKET_ERROR_NONE
  • HC12PACKET_ERROR_FORMAT
  • HC12PACKET_ERROR_CMD

Set HC 12 Module Clock Year


errCode = setHC12ModuleClkYear(fd, year, resultDescrString)


Input:

year: int


Output:

errCode, which may be

  • HC12PACKET_ERROR_NONE
  • HC12PACKET_ERROR_FORMAT
  • HC12PACKET_ERROR_CMD

Get HC 12 Module Clock Year


Input:


Output:

year: int *, must be previously allocated


Output:

errCode, which may be

  • HC12PACKET_ERROR_NONE
  • HC12PACKET_ERROR_FORMAT
  • HC12PACKET_ERROR_CMD

Get HC 12 GPS Module Override Mode – output GPS time instead of UTC time?


errCode = getHC12ModuleGPS_OverrideMode( fd, enable, resultDescrString)


Output:

enable: int *, must already be allocated

resultDescString: char *, must already be enabled

errCode, which may be

  • HC12PACKET_ERROR_NONE
  • HC12PACKET_ERROR_FORMAT
  • HC12PACKET_ERROR_CMD

Set HC 12 GPS Module to output GPS time instead of UTC time


errCode = setHC12ModuleGPS_OverrideMode( fd, enable, resultDescrString)


Input:

enable: int


Output:

resultDescString: char *, must already be enabled

errCode, which may be

  • HC12PACKET_ERROR_NONE
  • HC12PACKET_ERROR_FORMAT
  • HC12PACKET_ERROR_CMD

Get Enable/Disable for optional selection of timing sources


(Gets the enables/disables for optional selection of timing soruces using the priority list supplied via function setHC12ModuleSrcSelectList())


errCode = getHC12ModuleEnableSelByList( fd, resultDescrString)


Input:


Output:

resultDescString: char *, must already be enabled. Returns either the strong “ON” or “OFF”

errCode, which may be

  • HC12PACKET_ERROR_NONE
  • HC12PACKET_ERROR_FORMAT
  • HC12PACKET_ERROR_CMD

Get HC 12 Source Select List


This gets the optional priority list for sorting the timing source using a settable list.


errCode = getHC12ModuleSrcSelectList(fd, resultDescrString)


Input:


Output:

resultDescString: char *, must already be enabled.

errCode, which may be

  • HC12PACKET_ERROR_NONE
  • HC12PACKET_ERROR_FORMAT
  • HC12PACKET_ERROR_CMD

The return string is in the format of

A, DXX, DXX, DX, DXX

where:

  • A is the number of entries in the list
  • D is 'D'
  • XX and X are numeric digits that represent the timing sources and the priority order of them

So 3, D1, D24, D8 would be 3 entries of (1) GPS, (24) 10MHz and (8) Irig-B with the GPS having the highest priority, and Irig-B the lowest.


Set HC 12 Module Source Select List


This sets the optional priority list for sorting the timing source using a settable list.


errCode = setHC12ModuleSrcSelectList(fd,resultDescrString)


(Note in this case the resultDescrString is INPUT)


Input:

resultDescString: char *, must already be enabled.


The string is in the format of

A, DXX, DXX, DX, DXX

where:

  • A is the number of entries in the list
  • D is 'D'
  • XX and X are numeric digits that represent the timing sources and the priority order of them

So 3, D1, D24, D8 would be 3 entries of (1) GPS, (24) 10MHz and (8) Irig-B with the GPS having the highest priority, and Irig-B the lowest.


Output:

errCode, which may be

  • HC12PACKET_ERROR_NONE
  • HC12PACKET_ERROR_FORMAT
  • HC12PACKET_ERROR_CMD

Get HC 12 maximum number of timing sources that can be entere3d for timing source priority lists

errCode = getHC12ModuleMaxNumInSelectList( fd, resultDescrString)


Input:


output:

resultDescrStr: char *, must be pre-allocated.


Set HC 12 Module x86 bias


errCode = setHC12ModuleX86Bias(fd,lockFlag,bias,stratumNum,refid,leapSecState)


Input:

lockFlag: int

bias: double

stratumNum: int

refid: unsigned int

leapSecState: int


Output:

resultDescrStr: char *, must be pre-allocated

errCode, which may be

  • HC12PACKET_ERROR_NONE
  • HC12PACKET_ERROR_FORMAT
  • HC12PACKET_ERROR_CMD

Get HC 12 Module E1T1 Frequency select


Read what frequency and format the E1T1 chip is used.


errCode = getHC12ModuleE1T1_FreqSelect(fd,resultDescrStr)


Input:


Output:

resultDescrStr: char *, must be pre-allocated

Returned data is e1/t1 frequency and format. Example:

TYPE_E1_HD83_CRC4

errCode, which may be

  • HC12PACKET_ERROR_NONE
  • HC12PACKET_ERROR_FORMAT
  • HC12PACKET_ERROR_CMD

Set the HC 12 E1T1 Frequency Select


errCode = setHC12ModuleE1T1_FreqSelect(fd, freqSel, resultDescrStr)


Input:

freqSel: integration

OutputresultDescrStr: char *, must be pre-allocated.


Reset the E1T1 chip


errCode = setHC12ModuleE1T1_ResetHW(fd,resultDescrStr)


Input:


Output:

resultDescrStr: char *, must be pre-allocated.


Clear the RAM on the E1T1 chip


errCode = setHC12ModuleE1T1_ClarRam(fd, resultDescrStr)


Input:


Output:

resultDescrStr: char *, must be pre-allocated.

errCode, which may be

  • HC12PACKET_ERROR_NONE
  • HC12PACKET_ERROR_FORMAT
  • HC12PACKET_ERROR_CMD

Get HC 12 Module Irig AMDC Mode


errCode = getHC12ModuleIrigAMDC_Mode(fd, whichModule, resulDescrStr)


Input:

whichModule: SubModuleType_e , defined in hc12ModuleDefs.h


Output:

resultDescrStr: char *, must be pre-allocated

errCode, which may be

  • HC12PACKET_ERROR_NONE
  • HC12PACKET_ERROR_FORMAT
  • HC12PACKET_ERROR_CMD

Set HC 12 Module Irig Mode


errCode = setHC12ModuleIrigAMDC_Mode(fd, whichModule, resulDescrStr)


Input:

whichModule: SubModuleType_e , defined in hc12ModuleDefs.h


Output:

resultDescrStr: char *, must be pre-allocated

errCode, which may be

  • HC12PACKET_ERROR_NONE
  • HC12PACKET_ERROR_FORMAT
  • HC12PACKET_ERROR_CMD

Get HC 12 Module Low Frequency Ratio Stats


errCode = getHC12ModuleLFR_Stats(fd, resultDescrStr)


Input:


Output:

resultDescrStr: char *, must be pre-allocated

errCode, which may be

  • HC12PACKET_ERROR_NONE
  • HC12PACKET_ERROR_FORMAT
  • HC12PACKET_ERROR_CMD

The string returned contains two numbers. The first is a value from 0 to 1000. It tells the ratio of good read to all reads in units of .1%. The second number is set to 1 if there is a valid decode of the FLR signal since the last read of this info, and 0 if not.


Set HC 12 Alarm relay


errCode = setHC12ModuleSystem_AlarmRelay(fd, alarm, resultDescrStr)


Input:

alarm: int. Set to 1 to set alarm, 0 for no alarm


Output:

resultDescrStr: char * , must be pre-allocated

errCode, which may be

  • HC12PACKET_ERROR_NONE
  • HC12PACKET_ERROR_FORMAT
  • HC12PACKET_ERROR_CMD

Get HC 12 Alarm relay


errCode = getHC12ModuleSystem_AlarmRelay(fd, alarm, resultDescrStr)


Input:


Output:

alarm: int *, returns 1 if alarm set or 0 if no alarm. Must be pre-allocated.

resultDescrStr: char * , must be pre-allocated

errCode, which may be

  • HC12PACKET_ERROR_NONE
  • HC12PACKET_ERROR_FORMAT
  • HC12PACKET_ERROR_CMD

Set HC 12 alarm relay override


errCode = setHC12ModuleSystem_AlarmRelayOverride(fd, alarmOverride, resultDescrStr)


Input:

alarmOverride: int, 1 for alarm, 0 for no alarm, -1 for no override.


Output:

resultDescrStr: char *, must be pre-allocated

errCode, which may be

  • HC12PACKET_ERROR_NONE
  • HC12PACKET_ERROR_FORMAT
  • HC12PACKET_ERROR_CMD

Get HC 12 alarm relay override


errCode = getHC12ModuleSystem_AlarmRelayOverride(fd, alarmOverride, resultDescrStr)


Input:


Output:

alarmOverride: int *, contains 1 for alarm, 0 for no alarm, -1 for no override.

resultDescrStr: char *, must be pre-allocated

errCode, which may be

  • HC12PACKET_ERROR_NONE
  • HC12PACKET_ERROR_FORMAT
  • HC12PACKET_ERROR_CMD

Get Module battery status

errCode = getHC12ModuleBatteryStatus(fd, whichModule, battVoltLevel, batteryGood, resultDescrStr)


Input:

whichModule: SubModuleType_e , defined in hc12ModuleDefs.h


Output:

battVoltLevel: float *

batteryGood: int * (returns 0 if bad, 1 if good)

resultDescrStr: char *

errCode, which may be

  • HC12PACKET_ERROR_NONE
  • HC12PACKET_ERROR_FORMAT
  • HC12PACKET_ERROR_CMD

Translate timing name ot index)


nameIndex = translateTimingNameToIndex(name)


Input:

name: char *


Output:

nameIndex: int


The nameIndex is the index in the HC12ModuleNameTable structure where this table name resides.


translateTimingIndexToName(index)


input:

index: int


This function type is a char * and returns a pointer to the name of the HC 12 Module Name in the HC12ModuleNameTable structure.


Find Irig-B type name in table


irigInt = translateIrigBNameToIndex(name)


Input:

name: char *


Output:

irigInt: integer, location in the HC12IrigTable structure where this is located.


The type name is STANDARD, TRUETIME, 1344.


Find the Irig table name when index is known


translateIrigBIndexToName(index)


Input:

index: int


Output:

Function returns a pointer to the IRIG table name in the HC12IrigBNameTable structure.


Translate Time Type to an index value


tType = translateTimeTypeNameToIndex (name)


Input:

name: char * ; the type name is GPS, STANDARD, LOCAL, GPS


Output:

tType: int. This is the index location of the entry in the HC12TimeTypeNameTable.


Translate Time Type Index to Name


translateTimeTypeIndexToName(index)


Input:

index: int, location of time type index in HC12TimeTypeNameTable.


Output:

Function returns a char * of the Time Type (UTC, etc.)


Find auto/free name in table


indexInt = transateFreeAutoNameToIndex(name)


Input:

name: char *, containing Auto name


Output:

indexInt: int, location of entry in HC12FreeAutoNameTable


Translate Free Auto index to name


translateFreeAutoIndexToName(index)


Input:

index: integer, entry in HC1FreeAutoNameTable


Output:

Function returns char * pointer to name entry in structure.


Translate Oscillator Name to index


indexLoc = translateOscillatorNameToIndex(name)


Input:

name: char *, oscillator name such as TCXO, OCXO, RB

Output:

indexLoc: location of entry in HC12OscillatorNameTable


Translate time type Index to name


translateOscillatorIndexToName (index)


Input:

index: integer location


Output:

Function returns char * pointer to name entry in HC12OscillatorNameTable for this index.


Get HC 12 Module Unlock drift window


errCode = getHC12ModuleUnlockDraftWindow(fd, driftWindow)


Input:


Output:

driftWindow: unsigned long. This is the drift window in nanoseconds.

errCode, which may be

  • HC12PACKET_ERROR_NONE
  • HC12PACKET_ERROR_FORMAT
  • HC12PACKET_ERROR_CMD