I have a C extension to a dll function.
static PyObject *_wrap_SetTxCom mandRegister(Py Object *self, PyObject
*args) {
PyObject *resultobj;
int arg1 ;
int arg2 ;
int arg3 ;
char *arg4 = (char *)"Python" ;
err result;
if(!PyArg_Parse Tuple(args,(cha r
*)"iii|s:SetTxC ommandRegister" ,&arg1,&arg2,&a rg3,&arg4)) goto fail;
result = (err)SetTxComma ndRegister(arg1 ,arg2,arg3,(cha r const
*)arg4);
resultobj = PyInt_FromLong( (long)result);
return resultobj;
fail:
return NULL;
}
Now here is what i pass from python
test = [0xff,0xaf,0xf0]
newint = test[0]
SetTxCommandReg ister(0xff,test[1],test[2])
print test
arg1 = 0xaf if i pass either test[0] or newint
arg1 = 0xff if i pass constant like what i have shown in the code
What am i doing wrong?
Thanks in advance
Anand