# 'hostname' is the name of the server
# 'port' is the port on the server
# 'emm' is a flag to allow EMM transfers to the server
-# (0=disabled 1=enabled)
+# (0=disabled 1=enabled 2=enabled without caching)
# 'caid' (optional) caid on which this client should work
# 'mask' (optional) mask for caid e.g. caid=1700 mask=FF00 would allow
# anything between 1700 & 17FF.
if(MatchEMM(source)) {
const int length=SCT_LEN(source);
int id=msEMM.Get(source,length,0);
- if(id>0) {
+ if(id>0 || emmAllowed>1) {
unsigned char *buff=AUTOMEM(length+8);
memcpy(buff,"EMM",3);
memcpy(&buff[3],source,length);
if(MatchEMM(source)) {
const int length=SCT_LEN(source);
int id=msEMM.Get(source,length,0);
- if(id>0) {
+ if(id>0 || emmAllowed>1) {
unsigned char *buff=AUTOMEM(length+32);
buff[0]=0x03;
buff[1]=(caSys>>8);
if(len+off<=255) {
memcpy(&cb->data[off],data,len);
int id=msEMM.Get(&cb->data[0],len+off,0);
- if(id>0) {
+ if(id>0 || emmAllowed>1) {
SendBlock(cb,len+off);
msEMM.Cache(id,true,0);
}
,msEMM(32,0)
{
name=Name;
- emmAllowed=false; emmCaid[0]=0x1700; emmMask[0]=0xFF00; numCaid=1;
+ emmAllowed=0; emmCaid[0]=0x1700; emmMask[0]=0xFF00; numCaid=1;
}
bool cCardClient::Immediate(void)
int n, emm=0;
if(!num) num=&n;
if(sscanf(config,"%63[^:]:%d:%d%n",hostname,&port,&emm,num)<3) return false;
- if(emm>0) emmAllowed=true;
+ if(emm>0) emmAllowed=1;
+ if(emm==2) emmAllowed=2; // EMM caching disabled
if(config[*num]=='/') {
numCaid=0;
do {
const char *name;
char hostname[64];
int port;
- bool emmAllowed;
+ int emmAllowed;
int emmCaid[MAX_CC_CAID], emmMask[MAX_CC_CAID], numCaid;
cMsgCache msECM, msEMM;
//
while((d=ad.Assembled())) {
int len=SCT_LEN(d);
int id=s->Cache()->Get(d,len,0);
- if(id>0) {
+ if(id>0 || emmAllowed>1) {
if(len<256) {
unsigned char bb[sizeof(struct EmmRequest)+256];
struct EmmRequest *req=(struct EmmRequest *)bb;
while((data=ad.Assembled())) {
int len=SCT_LEN(data);
int id=msEMM.Get(data,len,0);
- if(id>0) {
+ if(id>0 || emmAllowed>1) {
if(SendMessage(data,len,true,0)) {
unsigned char buffer[CWS_NETMSGSIZE];
len=ReceiveMessage(buffer,true);
while((data=ad.Assembled())) {
int len=SCT_LEN(data);
int id=msEMM.Get(data,len,0);
- if(id>0) {
+ if(id>0 || emmAllowed>1) {
unsigned char buff[512];
StartMsg(buff,0x41); //
AddNano(buff,0x42,2,caSys); // EMM_CAID