کلینیک فوق تخصصی اکسس ( کاربرد vba در اکسس )

کلینیک فوق تخصصی اکسس ( کاربرد vba در اکسس )

به اشتراک گذاری اطلاعات کسب شده در اکسس از سایت آفیس و سایت های تخصصی خارجی
کلینیک فوق تخصصی اکسس ( کاربرد vba در اکسس )

کلینیک فوق تخصصی اکسس ( کاربرد vba در اکسس )

به اشتراک گذاری اطلاعات کسب شده در اکسس از سایت آفیس و سایت های تخصصی خارجی

موجودیت و صفات در اکسس ( نمودار Relationship )







در نمودار ER ( روابط موجودیت ) بالا موجودیت ( جدول ) با Rectangle یا مستطیل و صفات ( فیلدهای جدول ) با بیضی نمایش داده شده



صفت ( Attribute ) :


یک صفت ویژگی یک موجودیت ( Entity ) را توصیف میکند.یک صفت در نمودار ER یا Entity Relationship با یک بیضی نمایش داده می شود.چهار نوع صفت وجود دارد:

1-صفت کلید

2-صفت ترکیبی

3-صفت یا ویژگی چند مقداری ( فیلد Multivalued )

4-صفت مشتقی



1-صفت کلید (Key attribute) :


این صفت می تواند بصورت یکتا یک موجودیت  را از یک مجموعه موجودیت مشخص نماید.برای مثال شماره گردش دانشجو می تواند بصورت یکتا و یونیک یک دانشجو از مجموعه دانشجویان را تعیین نماید.صفت کلید با بیضی بعنوان سایر صفات نمایش داده می شود اگر چه متن صفت کلید را Undeline می کنند.( یعنی صفت در بیضی است و یک خط ممتد زیر متن آن کشیده می شود)


 



2-صفت ترکیبی ( Composite attribute ) : 


صفتی (Attribute) که ترکیبی از صفات دیگر است بعنوان صفت ترکیبی یا composite attribute شناخته می شود.برای مثال در موجودیتِ ( entity ) ( منظور table در اکسس ) دانشجو ، آدرس یک صفت ترکیبی است که از صفات دیگری تشکیل شده مثل پین کُد ، ایالت و کشور.



3-صفت چندمقداری ( Multivalued ) :


صفتی که قابلیت نگهداری چند مقدار را در خود دارد که در نمودار ER با دو تا بیضی نمایش داده می شود. برای مثال یک شخص می تواند بیش از یک شماره تلفن داشته باشد بنابراین Phone number صفتی چندمقداری است.


4-صفت مشتقی :

صفت مشتق شده ، صفتی است که مقدر آن پویا (Dynamic) بوده و از ویژگی دیگری مشتق شده است.درنمودار ER با یک بیضی چین دار( خط چین ) نمایش داده می شود.برای مثال سن فرد (Age) یک ویژگی مشتق شده است زیرا در طول زمان تغییر می کند و می تواند از ویژگی دیگری ( DateOfBirth) مشتق شود.











دریافت داده از ترازو ( Scale )




NETComm6.Output = "p" & Chr(13) 'send PRINT command to the scale.
Dim Buffer As String 'define Buffer    
Buffer$ = Buffer$ & NETComm6.InputData 'wait for the data come into the serial port    
WtInfo = Buffer

And i got this
80 00 000S99291235 F80 00 000S99291236 E80 00 000S99291237 D80 00 000S99291238 K80 00 000S9929123



Weight = Wtarray(0)   // assuming the weight is in the 1st position 




Vbcrlf

-Command: SI + CR + LF (53h, 49h, 0Dh, 0Ah)

Response: <LONG> (after establishing stable value)


-Command for Print

Command: SP + <Weight> + CR + LF

Response: <print>


-Enquiry for current weight value

Command: Sx1 + CR + LF

Response: <LONG>













I have a Magellan scanner/scale. It is connected to my pc through rs232. I can read the weight on the scale by sending the command S11 + ENTER in Hyperterminal program and the weight shows on Hyperterminal with no problems at all.



SI + ENTER





7bit


شاتوت (شاه توت : غرب آسیا ) دارای قند طبیعی و سرشار از ویتامین ها مثل کلسیم ، پتاسیم و منیزیم ... ضدسرطان .. پاک کردن روده ها و رفع یبوست ( نه مزمن )




GSM 03.40


SEND SMS through At Command



00150008810100358500600831c7321d14be87f320b3fcdd06a1cbf23228dd6e97c9e930bdccce87422194f6fd2683cc6179580e5abfdd29


TP-UDL : 31(hex) 3×16+1=49

TP-UD :

c7321d14be87f320b3fcdd06a1cbf232

28dd6e97c9e930bdccce87422194f6fd

2683cc6179580e5abfdd29


-Decode UD

--bring hexes from the last to the first 

29ddbf......C7

--Convert hexes to binary (8bit)

0010100111011101....11000111

29(00101001)

--Remove zero(s) at the left

43×8-Int(43×(8/7))×7=1

--Arrange binaries in 7bit

--Convert binary to hex

--Arrange hexes from the last to the first

--Convert hexes to string





Encoding :

Hex_Count=49

Add Zero(s) at the left

[int(48×(7/8))+1]×8-49×7=1 Zero

Arrange binaries in 8bit

Decoding :

Hex_Count : 43

Remove Zero(s) at the first

How many?

43×8-int(43×(8/7))×7=1 Zero

Arrange binaries in 7bit



کاهش شدید ارزش پولی ظرف فقط ۲۰ ماه




رسول خدا در خطبه ای فرمود:  أَیُّهَا النَّاسُ إِیَّاکُمْ وَ خَضْرَاءَ الدِّمَنِ ای مردم از سبزه مزبله پرهیز کنید.

سؤال شد: "خضراء الدمن= سبزه مزبله"  چیست؟

پیامبر فرمود:  الْمَرْأَةُ الْحَسْنَاءُ فِی مَنْبِتِ السَّوْءِ

زن زیبا رو و رعنا که در محیط نامناسب پرورش یافته و پرورده محیط نامناسب اعتقادی و اخلاقی است. (1)

پس خضراء الدمن یعنی دختران  زیبارویی که در خانواده و محیط ناپاک رشد یافته و گر چه زیبا و رعنا و ماننده سبزه بهار خوش آب و رنگ هستند، ولی ناپاک اند. از لحاظ اخلاق و پای بندی  به عفت و حیا، با توجه به تربیت ناپاکی که داشته اند ، نمره قبولی نمی گیرند.



امکان رشد مجدد دندان‌ها به صورت نامحدود

تا کنون تمام آزمایشات بر روی موش‌های مبتلا به این بیماری دندانی انجام شده است. در طی مطالعات، محققان ژنی را کشف کردند که پروتئینی را که در رشد یا عدم رشد دندان نقش دارد، رمزگذاری می‌کند. محققان دریافتند موش‌هایی که فاقد ژن خاصی هستند، تعداد دندان‌هایشان افزایش یافته است. پروتئینی به نام (USAG-۱) که توسط این ژن سنتز شده است، رشد دندان‌ها را محدود می کند.

هنگامی که همه چیز طبیعی باشد، روند رشد پس از جایگزینی دائمی دندان متوقف می‌شود، بر این اساس دانشمندان با تمرکز بر روی این پروتئین آنتی بادی را تولید کردند که می‌تواند به طور موقت از عملکرد این پروتئین جلوگیری کرده و به دندان‌های جدید اجازه رشد دوباره بدهد.



کامنت یکی از شهروندان در بهبودی با لیزر :

سلام.لیزر پرتوان وکم‌توان به جز هزینه ی زیادی که برای بیمار دارد.هیچ خاصیت دیگری در درمان آن ندارد و فقط بعنوان تکنولوژی جدید جیب بیماران را به نفع صاحب دستگاه لیزر خالی میکنند.که اتفاقا همان فیزیوتراپی اثر خیلی بهتری در درمان دارد.
بعد از ده جلسه لیزرپرتوان و نداشتن یک سر سوزن اثر .پزشک معالج همان فیزیوتراپی را تجویزکردند و از بیماران دیگر هم که از لیزر استفاده کرده اند .سوال کردم که هیچکدام راضی نبوده اند و هیچ خاصیتی نداشته. بجز خالی کردن جیب بیمار . واقعا متاسفم برای افرادی که از این دستگاه بعنوان درمان استفاده می کنند و جیب بیماران را خالی میکنن.و متاسفانه پزشکان هم آنها را به این لیزر هدایت میکنند.
لطفا این مطلب رامنتشر کنید که حداقل بقیه بیماران گرفتار این دام لیزر نشوند.




























TP-DCS



26 خرداد 1402 

نتایج طرح فروش خودرو در سامانه یکپارچه اعلام شد و طی آن شاهد هستیم که برای بسیاری از متقاضیان، خودرویی تخصیص نیافته است و بسیاری دیگر نیز باید خودروهای خود را در زمستان ۱۴۰۳ تحویل بگیرند که این مسئله با قول هایی که پیش از این برای تحویل فوری خودروها به مردم داده شده بود کاملاً متناقض است.





11110010 : F2

F0 (240) GSM 7bit  Class 0 (Flash Message)

F1(241)  GSM 7bit Class 1 (ME-specific)

F2(242) GSM 7bit Class 2 (SIM/USIM specific)

F3(243) GSM 7bit Class 3 (TE-specific)

F4(244) 8 bit data Class 0 ( Flah message)

E3(227)    UCS2       Other Inactive

18(decimal:24)   Class 0 (Flash Msg)


76543210<<<Bits

00101000<<<Binary


Coding Group Bits 7..4 :

-00xx : Like 0001 : General Data Coding indication

--Bit 3..0

General Data Coding indication
Bits 5..0 indicate the following:
Bit 5
0    Text is uncompressed
1     Text is compressed
Bit 4
  0  Bits 1 and 0 are reserved and have no message class meaning
1    Bits 1 and 0 have a message class meaning
Bit3 Bit2   Alphabet being used
  0             0            Default alphabet
  0             1           8 bit data

  1             0           UCS2 (16bit)

  1             1            Reserved
Bit1 Bit0  Message class   Description
  0               0              Class 0                    Immediate display (alert)
  0               1              Class 1                         ME specific
  1               0              Class 2                         SIM specific
  1               1              Class 3                          TE specific


NOTE: The special case of bits 7..0 being 0000 0000 indicates the Default Alphabet as in Phase 2



-0100 ... 0111 : Message Marked for Automatic Deletion

-1100Message Waiting Indication Group: Discard Message

--Bits 3..0 are coded in exactly the same way as Group 1101, however, with bits 7..4 set to 1100 the mobile may discard the contents of the message, and only present the indication to the user.


00150008810100358500CB0002C834

CB : 1100  1011

(1011)

Bits1,0 : 11 : Other Message

Bit2 only set to 0

Bit 3 : Set Indication Active



-1101Message Waiting Indication Group: Store Message ( Only 7 bit)

-- This Group allows an indication to be provided for the user about the status of types of message waiting on systems connected to the GSM PLMN. The mobile may present this indication as an icon on the screen, or another MMI indication. The mobile may take note of the Origination Address for the message in this group and group 1100. For each indication supported, the mobile may provide storage for the Origination Address which is to control the mobile indication.

Text included in the user data is coded in the Default Alphabet.
Where a message is received with bits 7..4 set to 1101, the mobile will store the text of the SMS message in addition to setting the indication.
Bit 3           Descrption
   0         Set Indication Inactive
   1         Set Indication Active



Bit1  Bit0    Indication Type
   1       0      Voicemail Message Waiting
   0       1      Fax Message Waiting
   1       0      Electronic Mail Message Waiting
   1      1      Other Message Waiting

Bit 2 is reserved , and set to 0


* Mobile manufacturers may implement the "Other Message Waiting" indication as an additional indication without specifying the meaning. The meaning of this indication is intended to be standardized in the future, so Operators should not make use of this indication until the standard for this indication is finalized.



-1110Message Waiting Indication Group: Store Message (Only UCS2)

--The coding of bits 3..0 and functionality of this feature are the same as for the Message Waiting Indication Group above, (bits 7..4 set to 1101) with the exception that the text included in the user data is coded in the uncompressed UCS2 alphabet.


-1111Data coding/message class (Only GSM 7 bit & 8 bit data)

Bit 3 is reserved , set to 0

Bit2 Message coding

0             Default alphabet

1             8-bit data

Bit1 Bit0 Message Class  Description

0           0           Class 0                   Immediately

display(alert)

0          1          Class 1                  Me specific

1          0          Class 2                  SIM specific

1          1          Class 3                  TE specific



F0(240) GSM 7 bit Class 0 (Flash message)            -

F1(241) GSM 7 bit Class 1 (ME-specific)                   -

F2(242) GSM 7 bit Class 2 (SIM/USIM-specific) -

F3(243) GSM 7 bitClass 3 (TE-specific)                      -

F4(244) 8 bit data Class 0 (Flash message)             -

F5(245) 8 bit data Class 1 (ME-specific)                    -

F6(246) 8 bit data Class 2 (SIM/USIM-specific)  -

F7(247) 8 bit dataClass 3 (TE-specific)

- : Uncompressed , + : Compressed








0015000881010035850048000406450646


48 >>> 0 1 0 0 1 0 0 0

Bit5 : 0 : Uncompressed

Bit4 : 1 : Bits 1 and 0 have a message class 

Bits3,2 : 10 : UCS2(16bits)

Bits1,0 : 00 : Message Class 0


00150008810100358500600002C834

60(96) Gsm 7 bit Default (+: Compressed)

-0110 : Message Marked for Automatic Deletion



PDU TYPE : 15

00010101

Bits1,0 : 01 : SMS-SUBMIT

Bit2 : 1 : RD (Reject duplicate)

Bits4,3 : 10 : VPF : Present (here 00 after 60)

Bit5 : 0 : SRR : Status report not requested

Bit6 : 0 : UDHI : Not present

Bit7 : 0 : RP (Reply path)






























SMS-SUBMIT binary 8bit



15010A91561904472800F4A718496E6920636F6E746F6820666C61736820534D53206C686F

TP-DCS
F0   GSM 7 bit Class 0 (Flash message)
F4   8 bit data  Class 0 (Flash message)


-1st byte: 0×15 or in binary 00010101
--TP-MTI (bit 0&1) = 01 means this PDU SMS type is SMS-SUBMIT
--TP-RD (bit 2) = 1 means reject duplicate if there’s a same SMS with same TP-MR
--TP-VPF (bit 4&3) = 10 means this SMS contain validity period info with relative format
--TP-SRR (bit 5) = 0 means we don’t ask for delivery report
--TP-UDHI (bit 6) = 0 means no user data header information (UDHI)
--TP-RP (bit 7) = 0 means reply path unused
-2nd byte: TP-MR = 0×01, means message reference number is 0×01
-3rd byte: TP-DA length = 0x0A, this is length of destination address.I want to send to my own number which is 6591407482 -> see there’re 10 digits, to TP-DA should be 0x0A or 10 in decimal
-4th byte: TON/NPI info = 0×91 or in binary format 10010001
--TON (bit 6,5,4) = 001 -> means International Number
--NPI (bit 3,2,1,0) = 0001 -> means ISDN telephone number
-5th byte .. 9th byte: 5619044728 -> this is the destination number 6591407482 but written in BCD semioctet format
-10th byte: TP-PID = 0×00 -> means use default protocol identifier
-11th byte: TP-DCS = 0xF4 or in binary format 11110100
--Bit 3,2 = 01, means TP-UD (user data) is encoded using 8 bit format
--Bit 0,1 = 00, means class 0 {this will make this sms become flash sms}
-12th byte: TP-VP = 0xA7 means this SMS is valid only for 24 hours
-13th byte: TP-UDL = 0×18 means the user data/message part length is 24 character
-the rest byte: 
-496E6920636F6E746F6820666C61736820534D53206C686F + Thi is hex representation of string “Ini contoh flash SMS lho”




SMS-SUBMIT 7bit







0001000C91180910325476400005E8329BFD06


-PDU Type : 01

--00000001 >>> 01 : SMS-SUBMIT

-DA : 0C9118091032547

-PID : 40

-DCS : 00 : Alphabet 7bit

-UDL : 05 in hex

UD : E8329BFD06



Decoding Data :

E8 32 9B FD 06

-Reverse Hex

06 FD 9B 32 E8

-Hex to binary

00000110 11111101 10011011 00110010

11101000

-Remove zero from the left

Hex_Count : 5

5×8-int(5×8/7)×7=5

00000110 11111101 10011011 00110010

11101000


110 11111101 10011011 00110010

11101000

-7bit

1101111 1101100 1101100 1100101 1101000

-Put zero before each 7bit

01101111 01101100 01101100 01100101 01101000

-Binary to hex

6F 6C 6C 65 68

-Reverse hex

68 65 6C 6C 6F

-Hex to string

68656C6C6F

Char Count : 5 







At the beginning of both PDUs, 00 is added as the SCA (Service Center Address) to indicate the default SMSC, and 01 is set in the TP-MTI to indicate SMS-SUBMIT. The TP-PID is set to 00 for a normal text message, and 40 (bit pattern: 01000000) for short message type 0. The phone number +819001234567 set as the TP-DA in the figure is a dummy. The TP-UD is set to hello encoded in GSM 7-bit characters


64/16=4,Reminder=0>>>40


For TP-PID = 63 the SC converts the SM from the received TP Data Coding Scheme to any data coding scheme supported by that MS (e.g. the default).


56–62SC-specific; usage based on mutual agreement between the SME and the SC
63A GSM/UMTS mobile station.
64Short Message Type 0
65Replace Short Message Type 1
66Replace Short Message Type 2
67Replace Short Message Type 3
68Replace Short Message Type 4
69Replace Short Message Type 5
70Replace Short Message Type 6
71Replace Short Message Type 7



نوع پیام کوتاه 0 به عنوان پیامک بی صدا Silent SMS شناخته می شود. هر گوشی باید بتواند چنین پیام کوتاهی را دریافت کند، صرف نظر از اینکه حافظه در (U)SIM یا ME موجود است یا خیر، باید دریافت پیام را تأیید کند، اما نباید دریافت آن را به کاربر نشان دهد و باید محتوای آن را دور بیندازد. بنابراین پیام در (U)SIM یا ME ذخیره نخواهد شد.



فلش اس ام اس نوعی پیامک است که مستقیماً در صفحه اصلی بدون تعامل کاربر ظاهر می شود و به طور خودکار در صندوق ورودی ذخیره نمی شود. این می تواند در مواقع اضطراری، مانند اعلام حریق یا موارد محرمانه، مانند ارائه رمزهای عبور یکبار مصرف، مفید باشد.












































decode SMS-DELIVER


پیامک دریافتی 



SMS DELIVER:
SCA-PDU TYPE-OA-PID-DCS-SCTS-UDL-UD


07917238010010F5040BC87238880900F100009930925161958003C16010


-SCA : 07917238010010F5

--Length: 07 in hex (2byte:2digits)

--10010001 : 91 ( + ) International code

including EXT,TON,NPI

TON ( Type of number ) :bit 6,5,4

000 Unknown

001 International number

010 National number

100 Subscriber number
101 Alphanumeric, (coded according to 3GPP TS 23.038 [9] GSM 7-bit default alphabet)
110 Abbreviated number

NPI ( Numbering plan ) bit 3,2,1,0

0000 Unknown
0001 ISDN/telephone numbering plan (E.164/E.163)
0011 Data numbering plan (X.121)
0100 Telex numbering plan

1000 National numbering plan

1001 Private numbering plan

--7238010010F5
---Ext:1;TON:001;NPI:0001

---Reverse number 2byte from the left

27831000015

So Address is ... +27831000015

-PDU Type : 04 in hex 

MTI :

00         MS>SC SMS-DELIVER-REPORT

00         SC>MS SMS-DELIVER

01         MS>SC SMS-SUBMIT

01        SC>MS SMS-SUBMIT-REPORT

10        MS>SC SMS-COMMAND

10        SC>MS SMS-STATUS-REPORT

11        any           Reserved        


--00000100 ( bit7....bit0 )

---bit0,1 : 00 : SMS-DELIVER

---bit2 : 1 : MMS (0=More message)

---bit3 : 0

---bit5 : 0 : SRI (Status report indication)

---bit6 : 0 : UDHI

---bit7 : 0 : RP(Reply path) 

-OA : 0BC87238880900F1

From this address issued

--Length : 0B in hex

--11001000 : C8

Including EXT,TON,NPI

bit3..0 : NPI : 1000 :national numbering

bit6.4 : TON : 100 : Subscriber number

bit7 : EXT : 1 : Extension

--7238880900F1

---Reverse number 2byte from the left 

27838890001

-PID : 00

-DCS : 00

-SCTS : 99309251619580

Time stamp

2099/03/29 15:16:59 08

-UDL : 03

UD : C16010


Decoding UD (user data)


-Reverse hex

10 60 C1

-Hex to binary (octet : 8bit)

00010000 01100000 11000001

-Remove Extra zero from the left

[int(3×(7÷8))+1]×8-3×7=3

10000 01100000 11000001

-set 7bit binary

1000001 1000001 1000001

-Binary to hex

41 41 41

-Revers hex (Bring the hexes in order from end to first)

41 41 41

-Hex to string

AAA




Finally decided done successfully




00040A91890100358500001230205181020C074374589EA6E701


-4374589EA6E701

01 E7 A6 9E 58 74 43

00000001 11100111 10100110

10011110 01011000 01110100

01000011


[int(7×7/8)+1]×8-7×7=7


00000001 11100111 10100110

10011110 01011000 0111010



1111001 1110100 1101001

1110010 1100001 1101000

1000011


01111001 01110100 01101001

01110010 01100001 01101000

01000011


-79 74 69 72 61 68 43


-43 68 61 72 69 74 79


hex to string (43686172697479)


----------------------------------

-Example 

Encoding :

69 Character Or 69 Hex

7bit>8bit ... Add Zero

[int(69×(7÷8))+1]×8-69×7=5

61×8-69×7=5

Decoding :

61 Hex

8bit>7bit ... Remove zero

61×8-int(61×8/7)=5

61×8-69×7=5

----------------------------------


-Encode following hexes


5a6f6f647461722062696120696e6a

6120756e6a61206e612e




Reverse Hex :

2e 61 6e 20 61 6a 6e 75 20 61 6a 6e

69 20 61 69 62 20 72 61 74 64 6f 6f

5a

Hex to ninary , only 7bit from right

0101110 1100001 1101110 0100000

1100001 1101010 1101110 1110101

0100000 1100001 1101010 1101110

1101001 0100000 1100001 1101001

1100010 0100000 1110010 1100001

1110100 1100100 1101111 1101111

1011010

Add Zero to the left

Hex or chararter count : 25

[int(25×(7÷8))+1]×8-25×7=

22×8-25×7=1

0 0101110 1100001 1101110 0100000

1100001 1101010 1101110 1110101

0100000 1100001 1101010 1101110

1101001 0100000 1100001 1101001

1100010 0100000 1110010 1100001

1110100 1100100 1101111 1101111

1011010

8bit

00101110 11000011 10111001

00000110 00011101 01011011

10111010 10100000 11000011

10101011 01110110 10010100

00011000 01110100 11100010 01000001 11001011 00001111

01001100 10011011 11110111

11011010

Binary to hex

 00101110 11000011 10111001

2e c3 b9

00000110 00011101 01011011

06 1d 5b

10111010 10100000 11000011

ba a0 c3

10101011 01110110 10010100

ab 76 94

00011000 01110100 11100010

18 74 e2

01000001 11001011 00001111

41 cb 0f

01001100 10011011 11110111

4c 9b f7

11011010

da

Reverse hex

da f7 9b 4c 0f cb 41 e2 74 18 94 76 ab

c3 a0 ba 5b 1d 06 b9 c3 2e


25 (character)  to hex : 25÷16=1,Reminder=9>>19

00040A91890100358500003220208080120819daf79b4c0fcb41e274189476abc3a0ba5b1d06b9c32e



decoding

da f7 9b 4c 0f cb 41 e2 74 18 94 76 ab c3 a0 ba 5b 1d 06 b9 c3 2e

Reverse hex and convert to binary

00101110 11000011 10111001

00000110 00011101 01011011

10111010 10100000 11000011

10101011 01110110 10010100

00011000 01110100 11100010 01000001 11001011 00001111

01001100 10011011 11110111

11011010

Remove zero

Hex_Count=22

22×8-25×7=1

00101110 11000011 10111001

00000110 00011101 01011011

10111010 10100000 11000011

10101011 01110110 10010100

00011000 01110100 11100010 01000001 11001011 00001111

01001100 10011011 11110111

11011010


0101110 11000011 10111001

00000110 00011101 01011011

10111010 10100000 11000011

10101011 01110110 10010100

00011000 01110100 11100010 01000001 11001011 00001111

01001100 10011011 11110111

11011010

-7bit to hex (can add zero to each 7bit then convert to hex)

0101110 1100001 1101110

2e 61 6e

0100000 1100001 1101010

20 61 6a

1101110 1110101 0100000

6e 75 20

1100001 1101010 1101110

61 6a 6e

1101001 0100000 1100001

69 20 61

1101001 1100010 0100000

69 62 20

1110010 1100001 1110100

72 61 74

1100100 1101111 1101111

64 6f 6f

1011010

5a


2e 61 6e 20 61 6a 6e 75 20 61 6a 6e

69 20 61 69 62 20 72 61 74 64 6f 6f

5a

Reverse hex and convert to string

5a6f6f647461722062696120696e6a

6120756e6a61206e612e























Concatenates message



If you send a long text message containing only characters that are part of the GSM 03.38 character set, then each SMS segment can contain up to 153 characters. (140 bytes - 6 bytes for the concatenation header leaves 134 available bytes, or 7 * 134 = 1072 bits. The most 7-bit characters that can be packed into 1072 bits is 153.)

If you send a long text message that includes any characters that require Unicode encoding, then each SMS segment can contain up to 67 characters. (67 * 16 = 1072 bits)


140×8=1120   1byte=8bits 

160×7=1120    1byte=7bits

1120-6×8(see below)=1072

1072/7=153 in 7bit 

1072/8=134 in 8 bit 


05 00 03 CC 02 01=6Byts=6×8bits=48bits


in 12bits ( Unicode )  like persian

(1072-48)/16=67 Characters can be sent in  each part



UDHI 


05 00 03 44 03 01


05 : Length including 5 byte
00 : indicate multipart
03 : Subpart length
44 : Refrences from 00 to FF
03 : Total number to be send
01 : Sequence number



در ارسال بصورت پَک شده ۷ بیتی برای ارسال پیامک
چند پارتی 153 کاراکتر قابل ارسال است و در ۸ بیتی
134 کاراکتر ... در یونیکد یا 16 بیتی تنها 67 کاراکتر
را می توان در هر پارت ارسال کرد تا در مبدا بصورت
پیوسته در قالب یک پیام مشاهده شوند.

در ارسال بصورت پک شده ۷ بیتی می بایست در ابتدا
hex اسکی کد کاراکتر را برعکس نموده و تبدیل به
باینری کرد ، سپس محاسبه کرد که چند صفر قبل از
اولین کد باینری قرار گیرد تا تعداد جمع مجموعه بر ۸
تقسیم پذیر باشد.۷ رقم ۷ رقم جداسازی کرده و به هگز
تبدیل می نمائیم ، هگزهای بدست آمده را از آخر به اول
مرتب کرده و آنرا به کاراکتر تبدیل می کنیم.
در ارسال بصورت ۸ بیتی همان تبدیل به هگز کافیست
در ارسال بصورت ۱۶ بیت هم همان کد یونیکد کاراکتر
قرار می گیرد.


مثال در ارسال بصورت پَک ۷ بیتی :
فقط کدهای اسکی در ۷ بیتی مجاز هستند
ارسال کلمه Hi ... به طول ۲ بایت
Hex(H)=48
Hex(i)=69
هگزها را از آخر به اول مرتب می کنیم
69 48
هگزها را به باینری تبدیل می کنیم البته ۷ بیتی
یعنی جدا کردن ۷ رقم از سمت راست بایتری ۸
بیتی
69 : 01101001
48 : 01001000
حال باید از سمت راست ۷ رقم جدا کرد
1101001 1001000
در اینجا چند صفر می بایست قبل از باینری اول
قرار داد؟ تا جائیکه تعداد کل بر ۸ بخشپذیر باشد
2×7=14
16 بر ۸ بخشپذیر است لذا اگر 14 را از 16 کم
کنیم عدد باقیمانده 2 است پس 2 تا صفر اضافه
می کنیم
00 1101001 1001000
شروع به جداسازی ۷ رقم ۷ رقم می کنیم
00110100 11001000
باینری را به هگز بر می گردانیم
34 C8
هگزها را از آخر به اول مرتب می کنیم 
C834

0011000A9189010035850000AA02C834

PDU Type : 11
MR : 00
DA : 0A918901003585
PID : 00
DCS : 00 7bit ( Alphabet )
VPF : AA ( 4 days validity period )
UDL : 02 Length of char in hex
UD : C834 ( Hi )


129÷16=8 , Reminder=1
145÷16=9 , Reminder=1
129- if the value of address does not start with
a "+" character. For example, "85291234567".
145- if the value of address starts with a "+"
character. For example, "+85291234567"

Address 

octetMeaning
0address length in nibbles (semi-octets)
1EXT, TON, NPI
2-11address digits

EXT : 1

TON : Bit 6 5 4  Type Of Number 

Bit
6 5 4
Meaning
0 0 0Unknown
0 0 1International number
0 1 0National number

NPI : Bit 3 2 1 0 : Numbering plan
0 0 0 1ISDN/telephonenumbering
plan (E.164/E.163)

10010001=91 (+)
10100001=A1
10000001=81

0011000A9A89010035850000AB02C8348
00110008A1010035850000AB02C8348
hex(9A)=9×16+10=154(decimal)
hex(A1)=10×16+1=161(decimal)







پس از کشته شدن مرحوم کیان پیرفلک
به دست تروریست‌ها مادر وی سبک 
جدیدی از بلاگری به نام بلاگری خون 
را آغاز کرد. این کار اکنون باعث
 شهادت یک افسر پلیس در ایذه و 
یتیم شدن پنج فرزند او شده است.
 حالا خواهر قاتل افسر پلیس هم به 
بلاگری خون روی آورده است.

















SMS-SUBMIT in 8bit





It is possible to use a 16 bit CSMS reference number in order to reduce the probability that two different concatenated messages are sent with identical reference numbers to a receiver. In this case, the User Data Header shall be:

  • Field 1 (1 octet): Length of User Data Header (UDL), in this case 06.
  • Field 2 (1 octet): Information Element Identifier (IEI), equal to 08 (Concatenated short messages, 16-bit reference number)
  • Field 3 (1 octet): Length of the Information Element (IEL), excluding the IEI and the IEL; equal to 04
  • Field 4 (2 octets): 0000-FFFF, CSMS reference number, must be same for all the SMS parts forming the concatenated message
  • Field 5 (1 octet): 00-FF, total number of parts. The value shall remain constant for every short message which makes up the concatenated short message. If the value is zero then the receiving entity shall ignore the whole information element
  • Field 6 (1 octet): 00-FF, this part's number in the sequence. The value shall start at 1 and increment for every short message which makes up the concatenated short message. If the value is zero or greater than the value in Field 5 then the receiving entity shall ignore the whole information element.




0051000C912943524295050004AA0F060804112F01014869206475646521


-SCA : 00

-PDU Type : 51 (01010001)

from right 

bit0,1: 01:SMS-SUBMIT

bit3,4 : 10 : VPF present

bit6 : UDHI present

-MR : 00

-DA : 0C91294352429505

lengrh : 0C : 12

number : +923425245950

-PID : 00

-DCS : 04 ( 8 bit ) binary

-VPF : AA

-UDL : 0F : 15

-UDHI : 060804112F0101

-UD : 4869206475646521

Hex to string : put above UD 

https://codebeautify.org/hex-string-converter

































decode SMS-SUBMIT



SMS-SUBMIT including : 
SCA-PDU TYPE-MR-DA-PID-DCS-VP-UDL-UD



0891683108200805F01151048181160000FF16C8329BFD66B5F320B8BC4CA7E741F7B79C4D0E01



-SMSC : 0891683108200805F0

--Length : 08 (2digit 2digit)

--number : 91683108200805F0

---International : 91 (+ )

---683108200805F0

Reverse 2digits

86 13 80 02 80 50 00

number is >>> +8613800280500

-PDU Type : 11

--00010001

>>>from right to left 

---MTI : 01 ( SMS SUBMIT )

---RD : 0 ( Reject duplicate )

---VPF : 10 means present see FF after DCS

---SRR : 0 status report not requested

---UDHI : 0 no header present in multi part sms

---RP : 0 (Replay path )

-MR : 51 in hex : 5×16+1=81

-DA : 04818116

--Length : 04

--Number : 818116

---national : 81

---8116

Reverse

1861

number >>> 1861

-PID : 00 ( Protocol ID )

-DCS : 00 ( Data coding scheme : alphabet 7bit )

-VPF : FF in hex 141 days

( Validity period format bit3,4 present in pdu type )

-UDL : 16

-UD : C8329BFD66B5F320B8BC4CA7E741F7B79C4D0E01---Decoding User Data 

C8329BFD66B5F320B8BC4CA7E7

41F7B79C4D0E01

---Reverse hex

01 0E 4D 9C B7 F7 41 E7 A7 4C

BC B8 20 F3 B5 66 FD 9B 32 C8

hex_count :20

---hex to binary

00000001 00001110 01001101

10011100 10110111 11110111

01000001 11100111 10100111

01001100 10111100 10111000

00100000 11110011 10110101

01100110 11111101 10011011

00110010 11001000

---Remove zeros from the left

20×8-int((20×(8/7))×7=6

20×822×7=6


00000001 00001110 01001101

10011100 10110111 11110111

01000001 11100111 10100111

01001100 10111100 10111000

00100000 11110011 10110101

01100110 11111101 10011011

00110010 11001000


---Seperate in 7bits

0100001 1100100 1101100

1110010 1101111 1110111

0100000 1111001 1110100

1110100 1100101 1110010

1110000 0100000 1111001

1101101 0101100 1101111

1101100 1101100 1100101

1001000

---Binary to hex


21 64 6C 72 6F 77 20 79 74

74 65 72 70 20 79 6D 2C 6F

6C 6C 65 48


---Reverse hex


48656C6C6F2C6D79207072657474

7920776F726C6421


hex_count=22>>>22÷16=1 Reminder=6

UDL=16


---Put hex here

https://codebeautify.org/hex-string-converter



Finally decoded done successfully.


Encoding : 

Hex_Count:22

Int(22×(7÷8))+1-22×7=6

Add 6 Zero to the first

Decoding : 

Hex_Count :20

20×8-int(20×(8/7))=6

Remove 6 zero from the first







GSM-7 messages break down as follows:

  • Standard single SMS messages: For GSM phones with 7-bit character encoding, a standard SMS message can contain a maximum of 160 characters. That is 1120 bits / (7 bits/character) = 160 characters for a single SMS message.
  • GSM-7 multi-part or concatenated messages: When the message text is longer than 160 GSM characters, the message is concatenated and sent. When a message is concatenated, the user data header (UDH) consumes 6 bytes or 48 bits. This reduces the maximum number of characters in each message part:

1120 bits - 48 bits = 1072 bits

1072 bits / (7 bits/character) = 153 characters per message part.





























decode SMS-SUBMIT




079144872000626011000C914477000910320011002154747A0E4ACF416190BD2CCF83E6E9369C5D06B5CBF379F85C06E95A29



-0791448720006260 : SMSC

--07 : Length(Hex)

---Number :

91448720006260

91 : International ( + )

448720006260

Reverse 2digits from left

number is ... 44 78 02 00 26 06

-11 : PDU Type

--00010001

bit0,1(from right) : 01 : MTI

SMS-SUBMIT :01 & DELIVER : 00

bit2 : 0 : RD ( Reject duplicate )

bit3,4 : 10 : VPF : present

bit5 : 0 : SRR

bit6: 0 : UDHI : not present ( for concatenated messages or multi part)

bit7 : 0 : RP ( Reply path )

-00 : MR ( Message refrence in hex )

-0C91447700091032 : DA (send To this)

--0C : Length in hex

C=0×16+12=12

---Number

91 : International ( + )

447700091032

Reverse 2digits from the left

number is ... 44 77 00 90 01 23

-00 : PID

-11 : DCS ( Data coding scheme )

Alphabet 7bit

--Group coding

General data coding

11 GSM 7BIT CLASS 1 (ME-specific)


-00 : VPF
( Ckeck bit3,4 of PDU Type [10] ,it means present)

-21 : UDL in hex

-54747A0E4ACF416190BD2CCF83E6E9369C5D06B5CBF379F85C06E95A29 : UD


---Decoding User Data ( UD )

Data coding is ... alphabet mode 


54747A0E4ACF416190BD2CCF8

3E6E9369C5D06B5CBF379F85C06

E95A29


-Reverse above Hex 

29 5A E9 06 5C F8 79 F3 CB B5 06 

5D 9C 36 E9 E6 83 CF 2C BD 90 61

41 CF 4A 0E 7A 74 54


-Hex to binary

00101001 01011010 11101001

00000110 01011100 11111000

01111001 11110011 11001011

10110101 00000110 01011101

10011100 00110110 11101001

11100110 10000011 11001111

00101100 10111101 10010000

01100001 01000001 11001111

01001010 00001110 01111010

01110100 01010100



Hex_Count (2digits)=29

How many zeros to be remove? ( from the left of binery [Octet])

29×8-int(29×8/7)×7=1


Remove 1 Zero from the left then Set to septet (7bit) All binaries

0101001 0101101 0111010

0100000 1100101 1100111

1100001 1110011 1110011

1100101 1101101 0100000

1100101 1101100 1110000

1101101 1101001 1110011

0100000 1111001 1110010

1100101 1110110 0100000

1100001 0100000 1110011

1101001 010 0000 1110011

1101001 1101000  1010100


-Binary to hex

Ex : 010 1001:010=2,1001:9

29 2D 3A 20 65 67 61 73 73

65 6D 20 65 6C 70 6D 69 73

20 79 72 65 76 20 61 20 73

69 20 73 69 68 54

-Reverse hex 

546869732069732061207665727920

73696D706C65206D65737361676520

3A2D29

Hex_Count=33

33 >>> 33÷16=2 Reminder=1>>21

21... is the actual length of UDL

-Put hex here

https://codebeautify.org/hex-string-converter


Finally decoded done successfully!!!

do not forget >>> like & comment 



Have a sweet day 

































decode SMS-SUBMIT




0001AB0B915121551532F400C80F3190BB7C07D9DFE971B91D4EB301


Data coding : SMS Default Alphabet


00 : SMSC ( use cell phone default )

01 : PDU Type

-00000001 : 01 >>> SMS-SUBMIT

--bit0,1:01 MTI message type indicator

--bit2 : 0 RD reject duplicate

--bit3,4 : 00 VPF not presented

--bit5 : 0 SRR status not requested

--bit6 : 0 UDHI not presented

--bit7 : 0 RP reply path

Decimal =10×16+11=171
AB : MR ( Message refrence ) hex value

DA : 0B915121551532F4

Destination address

--0B : Length hex value

decimal=0×16+11=11

International number : 91(+)

number : 5121551532F4

51 21 55 15 32 F4 ( remove F )

decode : 15125551234

finally >>> +15125551234

00 : PID

C8 : DCS 

--Coding Group: Message Waiting Info: Discard Message

C8  : Voicemail Active
C9  : Fax Active
CA  : E-mail Active

0F : UDL

3190BB7C07D9DFE971B91D4EB301 : UD


decoding User Data :

-Reverse hex

01B34E1DB971E9DFD9077CBB9031

-Change to bunary

00000001 10110011  01001110

00011101 10111001 01110001

11101001 11011111 11011001

00000111 01111100 10111011

10010000 00110001

-How many zeros to be remove from the left?

14×814×(8÷7)×7=0 ( means nothing )


--convert 7bits 7bits to hex value


0000000:00

1101100:6C

1101001:69

1100001:61

1101101:6D

1100101:65

1100011:63

1101001:69

1101111:6F

1110110:76

0100000:20

1110111:77

1100101:65

1101110:6E

0100000:20

0110001:31


-Reverse hex

31206E657720766F6963656D61696C00

-Hex to string ( Copy here )

https://codebeautify.org/hex-string-converter




finally decoded done successfully.
































decode SMS-SUBMIT



Read following  first : 

SMS-SUBMIT
Bit:
0,1-MTI (00 : Deliver , 01 Submit )
2-RD ( Reject Duplicate )
3,4-VPF
0 0 VP field is not present
0 1 Reserved
1 0 VP field present an integer represented (relative)
1 1 VP field present an semi-octet represented (absolute)
5-SRR (Status report request)
0:A status report is not requested
1:A status report is requested
6-UDHI
When TP-UDHI has value 1, the TP-UD field starts with User Data Header
7-RP

0:Reply Path parameter is not set in this PDU
1:Reply Path parameter is set in this PDU




SMS-SUBMIT :
000100
0B915892214365F7000021493A283D0795C3F33C88FE06CDCB6E32885EC6D341EDF27C1E3E97E72E


-SMSC Defualt in cell phone : 00

-PDU TYPE : 01

00000001

Starting from right  :

bit0,1 : 01 >>> SMS-SUBMIT

bit2 : 0 >>> RD ( Reject duplicate)

bit3,4 : 00 >>> VP (Valudity period)

if 00 means not present

bit5: 0 >>> SRR (Status report requested) if 1 report requested

bit6: 0 >>> UDHI (User data header indicator) ... use for cancatenated message if 1 means header is present like 05 00 03 CC 02 01 (total02/number01)

bit7: 0 >>> RP ( Reply path ) 

-MR : 00 ( Message refrence by SMSC )

-DA : 0B915892214365F7

DA Len : 0B (Destination address Length)

International code : 91 : Display (+)

Number : 58 92 21 43 65 F7

reverse number from begining as 2 digits

58>>>85

So >>>> 85291234567

---From : +85291234567

-PID : 00

-DCS : 00 (Alphabet) (Dada scheme coding)

if Unicode >>> 08

-UD : 21493A283D0795C3F33C88FE06CDCB6E32885EC6D341EDF27C1E3E97E72E

UDL : 21 in hex value (User data length)

UD : 493A283D0795C3F33C88FE06CDCB6E32885EC6D341EDF27C1E3E97E72E


decoding Data : 

-Reverse Hex value


2EE7973E1E7CF2ED41D3C65E88326ECBCD06FE883CF3C395073D283A49


-Hex to binary

00101110 11100111 10010111 00111110

00011110 01111100 11110010 11101101

01000001 11010011 11000110 01011110

10001000 00110010 01101110 11001011

11001101 00000110 11111110 10001000

00111100 11110011 11000011 10010101

00000111 00111101 00101000 00111010

01001001


Change octet to septet

--Get the number of zeros to be remove.

29×833×7=1

29×8-int(29×8/7)×7=1


-Remove 1 Zero from the left of first above binary ( octet : 00101110 )  and convert 7bits 7bits to hex value like as follows : 



0101110:2E

1110011:73

1100101:65

1100111:67

1100001:61

1110011:73

1110011:73

1100101:65

1101101:6D

0100000:20

1110100:74

1111000:78

1100101:65

1110100:74

0100000:20

1100100:64

1101110:6E

1100101:65

1110011:73

0100000:20

1101111:6F

1110100:74

0100000:20

1111001:79

1110011:73

1100001:61

1100101:65

0100000:20

1110011:73

1101001:69

0100000:20

1110100:74

1001001:49


-Binary to Hex and reverse

4974206973206561737920746F207365

6E642074657874206D65737361676573

2E

-Hex to text convertor : 

https://codebeautify.org/hex-string-converter



finally decoded done successfully !!!



Please do not hesitate to forget >>> Like and Comment






















SMS-SUBMIT



-Decode UD(User data) in 7bit (Sending max 160 char)-(Ascii 140 Char Max Len)


below Text(fingilish)  to Hex


4d616e206d6f6469726520696e206d616a6d6f6f652068617374616d206c6f7466616e2062612062616e64652068616d6168616e672062617368696420676f6c616e616d2e


Length : 69 (2digits)-change to hex value

Hex : 69÷16=4 & 69-4×15=5 : 45

So UDL(User data length)=45 


Hex to binary  : 

2E=2×16+14=46(decimal)

46÷2=23 Reminder=0

23÷2=11 Reminder=1

11÷2=5    Reminder=1

5÷2=2     Reminder=1

2÷2=1        Reminder=0

1÷2=0   Reminder=1

0÷2=0 Reminder=0


From Down to up :


hex(2E):decimal(46):binary(0101110)




Reverse Hex : 

2E6D616E616C6F672064696873616220676E6168616D61682065646E6162206162206E6166746F6C206D617473616820656F6F6D6A616D206E6920657269646F6D206E614D



2E : octet(00101110)>>>septet(01011110)[Len 7 from the right]


0101110 1101101 1100001 1101110 1100001 1101100  1101111 1100111 0100000 1100100 1101001 1101000 1110011 1100001 1100010 0100000 1100111 1101110 1100001 1101000 1100001 1101101 1100001 1101000 0100000 1100101 1100100 1101110 1100001 1100010 0100000 1100001 1100010 0100000 1101110 1100001 1100110 1110100 1101111 1101100 0100000 1101101 1100001 1110100 1110011 1100001 1101000 0100000 1100101 1101111 1101111 1101101 1101010 1100001 1101101 0100000 1101110 1101001 0100000 1100101 1110010 1101001 1100100 1101111 1101101 0100000 1101110 1100001 1001101



Add the required zero from the left until it is devided by 8 : 

69×7+x Mod 8=0

7bit > 8bit

int(69×7/8)+1=61×8-69×7=5



00000 0101110 1101101 1100001 1101110 1100001 1101100  1101111 1100111 0100000 1100100 1101001 1101000 1110011 1100001 1100010 0100000 1100111 1101110 1100001 1101000 1100001 1101101 1100001 1101000 0100000 1100101 1100100 1101110 1100001 1100010 0100000 1100001 1100010 0100000 1101110 1100001 1100110 1110100 1101111 1101100 0100000 1101101 1100001 1110100 1110011 1100001 1101000 0100000 1100101 1101111 1101111 1101101 1101010 1100001 1101101 0100000 1101110 1101001 0100000 1100101 1110010 1101001 1100100 1101111 1101101 0100000 1101110 1100001 1001101


Seperate 8digits (octet) : 


00000010111011011011100001110111

01100001110110011011111100111010

00001100100110100111010001110011

11000011100010010000011001111101

11011000011101000110000111011011

10000111010000100000110010111001

00110111011000011100010010000011

00001110001001000001101110110000

11100110111010011011111101100010

00001101101110000111101001110011

11000011101000010000011001011101

11111011111101101110101011000011

10110101000001101110110100101000

00110010111100101101001110010011

01111110110101000001101110110000

11001101


تبدیل باینری های بالا  طبق جدول به Hex : 


02 ED B8 77 61 D9 BF 3A 0C 9A 74 73 C3 89 06 7D D8 74 61 DB 87 42 0C B9 37 61 C4 83 0E 24 1B B0 E6 E9 BF 62 0D B8 7A 73 C3 A1 06 5D FB F6 EA C3 B5 06 ED 28 32 F2 D3 93 7E D4 1B B0 CD



برعکس کردن مقادیر Hex : 


CDB01BD47E93D3F23228ED06B5C3EA

F6FB5D06A1C3737AB80D62BFE9E6B0

1B240E83C46137B90C4287DB6174D8

7D0689C373749A0C3ABFD96177B8ED

02


00110008810100358500000C45CDB01BD47E93D3F23228ED06B5C3EAF6FB5D06A1C3737AB80D62BFE9E6B01B240E83C46137B90C4287DB6174D87D0689C373749A0C3ABFD96177B8ED02

UDL(User data length)=45hex=69




Address Example  : 


Alphanumeric address is at first put to the GSM 7-bit default alphabet, then encoded the same way as any message text in TP-UD field (that means it is 7-bit packed) and then the address is supplied with the "number" length and TON and NPI.

For example, a fictional alphanumeric address Design@Home is converted to the GSM 7-bit default alphabet which yields 11 bytes 44 65 73 69 67 6E 00 48 6F 6D 65 (hex), the 7-bit packing transforms it to 77 bits stored in 10 octets as C4 F2 3C 7D 76 03 90 EF 76 19; 77 bits is 20 nibbles (14 hex) which is the value of the first octet of the address. The second octet contains TON (5) and NPI (0), which yields D0 hex. The complete address in the GSM format is 14 D0 C4 F2 3C 7D 76 03 90 EF 76 19.

-Text to Hex Value : Design@Home

44657369676e40486f6d65

Length : 11

-Reverse Hex Values

65 6D 6F 48 40 6E 67 69 73 65 44

-Binary ( 7 bit from the right )

1100101 1101101 1101111 1001000

1000000 1101110 1100111 1101001

1110011 1100101 1000100

-Add required zero to the left : 

int(11×7/8)+1=10×8-11×7=80-77=3

000 1100101 1101101 1101111 

1001000 1000000 1101110 1100111 

1101001 1110011 1100101 1000100

-Octet :

00011001011101101110111110010001

000000110111011001111101

001111001111001011000100

-Binary to Hex :

19 76 EF 91 03 76 7D 3C F2 C4

-Reverse Hex : 

C4 F2 3C 7D 76 03 91 EF 76 19


80÷4=20>>>hex(14)


The format of addresses in the GSM 03.40 is described in the following table:

octetMeaning
0address length in nibbles (semi-octets)
1EXT, TON, NPI
2-11address digits

the nibble is often called a semi-octet


-Ext : usaually 1

-TON ( Type of number )

bit 6,5,4 :

unknown 000

international number : 001

National number : 010

Network specific number : 011

Subscriber number  100

Alphanumeric, (coded according to 3GPP TS 23.038 [9] GSM 7-bit default alphabet)  101

Abbreviated number 110

Reserved for extension 111


-NPI ( Numbering plan id )

bit 3,2,1,0

Unknown 0000

ISDN/telephone numbering plan (E.164/E.163) 0001

Data numbering plan (X.121) 0011

Telex numbering plan 0100

Service Centre Specific plan 0101

Service Centre Specific plan 2) 0110

National numbering plan 1000

Private numbering plan 1001

ERMES numbering plan (ETSI DE/PS 3 01 3) 1010

Reserved for extension 1111



EXT : 1 , TON : 001 , NPI : 0001 :

10010001 >>>>  Hex : 91

EXT : 1 , TON : 000 , NPI : 0001 :

10000001 >>>> Hex : 81


1 010 1000 : A8


00110008A8010035850008051006450647080006650666


1 001 1001 : 99


0011000A9989010035850008051006450647080006650666






002414
D0C4F23C7D760390EF76190000111011315214000BE474D81C0EBB5DE3771B


-TP-DCS : 


Message Classes
ValueMessage Class
0 00 - Flash messages
0 11 - ME-specific
1 02 - SIM / USIM specific
1 13 - TE-specific

Flash messages are received by a mobile phone even though it has full memory. They are not stored in the phone, they just displayed on the phone display.


Coding Group : General Data Coding


00  0   GSM 7 bit Default
08  8   UCS2        Default
10 16 GSM 7 bit  Class 0 (Flash message)
14 20 8 bit data Class 0 (Flash message)
18 24 UCS2 Class 0 (Flash message)
20 32 GSM 7 bit   Default  +(compressed)
30 48 GSM 7 bit  Class 0 (Flash message) +(compressed)

Message Marked for Automatic Deletion :
40 64 GSM 7 bit Default
44 68 8 bit data Default
48 72 UCS2       Default

48 : Hex , 72 : decimal

50 80 GSM 7 bit Class 0 (Flash message)
60 96 GSM 7 bit Default  +(compressed)
54 84 8 bit data Class 0 (Flash message)
60 96 GSM 7 bit Default  +(compressed)
70 112 GSM 7 bit Class 0 (Flash message) +(compressed)


0031000B9189199370489400480036062F06310020062D062706440020062A0633062A0020062706310633062706440020067E06CC0627064506A9002006470633062A0645

UDL:decimal(54),Hex(36)

062F : د

Length from 0B to the end : 66





























SMS in Alphabet mode



SMS DELIVER:
SCA-PDU TYPE-OA-PID-DCS-SCTS-UDL-UD
SMS-SUBMIT:
SCA-PDU TYPE-MR-DA-PID-DCS-VP-UDL-UD




Mode Alphabet : 160  Character in part 1 ( Ascii 140,binary septet 160 )

Text : Salam

1-Ascii text to Hexadecimal

53 61 6C 61 6D

?H53

2-Decimal to binary




83÷2=41 Reminder 1

41÷2=20 Reminder 1

20÷2=10 Reminder 0

10÷2=5 Reminder 0

5÷2=2 Reminder 1

2÷2=1 Reminder 0

1÷2=0 Reminder 1

Hex53Decimal83=1010011

Hex61Decimal97=1100001

Hex6CDecimal108=1101100

Hex61Decimal97=1100001

Hex6DDecimal109=1101101



3-Change 8 bit to 7 bit  : 10001100>0001100

Seperate 7 digits from Right 

4-Reverse Binary from last hex to the first

1101101 1100001 1101100 1100001 1010011

5-how many 0 reqired?  5×(7+1)-5×7=5

Add 5 Zero to the left 

00000 1101101 1100001 1101100 1100001 1010011

6-Change binary  to hex



0000011011011100001110110011000011010011


0110=0×2^(3)+1×2^(2)+1×2^(1)+0×2^(0)=6


0D33D3






7-Reverse Hex

D3303BDC06



SMS SUBMIT

00311E08810100353800000A05D3303BDC06


MR(Message refrence)=hex(1E):decimal(30)

DCS(Data coding scheme):00

Validity : 0A

UDL(User data length) : 05

UD (User data) : D3303BDC06




Packed




0110001 0110010 0110011 0110100 0110101 0110110 0110111 0111000

Reverse binary:

0111000 0110111 0110110 0110101 01101000110011 0110010 0110001

Add Zero to the first 8×(7+1)-8×7=8

000000000111000 0110111 0110110 0110101 01101000110011 0110010 0110001

Seperate 8 digits 8 digits :

00000000 : 00

01110000 : 70

11011101 : DD

10110011 : B3

01010110 : 56

10001100 : 8C

11011001 : D9

00110001 : 31

Reverse Hex : 

31 D9 8C 56 B3 DD 70 00


0031000881010035850000000831D98C56B3DD7000

Message : 12345678






-Hex

Hex Len:16

54 61 73 68 20 4D 65 6E 65 20 53 69 6C 65 73 68

-Septet

1010100 1100001 1110011 1101000 0100000 

1001101 1100101 1101110 1100101 0100000

1010011 1101001 1101100 1100101 1110011

1101000

-Reverse binary

1101000 1110011 1100101 1101100 1101001

1010011 0100000 1100101 1101110 1100101

1001101 0100000 1101000 1110011 1100001

1010100

-16×(7+1)-16×7=16

-Required Zero at the first =16

8 digits separation

00000000: 00

00000000:00

11010001:D1

11001111:CF

00101110:2E

11001101:CD

00110100:34

11010000:D0

01100101:65

11011101:DD

10010110:96

01101010:6A

00001101:0D

00011100:1C

11110000:F0

11010100:D4

-Revers Hex

D4 F0 1C 0D 6A 96 DD 65 D0 34 CD 2E CF D1 00 00


00310008810100358500000B10D4F01C0D6A96DD65D034CD2ECFD10000

UDL=16(decimal)=10(Hex)

UD=D4F01C0D6A96DD65D034CD2ECFD10000



SCA

Service Center Address information element

Telephone number of the Service Center

PDU Type

Protocol Data Unit

Type

 

MR

Message Reference

successive number (O. .255) of all SMS-SUBMIT Frames set by the MOBILE

OA

Originator Address

Address of the originating SME

DA

Destination Address

Address of the destination SME

PID

Protocol Identifier

Parameter showing the SMSC how to process the SM (as FAX, Voice etc)

DCS

Data Coding Scheme

Parameter identifying the coding scheme within the User Data (UD)

SCTS

Service Center Time Stamp

Parameter identifying time when the SMSC received the message

VP

Validity Period

Parameter identifying the time from where the message is no longer valid in the SMSC

UDL

User Data Length

Parameter indicating the length of the UD-field

UD

User Data

Data of the SM

RP

Reply Path

Parameter indicating that Reply Path exists

UDHI

User Data Header Indicator

Parameter indicating that the UD field contains a header

SRI

Status Report Indication

Parameter indicating if the SME has requested a status report

SRR

Status Report Request

Parameter indicating if the MS has requested a status report

VPF

Validity Period Format

Parameter indicating whether or not the VP field is present

MMS

More Messages to Send

Parameter indicating whether or not there are more messages to send

RD

Reject Duplicate

 

MTI

Message

Type

Indicator

Parameter describing the message type

00 means SMS-DELIVER

01 means SMS-SUBMIT




TPDU Types
TP-MTIdirectionmessage type
0 0MS → SCSMS-DELIVER-REPORT
0 0SC → MSSMS-DELIVER
0 1MS → SCSMS-SUBMIT
0 1SC → MSSMS-SUBMIT-REPORT
1 0MS → SCSMS-COMMAND
1 0SC → MSSMS-STATUS-REPORT
1 1anyReserved


SMS-DELIVER is used to deliver a message from SMSC to a mobile phone.


Bit fields in the first octet of SM-TL TPDU
bit(s)Meaning
1-0TP-Message-Type-Indicator (TP-MTI)
2TP-More-Messages-to-Send (TP-MMS) in SMS-DELIVER (0 = more messages)
2TP-Reject-Duplicates (TP-RD) in SMS-SUBMIT
3TP-Loop-Prevention (TP-LP) in SMS-DELIVER and SMS-STATUS-REPORT
4-3TP-Validity-Period-Format (TP-VPF) in SMS-SUBMIT (00 = not present)
5TP-Status-Report-Indication (TP-SRI) in SMS-DELIVER
5TP-Status-Report-Request (TP-SRR) in SMS-SUBMIT and SMS-COMMAND
5TP-Status-Report-Qualifier (TP-SRQ) in SMS-STATUS-REPORT
6TP-User-Data-Header-Indicator (TP-UDHI)
7TP-Reply-Path (TP-RP) in SMS-DELIVER and SMS-SUBMIT


According to above table ( PDU Type ) :  

Submit : MTI-RD-VPF-SRR-UDHI-RP

Deliver : MTI-MMS-LP-SRI-UDHI-RP



TP-SRI(only set by SMSC) :

0: a status report will not be returned to the SME

1: a status report will  be returned to the SME






00400881010035850008322131313121000B050003CC020106450648

SMS-SUBMIT
Bit:
0,1-MTI (00 : Deliver , 01 Submit )
2-RD ( Reject Duplicate )
3,4-VPF
0 0 VP field is not present
0 1 Reserved
1 0 VP field present an integer represented (relative)
1 1 VP field present an semi-octet represented (absolute)
5-SRR (Status report request)
0:A status report is not requested
1:A status report is requested
6-UDHI
When TP-UDHI has value 1, the TP-UD field starts with User Data Header
7-RP
0:Reply Path parameter is not set in this PDU
1:Reply Path parameter is set in this PDU

11=00010001

31=00110001

61=01100001


006100088101003585000809050003CC02010645
PDU  61 : 01100001
From the rightest digit : 
bit0,1:MTI:01:SMS-SUBMIT
bit 2:RD:0
bit 3,4:VP:00 Not Present
bit 5:SRR:1:report requested
bit6:UDHI:1:Present:050003CC0201
bit7:RP:0


0031000881010035850008BB020645
PDU 31 : 00110001
MTI : 01 : SMS-SUBMIT
-Different with PDU 61
From the rightest digit ( See Bold )
VP : 10 : Present : BB(21 Day validity)
UDHI : 0 : Not Present


0021000881010053850008020645
PDU  21 : 00100001
bit0,1 : 01 : MTI : SMS-SUBMIT
bit 5 : 1 : SRR : status report request
VP : not present
UDHI : not present

0025000881010035850008020645
SMSC:00 >Using Sms center number from cell phone
MR : Message refrence (Hex value) : 00
Usaully originated from SMSC and no need changing it from 00 to another
TO : 10005358 : 01003558
iff Odd Number then Add F to the last then reverse 2-digits from the left
PDU 25 : 00100101
bit0,1 : 01 : SMS-SUBMIT
bit2 : 1 : RD : Reject duplicate
bit3,4 : 00 : VP : not present
bit5 : 1 : SRR : status report requested
bit6 : 0 : UDHI : not present ( use in concatenated message : multi part )
bit 7 : 0 : RP : not present

00F5000881010035850008CC09050003BB04010645
VP:CC:84days
Data header:050003BB0401
UDL:09
UD:050003BB04010645
text: م
SMSC:00 (Use default center in cell)
PDU F5 : 11110101
bit0,1 : MTI : 01 : SMS-SUBMIT
bit2 : RD : 1
bit3,4 : VP : 10 : validity present
bit5 : SRR : 1 : status report requested
bit6 : UDHI : 1 : present ( Concatenated Message )
bit7 : RP : 1 :  present




there are 40, 44, and 60, there are additional header fields because it is a concatenated SMS. This means that the SMS is divided into parts and sent in segments, and then the modem/phone reassembles them. And there are headers for collecting the SMS parts




0021000881010035850008020645

SMS-SUBMIT:
SCA-PDU TYPE-MR-DA-PID-DCS-VP-UDL-UD

PDU TYPE

21=00100001






AT COMMAND : 

Sending in text mode

AT

>ATOK

AT+CMGF=1[ENTER]
Enter the destination phone number
AT+CMGS=”+61419879619”[ENTER]
Enter the text message and terminate it with “CTRL Z”
>hello[CTRL Z]




Baud Rate:19200 : bps
Data Bits : 8
Stop Bits : 1
Parity N : None

AT+CMGS=18 (actual pdu length)
>0011000A814091786991000001
05E8329BFD06[CTRL Z]

+CMGS: 12

OK 

To : 0419879619

Message : hello

PDU type : SMS-SUBMIT (11)

Refrence : 0 (00)

Validity : 10 minutes (01)

Data coding : SMS Default Alphabet

UDL : 05

UD : E8329BFD06



+CMGF: 0
OK
SMS message for is configured for PDU mode
Checking SMS Mode…
AT+CMGS=48

0011000881010035850000aa28D3E614D42CCFE7E17319342FBBE920B3FCDD0605A9A0E1BBDD0EBBC9206A794E2FCB5D


+CMGS: 23

OK


UDL:28

message : SMS Message sent from AT Command Tester.

Hex Value of message : 

534d53204d6573736167652073656e742066726f6d20415420436f6d6d616e64205465737465722e

Length : 40 (2digits)

UDL in alphabet mode is the length of septet before encoding to octet.

40decimal=28hex

40÷2=2 40-2×16=8 so 28



AT COMMAND : READ 


AT+CMGR=1 [ENTER]

+CMGR: 0,,24

07911614786007F0040B911604994743F400009930139100406B05E8329BFD06

OK










برای دفع سنگ کلیه  خربزه را تمیز شسته و با پوست و گوشت و تخم داخل مخلوط کن بریزید تا کامل میکس شود و روزی 2تا ۳ لیوان میل کنید .

 















SMSPDU-DELIVER


069189190150132006918908080008712042518192818406280633062A064700200627064A0646062A06310646062A0033003000200631064806320647060C00200032002B0032002006AF064A06AF062706280627064A062A00200647062F064A06470020063406280627064606470020062A06270020063306270639062A002000320030003A00340039003A003200310020062A06270631064A



***06918919015013

06>>>Length (91/89/19/01/50/13)  91=1 Len

91>>>+

8919015013>>>9891100531


***200691890808000871204251819281

TP-DCS : Data Coding Scheme (08)

TP-SCTS : Time Stamp

712042518192>>>YYMMDD:170224

518192>>>HHMMSS:151829

TP-UDL(User Data Length) & TP-UD

***8406280633062A064700200627064A0646062A06310646062A0033003000200631064806320647060C00200032002B0032002006AF064A06AF062706280627064A062A00200647062F064A06470020063406280627064606470020062A06270020063306270639062A002000320030003A00340039003A003200310020062A06270631064A

0628 has 2 Length :06/28

User Data Length : 

132 Decimal to Hex ?!!!

132>>>132\16 & 132  Mod 16>>>84



Concatenated SMS

in every part 70 Characer including space

05 00 03 CC 03 01

05 00 03 CC 03 02

05 00 03 CC 03 03


Field1: Length of UDH

Field2: IEI (information Element Identifier)-1 octet

Field3: IEL(information Element Length)-1 octet

Length Excluding IEI

Field4 : Unique Refrence number For All Parts-1 octet

From 00 to FF   ( 00-FF )

Field5 : Total number of parts-1 octer

00-FF ... Not Be Zero

Field6 : this part's number in sequence-1 octet

Start from 1 To 






Sending Message : ( Single Part )


PDU
07912160130300F411000A8158888700890000aa27D3E614D42CCEE7E17319342FBBE920B3FCDD0605A9A0E1BBDD0EBBC9206A794E2FCB01


SCA(Service Center Address)07912160130300F4
length 07
Address type 91
Service center address 2160130300F4

PDU-TYPE11

MR (Message ID) 00
DA (Destination Address) : 0A815888870089

Lenght of the address : 10>>>0A

Address Type : 81

Destination phone number: 5888870089
PID (Protocol ID) : 00
DCS (Data Coding Scheme) : 00
VP(Validity Period ) : aa
UDL (User Data Length) :  39 >>> 27
(User Data) :
D3E614D42CCEE7E17319342FBBE920B3FCDD0605A9A0E1BBDD0EBBC9206A794E2FCB01




another Ex. Submit-SMS

Message Split into two part

just part 1 :

007100098121436587F90008008C050003000201063306440627064500200639064406CC0020062D06270644062A002006860637064806310647002006450646002006270644062706460020062F06310020062C064406330647002006470633062A06450020064800200646064506CC0020062A06480646064500200635062D0628062A002006A9064606450020063406280020063306270639

Split Message >>>> 05 00 03 00 02 01

Data Coding Scheme >>> 08 ( UCS )  Like Persian format




00310D0881010035850008011E0645064606380645002006280627063400200641063106320646062F0645


Status Report : 31

MR ( Message Refren e ) : 0D

UDL ( User Data Length ) : 16 >>> Hex=10

UD ( User Data ) : 0645064606380645002006280627063400200641063106320646062F0645




User Data Header (UDH) is a binary structure which may be present at the start of a short message in the Short Message Service in GSM. It does not contain any text, but it specifies how the message should be formatted and processed.

UDH can be used to form Concatenated SMS





SMS (Short Message Service) can contain up to 160 characters, using the 7-bits GSM default alphabet or 140 characters for an 8 bit alphabet or 70 characters for a 16 bit UCS-2 alphabet.



MultiPart SMS : Submit-SMS


----- PDU---1/7 ------

0071000881010035850008058C050003000701062F0631002006AF0648063406CC200C0647062706CC00200633063106CC002006AF064406A9063306CC002006330627064506330648064606AF0020062706320020062C064506440647002006330627064506330648064606AF002006AF064406A9063306CC0020006100350030002006480020006100350031002006280647002006470645

08(Length)-81-10005358>>>088101003585

User Data Length (UDL) : Decimal=140>>>Hex=8C

UDH ( User Data Header ) : 050003000701

05 Length 00 03 00 Refrence 07 Total 01 Number

Length: 152

----- PDU---2/7 ------

0071000881010035850008058C050003000702063106270647002006AF0648063406CC200C0647062706CC00200645062D0628064806280020062F06CC06AF063106CC002006470645068606480646002006AF064406A9063306CC002000610032003100200645063406A906440020062A0628062F06CC064400200073006D00730020062806470020006D006D0073002006280647200C0635

Length: 152

----- PDU---3/7 ------

0071000881010035850008058C05000300070306480631062A0020062E0648062F06A906270631002006CC06A900200645063406A9064400200628063306CC0627063100200631062706CC062C0020064800200622063206270631062F06470646062F0647002006270633062A002E00200645063906450648064406270020062806270020062706410632062706CC06340020062A0639062F

Length: 152

----- PDU---4/7 ------

0071000881010035850008058C0500030007040627062F002006A906270631062706A9062A06310020062706330020062706450020062706330020062F0631002006330627064506330648064606AF00200028064506390645064806440627064B0020003300300030002006A906270631062706A9062A06310029002006280647200C063506480631062A0020067E06CC0634200C06410631

Length: 152

----- PDU---5/7 ------

0071000881010035850008058C050003000705063600200073006D0073002006CC06270020067E06CC0627064506A900200645062A064606CC0020062806470020067E06CC06270645002006860646062F002006310633062706460647200C062706CC002006CC06270020006D006D00730020062A0628062F06CC06440020064506CC200C06340648062F002E0020062A0628062F06CC0644

Length: 152

----- PDU---6/7 ------

0071000881010035850008058C0500030007060020067E06CC0627064500200645062A064606CC0020062806470020067E06CC06270645002006860646062F0020063106330627064606470020062706CC0020062A062C063106280647002006460627062E06480634062706CC0646062F06CC002006270633062A002006A9064700200647064606AF06270645002006270631063306270644

Length: 152

----- PDU---7/7 ------

007100088101003585000805740500030007070020067E06CC0627064506A900200637064806440627064606CC0020062F0631002006330627064506330648064606AF00200648002006AF0648063406CC200C0647062706CC002006270646062F0631064806CC062F06CC00200631062E0020064506CC200C062F0647062F002E

Length: 128





SMS-SUBMIT

Message To : 10005358

00710E088101003585001A000E050003CC07010645064606380645



Bit fields in the first octet of SM-TL TPDU
bit(s)Meaning
1-0TP-Message-Type-Indicator (TP-MTI)
2TP-More-Messages-to-Send (TP-MMS) in SMS-DELIVER (0 = more messages)
2TP-Reject-Duplicates (TP-RD) in SMS-SUBMIT
3TP-Loop-Prevention (TP-LP) in SMS-DELIVER and SMS-STATUS-REPORT
4-3TP-Validity-Period-Format (TP-VPF) in SMS-SUBMIT (00 = not present)
5TP-Status-Report-Indication (TP-SRI) in SMS-DELIVER
5TP-Status-Report-Request (TP-SRR) in SMS-SUBMIT and SMS-COMMAND
5TP-Status-Report-Qualifier (TP-SRQ) in SMS-STATUS-REPORT
6TP-User-Data-Header-Indicator (TP-UDHI)
7TP-Reply-Path (TP-RP) in SMS-DELIVER and SMS-SUBMIT



004008810100358500083231213121530016050003CC030106450646063806450200062806270634

DeliveyDate/Time :

323121312153>>>2023/12/13 13:12:35

TP-UDL : Decimal:22>>>Hex:16

TP-UDH : 050003CC0301




















الگوریتم لان ( Luhn algorithm )





الگوریتم لان یا فرمول لان، که به الگوریتم "پیمانه ۱۰" نیز مشهور است، یک فرمول ساده برای درستی یابی تعداد زیادی شماره شناسایی است، مانند شماره کارت‌های اعتباری، شماره‌های IMEI و شماره ملی.



در محاسبات یک Payload ظرفیت حمل یک بسته یا سایر واحدانتقال داده است


شرح برای شماره ای که حاوی Check digit نباشد : 

-شماره شامل 10 رقم 

--اولین رقم سمت راست را در نظر می گیریم و آنرا دوبل می کنیم مثلا اگر رقم سمت راست یک باشد عدد دوم میشود دو

--عدد یک و دو ( و به ترتیب تکرار می کنیم ) را زیر رقم های سمت چپ قرار می دهیم و در هم ضرب می کنیم 

--عدد حاصل از ضرب هر رقم ( در یک یا ۲ ) اگر دو رقمی شد ، آن عدد دو رقمی حاصله را رقم اول و دومش را با هم جمع می کنیم

--اعداد بدست آمده را باهم جمع می کنیم

--از فرمول زیر برای Check digit استفاده می کنیم 

10-(s mOod 10)


Example :

7992739871


1->>>> 1

2>>>> 1×2=2

3>>>>

7x1=7

9×2=18 >>>> 1+8=9

9×1=9

2×2=4

7×1=7

3×2=6

9×1=9

8×2=16 >>>> 1+6=7

7×1=7

1×2=2


s=Sum(7+9+9+4+7+6+9+7+7+2)=67

10-(67 mod 10)=3

67÷10=6.7>>67-(6×10)=67-60=3


final >>>> 79927398713












حوادث روزگار نامروت : 


محسن فوق‌لیسانس حسابداری داشت و یک تاجر بین‌المللی و پولدار بود. همه‌‌چیز در زندگی او به خوبی پیش می‌رفت تا اینکه شریکش سر او را کلاه گذاشت و اموالش را تصاحب کرد. محسن ماند با کلی بدهی؛ او در فضای مجازی از 10 پزشک به‌صورت آنلاین مشورت گرفت تا با شیوه بیهوشی از زنان سرقت کند. او که سال‌ها قبل مقام قهرمانی شطرنج کشور و کیک بوکسینگ را کسب کرده بود حالا تبدیل به یک سارق حرفه‌ای شده است.

چون ورشکست شدم. شریکم سرم را کلاه گذاشت و از کشور فرار کرد. مرا اینجوری نگاه نکنید، زمانی برای خودم برو و بیایی داشتم؛ مدام سفر خارجی می‌رفتم و زندگی‌ام لاکچری بود اما شریکم که از چشمانم بیشتر به او اعتماد داشتم زندگی‌ام را با خودش برد و کاری در حقم کرد که تبدیل به یک ورشکسته و بعد سارق حرفه‌ای شدم.







ISO 8583 ( تبادل پیام تراکنش مالی )


ISO 8583 یک استاندارد بین المللی برای کارت تراکنش مالی  منشا پیام های تبادلی است


-فرمت پیام 

--نشانگر نوع پیام یا MTI

از ۴ رقم تشکیل شده ، رقم اول نسخه ، رقم دوم هدف کلی پیام ، رقم سوم چگونگی جریان در سیستم و رقم چهارم  مکان منبه پیام در زنجیره پرداخت را مشخص می کند


مثال : برای 0110

رقم اول از سمت چپ : نسخه 1987
رقم دوم از سمت چپ : کلاس پیام ( یک برابر پیام مجوز)
رقم سوم از سمت چپ : عملکرد پیام (  یک برابر جواب )
رقم چهارم از سمت چپ : چه کسی ارتباط را آغاز می کند ( صفر برابر خریدار )  
بنابراین ، MTI 0110 یک پیام پاسخ مجوز است که در آن  تراکنش واقعی توسط خریدار انجام شده است.

0*** - ISO 8583:1987
1*** - ISO 8583:1993
2*** - ISO 8583:2003
...


یک بیتمپ کدباینری است در این ایزو که نشان میدهد کدام فیلد  در یک پیام تراکنش مالی  موجودیت دارد . هر بیت بیانگر یک تک فیلد است ، با یک به معنی موجودیت و 0 عدم موجودیت فیلد .
مثال : 
ما فیلدهای زیر را در پیام  ایزو دریافت کردیم
 3, 4, 6, 7, 10, 12, 13, 14, 21, 24, 25, 27, 29, 30, 33, 34, 36, 39, 44, 48, 52, 55, 57, 59, 62,63

 اگر بعنوان باینری بخواهیم ارائه کنیم بصورت زیر می شود : 64 بیت برابر با ۸ بایت از باینری 

 0011 0110 0101 1100 0000 1001 1010 1100 1101 0010 0001 0001 0001 0010 1010 0110


0011 از سمت چپ شروع کنید  00  اول یعنی فیلد اول و دوم وجود ندارند و دو تای بعدی که یک هستند یعنی فیلد سوم و چهارم موجود هستند (فیلد چهارم میشه مبلغ تراکنش)

وقتی بخواهیم چیزی را خواناتر و فشرده تر سازیم ، می توانیم باینری را به صورت 16 بایت از مقدار هگزادسیمال ( Unpacked ) نشان دهیم که به شکل زیر می شود

365C09ACD21112A6

در زیر نشان داده شده که چگونه هگزادسیمال از باینری بدست آمده 

0011 -> 3
0110 -> 6
0101 -> 5
1100 -> C
... etc
مثال دیگر : موجودیت بیت ها 
3,4,7,11,12,13,15,17,32,35,37,41,43,48,
49,60,61,62,63,64,100,102
0011(3) 0010(2) 0011(3) 1010(A) 1000(8) 0000(0) 0000(0) 0001(10010(2) 1000(8) 1010(A) 0001(1) 1000(8) 0000(0) 0001(1) 1111(F)
323A800128A1801F0000000014000000
بصورت ۱۶ کاراکتر هگزادسیمال : 
Primary : 323A800128A1801F
Secondary :0000000014000000

فیلد 49 ( Currency ) برای ایران : کد ۳۶۴

Iran

IRR

364

درجدول ستون Data Field رو ملاحظه کنید که جلوی مقدار 49 ذکر کرده Alpha numeric به طول ۳ کاراکتر ( یعنی می توان یکی از IRR یا کد 364 را وارد کرد.)

----بیتمپ ممکن است به صورت ۸ بایت داده باینری یا بصورت 16 کاراکتر هگزادسیمال ارسال شود.0-9 ، A-F در مجموعه کاراکترهای ASCII یا EBCDIC. یک فیلد تنها زمانی وجود دارد که بیت خاص در بیتمپ درست باشد.به عنوان مثال ، بایت 82x و باینری 1000 0010 و بدین معنی است که  فیلدهای 1 و 7 در پیام موجود است و فیلدهای 2 تا 6 وجود ندارند.

Field 1 : Binary 1000 : Hex 8
Field 64 : Binary 0001 : Hex 1
8000000000000001 (Fields 1, 64)
Field 127,128 :Binary  0011 : Hex 3
0000000000000003
(secondary bitmap) Fields 127, 128


1011001000111000000000000000000000001000100000010000000000010000 .
-Now group it by 4 when it will be like
1011 0010 0011 1000 0000 0000 0000 0000 0000 1000 1000 0001 0000 0000 0001 0000 .
-Get the Hex value of each of the 4 groups.
1011 = B
0010 = 2
0011 = 3
1000 = 8
and so on
-Now put them all together to get the primary bitmap  :
B238000008810010


020012100000000080000000001100000504135520122348IRR
MTI:0200
Primary Bitmap : 1210000000008000
Field 4,7,12,49 are prsent


در ISO 8583 یک Bitmap فیلد یا زیرفیلدهایی درون یک پیام است ، که مشخص می کند سایر عناصر داده یا زیر فیلدهای عنصر داده در جای دیگری از پیام وجود دارند یا خیر.

یک فیلد زمانی وجود دارد که بیت مربوطه در بیتمپ تنظیم شده باشد.بعنوان مثال ، یک هگز با مقدار 0x82 ( دسیمال 130 ) باینری 0010 1000 است.یعنی فیلدهای 1 و 7 در پیام وجود دارند و فیلدهای 6،5،4،3،2 و 8 وجود ندارند.

Bitmap ممکن است بعنوان 8 بایت از داده باینری یا کاراکترهای هگزادسیمال ( A-F , 0-9 ) در کاراکتر اسکی بیان گردد.یک پیام شامل حداقل یک بیتمپ با نام Primary bitmap خواهد بود و نمایانگر اجزاء داده 1 تا 64 موجود است.وجود یک بیتمپ ثانویه اختیاری نیز با بیت اول در بیت مپ اولیه نمایش داده می شود ( یعنی اگر بیت اول یک باشد مثل کد باینری 1000 در اول کدهای باینری Primary با دارا  بودن اولین کاراکتر سمت چپ که  یک است ، نشاندهنده وجود Secondary Bitmap است.  در صورت وجود ، بیتمپ ثانویه نشان می دهد که آیا عناصر داده 65 تا 128 وجود دارند یا خیر .به طور مشابه یک بیتمپ سوم می تواند برای نشان دادن حضور فیلدهای 129 تا 192 استفاده شود ، اگر چه این عناصر به ندرت استفاده می شوند.


مثال : 

مقدار بیتمپ داده شده 

70 10 00 11 02 C0 48 04

هگز 70 برابر 0000 0111 ( شمارش از سمت چپ ، دوم تا چهارمین بیت یک است ، که نشان می دهد فیلد 2 تا 4 موجود هستند.)


هگز 10 برابر باینری 0000 0001 ( اولین بیت متعلق به فیلد 9 است ، همچنین بیت چهارم اینجا نشان می دهد که فیلد 12 موجود است.)


هگز 00 یا باینری 0000 0000 ( هیچ فیلدی موجود نیست )


هگز 11 یا باینری 0001 0001 ( فیلد 28 و 32 موجودند)


هگز 02 یا باینری 0010 0000 ( فیلد 39 موجود است)


هگز C0 یا باینری 0000 1100 ( فیلد 41 و 42 موجودند )



هگز 48 یا باینری 1000 0100 ( فیلد 50 و 53 موجودند)


هگز 04 یا باینری 0100 0000 ( فیلد 62 موجود است )



هگز به دسیمال : 
(70)₁₆ = (7 × 16¹) + (0 × 16⁰) = (112)₁₀
دسیمال به هگز
112÷16=7
112-(7×16)=0
70

هگز 7 به باینری ( دودویی)
7/2=3 , reminder=1
3/2=1 , reminder=1
1/2=0 , reminder=1
So >>> 111 ... 0111
5/2=2 , Reminder=1
2/2=0 , Reminder=0
0/2=0 , reminder=1
So >>> 101 ... 0101
&H57 = 01010111




فیلد 4 حاوی مبلغ تراکنش می باشد، به طور کلی اگر تراکنشی دارای مبلغ باشد، باید مقدار آن را در فیلد شماره 4 با طول ثابت 12 رقم قرار دهد برای مثال 1000 تومن را باید 000000010000 در نظر گرفت.

b 64 منظور تشکیل شده از ۶۴ بیت 
n یعنی فقط  عددی  وقتی dot دارد یعنی تا آن طول
در جدول زیر فیلد 4 ستون Type یعنی  فقط ارقام با طول دوازده کاراکتر
فیلد 7 برای تاریخ و زمان با طول ۱۰ کاراکتر مثل 0504162603 اولی Date و بعدی شامل ساعت دقیقه و ثانیه 
Data fieldTypeUsage
1b 64Bitmap
2n..19Primary account number (PAN)
3n 6Processing Code
4n 12Amount Transaction
5n 12Amount, settlement
6n 12Amount, cardholder billing
7n 10Transmission date & time
8n 8Amount, cardholder billing fee
9n 8Conversion rate, settlement
10n 8Conversion rate, cardholder billing
11n 6System trace audit number (STAN)
12n 6Local transaction time (hhmmss)
13n 4Local transaction date (MMDD)
14n 4Expiration date (YYMM)
15n 4Settlement date
16n 4Currency conversion date
17n 4Capture date
18n 4Merchant type, or merchant category code
19n 3Acquiring institution (country code)
20n 3PAN extended (country code)
21n 3Forwarding institution (country code)
22n 3Point of service entry mode
23n 3Application PAN sequence number
24n 3Function code (ISO 8583:1993), or network international identifier (NII)
25n 2Point of service condition code
26n 2Point of service capture code
27n 1Authorizing identification response length
28x+n 8Amount, transaction fee
29x+n 8Amount, settlement fee
30x+n 8Amount, transaction processing fee
31x+n 8Amount, settlement processing fee
32n ..11Acquiring institution identification code
33n ..11Forwarding institution identification code
34ns ..28Primary account number, extended
35z ..37Track 2 data
36n ...104Track 3 data
37an 12Retrieval reference number
38an 6Authorization identification response
39an 2Response code
40an 3Service restriction code
41ans 8Card acceptor terminal identification
42ans 15Card acceptor identification code
43ans 40Card acceptor name/location (1–23 street address, –36 city, –38 state, 39–40 country)
44an ..25Additional response data
45an ..76Track 1 data
46an ...999Additional data (ISO)
47an ...999Additional data (national)
48an ...999Additional data (private)
49a or n 3Currency code, transaction
50a or n 3Currency code, settlement
51a or n 3Currency code, cardholder billing
52b 64Personal identification number data
53n 16Security related control information
54an ...120Additional amounts
55ans ...999ICC data – EMV having multiple tags
56ans ...999Reserved (ISO)
57ans ...999Reserved (national)
58ans ...999
59ans ...999
60ans ...999Reserved (national) (e.g. settlement request: batch number, advice transactions: original transaction amount, batch upload: original MTI plus original RRN plus original STAN, etc.)
61ans ...999Reserved (private) (e.g. CVV2/service code   transactions)
62ans ...999Reserved (private) (e.g. transactions: invoice number, key exchange transactions: TPK key, etc.)
63ans ...999Reserved (private)
64b 64Message authentication code (MAC)
65b 1Extended bitmap indicator
66n 1Settlement code
67n 2Extended payment code
68n 3Receiving institution country code
69n 3Settlement institution country code
70n 3Network management information code
71n 4Message number
72n 4Last message's number
73n 6Action date (YYMMDD)
74n 10Number of credits
75n 10Credits, reversal number
76n 10Number of debits
77n 10Debits, reversal number
78n 10Transfer number
79n 10Transfer, reversal number
80n 10Number of inquiries
81n 10Number of authorizations (PUTA!)
82n 12Credits, processing fee amount
83n 12Credits, transaction fee amount
84n 12Debits, processing fee amount
85n 12Debits, transaction fee amount
86n 16Total amount of credits
87n 16Credits, reversal amount
88n 16Total amount of debits
89n 16Debits, reversal amount
90n 42Original data elements
91an 1File update code
92an 2File security code
93an 5Response indicator
94an 7Service indicator
95an 42Replacement amounts
96b 64Message security code
97x+n 16Net settlement amount
98ans 25Payee
99n ..11Settlement institution identification code
100n ..11Receiving institution identification code
101ans ..17File name
102ans ..28Account identification 1
103ans ..28Account identification 2
104ans ...100Transaction description
105ans ...999Reserved for ISO use
106ans ...999
107ans ...999
108ans ...999
109ans ...999
110ans ...999
111ans ...999
112ans ...999Reserved for national use
113ans ...999
114ans ...999
115ans ...999
116ans ...999
117ans ...999
118ans ...999
119ans ...999
120ans ...999Reserved for private use
121ans ...999
122ans ...999
123ans ...999
124ans ...999
125ans ...999
126ans ...999
127ans ...999
128b 64Message authentication code (This field belongs to Philipine's Eifle Tower)



00Approved or completed successfully
03Invalid merchant
09Request in progress
12Invalid transaction
13Invalid amount
14Invalid card number (no such number)
19Re-enter transaction
20Invalid response
33Expired card
41Lost card
51Not sufficient funds
54Expired card
57Transaction not permitted to cardholder
58Transaction not permitted to terminal
59Suspected fraud
101expired card
111invalid card number
119transaction not permitted to cardholder
120transaction not permitted to terminal
201expired card


Hex : 080020200000008000000000000000013239313130303031

Table 3. Primary Bitmap
bytehex valuebit valuefield #

0

20

0010 0000

3

1

20

0010 0000

11

2

00

0000 0000

3

00

0000 0000

4

00

0000 0000

5

80

1000 0000

41

6

00

0000 0000

7

00

0000 0000


MTI (0800)
bitmap (2020000000800000)
طبق بالا فیلدهای 3 ، 11 و 41 موجودند بنابراین فیلد بعدی ما شماره 3 است ( اولی MRI دومی BITMAP و سومی ... )



Table 9. Sample authorization request
Fld #DescriptionValueComments

0

MTI

0100

Authorization request

2

Primary Account Number

4321123443211234

3

Processing Code

000000

4

Amount transaction

000000012300

e.g., 123.00

7

Transmission data/time

0304054133

MMYYHHMMSS

11

System trace audit number

001205

14

Expiration date

0205

YYMM

18

Merchant Type

5399

22

POS Entry Mode

022

Swiped Card

25

POS Condition Code

00

35

Track 2

4321123443211234=0205..

37

Retrieval Reference Number

206305000014

41

Terminal ID

29110001

42

Merchant ID

1001001

49

Currency

840












Val(&HE)=Decimal(14) .... Binary (1110)
HEX2BIN:
Dim b As string * 4
b="0000"
جاگذاری از سمت راست
14 Mod 2=0
14\2=7 > 7 Mod 2=1
7\2=3 >  3 Mod 2=1
3\2=1 > 1 Mod 2=1
در نتیجه : 0000 >>>>> 1110 

تبدیل باینری به دسیمال و بعد هگزادسیمال :
Binary(1010)

1×2^(3)+0×2^(2)+1×2^(1)+0×2^(0)=10

Hex(10)=A

Binary(1100)

1×2^(3)+1×2^(2)+0×2^(1)+0×2^(0)=12

Hex(12)=C

Binary(1111)

1×2^(3)+1×2^(2)+1×2^(1)+1×2^(0)=15

Hex(15)=F



هر عنصر داده در قالب استانداردی  توصیف می شود که محتوای  مجاز فیلد ( عددی ، باینری و ... ) و طول فیلد ( متغیر یا ثایت ) را تعریف می کند.

هر فیلد ممکن است دارای طول ثابت یا متغیر باشد.اگر متغیر باشد ، قبل از طول فیل  یک نشانگر طول قرار می گیرد.

TypeMeaning
Fixedno field length used
LLVAR or (..xx)Where 0 < LL < 100, means two leading digits LL specify the field length of field VAR
LLLVAR or (...xxx)Where 0 < LLL < 1000, means three leading digits LLL specify the field length of field VAR
LL and LLL are hex or ASCII. A VAR field can be compressed or ASCII depending on the data element type.LL can be one or two bytes. For example, if compressed as one hex byte, '27x means there are 27 VAR bytes to follow. If ASCII, the two bytes '32x, '37x mean there are 27 bytes to follow. Three-digit field length LLL uses two bytes with a leading '0' nibble if compressed, or three bytes if ASCII. The format of a VAR data element depends on the data element type. If numeric it will be compressed, e.g. 87456 will be represented by three hex bytes '087456x. If ASCII then one byte for each digit or character is used, e.g. '38x, '37x, '34x, '35x, '36x.




00000:00 5B 30 31 31 30 30 30 30 30 30 30 30 38 32 30 80 38 00 00 [.[01100000000820.8..] 
00020:00 81 00 00 04 00 00 00 00 00 00 00 33 36 32 39 31 30 31 30 [............36291010] 
00040:32 39 35 37 31 30 33 31 31 30 30 30 30 30 30 35 30 33 31 53 [2957103110000005031S] 
00060:55 32 30 31 31 31 30 33 31 31 30 32 39 35 37 32 30 31 31 31 [U2011103110295720111] 
00080:30 33 31 31 30 32 39 35 37 33 30 30 31 [0311029573001 ]

5B طول پیام هست و معادل 91 یعنی 11+16×5

1×18+3×20+13=91


بیتمپ اولیه : 

80 38 00 00 00 81 00 00 
فیلدهای 48 ، 41 ،  13 ، 12 ، 11 ، 1 موجود است و فیلد یک یعنی بیتمپ ثانویه نیز موجود است.

بیتمپ ثانویه : 

04 00 00 00 00 00 00 00 
  • فیلد 70 موجود است 

فیلد ۱۱ :   30 31 39 32 36 33   >>>362910
فیلد ۱۲ : 37 35 39 32 39 31  >>> 102957 hhmmss
فیلد ۱۳ :  31 33 30 31  >>> 1031 MMDD
فیلد ۴۱ : 35 30 30 30 30 30 30 31  >>> 10000005
فیلد ۴۸ : 031 
SU20111031102957201110311029573
به فیلد طول 3 رقمی قبل از داده های باقیمانده در این فیلد توجه کنید . که یک فیلد عمومی ( استفاده آینده / خصوصی ) است.
فیلد 70 : 001  مقدار 001 از پیام این نشانه را میدهد که MTI باید 0800 باشد 

Field DefinitionMeaning
n 6Fixed length field of six digits
n.6LVAR numeric field of up to 6 digits in length
a..11LLVAR alpha field of up to 11 characters in length
b...999LLLVAR binary field of up to 999 bytes in length


بررسی پیام ایزو زیر : 

01581200F230040102B000000000000004000000

1048468112122012340000100000001107221800

000001161204171926FABCDE123ABD06414243

000termid1210Community106A5DFGR1112341234234

0158 : طول هدر ( 4 بایت یا ارقام هدر ).نشان می دهد که طول پیام غیر از هدر 158 رقم است . بصورت دو بایت آورده شده.
از خود 1200به طول 4 تا آخرین کاراکترشمارش کنید طول 158 بدست می آید ... 44+38+40+32+4
1200 : نشاندهنده MTI است .
F23 ببعد فیلد یک دارد و نشاندهنده وجود بیتمپ ثانویه چون F را اگر به باینری تبدیل کنید میشود 1111 . از اینجا مشخص می شود که فیلد یک تا 4 موجود است و فیلد یک هم با یک بودنش نمایانگر Secondary Bitmap است.
104846811212 : فیلد دو حاوی شماره حساب اولیه  ( پیشوند هدر نمایانگر طول فیلد 2 یعنی رقم 10 است ) اگر در جدوا فیلدها مشاهده کنید در ستون وسط قید شده n.19 یعنی فیلد فقط numeric یا عددی است و تا 19 عدد را می تواند شامل شود لذا چون طول حساب کمتر از 19 شده لذا طول آن که 10 است قبل آن پیوست شده.
201234 : فیلد سوم  حاوی کد پردازش
000010000000 : فیلد چهارم حاوی  مبلغ تراکنش.اگر در جدول مشاهده کنید فیلد فقط   از نوع numeric یا عددی است با طول 12 و ننوشته تا 12 در نتیجه جای کاراکتر های خالی قبلش تا طول 12 را با صفر پر کرده.
1107221800 : فیلد 7 حاوی  تاریخ و زمان انتقال.
000001 : فیلد 11 حاوی شماره حسابرسی ردیابی سیستم
161204171926 : فیلد 12 حاوی زمان محلی تراکنش
FABCDE123ABD : فیلد 22 کد داده pos
06414243 : فیلد 32 حاوی اخذ شناسایی موسسه    ( پیشوند هدر 06 که نمایانگر طول فیلد 32 است ).طبق جدول فیلد از نوع فقط numeric یا عددی و تا طول 11 را می پذیرد چون در اینجا هدر 6 عدد است لذا طول 6 را در اول آن قرار می دهیم.
000 : فیلد 39 حاوی کد پاسخ.
termid12 : فیلد 41 حاوی شماره شناسایی ترمینال
در جدول ans 8 قید کرده یعنی شامل عدد و حرف و کاراکترهای ویژه . اگر فرضاً عنوان میشد ans .. 8 اگر طول کاراکتر کمتر از 8 میشد می بایست قبل از آن طول قید گردد.
10Community : فیلد 43 حاوی موقعیت داده ( پیشوند هدر نمایانگر طول فیل  43 یعنی رقم 10 است.)
06A5DFGR : فیلد 44 حاوی کد پاسخ اضافی ( پیشوند هدر نمایانگر طول فیلد 32 یعنی رقم 6 است.)
1112341234234 : فیلد 102 حاوی شماره حساب ... این فیل  طبق جدول طولش تا 28 کاراکتر شامل ارقام و حروف و special character است >>>> ans .. 28 که احتمال زیاد عدد 11 اولی طول هدر است .


















13 خرداد ۱۴۰۲ شرکت در جشن ولیعهد اُردُن

















رفع خطای ثبت MSCOMCTL.OCX در ویندوز ۶۴ بیت




Regsvr32 /u  "C:\Windows\SysWOW64\MSCOMCTL.OCX" Regsvr32 "C:\Windows\SysWOW64\MSCOMCTL.OCX"








عبارت GET در Vba برای خواندن Data



داده را از فایل باز داخل یک متغیر می خواند

Syntax

Get [ # ] filenumber, [ recnumber ], varname



varString=String(10," ")

Get #1,,varString





Serial Port Setting




















Com1:9600,n,8,1






مِتُد Rename در تغییر نام شئ مثل جدول یا کوئری در ویژوال بیسیک


Docmd


expression.Rename (NewNameObjectTypeOldName)


Rename "New","Table","Old"


-آرگومان اول : نام جدید

-آرگومان دوم : نوع شئ مثل Query ، Table یا Form

-آرگومان سوم : نام فعلی


Application

expression.RefreshDatabaseWindow






شئ WshShell برای ایجاد شورتکات یا اجرای برنامه



Wscript.Shell


 زمانیکه نیاز به اجرای برنامه ای بصورت محلی ، دستکاری محتویات رجیستری ، ایجاد شورتکات ، یا دسترسی به پوشه سیستمی دارید می توانید WshShell را ایجاد نمائید.شئ WshShell مجموعه Environment را فراهم می سازد.این مجموعه یا Collection به شما اجازه می دهد تا متغیرهای محیطی ( مانند WINDIR ، PATH یا PROMPT ) را مدیریت کنید.






set oShellLink = WshShell.CreateShortcut(strDesktop & "\Shortcut Script.lnk")
oShellLink.TargetPath = WScript.ScriptFullName
oShellLink.WindowStyle = 1
oShellLink.Hotkey = "CTRL+SHIFT+F"
oShellLink.IconLocation = "notepad.exe, 0"
oShellLink.Description = "Shortcut Script"
oShellLink.WorkingDirectory = strDesktop
oShellLink.Save



 



شئ Shell.Application




بعضی مِتُدها :


Explore : باز کردن یک فولدر

FileRun : باز کردن دیالوگ باکس File-Run

FindFiles : نمایش باکس Search ویندوزی

FindPrinter : نمایش باکس ویندوزی انتخاب پرینتر

MinimizeAll : مینیمایز کردن هرچیزی

("\\:NameSpace("C : ایجاد یک رفرنس شئ به فولدر

Open : بار کردن پوشه خاص

BrowseForFolder : باکس نمایش فولدرها ، نتیجه : یک شئ مرجع به شئ پوشه انتخابی ( شامل ویژگی title و self )

ShellExecute : اجرا کردی اسکریپت یا اپلیکیشن

ShutDownWindowse : نمایش باکس ShutDown ویندوز

ShowBrowseBar : نمایش نوارجستجو

ToggleDesktop : نمایش و مخفی کردن دسکتاپ

UndoMinimizeAll : از حالت مینیمایز در آوردن هر چیزی 



تابع Shell برای اجرای برنامه های اجرائی



نوشتاریِ تابع بصورت زیر و دارای دو آرگومان اجباری (Required) و اختیاری(Optional)است.اولی مسیر و نام فایل ، دومی حالت پنجره مثل vbNormalFocus یا vbHide ( پنهان می شود  )



Shell ( pathname [windowstyle ] )