Fixes as requested

pull/14/head
Darjeeling 3 years ago
parent 8a63961092
commit 8d4e98a77d

@ -326,7 +326,7 @@ namespace p25
const uint8_t TSBK_OSP_ADJ_STS_BCAST = 0x3CU; // ADJ STS BCAST - Adjacent Site Status Broadcast const uint8_t TSBK_OSP_ADJ_STS_BCAST = 0x3CU; // ADJ STS BCAST - Adjacent Site Status Broadcast
const uint8_t TSBK_OSP_IDEN_UP = 0x3DU; // IDEN UP - Channel Identifier Update const uint8_t TSBK_OSP_IDEN_UP = 0x3DU; // IDEN UP - Channel Identifier Update
const uint8_t TSBK_OSP_STS_Q = 0x1AU; // STS_Q - Status Query const uint8_t TSBK_OSP_STS_Q = 0x1AU; // STS_Q - Status Query
const uint8_t TSBK_OSP_TIME_DATE_ANN = 0b110101; // TIME_DATE_ANN - Time and Date Announcement const uint8_t TSBK_OSP_TIME_DATE_ANN = 0x35U; // TIME_DATE_ANN - Time and Date Announcement
// TSBK Motorola Outbound Signalling Packet (OSP) Opcode(s) // TSBK Motorola Outbound Signalling Packet (OSP) Opcode(s)

@ -898,12 +898,12 @@ void TSBK::encode(uint8_t* data, bool rawTSBK, bool noTrellis)
std::chrono::system_clock::time_point now = std::chrono::system_clock::now(); std::chrono::system_clock::time_point now = std::chrono::system_clock::now();
time_t tt = std::chrono::system_clock::to_time_t( now ); time_t tt = std::chrono::system_clock::to_time_t( now );
tm local_tm = *gmtime( &tt ); tm local_tm = *gmtime( &tt );
unsigned long tmM = 0b000;//Month; +1 to account for tm_mon being 0-11 and p25 being 1-12 unsigned long tmM = 0b000;
unsigned long tmMDAY = 0b00000;//Day of month unsigned long tmMDAY = 0b00000;
unsigned int tmY = 0b0000000000000;//Year uint32_t tmY = 0b0000000000000;
unsigned int tmH = 0b00000;//Hour uint32_t tmH = 0b00000;
unsigned int tmMin = 0b000000;//Min uint32_t tmMin = 0b000000;
unsigned int tmS = 0b000000;//Second uint32_t tmS = 0b000000;
//Assign Values //Assign Values
tmM |= (local_tm.tm_mon + 1);//Month; +1 to account for tm_mon being 0-11 and p25 being 1-12 tmM |= (local_tm.tm_mon + 1);//Month; +1 to account for tm_mon being 0-11 and p25 being 1-12
@ -911,16 +911,14 @@ void TSBK::encode(uint8_t* data, bool rawTSBK, bool noTrellis)
tmY |= local_tm.tm_year;//Year tmY |= local_tm.tm_year;//Year
tmH |= local_tm.tm_hour;//Hour tmH |= local_tm.tm_hour;//Hour
tmMin |= local_tm.tm_min;//Min tmMin |= local_tm.tm_min;//Min
unsigned int i = local_tm.tm_sec; uint32_t i = local_tm.tm_sec;
unsigned long VFLAGS = 0b11100000; // VL,VT,VD, Res(leave 0),LTO direction, LTO unsigned long VFLAGS = 0xE0; // VL,VT,VD, Res(leave 0),LTO direction, LTO
unsigned long VLTO = 0b00000000; // LTO unsigned long VLTO = 0b00000000; // LTO
//Catch Leap Seconds //Catch Leap Seconds
if ( i > 59U ) if (i > 59U) {
{
tmS |= 59U; tmS |= 59U;
} else } else {
{
tmS |= i; tmS |= i;
} }
@ -928,7 +926,7 @@ void TSBK::encode(uint8_t* data, bool rawTSBK, bool noTrellis)
tmY = tmY - 100U; tmY = tmY - 100U;
//Shift Shift //Shift Shift
VFLAGS = VFLAGS << 56 ; VFLAGS = VFLAGS << 56 ; //Flags
VLTO = VLTO << 48; //LTO VLTO = VLTO << 48; //LTO
tmM = tmM << 44; //Month tmM = tmM << 44; //Month
tmMDAY = tmMDAY << 39; //Day of month tmMDAY = tmMDAY << 39; //Day of month
@ -939,9 +937,9 @@ void TSBK::encode(uint8_t* data, bool rawTSBK, bool noTrellis)
//Build tsbkValue //Build tsbkValue
tsbkValue = 0U; //Zero out tsbkValue tsbkValue = 0U; //Zero out tsbkValue
//Flags
tsbkValue = tsbkValue + VFLAGS; tsbkValue = tsbkValue + VFLAGS;
tsbkValue = tsbkValue + VLTO; //LTO tsbkValue = tsbkValue + VLTO;
//Date //Date
tsbkValue = tsbkValue + tmM; tsbkValue = tsbkValue + tmM;
tsbkValue = tsbkValue + tmMDAY; tsbkValue = tsbkValue + tmMDAY;
@ -951,16 +949,17 @@ void TSBK::encode(uint8_t* data, bool rawTSBK, bool noTrellis)
tsbkValue = tsbkValue + tmMin; tsbkValue = tsbkValue + tmMin;
tsbkValue = tsbkValue + tmS; tsbkValue = tsbkValue + tmS;
//Debug Stuff, Comment out or put in a #if DEBUG statement before push #if DEBUG_P25_TSBK
LogError( LOG_P25 , "TSBK_OSP_TIME_DATE_ANN (Dump Start)" ); LogError(LOG_P25 , "TSBK_OSP_TIME_DATE_ANN (Dump Start)");
LogError( LOG_P25 , "tsbkValue RAW= $%p" , tsbkValue ); LogError(LOG_P25 , "tsbkValue RAW= $%p" , tsbkValue);
LogError( LOG_P25 , "tmM= $%p" , tmM ); LogError(LOG_P25 , "tmM= $%p" , tmM);
LogError( LOG_P25 , "tmMDAY= $%p" , tmMDAY ); LogError(LOG_P25 , "tmMDAY= $%p" , tmMDAY);
LogError( LOG_P25 , "tmY= $%p" , tmY ); LogError(LOG_P25 , "tmY= $%p" , tmY);
LogError( LOG_P25 , "tmH= $%p" , tmH ); LogError(LOG_P25 , "tmH= $%p" , tmH);
LogError( LOG_P25 , "tmMin= $%p" , tmMin ); LogError(LOG_P25 , "tmMin= $%p" , tmMin);
LogError( LOG_P25 , "tmS= $%p" , tmS ); LogError(LOG_P25 , "tmS= $%p" , tmS);
LogError( LOG_P25 , "TSBK_OSP_TIME_DATE_ANN (Dump End)" ); LogError(LOG_P25 , "TSBK_OSP_TIME_DATE_ANN (Dump End)");
#endif
}break; }break;
default: default:

@ -1301,7 +1301,7 @@ void Trunk::writeRF_ControlData(uint8_t frameCnt, uint8_t n, bool adjSS)
break; break;
case 8: case 8:
// write TIME_DATE_ANN // write TIME_DATE_ANN
queueRF_TSBK_Ctrl( TSBK_OSP_TIME_DATE_ANN ); queueRF_TSBK_Ctrl(TSBK_OSP_TIME_DATE_ANN);
break; break;
} }
@ -1867,8 +1867,7 @@ void Trunk::queueRF_TSBK_Ctrl(uint8_t lco)
m_rfTSBK.setMFId(P25_MFG_DVM); m_rfTSBK.setMFId(P25_MFG_DVM);
break; break;
case TSBK_OSP_TIME_DATE_ANN: case TSBK_OSP_TIME_DATE_ANN:
if ( m_debug ) if ( m_debug ) {
{
LogMessage( LOG_RF , P25_TSDU_STR ", TSBK_OSP_TIME_DATE_ANN (Time Date Announce)" ); LogMessage( LOG_RF , P25_TSDU_STR ", TSBK_OSP_TIME_DATE_ANN (Time Date Announce)" );
} }
m_rfTSBK.setLCO( TSBK_OSP_TIME_DATE_ANN ); m_rfTSBK.setLCO( TSBK_OSP_TIME_DATE_ANN );

Loading…
Cancel
Save

Powered by TurnKey Linux.