Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions Control/SMSCB.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ void SMSCBSendMessage(sqlite3* DB, sqlite3_stmt* stmt, GSM::CBCHLogicalChannel*
while (dp<82) { thisPage[dp++] = 0; thisPage[dp++]='\r'; }
} else {
// 03.38 section 5
codingScheme = 0x10; // 7'
codingScheme = 0x01; // 7'
int buf = 0;
int shift = 0;
// The spec (above) says to put this language stuff in, but it doesn't work on my samsung galaxy y.
Expand Down Expand Up @@ -176,11 +176,13 @@ void* Control::SMSCBSender(void*)

while (1) {
// Get the next message ready to send.
const char* query =
char query[200];
sprintf(query,
"SELECT"
" GS,MESSAGE_CODE,UPDATE_NUMBER,MSGID,MESSAGE,LANGUAGE_CODE,SEND_COUNT,ROWID"
" FROM SMSCB"
" WHERE SEND_TIME==(SELECT min(SEND_TIME) FROM SMSCB)";
" WHERE SEND_TIME==(SELECT min(SEND_TIME) FROM SMSCB)"
" AND SEND_TIME<=%u", (unsigned)time(NULL));
sqlite3_stmt *stmt;
if (sqlite3_prepare_statement(DB,&stmt,query)) {
LOG(ALERT) << "Cannot access SMSCB database: " << sqlite3_errmsg(DB);
Expand Down
12 changes: 9 additions & 3 deletions GSM/GSML2LAPDm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1071,13 +1071,19 @@ void CBCHL2::l2WriteHighSide(const GSM::L3Frame& l3)
assert(l3.primitive()==UNIT_DATA);
assert(l3.size()==88*8);
L2Frame outFrame(DATA);
// Chop the L3 frame into 4 L2 frames.
// Chop the L3 frame into 4 L2 frames.
for (unsigned i=0; i<4; i++) {
outFrame.fillField(0,0x02,4);
// If it is the fourth frame, set the Last Block Bit to 0x03.
if(i==3){
outFrame.fillField(0,0x03,4);
}
else {
outFrame.fillField(0,0x02,4);
}
outFrame.fillField(4,i,4);
const BitVector2 thisSeg = l3.cloneSegment(i*22*8,22*8);
thisSeg.copyToSegment(outFrame,8);
OBJLOG(DEBUG) << "CBCHL2 outgoing L2 frame: " << outFrame;
OBJLOG(DEBUG) <<"Frame "<< i <<" of 4 " << "CBCHL2 outgoing L2 frame: " << outFrame;
mL2Downstream->writeHighSide(outFrame);
}
}
Expand Down
5 changes: 5 additions & 0 deletions GSM/GSMTAPDump.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@ void gWriteGSMTAP(unsigned ARFCN, unsigned TS, unsigned FN,
case GSM::SDCCH_4_0:
case GSM::SDCCH_4_1:
case GSM::SDCCH_4_2:
if(gConfig.getStr("Control.SMSCB.Table").length() != 0){
stype = GSMTAP_CHANNEL_CBCH52;
scn = to - GSM::SDCCH_4_0;
break;
}
case GSM::SDCCH_4_3:
stype = GSMTAP_CHANNEL_SDCCH4;
scn = to - GSM::SDCCH_4_0;
Expand Down