Commit 46b2ee95 authored by Cedric Roux's avatar Cedric Roux

integration fix: attempt to clarify ODD_PARITY

This may need to be refined.

The variable ODD_PARITY is defined at various places,
with different values, causing compilation warnings.

It's wrong to define a variable with different values.

A new variable is created, specific to IMEI case: IMEI_ODD_PARITY.
Maybe ODD_PARITY should also have 0xf as value, and so maybe only
one variable is necessary. To be checked at some point...
parent 752ceb19
......@@ -119,7 +119,7 @@ typedef struct {
Byte_t digit14:4;
Byte_t digit13:4;
#define EVEN_PARITY 0
#define ODD_PARITY 0xf
#define ODD_PARITY 1
Byte_t parity:4;
Byte_t digit15:4;
} num;
......
......@@ -93,7 +93,7 @@ typedef struct imeisv_s{
uint8_t digit15:4;
uint8_t digit16:4;
#define EVEN_PARITY 0
#define ODD_PARITY 1
#define IMEI_ODD_PARITY 0xf
uint8_t parity:4;
} imeisv_t;
......@@ -119,7 +119,7 @@ typedef struct imeisv_s {
uint8_t svn2:4;
uint8_t svn1:4;
#define EVEN_PARITY 0
#define ODD_PARITY 1
#define IMEI_ODD_PARITY 0xf
uint8_t parity:4;
} num;
#define IMEISV_BCD8_SIZE 9
......
......@@ -879,7 +879,7 @@ int emm_send_security_mode_complete(const emm_as_security_t *msg,
emm_msg->imeisv.imeisv.digit14 = 0x3;
emm_msg->imeisv.imeisv.digit15 = 0x0;
emm_msg->imeisv.imeisv.digit16 = 0x0;
emm_msg->imeisv.imeisv.parity = ODD_PARITY;
emm_msg->imeisv.imeisv.parity = IMEI_ODD_PARITY;
size += SECURITY_MODE_COMPLETE_MAXIMUM_LENGTH;
}
......
......@@ -40,6 +40,7 @@ Description Defines the EPS Mobility Management procedure call manager,
#include "emm_main.h"
#include "nas_log.h"
#include "emmData.h"
#include "MobileIdentity.h"
#include "memory.h"
#include "usim_api.h"
......@@ -919,7 +920,7 @@ static int _emm_main_get_imei(imei_t *imei, const char *imei_str)
int len = strlen(imei_str);
if (len % 2) {
imei->u.num.parity = ODD_PARITY;
imei->u.num.parity = IMEI_ODD_PARITY;
} else {
imei->u.num.parity = EVEN_PARITY;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment