亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? pdu.cpp

?? 用一個開源碼ASCII ENCODE,DECODE,來發送ASCII短信
?? CPP
?? 第 1 頁 / 共 2 頁
字號:
#include <iostream>#include <string>#include <sstream>#include <stdlib.h>#include "pdu.h"using namespace std;using std::string;/** * string semiOctetToString ( string ) * --------------------------------------------------------------- * Converts a string representing semi-octets to an octet * string. *  * Example: * string semiOctetString = "123456789A"; * string MyString = semiOctetToString(semiOctetString); * cout << MyString << endl; *  * ( will result in 21436587A9 , being printed ) *  * */string pdu::semiOctetToString (string semiOctet) {	unsigned int i;	string OctetString;		for (i = 0; i < ( semiOctet.length() / 2 ); i++) {		OctetString += semiOctet.substr(i*2 + 1, 1);		OctetString += semiOctet.substr(i*2, 1);	}	return OctetString;}/** * string stringToSemiOctet ( string ) * --------------------------------------------------------------- * Converts a string to a semi-octet string, and if necessary * pad the original string with 'F' to make it compatible. *  * Example: * string OctetString = "123456789"; * string MyString = stringToSemiOctet(OctetString); * cout << MyString << endl; *  * ( will result in 21436587F9 , being printed ) *  * */string pdu::stringToSemiOctet (string StringData) {	if ( StringData.length() % 2 != 0 ) {		StringData += "F";	}		return semiOctetToString(StringData);}/** * int hexStringToInt ( string ) * --------------------------------------------------------------- * Converts a string representing a hexadecimal value to a an * integer *  * Example: * string HexString = "0A"; * int MyInt = hexStringToInt(HexString); * cout << MyInt << endl; *  * ( will result in 10 , being printed ) *  * */int pdu::hexStringToInt (string hexString) {	unsigned int i;	int charvalue;	int returnvalue = 0;		for (i = 0; i < hexString.length(); i++) {		if ( hexString[i] >= 'a' && hexString[i] <= 'f' ) {			charvalue = (int) hexString[i] - 87;		}		if ( hexString[i] >= 'A' && hexString[i] <= 'F' ) {			charvalue = (int) hexString[i] - 55;		}		if ( hexString[i] >= '0' && hexString[i] <= '9' ) {			charvalue = (int) hexString[i] - 48;		}		returnvalue += charvalue * ( pow(16, (int)(hexString.length() - (i + 1)) ));	}	return returnvalue;}/** * string intToHexString ( int ) * --------------------------------------------------------------- * Converts an integer to a string representing the hexadecimal value * of the integer. The result will be have a 0 prepended to make the * string length even. *  * Example: * int MyInt = 10; * string MyHex = intToHexString(MyInt); * cout << MyHex << endl; *  * ( will result in "0A" , being printed ) *  * */string pdu::intToHexString (int integer) {	string hexString = "";	/*	for (int i=2*sizeof(int) - 1; i>=0; i--) {		if ( ( (integer >> i*4) & 0xF ) != 0 )  {			hexString += "0123456789ABCDEF"[((integer >> i*4) & 0xF)];					}	}	if ( hexString.length() % 2 != 0 ){		hexString = "0" + hexString;	}	*/	//Changed Conversion from intToHex from above to below...	char buf[3];	sprintf(buf,"%X",integer);	hexString = (string)buf;	//Prepend a 0 when not even	if ( hexString.length() % 2 != 0 ){		hexString = "0" + hexString;	}		return hexString;}/** * int binStringToInt ( string ) * --------------------------------------------------------------- * Converts a string representing a binary value to a an * integer *  * Example: * string BinString = "01111"; * int MyInt = binStringToInt(BinString); * cout << MyInt << endl; *  * ( will result in 15 , being printed ) *  * */int pdu::binStringToInt (string binString) {		unsigned int pos;	int integerReturn = 0;	int base = 2;		for (pos = 0; pos < binString.length(); pos++) {		if ( binString.substr(pos, 1) == "1" ) {			integerReturn += pow(base, (binString.length() - (pos + 1)) );		}	}	return integerReturn;}/** * string intToBinString ( int ) * --------------------------------------------------------------- * Converts an integer to a string representing the binary value * of the integer. padded to make the string a multiple of 8 characters long *  * Example: * int MyInt = 16; * string MyBin = intToBinString(MyInt); * cout << MyBin << endl; *  * ( will result in "00010000" , being printed ) *  * */string pdu::intToBinString (int integer) {	string stringReturn;		if (integer <= 0) {		return "0";	}		while ( integer > 0 ) {		if ( integer % 2 == 1 ) {			stringReturn = "1" + stringReturn;			--integer;		} else {			stringReturn = "0" + stringReturn;		}		integer = integer / 2;	}	//Changed 8 to 7 because the characters are in septets	while ( stringReturn.length() % 7 != 0 ) {		stringReturn = "0" + stringReturn;	}	return stringReturn;}/** * int pow ( int, int ) * --------------------------------------------------------------- * Calculates int 1 to the power of int 2. *  * Example: * int MyInt1 = 10; * int MyInt2 = 2; * int MyResult = pow(MyInt1, MyInt2); * cout << MyResult << endl; *  * ( will result in 100 , being printed ) *  * */int pdu::pow(int n, int i){   if (i == 0)      return 1;   else if (i == 1)      return n;   else {      int partial = pow(n, i / 2);      if (i % 2 == 0)         return partial * partial;      else         return partial * partial * n;   }}/** * int parsePDU ( string ) * --------------------------------------------------------------- * Parses a string representing a SMS in PDU mode *  * Example: * pdu MyPDU; * int MyResult = MyPDU.parsePDU("ADGHJ....5F"); * cout << MyResult << endl; *  * ( will result in 1 , being printed if ok, -1 on failure ) *  * */void pdu::parsePDU(string pduString) {	int stringLocation = 0;				this->smsc_length = hexStringToInt(pduString.substr(stringLocation, 2));	stringLocation += 2;		if ( this->smsc_length != 0 ) {					this->smsc_type_of_address = hexStringToInt(pduString.substr(stringLocation, 2));		stringLocation += 2;				this->smsc_number = semiOctetToString( pduString.substr(stringLocation, ( this->smsc_length -1 ) * 2 ) );		if ( this->smsc_number[this->smsc_number.length() - 1 ] == 'F' ) {			this->smsc_number = this->smsc_number.substr(0, this->smsc_number.length() - 1);		}		stringLocation += ( this->smsc_length -1 ) * 2;	} else {				this->smsc_type_of_address = 0;		this->smsc_number = "0";	}		this->sms_deliver = hexStringToInt(pduString.substr(stringLocation, 2));	stringLocation += 2;		if (this->sms_deliver & 0x03) {				parsePDU_send(pduString.substr(stringLocation, (pduString.length() - stringLocation  )));	} else {		parsePDU_receive(pduString.substr(stringLocation, (pduString.length() - stringLocation )));	}}/** * void parsePDU_receive ( string ) * --------------------------------------------------------------- * Parses a string representing a SMS in PDU mode *  * Example: * pdu MyPDU; * int MyResult = MyPDU.parsePDU("ADGHJ....5F"); * cout << MyResult << endl; *  * ( will result in 1 , being printed if ok, -1 on failure ) *  * */void pdu::parsePDU_receive(string pduString) {	int stringLocation = 0;			// SENDER Lenght	this->sender_length = hexStringToInt(pduString.substr(stringLocation, 2));	stringLocation += 2;	if ( this->sender_length != 0 ) {		// SENDER Type of address		this->sender_type_of_address = hexStringToInt(pduString.substr(stringLocation, 2));		stringLocation += 2;				// SENDER Number		int evenSenderLength = this->sender_length + ( this->sender_length % 2 );		this->sender_number = semiOctetToString( pduString.substr(stringLocation, evenSenderLength ));		this->sender_number = this->sender_number.substr(0, this->sender_length);		stringLocation += evenSenderLength;	}	// PROTOCOL Identifier	this->tp_pid = hexStringToInt(pduString.substr(stringLocation, 2));	stringLocation += 2;	//DATA Coding scheme tp_dcs

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
黑人精品欧美一区二区蜜桃| 日韩一区中文字幕| 亚洲国产一区二区在线播放| 在线观看免费亚洲| 日韩精品五月天| 日韩午夜中文字幕| 国产麻豆一精品一av一免费 | 国产盗摄女厕一区二区三区| 久久亚洲一级片| 成人av免费在线观看| 亚洲美女精品一区| 欧美日韩国产大片| 国产伦精品一区二区三区免费迷 | 国产免费观看久久| 99久久精品免费看国产免费软件| 亚洲三级视频在线观看| 8x8x8国产精品| 国产资源在线一区| 亚洲欧美成人一区二区三区| 欧美日韩国产成人在线免费| 国内精品久久久久影院薰衣草| 中文字幕精品一区二区精品绿巨人| 一本久久综合亚洲鲁鲁五月天| 一区二区激情小说| 精品国产百合女同互慰| 99国产麻豆精品| 日韩精品一二三区| 国产精品乱码妇女bbbb| 欧美日韩色一区| 国产成人亚洲综合a∨婷婷| 亚洲激情自拍视频| 精品国产乱码久久久久久浪潮| 播五月开心婷婷综合| 亚洲国产综合在线| 国产精品日日摸夜夜摸av| 欧美日韩激情一区| 懂色av噜噜一区二区三区av| 亚洲国产三级在线| 国产免费成人在线视频| 欧美一卡二卡在线| 91精彩视频在线| 国产成人在线视频网站| 日韩精品一二三| 亚洲美女免费在线| 日本一区二区三区高清不卡| 337p亚洲精品色噜噜| 91亚洲资源网| 国产麻豆精品theporn| 日韩成人一级片| 亚洲欧美精品午睡沙发| 久久久高清一区二区三区| 欧美日韩精品欧美日韩精品一综合| 成人午夜av影视| 国产呦萝稀缺另类资源| 日韩精品五月天| 亚洲成人动漫在线观看| 亚洲色欲色欲www| 国产日产亚洲精品系列| 日韩午夜av一区| 91精品国产91综合久久蜜臀| 欧美专区亚洲专区| 一本到不卡免费一区二区| 国产a级毛片一区| 久久机这里只有精品| 人禽交欧美网站| 婷婷久久综合九色国产成人| 亚洲精品日日夜夜| 亚洲欧美日韩系列| 亚洲男人的天堂一区二区| 国产精品第四页| 中文字幕一区二区在线播放| 中文字幕精品三区| 国产精品免费看片| 国产精品美女久久久久av爽李琼 | 日韩女优毛片在线| 日韩欧美二区三区| 精品剧情v国产在线观看在线| 日韩视频一区二区| 亚洲精品一区二区三区香蕉| 精品国产免费久久| 久久亚洲综合色一区二区三区 | av在线不卡电影| 99视频超级精品| 一本久久精品一区二区| 欧美视频完全免费看| 在线不卡欧美精品一区二区三区| 欧美美女一区二区三区| 91精品国产欧美日韩| 精品1区2区在线观看| 久久久精品欧美丰满| 国产精品久久久久天堂| 怡红院av一区二区三区| 午夜精品福利一区二区三区av| 美国欧美日韩国产在线播放| 极品少妇一区二区三区精品视频| 国产精品91一区二区| 91免费视频网| 欧美日韩国产a| 久久九九全国免费| 亚洲美女屁股眼交3| 日韩激情视频网站| 国产成人在线看| 日本韩国精品在线| 精品剧情在线观看| 亚洲欧美日韩国产综合| 日韩电影一区二区三区四区| 国产91精品在线观看| 在线国产亚洲欧美| 欧美精品一区二区三区视频| 国产精品国产三级国产有无不卡| 亚洲午夜视频在线观看| 精品午夜久久福利影院 | 狠狠色狠狠色综合系列| 成人国产精品免费观看动漫 | 精品一区二区三区免费| 成人黄页在线观看| 欧美一卡2卡三卡4卡5免费| 中文字幕国产一区二区| 午夜精品久久久| 成人动漫一区二区在线| 欧美高清激情brazzers| 中文字幕 久热精品 视频在线| 亚洲高清免费视频| 成人一级视频在线观看| 欧美一区二区三区视频在线| 中文字幕在线不卡一区| 免费成人在线影院| 色哟哟一区二区| 久久免费午夜影院| 天涯成人国产亚洲精品一区av| 成人av午夜影院| 日韩精品影音先锋| 亚洲mv在线观看| 91小视频在线免费看| xfplay精品久久| 热久久免费视频| 欧美日韩午夜在线| 亚洲精品免费视频| 成人亚洲精品久久久久软件| 日韩欧美中文字幕一区| 亚洲午夜久久久久久久久电影网 | 亚洲午夜电影在线观看| 99久久精品国产导航| 久久久不卡网国产精品二区| 日本欧美一区二区三区乱码| 欧美综合久久久| 亚洲激情六月丁香| 本田岬高潮一区二区三区| 亚洲精品在线免费播放| 青青国产91久久久久久| 欧美视频在线不卡| 亚洲一二三专区| 色94色欧美sute亚洲线路一久| 亚洲图片激情小说| www.成人在线| 国产精品卡一卡二| 成人精品一区二区三区四区| 久久亚洲二区三区| 国产真实乱偷精品视频免| 日韩美女在线视频| 韩国精品在线观看| 26uuu另类欧美亚洲曰本| 精品写真视频在线观看| 久久综合色8888| 国产剧情一区二区三区| 国产亚洲欧美日韩在线一区| 国精产品一区一区三区mba桃花 | 国产亚洲精品aa午夜观看| 久久黄色级2电影| 26uuu精品一区二区| 精品一区二区三区欧美| 久久综合九色综合欧美就去吻| 国内一区二区在线| 国产清纯白嫩初高生在线观看91| 国内久久精品视频| 国产欧美日韩精品一区| 91免费国产视频网站| 亚洲美女屁股眼交3| 欧美日韩二区三区| 久久电影国产免费久久电影| 久久久高清一区二区三区| 成人午夜精品一区二区三区| 亚洲另类春色校园小说| 欧美三区在线视频| 精品在线免费观看| 国产精品国产a级| 色噜噜狠狠色综合欧洲selulu| 亚洲国产aⅴ天堂久久| 精品黑人一区二区三区久久| 国产精品自拍毛片| 亚洲男同性恋视频| 欧美美女激情18p| 激情国产一区二区| 国产精品久久久久婷婷| 欧美日韩国产精品成人| 国产精品1区2区3区在线观看| 亚洲欧洲日产国码二区| 91麻豆精品国产自产在线| 国产白丝网站精品污在线入口| 亚洲专区一二三|