📄 caix.c
字号:
status = CAIX_DONE_S;
*msg_pos_ptr = msg_pos;
/* Update the position inside the message which is to be parsed */
return ( status );
}
/* <EJECT> */
/*===========================================================================
FUNCTION XLATE_EXT_REDIR_NUM_REC
DESCRIPTION
This function translates the Redirecting Number information record
appended to the Feature Notification Message on the Paging Channel, or
the Alert with Information or Flash with Information Messages on the
Forward Traffic Channels from the external to internal format.
DEPENDENCIES
Assumes that the buffer pointer received as an input to the
procedure points to the first bit of the subaddress record and the
internal message pointer points to the record.
RETURN VALUE
Errors that were encountered while translating the message.
SIDE EFFECTS
None
===========================================================================*/
word xlate_ext_redir_num_rec
(
word rec_len,
/* Length in bits of the information record to be parsed */
byte *buf_ptr,
/* Pointer to received message to be translated */
byte *msg_ptr,
/* Pointer to position inside the internal message type */
word *msg_pos_ptr
/* Pointer to position of record inside message */
)
{
word i;
/* Index for looping through neighbors */
word status;
/* Status to be returned to calling procedure */
word msg_pos;
/* Position of record inside the message */
word start_pos;
/* Temporary storage for the start point of the msg */
msg_pos = *msg_pos_ptr;
/* --------------------------------------------------------
** Redirecting Number info record
** -------------------------------------------------------- */
start_pos = msg_pos;
((caii_redir_rec_type *) msg_ptr)->fix.extension_bit1 =
b_unpackb( buf_ptr, msg_pos,
FSIZ( cai_redir_fix_type, extension_bit1 ));
msg_pos += FSIZ( cai_redir_fix_type, extension_bit1 );
((caii_redir_rec_type *) msg_ptr)->fix.number_type =
b_unpackb( buf_ptr, msg_pos,
FSIZ( cai_redir_fix_type, number_type ));
msg_pos += FSIZ( cai_redir_fix_type, number_type );
((caii_redir_rec_type *) msg_ptr)->fix.number_plan =
b_unpackb( buf_ptr, msg_pos,
FSIZ( cai_redir_fix_type, number_plan ));
msg_pos += FSIZ( cai_redir_fix_type, number_plan );
if( !((caii_redir_rec_type *) msg_ptr)->fix.extension_bit1 )
{
/* ---------------------------------------------------
** If EXTENSION_BIT1 is 0, the following is included
** --------------------------------------------------- */
((caii_redir_rec_type *) msg_ptr)->fix.extension_bit2 =
b_unpackb( buf_ptr, msg_pos,
FSIZ( cai_redir_fix_type, extension_bit2 ));
msg_pos += FSIZ( cai_redir_fix_type, extension_bit2 );
((caii_redir_rec_type *) msg_ptr)->fix.pi =
b_unpackb( buf_ptr, msg_pos,
FSIZ( cai_redir_fix_type, pi ));
msg_pos += FSIZ( cai_redir_fix_type, pi );
msg_pos += FSIZ( cai_redir_fix_type, reserved1 );
((caii_redir_rec_type *) msg_ptr)->fix.si =
b_unpackb( buf_ptr, msg_pos,
FSIZ( cai_redir_fix_type, si ));
msg_pos += FSIZ( cai_redir_fix_type, si );
/* ---------------------------------------------------
** If EXTENSION_BIT2 is ALSO 0, the following is included
** --------------------------------------------------- */
if( !((caii_redir_rec_type *) msg_ptr)->fix.extension_bit2 )
{
((caii_redir_rec_type *) msg_ptr)->fix.extension_bit3 =
b_unpackb( buf_ptr, msg_pos,
FSIZ( cai_redir_fix_type, extension_bit3 ));
msg_pos += FSIZ( cai_redir_fix_type, extension_bit3 );
msg_pos += FSIZ( cai_redir_fix_type, reserved2 );
((caii_redir_rec_type *) msg_ptr)->fix.redir_reason =
b_unpackb( buf_ptr, msg_pos,
FSIZ( cai_redir_fix_type, redir_reason ));
msg_pos += FSIZ( cai_redir_fix_type, redir_reason );
}
}
((caii_redir_rec_type *) msg_ptr)->fix.num_char =
(byte) (((rec_len - (msg_pos - start_pos))
/ sizeof( cai_redir_var_type )));
for (i=0;
i < ((caii_redir_rec_type *) msg_ptr)->fix.num_char; i++)
{
(( caii_redir_rec_type*) msg_ptr)->var[i] =
b_unpackb( buf_ptr, msg_pos,
FSIZ( cai_redir_var_type, chari ));
msg_pos += FSIZ( cai_redir_var_type, chari );
}
status = CAIX_DONE_S;
*msg_pos_ptr = msg_pos;
/* Update the pointer position inside the message which is
being parsed */
return ( status );
}
/* <EJECT> */
/*===========================================================================
FUNCTION XLATE_EXT_PARA_ALERT_REC
DESCRIPTION
This function translates the Parametric Alerting information record
appended to the Feature Notification Message on the Paging Channel, or
the Alert with Information or Flash with Information Messages on the
Forward Traffic Channels from the external to internal format.
DEPENDENCIES
Assumes that the buffer pointer received as an input to the
procedure points to the first bit of the subaddress record and the
internal message pointer points to the record.
RETURN VALUE
Errors that were encountered while translating the message.
SIDE EFFECTS
None
===========================================================================*/
word xlate_ext_para_alert_rec
(
word rec_len,
/* Length in bits of the information record to be parsed */
byte *buf_ptr,
/* Pointer to received message to be translated */
byte *msg_ptr,
/* Pointer to position inside the internal message type */
word *msg_pos_ptr
/* Pointer to position of record inside message */
)
{
word i;
/* Index for looping through neighbors */
word status;
/* Status to be returned to calling procedure */
word msg_pos;
/* Position of record inside the message */
msg_pos = *msg_pos_ptr;
/* --------------------------------------
** Parametric Alerting Information Record
** -------------------------------------- */
((caii_para_alert_rec_type *) msg_ptr)->fix.cadence_cnt =
b_unpackb( buf_ptr, msg_pos,
FSIZ( cai_para_alert_fix_type, cadence_cnt ));
msg_pos += FSIZ( cai_para_alert_fix_type, cadence_cnt );
((caii_para_alert_rec_type *) msg_ptr)->fix.num_groups =
b_unpackb( buf_ptr, msg_pos,
FSIZ( cai_para_alert_fix_type, num_groups ));
/* Range check */
if(((caii_para_alert_rec_type *) msg_ptr)->fix.num_groups
> CAII_PARA_ALERT_MAX )
{
((caii_para_alert_rec_type *) msg_ptr)->fix.num_groups =
CAII_PARA_ALERT_MAX;
}
msg_pos += FSIZ( cai_para_alert_fix_type, num_groups );
for (i=0;
i < ((caii_para_alert_rec_type *) msg_ptr)->fix.num_groups;
i++)
{
((caii_para_alert_rec_type *) msg_ptr)->var[i].amplitude =
b_unpackb( buf_ptr, msg_pos,
FSIZ( cai_para_alert_var_type, amplitude ));
msg_pos += FSIZ( cai_para_alert_var_type, amplitude );
((caii_para_alert_rec_type *) msg_ptr)->var[i].freq_1 =
b_unpackw( buf_ptr, msg_pos,
FSIZ( cai_para_alert_var_type, freq_1 ));
msg_pos += FSIZ( cai_para_alert_var_type, freq_1 );
((caii_para_alert_rec_type *) msg_ptr)->var[i].freq_2 =
b_unpackw( buf_ptr, msg_pos,
FSIZ( cai_para_alert_var_type, freq_2 ));
msg_pos += FSIZ( cai_para_alert_var_type, freq_2 );
((caii_para_alert_rec_type *) msg_ptr)->var[i].on_time =
b_unpackb( buf_ptr, msg_pos,
FSIZ( cai_para_alert_var_type, on_time ));
msg_pos += FSIZ( cai_para_alert_var_type, on_time );
((caii_para_alert_rec_type *) msg_ptr)->var[i].off_time =
b_unpackb( buf_ptr, msg_pos,
FSIZ( cai_para_alert_var_type, off_time ));
msg_pos += FSIZ( cai_para_alert_var_type, off_time );
((caii_para_alert_rec_type *) msg_ptr)->var[i].repeat =
b_unpackb( buf_ptr, msg_pos,
FSIZ( cai_para_alert_var_type, repeat ));
msg_pos += FSIZ( cai_para_alert_var_type, repeat );
((caii_para_alert_rec_type *) msg_ptr)->var[i].delay =
b_unpackb( buf_ptr, msg_pos,
FSIZ( cai_para_alert_var_type, delay ));
msg_pos += FSIZ( cai_para_alert_var_type, delay );
}
#ifdef FEATURE_IS2000_REL_A
#error code not present
#endif /* FEATURE_IS2000_REL_A */
msg_pos += 4; /* Increment past reserved bit at end */
status = CAIX_DONE_S;
*msg_pos_ptr = msg_pos;
/* Update the pointer position inside the message which is
being parsed */
return ( status );
}
/* <EJECT> */
/*===========================================================================
FUNCTION XLATE_EXT_EXT_DISP_REC
DESCRIPTION
This function translates the Extended Display information record
appended to the Feature Notification Message on the Paging Channel, or
the Alert with Information or Flash with Information Messages on the
Forward Traffic Channels from the external to internal format.
DEPENDENCIES
Assumes that the buffer pointer received as an input to the
procedure points to the first bit of the subaddress record and the
internal message pointer points to the record.
RETURN VALUE
Errors that were encountered while translating the message.
SIDE EFFECTS
Updates the msg_ptr to point to the first byte past the translated
message.
===========================================================================*/
word xlate_ext_ext_disp_rec
(
word rec_len,
/* Length in bits of the information record to be parsed */
byte *buf_ptr,
/* Pointer to received message to be translated */
byte **message_ptr,
/* Pointer to pointer to position inside the internal message type */
word *msg_pos_ptr
/* Pointer to position of record inside message */
)
{
word i;
/* Index for looping through neighbors */
word status;
/* Status to be returned to calling procedure */
word msg_pos;
/* Position of record inside the message */
byte *rec_ptr;
/* Pointer to position */
word end_pos;
/* Temporary storage for the end point of the msg */
word len;
/* temp storage for length of subrecord */
byte *msg_ptr;
/* temp storage for message pointer */
msg_ptr = *message_ptr;
msg_pos = *msg_pos_ptr;
end_pos = rec_len + msg_pos; /* End Position of this record */
status = CAIX_DONE_S;
/* ------------------------------
** Extended Display Info Record
** ------------------------------ */
((caii_ext_disp_type *) msg_ptr)->fix.ext_display_ind =
b_unpackb( buf_ptr, msg_pos,
FSIZ( cai_ext_disp_fix_type, ext_display_ind ));
msg_pos += FSIZ( cai_ext_disp_fix_type, ext_display_ind );
((caii_ext_disp_type *) msg_ptr)->fix.display_type =
b_unpackb( buf_ptr, msg_pos,
FSIZ( cai_ext_disp_fix_type, display_type ));
msg_pos += FSIZ( cai_ext_disp_fix_type, display_type );
((caii_ext_disp_type *) msg_ptr)->fix.rec_len = 0;
#ifdef FEATURE_MSG_PACK_UNIT_TEST
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -