diff --git a/src/libmisdnuser/suppserv/fac.c b/src/libmisdnuser/suppserv/fac.c index c528f44..6e19955 100644 --- a/src/libmisdnuser/suppserv/fac.c +++ b/src/libmisdnuser/suppserv/fac.c @@ -423,14 +423,14 @@ static int encodeAOCDChargingUnitOperation(__u8 * dest, const struct asn1_parm * p[i++] = 0x02; // Operation Tag p[i++] = 0x01; // Tag Length p[i++] = Fac_AOCDChargingUnit; // Operation Value - p[i++] = 0x30; + p[i++] = 0x30; // specificChargingUnits p[i++] = (0x09 + len); // Length p[i++] = 0xa1; // APDU p[i++] = (0x04 + len); // Length - p[i++] = 0x30; - p[i++] = (0x02 + len); - p[i++] = 0x02; // Operation Tag - p[i++] = 0x01; + p[i++] = 0x30; // recordedUnits + p[i++] = (0x02 + len); // Length + p[i++] = 0x02; // recordedNumberOfUnits + p[i++] = len; // Recorded units could take up as much as 3 bytes (0xFFFFFF) p[i] = numberOfUnits & 0xFF; @@ -441,10 +441,10 @@ static int encodeAOCDChargingUnitOperation(__u8 * dest, const struct asn1_parm * i += len; p[i++] = 0x82; // Type of charging info - p[i++] = 0x01; + p[i++] = 0x01; // Length p[i++] = 0x00; // AOC-D so Sub-Total - p[1] = (AOCD_CHARGE_UNIT_IE_LENGTH + len); // IE Payload Length + p[1] = i - 2; // IE Payload Length p[4] = p[1] - 3; // Invoke Component Length result = p[1] + 2; // Total Length of IE } @@ -482,11 +482,13 @@ static int encodeAOCEChargingUnitOperation(__u8 * dest, const struct asn1_parm * p[i++] = 0x01; // Tag Length p[i++] = Fac_AOCEChargingUnit; // Operation Value p[i++] = 0x30; // ChargingUnitInfo - p[i++] = (0x0b + len); // Length + p[i++] = (0x08 + len); // Length p[i++] = 0x30; // specificChargingUnits - p[i++] = (0x09 + len); // Length + p[i++] = (0x06 + len); // Length + p[i++] = 0xa1; // Constructor + p[i++] = (0x04 + len); // Length p[i++] = 0x30; // recordedUnits - p[i++] = (0x02 + len); + p[i++] = (0x02 + len); // Length p[i++] = 0x02; // recordedNumberOfUnits p[i++] = len; @@ -498,10 +500,6 @@ static int encodeAOCEChargingUnitOperation(__u8 * dest, const struct asn1_parm * p[i+2] = (numberOfUnits >> 16) & 0xFF; i += len; - p[i++] = 0x82; // AOCEBillingId - p[i++] = 0x01; // Length - p[i++] = 0x00; // normalCharging - p[1] = i - 2; // IE Payload Length p[4] = p[1] - 3; // Invoke Component Length