SetSimLocation

From IRON Test Suite
Jump to navigation Jump to search

DESCRIPTION

This command sets (allocates or unallocates) SIM card to/from the specified GSM port. Depending on the allocation mode, ICCID, IMSI or SIM Rack IP address, board and slot should be specified. SIM Rack boards and slots are numbered starting from 0 (contrary from ISSO Web interface where SIM Rack slots are numbered from 1). Mode can be BEST_SIM, SIM_ICCID, SIM_LOCATION, SIM_EMUL or SIM_UNALLOCATE. In the case of BEST_SIM IRON SimManager desides what SIM card will be allocated. Mode SIM_EMUL is used when 2G Full Simulation is configured for specified GSM port; in this case emulated ICCID and IMSI are specified.

COMMAND

Command Input arguments Returns
SetSimLocation [SimRackIPAddr, SimRackBoard, SimRackSlot] | [ICCID, IMSI] In the case of error, Error Code

OUTPUT

Command status in the following format:
"%s\n", command_status

EXAMPLE

~# SetSimLocation 0 BEST_SIM
SIM ALLOCATED
~# SetSimLocation 0 SIM_ICCID 8938101080319197847
SIM ALLOCATED
~# SetSimLocation 0 SIM_LOCATION 198.214.100.025 2 17
SIM NOT FOUND
~# SetSimLocation 0 SIM_EMUL 8938101080319197847 310150345284037
SIM ALLOCATED
~# SetSimLocation 0 SIM_UNALLOCATE
SIM UNALLOCATED

API

MessageCode: GRA_SET_SIM_LOCATION_REQUEST

MESSAGE BODY
Field Name Length Description
PortIndex 4 SIM ICCID number, used if the mode is ICCID
AllocationMode 4 SIM allocation mode:
0- Best SIM
1- ICCID
2- SIM location
3- Emulation
0xFFFFFFFF - Unallocate
ICCID 20 SIM ICCID number, used if the mode is ICCID
SimRackIpAddr 16 SIM Rack IP address (zero terminated string), used if the mode is SIM location
SimRackBoard 4 SIM Rack board, used if the mode is SIM location
SimRackSlot 4 SIM Rack slot, used if the mode is SIM location
ICCIDEmul 20 SIM ICCID number, used if the mode is Emulation
IMSIEmul 16 SIM IMSI number, used if the mode is Emulation

The format of Message Body can be coded as the following C-language structure:

 typedef struct
 {
   ULONG    PortIndex;
   ULONG    AllocationMode;
   union
   {
     struct
     {
       UCHAR    ICCID[20];
     } i;
     struct
     {
       UCHAR    SimRackIpAddr[16];
       ULONG    SimRackBoard;
       ULONG    SimRackSlot;
     } l;
     struct
     {
       UCHAR    ICCID[20];
       UCHAR    IMSI[16];
     } e;
   } u;
 } GRAM_SET_SIM_LOCATION_REQUEST;

MessageCode: GRA_SET_SIM_LOCATION_CONFIRM

MESSAGE BODY
Field Name Length Description
Status 4 0- Successful
1- Error SIM not found
2- Error Port not found
3- Error SIM is deactivated
4- Error Port is deactivated
5- Error SIM busy

The format of Message Body can be coded as the following C-language structure:

typedef struct
{
   ULONG    Status;
} GRAM_SET_SIM_LOCATION_CONFIRM;