A
Andre Azevedo
Hi all,
I'm translation some C headers to C# but it doesn't work.
I need to fill the Call struct and pass it in encode function as *pdu
parameter. The function will encode and fill the PrivateData struct in *priv
parameter filling the data field but it return some wrong values. I've the
original C application and I know what must return but I don't know what is
wrong.
Can anyone help me?
TIA,
--
Andre
-------------- C header -----------------
encode ( int pdunum, CONST_PARAM void FAR * pdu, PrivateData FAR * priv );
typedef struct Call {
Boolean priorityCalling;
short maxRings;
AnswerTreat answerTreat; ---------> ---------------> simple enum like
ProtocolType !
DeviceID_t destRoute; -----------> char[64] in C! I'm using C#
string with managedAs=ByValStr
UserInfo userInfo;
} Call ;
typedef struct UserInfo {
ProtocolType type;
struct {
short length;
unsigned char value[129];
} data;
} UserInfo ;
typedef enum ProtocolType {
NONE = -1,
USER_SPECIFIC = 0,
ASCII = 4
} ProtocolType;
typedef struct PrivateData {
char vendor[32];
unsigned short length;
char data[1024];
} PrivateData ;
I'm translation some C headers to C# but it doesn't work.
I need to fill the Call struct and pass it in encode function as *pdu
parameter. The function will encode and fill the PrivateData struct in *priv
parameter filling the data field but it return some wrong values. I've the
original C application and I know what must return but I don't know what is
wrong.
Can anyone help me?
TIA,
--
Andre
-------------- C header -----------------
encode ( int pdunum, CONST_PARAM void FAR * pdu, PrivateData FAR * priv );
typedef struct Call {
Boolean priorityCalling;
short maxRings;
AnswerTreat answerTreat; ---------> ---------------> simple enum like
ProtocolType !
DeviceID_t destRoute; -----------> char[64] in C! I'm using C#
string with managedAs=ByValStr
UserInfo userInfo;
} Call ;
typedef struct UserInfo {
ProtocolType type;
struct {
short length;
unsigned char value[129];
} data;
} UserInfo ;
typedef enum ProtocolType {
NONE = -1,
USER_SPECIFIC = 0,
ASCII = 4
} ProtocolType;
typedef struct PrivateData {
char vendor[32];
unsigned short length;
char data[1024];
} PrivateData ;