Opened 13 years ago
Closed 13 years ago
#1261 closed defect (duplicate)
sssp source code from my reciver want to add in oscam as a reader
Reported by: | elmofty | Owned by: | |
---|---|---|---|
Priority: | Please fill in | Component: | ! Please select... |
Severity: | Please fill in | Keywords: | |
Cc: | Sensitive: | no |
Description
this is the source code for sssp twin protocol can oscam team support the sssp twin as a reader to work with the dongole
SERIAL Setting : 115200 Baud, 8 data bits, no parity, 1 stop bit
satellite sharing protocol
STB => Dongle
request : 07 06 degree(2) frequency(2) serviceid(2)chksum(1)
ex) nilesat(W 7) 11803 1106(service id)
send to dongle => 07 06 0D CA 2E 1B 04 52 A5(checksum)
chksum = 07 06 0D CA 2E 1B 04 52;
Dongle => STB
reply : F7 00 16 cw1(8 byte) cw2(8 byte)
ex) F7 00 16 11 11 11 33 22 22 22 66 11 11 11 33 33 33 33 99
================================================== ==========
request every second.
Answer in a second.
Key datas are all "00" mean no key.
Sample source code ------------------------------------------------------------
IRD => dongle .
int SSSP_DoCommand07(void)
{
char szFront[16];
unsigned char ucaReply[32];
unsigned short wLen;
int i, j, k, nErrorCnt;
DWORD dwWriteSize, dwReadSize;
unsigned char *p;
DWORD ident;
s_dwActiveFrequency = s_dwCurrentFrequency;
s_ucaUARTWriteBuffer[0] = 0x07;
s_ucaUARTWriteBuffer[1] = 0x06;
s_ucaUARTWriteBuffer[2] = (s_wCurrentDegree >> 8) & 0xFF;
s_ucaUARTWriteBuffer[3] = (s_wCurrentDegree >> 0) & 0xFF;
s_ucaUARTWriteBuffer[4] = (s_dwCurrentFrequency >> 8) & 0xFF;
s_ucaUARTWriteBuffer[5] = (s_dwCurrentFrequency >> 0) & 0xFF;
s_ucaUARTWriteBuffer[6] = (s_wCurrentServiceID >> 8) & 0xFF;
s_ucaUARTWriteBuffer[7] = (s_wCurrentServiceID >> 0) & 0xFF;
p = &s_ucaUARTWriteBuffer[0];
s_ucaUARTWriteBuffer[8] = p[0] p[1] p[2] p[3] p[4] p[5] p[6] p[7];
STUART_Flush(s_SerialHandle);
STUART_Write(s_SerialHandle, s_ucaUARTWriteBuffer, 9, &dwWriteSize, 500);
for (j = 0;j < 1; j++) {
s_ucWaitStatus = 1;
ucaReply[0] = 0x00;
dwReadSize = 0;
for (k = 0; k <10>= 10) return -2;
(ucaReply[0] != 0xF7)) { |
sprintf(szFront, "F%03d", dwReadSize);
szFront[4] = (char)(0xff);
FRONT_PrintData(szFront);
return -1;
}
STUART_Read(s_SerialHandle, &ucaReply[1], 18, &dwReadSize, 1000);
if (dwReadSize == 18) {
p = &ucaReply[3];
nErrorCnt = 0;
if ((p[3] != ((p[0]+p[1]+p[2]) & 0xFF))) nErrorCnt |= 0x01;
if ((p[7] != ((p[4]+p[5]+p[6]) & 0xFF))) nErrorCnt |= 0x02;
if ((p[11] != ((p[8]+p[9]+p[10]) & 0xFF))) nErrorCnt |= 0x04;
if ((p[15] != ((p[12]+p[13]+p[14]) & 0xFF))) nErrorCnt |= 0x08;
if (nErrorCnt == 0) {
if (memcmp(s_ucaOldCW, &ucaReply[3], 16) != 0) {
sprintf(szFront, "SETK");
szFront[4] = (char)(0xff);
FRONT_PrintData(szFront);
Descrypt(&ucaReply[3], &ucaReply[3+8], 0);
} else {
sprintf(szFront, "NOSE");
szFront[4] = (char)(0xff);
FRONT_PrintData(szFront);
}
memcpy(s_ucaOldCW, &ucaReply[3], 16);
return 0;
} else {
sprintf(szFront, "E%d%02d", nErrorCnt, dwReadSize);
szFront[4] = (char)(0xff);
FRONT_PrintData(szFront);
return -1;
}
} else {
sprintf(szFront, "F%03d", dwReadSize);
szFront[4] = (char)(0xff);
FRONT_PrintData(szFront);
return -1;
}
}
return -1;
}
Duplicate of #763.