/* This test driver program encodes a data record and writes the        */
/* encoded result to an output file..                                   */

#include <stdio.h>
#include <stdlib.h>
#include "CSTA-call-connection-identifiers.h"

#define MAXMSGLEN 1024

static void setConnectionIds (ASN1BEREncodeBuffer& encodeBuffer);

int main (int argc, char** argv)
{
      ASN1BEREncodeBuffer encodeBuffer;
      setConnectionIds (encodeBuffer);

   return 0;

}

/* sample function to set different values for ConnectionId */

static void setConnectionIds (ASN1BEREncodeBuffer& encodeBuffer)
{
   /*
    <connectionID>
      <callID>1</callID> 
      <deviceID>22222</deviceID> 
    </connectionID>
   
   { both { callID '1'H , deviceId { staticID:dialingNumber: "22222" } } }
   */
   ASN1T_ConnectionID connectionID1;
   ASN1T_DeviceID staticID1;
   staticID1.deviceIdentifier.t = T_DeviceID_deviceIdentifier_dialingNumber;
   staticID1.deviceIdentifier.u.dialingNumber = "22343";
   ASN1T_ConnectionID_both both1;
   both1.callID.numocts = 1;
   OSOCTET data1 = 0x10;
   both1.callID.data = &data1;
   both1.deviceID.t = T_LocalDeviceID_staticID;
   both1.deviceID.u.staticID = &staticID1;
   connectionID1.t = T_ConnectionID_both;
   connectionID1.u.both = &both1;


   /*
    <connectionID>
      <callID>1</callID> 
    </connectionID>

   { callID  '1'H }
   */

   ASN1T_CallID callID2;
   callID2.numocts = 1;
   OSOCTET data2 = 0x10;
   callID2.data = &data2;

   ASN1T_ConnectionID connectionID2;
   connectionID2.t = T_ConnectionID_callID;
   connectionID2.u.callID = &callID2;

   /*
    <connectionID>
      <deviceID>22222</deviceID> 
    </connectionID>

   { deviceID { staticID:dialingNumber: "22222" } } 
   */
   ASN1T_DeviceID staticID3;
   staticID3.deviceIdentifier.t = T_DeviceID_deviceIdentifier_dialingNumber;
   staticID3.deviceIdentifier.u.dialingNumber = "22343";

   ASN1T_LocalDeviceID localDeviceID3;
   localDeviceID3.t = T_LocalDeviceID_staticID;
   localDeviceID3.u.staticID = &staticID3;

   ASN1T_ConnectionID connectionID3;
   connectionID3.t = T_ConnectionID_deviceID;
   connectionID3.u.deviceID = &localDeviceID3;

}

