Changeset 11588 for trunk/module-camd35.c
- Timestamp:
- 08/23/20 21:07:28 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/module-camd35.c
r11587 r11588 317 317 buflen = (((buf[21] & 0x0F) << 8) | buf[22]) + 3; 318 318 } 319 else if(buf[0] == 0x 3D || buf[0] == 0x3E || buf[0] == 0x3F) // cacheex-push319 else if(buf[0] == 0x40 || buf[0] == 0x41 || buf[0] == 0x42 || buf[0] == 0x3D || buf[0] == 0x3E || buf[0] == 0x3F) // cacheex-push 320 320 { 321 321 buflen = buf[1] | (buf[2] << 8); … … 641 641 } 642 642 643 buf[0]++; // ecm response (CMD01 or CMD04) 643 if(er->localgenerated && client->c35_extmode) 644 { 645 buf[0] += 0x51; // ecm response with lg-flag 646 } 647 else 648 { 649 buf[0]++; // ecm response (CMD01 or CMD04) 650 } 651 644 652 buf[1] = 16; 645 653 camd35_cacheex_init_dcw(client, er); … … 862 870 } 863 871 864 if(cacheex_get_rdr_mode(cl->reader) == 2 )872 if(cacheex_get_rdr_mode(cl->reader) == 2 || cacheex_get_rdr_mode(cl->reader) == 1) 865 873 { 866 874 camd35_cacheex_send_push_filter(cl, 2); 875 #ifdef CS_CACHEEX 876 camd35_cacheex_feature_request(cl); 877 #endif 867 878 } 868 879 … … 949 960 camd35_send_keepalive_answer(client); // keepalive msg 950 961 break; 951 962 case 0x43: 963 break; 964 case 0x50: 965 if(client && !client->c35_extmode) 966 camd35_send_extmode(client); 967 client->c35_extmode = 1; 968 break; 952 969 default: 953 970 if(!camd35_cacheex_server(client, mbuf)) … … 1006 1023 memcpy(buf + 20, er->ecm, er->ecmlen); 1007 1024 1025 camd35_send_extmode(client); 1026 1008 1027 int32_t rc = (camd35_send(client, buf, 0) < 1) ? -1 : 0; 1009 1028 … … 1134 1153 // CMD44: old reject command introduced in mpcs 1135 1154 // keeping this for backward compatibility 1136 if((buf[0] != 1) && (buf[0] != 0x44) && (buf[0] != 0x08) )1155 if((buf[0] != 1) && (buf[0] != 0x44) && (buf[0] != 0x08) && (buf[0] != 0x51) && (buf[0] != 0x50)) 1137 1156 { 1138 1157 return -1; … … 1148 1167 *rc = 2; // INVALID sent by CMD08 1149 1168 } 1169 if(buf[0] == 0x51 || buf[0] == 0x54) // lg-flag 1170 { 1171 *rc = 0x86; 1172 } 1173 if(buf[0] == 0x50) 1174 client->c35_extmode = 1; 1150 1175 1151 1176 memcpy(dcw, buf + 20, 16); 1152 1177 1153 1178 return idx; 1179 } 1180 1181 void camd35_send_extmode(struct s_client *cl) 1182 { 1183 uint8_t rbuf[32]; //minimal size 1184 if(!cl->crypted) { return; } 1185 memset(rbuf, 0, sizeof(rbuf)); 1186 rbuf[0] = 0x50; 1187 rbuf[1] = 12; 1188 rbuf[2] = 0; 1189 rbuf[20] = 1; 1190 camd35_send(cl, rbuf, 12); //send adds +20 1154 1191 } 1155 1192
Note:
See TracChangeset
for help on using the changeset viewer.