diff options
Diffstat (limited to 'library')
-rw-r--r-- | library/CBSP_Templates.ttcn | 24 | ||||
-rw-r--r-- | library/CBSP_Types.ttcn | 19 | ||||
-rw-r--r-- | library/SABP_Adapter.ttcn | 4 |
3 files changed, 36 insertions, 11 deletions
diff --git a/library/CBSP_Templates.ttcn b/library/CBSP_Templates.ttcn index 5ee1f33b..5da29585 100644 --- a/library/CBSP_Templates.ttcn +++ b/library/CBSP_Templates.ttcn @@ -54,7 +54,7 @@ function tr_CbspChannelInd(template uint8_t val := ?) return template CBSP_IE { if (istemplatekind(val, "omit")) { ie := omit; } else if (istemplatekind(val, "*")) { - ie := tr_CBSP_IE({channel_ind := ?}) ifpresent; + ie := tr_CBSP_IE({channel_ind := ?}); //ifpresent; } else { ie := tr_CBSP_IE({channel_ind := val}); } @@ -542,14 +542,20 @@ template (value) CBSP_PDU ts_CBSP_KILL(template (value) uint16_t msg_id, ts_OldSerNo(old_ser_nr), ts_CbspCellList(cell_list), ts_CbspChannelInd(channel_ind)}); -template CBSP_PDU tr_CBSP_KILL(template uint16_t msg_id := ?, template uint16_t old_ser_nr := ?, - template BSSMAP_FIELD_CellIdentificationList cell_list := ?, - template uint8_t channel_ind := ?) := - tr_CBSP(CBSP_MSGT_KILL, { - tr_CbspMsgId(msg_id), - tr_OldSerNo(old_ser_nr), - tr_CbspCellList(cell_list), - tr_CbspChannelInd(channel_ind) }); +function tr_CBSP_KILL(template uint16_t msg_id := ?, template uint16_t old_ser_nr := ?, + template BSSMAP_FIELD_CellIdentificationList cell_list := ?, + template uint8_t channel_ind := ?) +return template (present) CBSP_PDU { + var template CBSP_IEs ies := { + tr_CbspMsgId(msg_id), + tr_OldSerNo(old_ser_nr), + tr_CbspCellList(cell_list) + }; + if (not istemplatekind(channel_ind, "omit")) { + ies[lengthof(ies)] := tr_CbspChannelInd(channel_ind); + } + return tr_CBSP(CBSP_MSGT_KILL, ies); +} /* 8.1.3.5 KILL COMPLETE */ function ts_CBSP_KILL_COMPL(template (value) uint16_t msg_id, template (value) uint16_t old_ser_nr, diff --git a/library/CBSP_Types.ttcn b/library/CBSP_Types.ttcn index c4c6cf25..5ab3c98b 100644 --- a/library/CBSP_Types.ttcn +++ b/library/CBSP_Types.ttcn @@ -378,5 +378,24 @@ external function enc_CBSP_PDU(in CBSP_PDU msg) return octetstring external function dec_CBSP_PDU(in octetstring msg) return CBSP_PDU with { extension "prototype(convert) decode(RAW)" }; +/* convert from warning period encoding to seconds */ +function f_cbsp_period2s(uint8_t period) return integer +{ + if (period == 0) { + return -1; /* infinite */ + } else if (period <= 10) { + return period; + } else if (period <= 20) { + return 10 + (period - 10)*2; + } else if (period <= 38) { + return 30 + (period - 20)*5; + } else if (period <= 86) { + return 120 + (period - 38)*10; + } else if (period <= 186) { + return 600 + (period - 86)*30; + } else { + return 0; + } +} } with { encode "RAW"; variant "FIELDORDER(msb)" } diff --git a/library/SABP_Adapter.ttcn b/library/SABP_Adapter.ttcn index e94e91cb..046f597c 100644 --- a/library/SABP_Adapter.ttcn +++ b/library/SABP_Adapter.ttcn @@ -20,7 +20,7 @@ import from SABP_CodecPort all; import from SABP_CodecPort_CtrlFunct all; import from IPL4asp_Types all; import from IPL4asp_PortType all; -//import from Socket_API_Definitions all; +import from Socket_API_Definitions all; const integer SABP_HDR_LEN := 3; @@ -72,7 +72,7 @@ private function f_aper_len_det(in octetstring stream, out integer len_len) retu * If the callback function detects that the it will be impossible to determine the length of the message, * even receiving more octets, should return "-2". In this case the connection will be closed and the * length calculation error will be reported. */ -private function f_APER_getMsgLen(in octetstring stream, inout ro_integer args) return integer { +private function f_APER_getMsgLen(in octetstring stream, inout Socket_API_Definitions.ro_integer args) return integer { var integer stream_len := lengthof(stream); var integer hdr_len := args[0]; var octetstring stream_nohdr; |