Professional Documents
Culture Documents
Serial number:
Level: Confidential
DTSS
SMS to CAS API communication protocol
Version 5.0
Department:CAS
Project Name:CAS5.0
Authors:Stephens
Leader:Sharp
Audit:Stephens
Level:Confidentiality
Date of completion:
Update:2017/1/11
DTSS Technology Corporation Ptv. Ltd.
Index
SMS to CAS API communication protocol .......................................................................................................... 1
Data Type Description ................................................................................................................................ 5
SMS to CA command format ..................................................................................................................... 5
CmdType List: ...................................................................................................................................... 5
Response Command Format(Except for some special Commands) .................................................................. 8
1. System class ....................................................................................................................................................... 9
1.1. SMS request program information from ca(0101) ............................................................................. 9
1.2. CA to return the basicpackage structure(0102) .................................................................................. 9
1.3. Send the reminders fee settings(0109) ............................................................................................. 10
1.4. Add/Update Region/(0114) .............................................................................................................. 10
1.5. Delete Region/(0115) ....................................................................................................................... 11
1.6. Sync Region/(0116) .......................................................................................................................... 11
1.7. Get All Packages From ca(0117) ...................................................................................................... 11
1.8. Get blacklist From ca(0118) ............................................................................................................. 12
1.9. Reponse blacklist From ca(0119) ..................................................................................................... 12
1.10. Add blacklist(0120) .......................................................................................................................... 13
1.11. Delete blacklist(0121) ...................................................................................................................... 13
1.12. Response All Packages From ca(0122) ............................................................................................ 14
1.13. Send channel/basicpackage list to ca (0123) ........................................................................... 14
1.14. Send Package list to ca (0124) ...................................................................................................... 15
2. User class ......................................................................................................................................................... 15
2.1. Enabling Smart Card(0201).............................................................................................................. 15
2.2. Disable Smart Card(0202) ................................................................................................................ 16
2.3. STB- card pairing / Cancel(0203) .................................................................................................... 16
2.4. Changing Card(0204) ....................................................................................................................... 17
2.5. Conditions limit broadcast / Cancel(0206) ....................................................................................... 17
2.6. Reset the PIN code(0207)................................................................................................................. 18
2.7. Allow recording/ disable (0208)....................................................................................................... 18
2.8. Wallet recharge (0210) .................................................................................................................. 18
2.9. Updated information on the smart card in a field ( 0212 ) ............................................................... 19
2.10. Add EMM FingerPrint ( 0213 ) ........................................................................................................ 19
2.11. Delete EMM FingerPrint ( 0214 ) .................................................................................................... 20
2.12. Add ECM FingerPrint ( 0215 )......................................................................................................... 21
2.13. Delete ECM FingerPrint ( 0216 ) ..................................................................................................... 22
2.14. Pause Entitlement( 0217) ................................................................................................................. 22
2.15. Resume Entitlement ( 0218) ............................................................................................................. 23
3. Authorized class ............................................................................................................................................... 23
3.1. Add Authorization(0301) ................................................................................................................. 23
3.2. Cancel Authorization(0302) .......................................................................................................... 24
3.3. Suspend Authorization(0303) ........................................................................................................... 25
3.4. Resume Authorization(0304) ........................................................................................................... 25
DTSS Technology Corporation Ptv. Ltd.
Command Header 1
CommandCode 1
AddressCondition
0-1
CommandBody 0-1
MD5 (32Bytes) 1
Struct CommandHeader
{
Serial number H(8) 00000000-FFFFFFFF eg.:0000000A
CASYSID H(4) fixed:9101
Version D(4) eg:0400
Follow-up length H(4) eg:002C,The total length of the follow-up,not include MD5
}
Eg:0000000A91010400002C
Struct CommandType
{
CmdType D(4) eg:0101
}
CmdType List:
DTSS Technology Corporation Ptv. Ltd.
0201 Enabling Smart Card SMS allocated a certain smart cards to users
0202 Disable Smart Card SMS cancel smart card
Machine card pairing / cancel
0203
pairing
Changing Card User changing the card, to enable the new
card, the old card of the original
0204
authorization to be transferred to the new
card, and disable the old card
0206 Conditions limit
Clear Passwords PIN Code of the smart card reset to default
0207
values
0208 Recording Control
0210 Wallet recharge
Updated information on the smart
0212
card in a field
0213 Add EMMG fingerprint
0214 Delete Emmg fingerprint
0215 Add Ecmg fingerprint
0216 Delete Ecmg fingerprint
Struct AddressCondition
{
AddressLen H(2) eg:13
Layer Count H(2) fixed:01 or 00, 00 means all users
For(i=0; i<layercount; i++)
{
Address Code H(2) eg:01,defined in the table below
Loop Count H(2)
For(i=0; i<loopcount; i++)
{
Start value D(9) eg:000000001
Number H(4) ex:000C
}
}
}
Eg:1F010102000000001000A0000000120005
Represents the card number from 1-10 and 12 -17
Note: 0200 means that all users
Commandheader 1
CommandType 1
ResponseCode(4Bytes) 1
MD5 1
ResponseCode:
ResponseCode Description
S000 Success
E000 unknown error
E001 Invalid Command Type
E002 Invalid SMS Number
E003 Request packet length is wrong
E004 CASYSID error
E005 CA Version error
E006 Addressing expression error
E007 Smart card does not exist
E008 Package number is invalid
E171 Operator ID error
E241 Invalid new card number
E242 The card in blacklist
E243 The stbid in blacklist
E244 The stbid used
Remarks:
1. Time format definition:
the use of a uniform time format, 14-length string: (YYYYMMDDHHMMSS).
DTSS Technology Corporation Ptv. Ltd.
Command Format
1. System class
1.1. SMS request program information from ca(0101)
Components
Command header
CommandType
MD5
Example:000000019101040000040101+MD5(32Bytes)
Success response:0102Command
Fail response:Response Command Format
1.2. CA to return the basicpackage structure(0102)
Components
Command header
CommandType
CommandBody
MD5
Struct Commandbody
{
BasicPackageCnt H(2) eg:01
For(i=0; i<BasicPackageCnt;i++)
{
BasicPackageNo H(4) eg:0001
BasicPackage type H(2) eg:00 0:PPC 1:IPPV 2:IPPT
Basic package name S(40) eg:mypackage1
ChannelCnt H(2) eg:02
For(int i=0; i<ChannelCnt; i++)
{
Channel number H(4) eg:0001
Channel name S(40) eg:tvname1
}
}
}
Example:0000000191010400008E010201000100mypackage1
020001tvname1
0002tvname2 +MD5(32Bytes)
DTSS Technology Corporation Ptv. Ltd.
Command header
CommandType
CommandBody
MD5
Struct Commandbody
{
Reminder fee type H(2) 01:Frequency 02:Period
Time H(2) if(Reminderfeetype == 1)
Time means show times
If(Reminderfeetype == 2)
Time means show Frequency (Hours)
FrontDay H(2) days before authority expires
ContentLength H(2) Maximum 50 = Decimal 80
Content S(ContentLength ) eg:Your license is about to expire, please recharge
}
Example:
0000000191010400003C010901050F30Your license is about to expire, please recharge+MD5(32Bytes)
Response: Response Command Format+MD5(32Bytes)
Command header
CommandType
CommandBody
MD5
Struct Commandbody
{
PostcalCode S(6)
RegionNameLen H(2)
RegionName S(RegionNameLen)
}
Example: 00000001690204000010011461173104xipu+MD5(32Bytes)
Response: Response Command Format
DTSS Technology Corporation Ptv. Ltd.
Command header
CommandType
CommandBody
MD5
Struct Commandbody
{
PostcalCode S(6)
}
Example: 0000000169020400000A0115611731+MD5(32Bytes)
Response: Response Command Format
Command header
CommandType
CommandBody
MD5
Struct Commandbody
{
LoopCnt H(2)
for(i=0; i<LoopCnt; i++)
{
PostcalCode D(6)
RegionNameLen H(2)
RegionName S(RegionNameLen)
}
}
Example: 0000000169020400002101150261173104xipu61401307yangwan
Response: Response Command Format
Command header
CommandType
MD5
DTSS Technology Corporation Ptv. Ltd.
Example: 000000016902040000040117+MD5(32Bytes)
Response: Response 0122 protocal
Command header
CommandType
CommandBody
MD5
Struct Commandbody
{
start_index H(8) from 1 start
count H(2) Number of requests, maximum 255 per request
}
Example:
000000016902040000040118+MD5(32Bytes)
000000016902040000040118+MD5(32Bytes)
000000016902040000040118+MD5(32Bytes)
Command header
CommandType
CommandBody
MD5
Struct Commandbody
{
max_index H(8) all records count
respose_cnt H(2) The response number
for(int i=0; i< respose_cnt; i++)
{
ic_no D(8)
stb_id D(8)
}
}
Example:
DTSS Technology Corporation Ptv. Ltd.
0000000169020400002001190000006400020000000100000002+MD5(32Bytes)
Response:
Command header
CommandType
CommandBody
MD5
Struct Commandbody
{
ic_cnt H(2) max 255 per request
for(int i=0; i< ic_cnt; i++)
{
ic_no D(8)
stbid D(8)
}
}
Example:
000000016902040000160120020000000100000002+MD5(32Bytes)
Response: Response Command Format
Command header
CommandType
CommandBody
MD5
Struct Commandbody
{
ic_cnt H(2) max 255 per request
for(int i=0; i< ic_cnt; i++)
{
ic_no D(8)
}
}
Example:
000000016902040000160121020000000100000002+MD5(32Bytes)
Response: Response Command Format
DTSS Technology Corporation Ptv. Ltd.
Command header
CommandType
CommandBody
MD5
Struct Commandbody
{
PackageCnt H(4)
for(int i=0; i< PackageCnt; i++)
{
PackageNo H(4)
PackName S(40)
BaseProductCnt H(4)
for(int j=0; i< BaseProductCnt; j++)
{
BasicPackageNo H(4)
}
}
}
Example:000000016902040000B0012200030001pack1
0002000100020002pack2 0002000300040003pack3
000200050006+MD5(32Bytes)
Response:
Command header
CommandType
MD5
Struct Commandbody
{
package_cnt H(4)
for(int i=0; i< package_cnt; i++)
{
package_no H(4)
name_len H(2)
DTSS Technology Corporation Ptv. Ltd.
name S(name_len)
}
}
Example:
Response:
Command header
CommandType
CommandBody
MD5
Struct Commandbody
{
package_cnt H(4)
for(int i=0; i< package_cnt; i++)
{
package_no H(4)
name_len H(2)
name S(name_len)
Starttime D(14)
Endtime D(14)
{
Channel _cnt H(4)
for(int i=0; i< Channel _cnt; i++)
{
ACNo H(4)
}
}
}
}
Example:
Response:
2. User class
Components
Command header
CommandType
AddressCondition
CommandBody
MD5
Struct CommandBody
{
Group ID D(9) eg:000000001
Community D(9) eg:614013001
CASVer D(9) fixed:000000400
STBID D(9) eg:000000000
Custom signature 1 D(9) User-defined
Custom signature 2 D(9) User-defined
Custom signature 3 D(9) User-defined
Custom signature 4 D(9) User-defined
NetworkID D(9)
}
Example:0000000191010400006A02011301010107777777700010000000000000642000000004000000000
00000036000000000000000000000000000000000000000+MD5(32Bytes)
Response: Response Command Format
Command header
CommandType
AddressCondition
MD5
Example:000000019101040000190202130101010777777770001+MD5(32Bytes)
Response: Response Command Format
Command header
CommandType
DTSS Technology Corporation Ptv. Ltd.
AddressCondition
CommandBody
MD5
Struct CommandBody
{
State D(1) 1:Pairing 0:Cancel pairing
}
Example:0000000191010400001A02031301010107777777700011+MD5(32Bytes)
Response: Response Command Format
Command header
CommandType
AddressCondition
CommandBody
MD5
Struct CommandBody
{
NewCard D(8) eg:00000010
}
Remark:Changing the card only for a single card
Example:00000001910104000021020413010101077777777000100000010+MD5(32Bytes)
Response: Response Command Format
Command header
CommandType
AddressCondition
CommandBody
MD5
Struct CommandBody
{
DTSS Technology Corporation Ptv. Ltd.
Example:0000000191010400001A02061301010107777777700011+MD5(32Bytes)
Response: Response Command Format
Command header
CommandType
AddressCondition
CommandBody
MD5
Struct CommandBody
{
PinCode D(6) eg:123456
}
Example:0000000191010400001F0207130101010777777770001123456+MD5(32Bytes)
Response: Response Command Format
Command header
CommandType
AddressCondition
CommandBody
MD5
Struct CommandBody
{
State D(1) 1:Allow 0:Ban
}
Example:0000000191010400001A02081301010107777777700011+MD5(32Bytes)
Response: Response Command Format
Components
Command header
CommandType
AddressCondition
CommandBody
MD5
Struct CommandBody
{
Totalpoints H(8) eg:0x00000064
}
Example:0000000191010400001D02101301010107777777700010064+MD5(32Bytes)
Response: Response Command Format
Command header
CommandType
AddressCondition
CommandBody
MD5
Struct CommandBody
{
FieldNum H(2)
For(i=0; i<FieldNum; i++)
{
AddressingCode H(2) 02-0E
Value D(9)
}
}
Example:000000019101040000260212130101010777777770001010E000001111+MD5(32Bytes)
Response: Response Command Format
Command header
CommandType
AddressCondition
CommandBody
MD5
Struct CommandBody
{
FPId H(8)
ShowType H(1) 0:hide 1:overt 2:covert
EncrptState H(1) 0: not encrypt 1: encrypt
ForceState H(1) 0: not force 1: force
Sparkle H(1) 0: not Sparkle 1:Sparkle
StartTime D(14) yyyymmddHHMMSS
Duration H(4) seconds
Repetitions H(4)
Interval H(4) seconds
FontSize H(2)
Layout H(1) 0:Absolute 1:Percentage
frame of reference H(1) 0:screen 1:video
XSize H(4) bkground width FFFF means auto
YSize H(4) bkground heigth FFFF means auto
XPos H(4) bkground x position FFFF means auto
YPos H(4) bkground y position FFFF means auto
FontColor H(6) eg:FF00FF
Bkground Color H(6) eg:FFFF00
Transparent H(2) max:0x64
ShowItem H(2) 01: show card number
02:show ird number
03:show card and ird number
ContentLen H(4) Byte Count
ContentCoding H(2) 00:ASCII 01:unicode 02:gbk 03:utf-8
Content S(ContentLen)
}
Example:0000000169020400006D02131301010100000000100010000000110002015011300000000640
010000A1600FFFFFFFFFFFFFFFFFF00FF00FF003201000403test+MD5(32Bytes)
Response: Response Command Format
Command header
CommandType
AddressCondition
CommandBody
MD5
Struct CommandBody
{
FPId H(8)
}
Example:00000001910104000021021413010101077777777000100000001+MD5(32Bytes)
Response: Response Command Format
Command header
CommandType
CommandBody
MD5
Struct CommandBody
{
LoopCnt H(4) 0000: all channel
for(int i=0; i<LoopCnt; i++)
{
ProgramNo H(4)
LastCnt H(2)
}
ShowType H(1) 0:hide 1:overt 2:covert
EncrptState H(1) 0:not encrypt 1:encrypt
Sparkle H(1) 0:not Sparkle 1:Sparkle
Force H(1) 0:not force 1:force
Duration H(4) seconds
Interval H(4) seconds
EndTime D(14) yyyymmddHHMMSS
FontSize H(2)
Layout H(1) 0:Absolute 1:Percentage
frame of reference H(1) 0:screen 1:video
XSize H(4) bkground width FFFF means auto
DTSS Technology Corporation Ptv. Ltd.
Example:
Response: Response Command Format
Command header
CommandType
CommandBody
MD5
Struct CommandBody
{
LoopCnt H(4) 0000: all channel
for(int i=0; i<LoopCnt; i++)
{
ACNo H(4)
LastCnt H(2)
}
}
Example:
Response: Response Command Format
Command header
CommandType
AddressCondition
CommandBody
DTSS Technology Corporation Ptv. Ltd.
MD5
Struct CommandBody
{
smsPackage Cnt H(2)
For(int i=0; i<smsPacketCnt; i++)
{
PackageNo &ChannelNo H(8)
OrderType H(2) 00:PPC 01:IPPV 02:IPPT
the start time of Authorization D(14) eg:20141121000000
the endtime of Authorization D(14) eg:20151121235959
}
}
Example:
Response: Response Command Format
Command header
CommandType
AddressCondition
CommandBody
MD5
Struct CommandBody
{
smsPackage Cnt H(2)
For(int i=0; i<smsPacketCnt; i++)
{
PackageNo &ChannelNo H(8)
OrderType H(2) 00:PPC 01:IPPV 02:IPPT
the start time of Authorization D(14) eg:20141121000000
the endtime of Authorization D(14) eg:20151121235959
}
}
Example:
Response: Response Command Format
3. Authorized class
Command header
CommandType
AddressCondition
CommandBody
MD5
Struct CommandBody
{
smsPackage Cnt H(2)
For(int i=0; i<smsPacketCnt; i++)
{
PackageNo&ChannelNo H(8)
OrderType H(2) 00:PPC 01:IPPV 02:IPPT
the start time of Authorization D(14) eg:20141121000000
the endtime of Authorization D(14) eg:20151121235959
}
}
Example:
Response: Response Command Format
Note:adding new authorization on the basis of the original authorization
Command header
CommandType
AddressCondition
CommandBody
MD5
Struct CommandBody
{
smsPackage Cnt H(2)
For(int i=0; i<smsPacketCnt; i++)
{
PackageNo&ChannelNo H(8)
}
}
DTSS Technology Corporation Ptv. Ltd.
Example:
Response: Response Command Format
Command header
CommandType
AddressCondition
CommandBody
MD5
Struct CommandBody
{
Suspend type H(2) fixed:00
SuspendTime D(14) StartTime to Suspend eg:20141121000000
Month Num H(2) fixed:00
}
Example:0000000191010400002B0303130101010777777770001002014062009081600+MD5(32Bytes
)
Response: Response Command Format
Command header
CommandType
AddressCondition
CommandBody
MD5
Struct CommandBody
{
ResumeTime eg:20140620090816
}
Example:00000001910104000027030413010101077777777000120140620090831+MD5(32Bytes)
Response: Response Command Format
Components
Command header
CommandType
AddressCondition
MD5
Example:000000019101040000190305130101010777777770001+MD5(32Bytes)
Response: Response Command Format
Components
Command header
CommandType
AddressCondition
CommandBody
MD5
Struct CommandBody
{
Type H(1) 0: Cancel 1:Bind
BindCycle H(2) days eg:14
MotherCard D(8) eg:00000003
}
Example:00000001910104000024030613010101077777777000111400000003+MD5(32Bytes)
Response: Response Command Format
Command header
CommandType
AddressCondition
CommandBody
MD5
Struct CommandBody
{
DTSS Technology Corporation Ptv. Ltd.
Example:
Response: Response Command Format
Note:CA will clear all of the authorization and modified into new authorization
4. Message class
Components
Command header
CommandType
AddressCondition
CommandBody
MD5
Struct CommandBody
{
StartTime D(14) The start time to broadcast email
EndTime D(14) The end time to broadcast email
TitleLength H(2) <=40 bytes
Title S(TitleLength)
ContentLength H(3) <=800bytes
Content S(ContentLength)
TailLength H(2) <=20bytes
Tail S(TailLength)
}
Example:0000000191010400004004010200201406251921032014062619210305title00Ctesttesttest04ta
il+MD5(32Bytes)
Response: Response Command Format
Components
Command header
CommandType
AddressCondition
CommandBody
MD5
Struct CommandBody
{
OsdID D(12) eg:201411210001
StartTime D(14) eg:20141121000000
EndTime D(14) eg:20141122000000
TimeSection D(8) eg:08001700 Show from 08:00 to 17:00
Osd cycle H(2) minutes eg:14 means once every 20 minutes
Speed H(2) fixed:80
BasicPackageCnt H(2)
For(i=0; i<BasicPackageCnt; i++)
{
BasicPackageNo H(4)
}
ActionType D(1) fixed:1
Position1 D(3) fixed:000
Position2 D(3) 000:top show 001:bottom show
Lines D(2) fixed:01
Width D(3) fixed:000
FontColor D(1) see table below
BackGroundColor D(1) see table below
Type D(1) fixed:0
ContentLength H(3) <=510bytes
Content S(ContentLength)
}
Example:0000000191010400006204020200201408010001201408011210492014080212104900002359
015000000000101000910012this is a test osd+MD5(32Bytes)
Response: Response Command Format
Color definition:
0 Transparent color
1 White
2 Red
DTSS Technology Corporation Ptv. Ltd.
3 Orange
4 Yellow
5 Green
6 Cyan
7 Blue
8 Purple
9 Black
Components
Command header
CommandType
AddressCondition
CommandBody
MD5
Struct CommandBody
{
OsdId D(12)
}
Example:0000000191010400001404030200201408010001+MD5(32Bytes)
Response: Response Command Format
Command header
CommandType
AddressCondition
CommandBody
MD5
Struct CommandBody
{
OsdId D(12)
ContentLength H(3)
Content S(ContentLength) <=510bytes
}
Command header
CommandType
AddressCondition
CommandBody
MD5
Struct CommandBody
{
MessageID H(8)
ShowType H(1) 0:hide 1:show
ForceType H(1) 0:not force 1:force
StartTime H(14) show starttime
EndTime H(14) show endtime
FontSize H(2) eg.:18
LayOut H(1) 0:absolute 1:percentage
Frame H(1) 0:screen 1:video
XPos H(4) FFFF means auto,only for PostionType=5
YPos H(4) FFFF means auto,only for PostionType=5
XSize H(4) FFFF means auto,only for PostionType=5
YSize H(4) FFFF means auto,only for PostionType=5
Fontcolor H(6) RGB eg.:FF00FF
BKColor H(6) RGB eg.:FF00FF
Transparent H(2) 00-64
ConentLen H(4) 0000-0400 hex(0400) = dec(1024)
ContentCoding H(1) 0:ASCII 1:unicode 2:gbk 3:utf-8
Content S(ConentLen)
}
Example:
Command header
CommandType
AddressCondition
CommandBody
MD5
DTSS Technology Corporation Ptv. Ltd.
Struct CommandBody
{
MessageID H(8)
}
Example:
4.7. User Message (0413)
Components
Command header
CommandType
AddressCondition
CommandBody
MD5
Struct CommandBody
{
MessageID H(8)
ChannelCnt H(4) if=0 mean all channels
for(int i=0; i<ChannelCnt; i++)
{
ACNo H(4)
}
ShowType H(1) 0:hide 1:show
ForceType H(1) 0:not force 1:force
StartTime H(14) show starttime
EndTime H(14) show endtime
FontSize H(2) eg.:18
LayOut H(1) 0:absolute 1:percentage
Frame H(1) 0:screen 1:video
XPos H(4) FFFF means auto,only for PostionType=5
YPos H(4) FFFF means auto,only for PostionType=5
XSize H(4) FFFF means auto,only for PostionType=5
YSize H(4) FFFF means auto,only for PostionType=5
Fontcolor H(6) RGB eg.:FF00FF
BKColor H(6) RGB eg.:FF00FF
Transparent H(2) 00-64
ConentLen H(4) 0000-0400 hex(0400) = dec(1024)
ContentCoding H(1) 0:ASCII 1:unicode 2:gbk 3:utf-8
Content S(ConentLen)
}
Example:
DTSS Technology Corporation Ptv. Ltd.
Command header
CommandType
MD5
Send: fixed:000000009101040000040500+MD5(32Bytes)
Response:000000009101040000040501+MD5(32Bytes)
Notes:
When a message is sent in a special format, it contains a special meaning, which is as follows:
Command Description
reco Factory reset
autosearch Auto search channels
forcetune Force turn to some channel
specificota Upgrade some special STB