bufrex_codec.h File Reference


Detailed Description

High level encoding and decoding functions.

#include <dballe/core/rawmsg.h>
#include <dballe/msg/msgs.h>
#include <dballe/bufrex/msg.h>

Go to the source code of this file.

Functions

dba_err bufrex_decode_bufr (dba_rawmsg raw, dba_msgs *msgs)
 Decode a BUFR message into a dba_msg.
dba_err bufrex_decode_crex (dba_rawmsg raw, dba_msgs *msgs)
 Decode a CREX message into a dba_msg.
dba_err bufrex_encode_bufr (dba_msgs msgs, int type, int subtype, int localsubtype, dba_rawmsg *raw)
 Encode a dba_msg into a BUFR message.
dba_err bufrex_encode_crex (dba_msgs msgs, int type, int subtype, dba_rawmsg *raw)
 Encode a dba_msg into a CREX message.
dba_err bufrex_msg_from_dba_msg (bufrex_msg raw, dba_msg msg)
 Fill in the bufrex_msg with the contents of a dba_msg.
dba_err bufrex_msg_from_dba_msgs (bufrex_msg raw, dba_msgs msgs)
 Fill in the bufrex_msg with the contents of a dba_msgs.
dba_err bufrex_msg_to_dba_msgs (bufrex_msg raw, dba_msgs *msgs)
 Fill in a dba_msgs with the contents of the bufrex_msg.
dba_err bufrex_infer_type_subtype (dba_msg msg, int *type, int *subtype, int *localsubtype)
 Infer good type and subtype from a dba_msg.


Function Documentation

dba_err bufrex_decode_bufr ( dba_rawmsg  raw,
dba_msgs msgs 
)

Decode a BUFR message into a dba_msg.

Parameters:
raw The message to decode
Return values:
msgs The decoded message
Returns:
The error status (See error.h)

References BUFREX_BUFR, DBA_RUN_OR_GOTO, and DBA_VERBOSE_STREAM.

dba_err bufrex_decode_crex ( dba_rawmsg  raw,
dba_msgs msgs 
)

Decode a CREX message into a dba_msg.

Parameters:
raw The message to decode
Return values:
msgs The decoded message
Returns:
The error status (See error.h)

References BUFREX_CREX, DBA_RUN_OR_GOTO, and DBA_VERBOSE_STREAM.

dba_err bufrex_encode_bufr ( dba_msgs  msgs,
int  type,
int  subtype,
int  localsubtype,
dba_rawmsg raw 
)

Encode a dba_msg into a BUFR message.

Parameters:
msgs The message to encode
type The type of the encoded message. Use 0 to let the encoder make a good choice.
subtype The subtype of the encoded message. Use 0 to let the encoder make a good choice.
Return values:
raw The raw encoded message
Returns:
The error status (See error.h)

References _bufrex_msg::bufr, BUFREX_BUFR, bufrex_infer_type_subtype(), _bufrex_bufr_info::centre, dba_error_consistency, DBA_RUN_OR_GOTO, DBA_VERBOSE_STREAM, _bufrex_msg::edition, _dba_msgs::len, _bufrex_bufr_info::local_table, _bufrex_msg::localsubtype, _bufrex_bufr_info::master_table, MSG_GENERIC, _dba_msgs::msgs, _bufrex_msg::opt, _bufrex_bufr_info::subcentre, _bufrex_msg::subtype, _dba_msg::type, and _bufrex_msg::type.

dba_err bufrex_encode_crex ( dba_msgs  msgs,
int  type,
int  subtype,
dba_rawmsg raw 
)

Encode a dba_msg into a CREX message.

Parameters:
msgs The message to encode
type The type of the encoded message. Use 0 to let the encoder make a good choice.
subtype The subtype of the encoded message. Use 0 to let the encoder make a good choice.
Return values:
raw The raw encoded message
Returns:
The error status (See error.h)

References BUFREX_CREX, bufrex_infer_type_subtype(), _bufrex_msg::crex, dba_error_consistency, DBA_RUN_OR_GOTO, DBA_VERBOSE_STREAM, _bufrex_msg::edition, _dba_msgs::len, _bufrex_msg::localsubtype, _bufrex_crex_info::master_table, MSG_GENERIC, _dba_msgs::msgs, _bufrex_msg::opt, _bufrex_msg::subtype, _bufrex_crex_info::table, _dba_msg::type, and _bufrex_msg::type.

dba_err bufrex_infer_type_subtype ( dba_msg  msg,
int *  type,
int *  subtype,
int *  localsubtype 
)

Infer good type and subtype from a dba_msg.

Parameters:
msg The message for which to infer the encoding template
Return values:
type The type of the encoding template to use
subtype The subtype of the encoding template to use
Returns:
The error indicator for the function (See error.h)

References bufrex_infer_type_subtype(), _bufrex_exporter::localsubtype, MSG_ACARS, MSG_AIREP, MSG_AMDAR, MSG_BUOY, MSG_GENERIC, MSG_METAR, MSG_PILOT, MSG_POLLUTION, MSG_SAT, MSG_SHIP, MSG_SYNOP, MSG_TEMP, MSG_TEMP_SHIP, _bufrex_exporter::subtype, _bufrex_exporter::type, and _dba_msg::type.

Referenced by bufrex_encode_bufr(), bufrex_encode_crex(), and bufrex_infer_type_subtype().

dba_err bufrex_msg_from_dba_msg ( bufrex_msg  raw,
dba_msg  msg 
)

Fill in the bufrex_msg with the contents of a dba_msg.

Parameters:
raw The bufrex message that will be filled with the data from msg
msg The dba_msg to take the data from
Returns:
The error indicator for the function (See error.h)

References BUFREX_BUFR, _bufrex_exporter::datadesc, DBA_RUN_OR_RETURN, _bufrex_msg::encoding_type, _bufrex_exporter::exporter, _bufrex_msg::localsubtype, _bufrex_msg::rep_day, _bufrex_msg::rep_hour, _bufrex_msg::rep_minute, _bufrex_msg::rep_month, _bufrex_msg::rep_year, _bufrex_msg::subtype, and _bufrex_msg::type.

dba_err bufrex_msg_from_dba_msgs ( bufrex_msg  raw,
dba_msgs  msgs 
)

Fill in the bufrex_msg with the contents of a dba_msgs.

Parameters:
raw The bufrex message that will be filled with the data from msg
msgs The dba_msgs to take the data from
Returns:
The error indicator for the function (See error.h)

References BUFREX_BUFR, _bufrex_exporter::datadesc, dba_error_consistency, DBA_RUN_OR_RETURN, _bufrex_msg::encoding_type, _bufrex_exporter::exporter, _dba_msgs::len, _bufrex_msg::localsubtype, _dba_msgs::msgs, _bufrex_msg::rep_day, _bufrex_msg::rep_hour, _bufrex_msg::rep_minute, _bufrex_msg::rep_month, _bufrex_msg::rep_year, _bufrex_msg::subtype, and _bufrex_msg::type.

dba_err bufrex_msg_to_dba_msgs ( bufrex_msg  raw,
dba_msgs msgs 
)

Fill in a dba_msgs with the contents of the bufrex_msg.

Parameters:
raw The bufrex message with the data to interpret
Return values:
msgs The dba_msgs with the interpreted data
Returns:
The error indicator for the function (See error.h)

References DBA_RUN_OR_GOTO, _bufrex_msg::localsubtype, _bufrex_msg::subsets, _bufrex_msg::subsets_count, and _bufrex_msg::type.


Generated on Sun May 18 19:18:02 2008 for libdballe by  doxygen 1.5.5